this post was submitted on 05 Oct 2023
17 points (100.0% liked)
Ask Electronics
3325 readers
1 users here now
For questions about component-level electronic circuits, tools and equipment.
Rules
1: Be nice.
2: Be on-topic (eg: Electronic, not electrical).
3: No commercial stuff, buying, selling or valuations.
4: Be safe.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
What’s limiting your PWM frequency? You want it above 25 KHz so it’s outside the range of human hearing.
I think the limitation is my own knowledge of this LEDC library. When I run it with the frequency value of 25,000 it doesn't output anything on my GPIO pin that I can detect with my multimeter.
I’m reading the docs and it seems capable of running up into the MHz range although at higher frequencies the duty cycle resolution is reduced. Although I wouldn’t expect most multimeters to detect a frequency that high, anything should pick up the voltage.
Do you get an error on the serial monitor? It should report if the frequency/duty-cycle range you’re requesting isn’t possible.
E (196) ledc: requested frequency and duty resolution cannot be achieved, try reducing freq_hz or duty_resolution. div_param=128