Correct pinout for TMC2209 stepper motor driver and Mega?

// https://github.com/janelia-arduino/TMC2209
#include <TMC2209.h>

// This example will not work on Arduino boards without HardwareSerial ports,
// such as the Uno, Nano, and Mini.
//
// See this reference for more details:
// https://www.arduino.cc/reference/en/language/functions/communication/serial/

HardwareSerial & serial_stream = Serial3;

const long SERIAL_BAUD_RATE = 115200;
const int DELAY = 3000;

// Instantiate TMC2209
TMC2209 stepper_driver;


void setup()
{
  Serial.begin(SERIAL_BAUD_RATE);

  stepper_driver.setup(serial_stream);
}

void loop()
{
  if (stepper_driver.isSetupAndCommunicating())
  {
    Serial.println("Stepper driver is setup and communicating!");
    Serial.println("Try turning driver power off to see what happens.");
  }
  else if (stepper_driver.isCommunicatingButNotSetup())
  {
    Serial.println("Stepper driver is communicating but not setup!");
    Serial.println("Running setup again...");
    stepper_driver.setup(serial_stream);
  }
  else
  {
    Serial.println("Stepper driver is not communicating!");
    Serial.println("Try turning driver power on to see what happens.");
  }
  Serial.println();
  delay(DELAY);
}

TMC2209 ⟷ Mega
RX ⟷ TX3
GND ⟷ GND
VIO ⟷ 5V
EN ⟷ GND

I keep getting, "Stepper driver is not communicating!" So something isn't right. I swapped out drivers. I tested a program that moves the motor to confirm the driver works.

image

I'm not sure what "TX" does on the TMC2209 dev board/carrier. What works is connecting RX to RX and then putting a 1k resistor between the MCU's TX and RX pins (in this case, between the TX and RX of the Mega). The TX on the TMC2209 is left unattached.

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