I'm experiencing weird behavior in my step / dir signal generation code that I'm running on an ESP32 S2 (Adafruit feather).
For a minimum reproducible example, I generate constant velocity signals in a very simple loop:
Code: Select all
#define DIR_PIN 5
#define EN_PIN 6
#define STEP_PIN 9
void setup() {
pinMode(DIR_PIN, OUTPUT);
pinMode(EN_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
digitalWrite(EN_PIN, LOW);
digitalWrite(DIR_PIN, HIGH);
}
void loop() {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(400);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(933);
}
Interestingly, other users have reported similar issues on different ESP models and different projects:
https://forum.seeedstudio.com/t/xiao-es ... s/267707/7
I have also tried another S2, same problem. As this problem persists across chip models and projects of independent developers, I suspect a bug somewhere in the handling of the IO in the esp API. Does anyone have a clue what could be going on?
Any help is greatly appreciated!
Cheers,
lordreas