I am trying to have my TMC2209 use its StallGuard2 technology to detect a stall (to be used for sensor-less homing later). I am using the TMC2209 on Adafruits breakout board: https://www.adafruit.com/product/6121
I am using an ESP32 as my microcontroller. It's the 'ESP-WROOM-32'
Despite trying both extremes (and values between) for 'SGTHRS' I constantly just receive the following on my serial monitor:
Stall detected!
Stall Sensor Value: 0
What might I be missing please? I have spent two days troawling the internet, forums and friends for a solution and struggle to find one. Once this is resolved I intend to produce a Youtube video (similar to this one I made: https://youtu.be/1E4TDZC-xaY?si=vd3TwDqG9MbG7Nwa) documenting its use for everyone else who want's to use this feature to simplify wiring in their project designs and make the most of this brilliant driver IC.
Any questions, please ask.
They are wired up as follows:
ESP32 TMC2209 (Breakout)
---------- ----------------------
3.3V ----------------> VDD
GND ----------------> GND
GPIO 27 ----------------> EN (Enable)
GPIO 25 ----------------> DIR (Direction)
GPIO 26 ----------------> STEP (Step pulse)
GPIO 16 (RX) ---------> Via 1k restore to sam wire as TX
GPIO 17 (TX) ---------> PDN_UART (UART communication)
GPIO 14 ---------------> DIAG (Stall/Diagnostic output) - connected with an additional 4.7kohm resistor connected to the 3.3v power supply of the ESP32
This is my code: