I’ve been working with the MCPWM feature on the ESP32-S3 and encountered an issue with updating the prescaler values on the fly, similar to what was discussed in the original post (viewtopic.php?t=14210). In that post, henrik.basic presented a workaround that worked for the ESP32.
Following the same workaround:
Code: Select all
mcpwm0.timer[0].mode.start = 0; // Stop on TEZ
mcpwm0.timer[0].period.prescale = newPrescale;
mcpwm0.timer[0].sync.timer_phase = 0;
mcpwm0.timer[0].sync.sync_sw ^= 1;
delayMicroseconds(0);
mcpwm0.timer[0].mode.start = 2; // Free running
I’ve tried experimenting with different delays between stopping and restarting the timer, but I haven’t been able to resolve this on the ESP32-S3. It seems like the ESP32-S3 might handle the prescaler differently, or there could be other factors in play with this newer chip.
Has anyone else experienced this issue with the ESP32-S3? If so, were you able to find a working solution? I’d appreciate any insights or recommendations!
Thank you in advance for your help.