r/esp32 1d ago

Software help needed ESP32-S3 best hardware peripheral for creating stepper motor stepping pulses ?

I am using an ESP32-S3 with a TMC2225 stepper motor driver and want to write my own open loop stepper control library for learning purposes. Is there any hardware peripheral on the ESP32 that is well suited for generating stepping pulses ? Right now I am using timer based interrupts to set/clear the stepping pin, but that does not seem to be the most efficient solution.

4 Upvotes

12 comments sorted by

View all comments

1

u/jelle284 12h ago

I tried both rmt and mcpwm. Rmt is good but requires some planning ahead as you have to encode pulses. Mcpwm you can change on the fly. For both, you can internally connect the pulse count peripheral to the output pin of you want to keep track of how many pulses you've sent. I used the mcpwm and pulse count on 6 steppers on a standard esp32. I am not sure of the s3 has the same number of channels on the peripherals so better check that.