I have to drive a stepper motor with my esp32, with a frequency that requires a delay below milliseconds (for example 100 microseconds). The esp32 has WiFi and ESP-NOW active at the same time, receiving some data from another esp32. My idea was to create a freeRTOS task for the stepper motor on core 0, so that core 1 can run WiFi ESP-NOW, but I have a hard time managing microseconds delay by doing so. I know that the vTaskDelay() cannot go higher than 1kHz.
Any suggestions? Thanks in advance!
This isn’t true unless this is an MCU limit. Check with this very concise explanation:
Thank you for the suggestion!
Another option, which is likely better, is rather than trying to use the tick to time the steps, us another timer in the system for this timing, and either signal a task, or just do the step in the ISR. This allows changing the rate with a fine scale to accelerate.