> Source: https://www.tinkered.ai/components/tmc2209-stepper-driver/raspberry-pi-pico (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/tmc2209-stepper-driver/raspberry-pi-pico. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# TMC2209 Stepper Driver with a Raspberry Pi Pico

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

| TMC2209 Stepper Driver | Raspberry Pi Pico | Note |
| --- | --- | --- |
| 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)

## Code

Libraries: waspinator/AccelStepper

```cpp
// 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();
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## 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.

## More

- [TMC2209 Stepper Driver reference](https://www.tinkered.ai/components/tmc2209-stepper-driver.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the TMC2209 Stepper Driver on the Raspberry Pi Pico in the browser, with this wiring and code, free: https://www.tinkered.ai/components/tmc2209-stepper-driver/raspberry-pi-pico
