TMC2208 with cnc shield v3 and arduino uno to run NEMA 17 motor

Hi gang,

I am using one BIGTREETECH TMC2208 ALREADY in UART mode from the factory together with my CNC shield v3 and arduino uno. I am running into problems getting my motor to run at all. I have plugged the UART pin of the bigtretch into digital pin 12 on the cnc shield. My Voltmeter reads out 1.4 V on the TMC but the motor is not doing anything.

Sorry I know this isnt ideal but its a fairly simple setup. Let me know if there are any unclarities.

Here is the code I am using. I have copied it from the simple example from here.

#include <TMCStepper.h>

#define EN_PIN           8   // Enable pin (D8 on the CNC shield)
#define DIR_PIN          5   // Direction pin (D5 on the CNC shield)
#define STEP_PIN         2   // Step pin (D2 on the CNC shield)

#define SW_RX            13 // TMC2208/TMC2224 SoftwareSerial receive pin
#define SW_TX            12 // TMC2208/TMC2224 SoftwareSerial transmit pin
#define R_SENSE          0.11f // Sense resistor value

// Initialize TMC2208Stepper using SoftwareSerial (replace this with correct pin mappings for your setup)
TMC2208Stepper driver(SW_RX, SW_TX, R_SENSE);                     // Software serial

void setup() {

  pinMode(EN_PIN, OUTPUT);
  pinMode(STEP_PIN, OUTPUT);
  pinMode(DIR_PIN, OUTPUT);
  digitalWrite(EN_PIN, LOW);  // LOW enables the driver

  // Initialize serial communication
  driver.beginSerial(115200);  // Start communication with the driver
  
  // Enable the motor driver

  
  // Initialize TMC2208 settings
  driver.begin();             // Initialize the driver
  driver.toff(5);             // Enable the driver in software
  driver.rms_current(600);    // Set motor RMS current to 600 mA
  driver.microsteps(16);      // Set microstepping to 1/16
  driver.en_spreadCycle(false); // Disable SpreadCycle (StealthChop mode enabled)
  driver.pwm_autoscale(true); // Needed for StealthChop operation
}

bool shaft = false;

void loop() {
  // Run 5000 steps in one direction and then switch direction
  for (uint16_t i = 5000; i > 0; i--) {
    digitalWrite(STEP_PIN, HIGH);
    delayMicroseconds(160);  // Adjust this delay to control the speed
    digitalWrite(STEP_PIN, LOW);
    delayMicroseconds(160);
  }
  
  // Switch motor direction
  shaft = !shaft;
  driver.shaft(shaft);  // Change direction using the TMC2208 driver
}

Also I apologize for any idiocy I am an absolut beginner and would appreciate any help:)

Combining that shield and that driver has been the topic earlier. Try rhe "Search Forum" box, up and to the right in this window to read what has been told already.

yeah ive looked into that if you mean this one. I think mine might be different because I already have the resistor soldered across my UART output.

Do I still need to split the cable and add a resistor to the tx cable?
if not then something must be wrong with my code.

Was that all You found?

All I found on here that was useful. I also found this thread where somebody seems to have the exact same tmc as me but all the editing has made it confusing.

Sorry but the link is not accepted due to cookies, login etc...

Check and compare both wiring and code for details that are different.
There's a lot of comments to consider.

Does the motor not even energize? Is it as easy to spin as when there is no power applied?

If you try without the serial connection, does it work in plain old wired/non-UART mode?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.