teemuatlut / TMC2208Stepper

GNU General Public License v3.0
69 stars 23 forks source link

IOIN Register value is being read incorrectly #33

Open mustafab0 opened 1 year ago

mustafab0 commented 1 year ago

Hello,

I am trying to control the TMC driver using UART interface. I am able set IHOLD_IRUN and also read it. But when I try to read the IOIN register it gives me bogus values.

The following are the status of my Driver Pin: En: 1, MS1 & MS2 : 1, PDN: 1, DIR: 1.

The Binary output when reading the IOIN register is: 1010000000000000110 (0x5006 in HEX) And using bool function to access individual pin status gives following:
ENN: 0 MS1: 1 MS2: 0 DIAG: 0 PDN_UART: 0 STEP: 0 SEL_A: 0 DIR: 0 VERSION: 0

Output doesn't change even if I manually put DIR High or Low