TMC2209 Uart Conection

Hey im trying to conect my TMC2209 Stepper motor to my arduino uno with uart but i cant seem to get it ive tryed everything maybe someone knows how it should be heres the TMC i use



and my code :

#include <TMCStepper.h>
#include <SoftwareSerial.h>

// Pins
#define STEP_PIN 3
#define DIR_PIN 4
#define EN_PIN 5

#define RX_PIN 11
#define TX_PIN 10

#define R_SENSE 0.11f
#define DRIVER_ADDRESS 0b00

SoftwareSerial SWSerial(RX_PIN, TX_PIN);
TMC2209Stepper driver(&SWSerial, R_SENSE, DRIVER_ADDRESS);

void setup() {
Serial.begin(115200);
SWSerial.begin(19200);

pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
pinMode(EN_PIN, OUTPUT);

digitalWrite(EN_PIN, LOW);

delay(500);

driver.begin();
driver.toff(5);
driver.rms_current(600);
driver.microsteps(16);
driver.pwm_autoscale(true);

Serial.println("UART TEST STARTED");

Serial.print("GCONF: 0x");
Serial.println(driver.GCONF(), HEX);

Serial.print("IHOLD_IRUN: 0x");
Serial.println(driver.IHOLD_IRUN(), HEX);

Serial.print("DRVSTATUS: 0x");
Serial.println(driver.DRV_STATUS(), HEX);
}

void loop() {
// spin the motor slow
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(900);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(900);
}

Try posting an annotated schematic showing exactly how you have wired it.

1 Like

Many members have met problems with that so You’re not the first. There are plenty of topics on forum about this.

The tab “Search Forum” up and right in this window could provide good help.

Okay good idea on it thanks

I've tried that but I can't seem to find anything helpful

There is always the possibility that nothing is wrong, or that the problem cannot be found with the information provided. That is the situation we are dealing with in your project. We cannot see what you have in front of you, and many of us may not even have the same parts you are working with.

Your difficulty in finding a solution may simply be due to lack of experience or incomplete understanding. A schematic — the language of electronics — is the best way to show us what you have so we can help identify any possible errors.

If you need a schematic capture program, KiCad is a full-featured tool that you can download and use for free. Many of us here use it and can guide you if needed.

KICAd.pdf (65,7 KB)
Here is the way i wired it

The Motor may not be corect but in real live I wired it right

As stated here, you're supposed to connect RX_PIN (D11 in your case) to UART pin and TX_PIN (D10 in your case) to a 1kΩ resistor connected to D11/UART.

Ive tryied that and no result thanks tough