LEDC unable to attain 100% duty at 120Hz; no pulse at 60Hz?
LEDC unable to attain 100% duty at 120Hz; no pulse at 60Hz?
I have generated a LEDC PWM output at 120Hz and faded between 0 and 1 * (1 << LEDC_TIMER_19_BIT). During the fade period a separate task polled ledc_get_duty() and reported values that basically made sense. However on the oscilliscope it seemed the pulse grew from zero to around 2/3rds, instead of all the way to a full wavelength. I reduced the configured frequency to 60Hz and observed no signal was generated at all (also evidenced by ledc_get_duty() returning 0). I set it back to 120Hz and observed a signal again. Then I tried reducing the resolution, from 19 bits to 13 bits, and observed a pulse. I reduced it further to 8 bits and observed no pulse (@ 120Hz). It seemed odd I could not detect a pulse at 120Hz/8 bits resolution, or 60Hz/19 bits resolution. I did attempt to configure an unrealistically high test frequency of 1200000000Hz in order to observe that ledc_* api was in fact generating an error, and it did so in accordance with documentation. Anyhow, I am trying to understand why I might not be able to observe a 100% duty pulse at 120Hz, or why I can't seem to generate any pulse at 60Hz?
Re: LEDC unable to attain 100% duty at 120Hz; no pulse at 60Hz?
Bump!
That's a year 2018 problem and I am having the same problem!
ESP32-S3, whatever resolution or frequency i set, i cant have more than about 2/3 or 1/2 duty when i set to max value...
Is there a solution ?
Thank you.
That's a year 2018 problem and I am having the same problem!
ESP32-S3, whatever resolution or frequency i set, i cant have more than about 2/3 or 1/2 duty when i set to max value...
Is there a solution ?
Thank you.
Who is online
Users browsing this forum: Bing [Bot], jcolebaker and 154 guests