Skip to content

Conversation

@zehnm
Copy link
Owner

@zehnm zehnm commented Jul 30, 2025

Cherry-picking the PWM improvements from upstream's PR: crankyoldgit#2074

Uses fixed point pulse widths for higher precision and polling of micros instead of delay to be able to reach the frequencies required.
On ESP8266 lower than 160 MHz a free running PWM mode was also added to get as close to 455 kHz as possible.
A bonus is that the lower frequencies now are accurate to within a few hertz.

Verified with a logic analyzer on the GPIO pin. Signal definitely looks cleaner on this ESP32-S3 ESP-IDF implementation.

@zehnm zehnm self-assigned this Aug 26, 2025
@zehnm zehnm marked this pull request as ready for review August 26, 2025 07:45
@zehnm zehnm merged commit 160b843 into ucd3-idf Aug 26, 2025
8 checks passed
@zehnm zehnm deleted the refactor/pwm-generation branch August 28, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants