EFA:TMC2209 SilentStepStick

Pin Functions

PinFunction
.Power Supply
GNDGround
VMMotor Supply Voltage (5.5-28V)
VIOLogic Supply Voltage (3.3-5V)
.Motor Outputs
M1AMotor Coil 1
M1BMotor Coil 1
M2AMotor Coil 2
M2BMotor Coil 2
.Control Inputs
STEPStep-Signal Input
DIRDirection-Signal Input
ENEnable Motor Outputs (GND=on, VIO=off)
.Configuration
MS1Step-Configuration or Slave-Address on UART, pd
MS2Step-Configuration or Slave-Address on UART, pd
SPREADChopper, pd (GND=stealthChop, VIO=spreadCycle)
PDN_UARTUART and Auto Power Down Control, pd (GND=on, VIO=off)
DIAGDiagnostics Output (VIO=error)
INDEXIndex Output (one pulse per each four fullsteps)
VREFAnalog Reference Voltage

How to Use It?

This is a simple setup that doesn’t use all the fancier features of the stepper driver.

Step Configuration

CFG2/MS2CFG1/MS1SPREAD/MS3StepsInterpolationMode
GNDGNDGND1/81/256stealthChop
GNDVIOGND1/321/256stealthChop
VIOGNDGND1/641/256stealthChop
VIOVIOGND1/161/256stealthChop
GNDGNDVIO1/81/256spreadCycle
GNDVIOVIO1/321/256spreadCycle
VIOGNDVIO1/641/256spreadCycle
VIOVIOVIO1/161/256spreadCycle
int enPin = 4;
int dirPin = 2;
int stepPin = 3;
int stepAmount = 400;
int microSteps = 16; // 16 means 1/16, 32 means 1/32 etc.

void setup() {
  // put your setup code here, to run once:
  pinMode(dirPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(enPin, OUTPUT);
  digitalWrite(dirPin, HIGH);
  digitalWrite(enPin, LOW);
}

void loop() {
  oneFullRotation();
  delay(1000);
}

void oneStep() {
  digitalWrite(stepPin, HIGH);
  delayMicroseconds(100);
  digitalWrite(stepPin, LOW);
  delayMicroseconds(100);
}

void oneFullRotation() {
  for (int i = 0; i < stepAmount * microSteps; i++) {
    oneStep();
  }
}