Hi @mykepredko
here is the current setup for the TMC2240
I am attaching photos of the pins on the MKS board.
terminal listing (so SPI works)
8:37 SG4_IND: 00000002 sg4_ind_0=2
8:37 SG4_RESULT: 00000004 sg4_result=4
8:37 SG4_THRS: 00000200 sg4_angle_offset=1
8:37 PWM_AUTO: 0000001d pwm_ofs_auto=29
8:37 PWM_SCALE: 00000000
8:37 PWMCONF: c40c001d pwm_ofs=29 pwm_autoscale=1 pwm_autograd=1 pwm_reg=4 pwm_lim=12
8:37 DRV_STATUS: 80000261 sg_result=609 stst=1
8:37 COOLCONF: 00050000 sgt=5
8:37 CHOPCONF: 34410153 toff=3 hstrt=5 hend=2 tbl=2 tpfd=4 mres=4(16usteps) intpol=1 dedge=1
8:37 MSCURACT: 00930139 cur_a=-199 cur_b=147
8:37 MSCNT: 00000368 mscnt=872
8:37 ADC_TEMP: 000008cc adc_temp=0x08cc(27.8C)
8:37 ADC_VSUPPLY_AIN: 02db099f adc_vsupply=2463 adc_ain=731
8:37 THIGH: 00000000
8:37 TCOOLTHRS: 000fffff tcoolthrs=1048575
8:37 TPWMTHRS: 000fffff tpwmthrs=1048575
8:37 TSTEP: 000fffff tstep=1048575
8:37 TPOWERDOWN: 0000000a tpowerdown=10
8:37 IHOLD_IRUN: 04061f1f ihold=31 irun=31 iholddelay=6 irundelay=4
8:37 GLOBALSCALER: 000000a3 globalscaler=163
8:37 DRV_CONF: 00000001 current_range=1
8:37 IOIN: 4001303c encb=1 enca=1 drv_enn=1 encn=1 output=1 ext_res_det=1 silicon_rv=1 version=0x40
8:37 GSTAT: 00000000
8:37 GCONF: 0000000c en_pwm_mode=1 multistep_filt=1
8:37 ========== Queried registers ==========
8:37 MSLUTSTART: 00f70000 start_sin90=247
8:37 MSLUTSEL: ffff8056 w0=2 w1=1 w2=1 w3=1 x1=128 x2=255 x3=255
8:37 MSLUT7: 00404222 mslut7=4211234
8:37 MSLUT6: 49295556 mslut6=1227445590
8:37 MSLUT5: b5bb777d mslut5=3048961917
8:37 MSLUT4: fbffffff mslut4=4227858431
8:37 MSLUT3: 10104222 mslut3=269500962
8:37 MSLUT2: 24492929 mslut2=608774441
8:37 MSLUT1: 4a9554aa mslut1=1251300522
8:37 MSLUT0: aaaab554 mslut0=2863314260
8:37 ========== Write-only registers ==========
8:37 DUMP_TMC STEPPER=stepper_x
and SET_TMC_CURRENT
8:42 Run Current: 0.90A Hold Current: 0.90A
8:42 SET_TMC_CURRENT STEPPER=stepper_x CURRENT=0.9
8:42 Run Current: 0.10A Hold Current: 0.10A
8:42 SET_TMC_CURRENT STEPPER=stepper_x CURRENT=0.1