Section 14: Internal Pulse Generator

The advanced features such as StallGuard can be purchased in our PDF guide here.
Advanced Feature: Available in our guide.

The problem with using a single-core ESP32 with a stepper motor is that moving a motor by pulsing the STEP pin is a full-time job. The ESP32 is completely tied up when operating the stepper motor that it doesn’t have any processing time left to do other tasks. Sometimes it will crash as well when the watchdog timer gets triggered because other tasks are not able to run.

This is not a problem if you have a simple device that does not need to complete other tasks, like WiFi updates. However, if you want to use WiFi or run LED lights, or anything else whatsoever while moving the motor, you’ll be out of luck.

Fortunately, there’s a solution. The TMC2209 contains an internal pulse generator that will drive the STEP pin for us. All we need to do is tell it what speed to run at.
Let’s open the example “single_core_simple.ino” to get started.

Course Sections:

Advanced Sections:

Back to blog

Leave a comment