TMC2209 Stepper Driver with a Raspberry Pi Pico
The TMC2209 is a silent StealthChop2 microstepping driver for bipolar stepper motors, controlled by STEP/DIR or single-wire UART.

The TMC2209 runs its logic from the Raspberry Pi Pico's 3V3 on VIO and takes STEP, DIR and the active-low EN from GP0, GP1 and GP2. Its logic accepts 3.0 V to 5.25 V, so the Pico drives it directly while the motor runs from its own supply on VM.
Wiring the TMC2209 Stepper Driver to the Raspberry Pi Pico
Pin by pin.
| TMC2209 Stepper Driver | Raspberry Pi Pico |
|---|---|
| STEP | GP0 |
| DIR | GP1 |
| EN | GP2 |
| VIO | 3V3 |
| GND_LOGIC | GND |
| GND_MOT | GND |
What to know on the Raspberry Pi Pico
- VIO (VCC_IO) accepts 3.0 V to 5.25 V, so the Pico's 3V3 sets 3.3 V logic levels and no shifting is needed.TMC2209 datasheet rev 1.08, p. 75
- VM takes the motor supply, 4.75 V to 29 V, never from the Pico; only the grounds are shared.TMC2209 datasheet rev 1.08, p. 1
- With MS1 and MS2 unconnected the driver runs at 1/8 microsteps, which is why the sketch moves 1600 steps (200 x 8) for one turn.TMC2209 datasheet rev 1.08, MS1 and MS2 pin description
TMC2209 Stepper Driver code for the Raspberry Pi Pico
Compiled for rp2040:rp2040:rpipico on 2026-10-30.
// TMC2209 Stepper Driver on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/tmc2209-stepper-driver/raspberry-pi-pico
#include <AccelStepper.h>
#define STEP_PIN 0
#define DIR_PIN 1
#define EN_PIN 2
AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);
void setup() {
Serial.begin(9600);
stepper.setEnablePin(EN_PIN);
stepper.setPinsInverted(false, false, true); // EN is active-LOW
stepper.enableOutputs();
stepper.setMaxSpeed(1200); // microsteps/sec
stepper.setAcceleration(600); // microsteps/sec^2
stepper.moveTo(1600); // one full revolution at the 1/8 default (200*8)
}
void loop() {
// Ping-pong ±1 revolution so you can watch forward and reverse.
if (stepper.distanceToGo() == 0) {
stepper.moveTo(-stepper.currentPosition());
Serial.print("Reached position: ");
Serial.println(stepper.currentPosition());
}
stepper.run();
}
TMC2209 Stepper Driver on the Raspberry Pi Pico: questions
Can a 3.3 V Pico drive a TMC2209?
Yes. Power VIO from 3V3 (3.0 V to 5.25 V, TMC2209 datasheet rev 1.08, p. 75) and wire STEP, DIR and EN straight to GPIOs.
Why does the motor make one turn in 1600 steps?
MS1 and MS2 left open select 1/8 microstepping (TMC2209 datasheet, MS1 and MS2 pins), so 200 full steps become 1600.
Do I need the UART pin for this Pico sketch?
No. PDN_UART is only for configuring registers at run time; STEP/DIR control, as on this page, works without it.
Keep going
This guide as plain Markdown. /components/tmc2209-stepper-driver/raspberry-pi-pico.md