LEDC unable to attain 100% duty at 120Hz; no pulse at 60Hz?

piratejon
Posts: 2
Joined: Sun Jun 03, 2018 4:14 am

LEDC unable to attain 100% duty at 120Hz; no pulse at 60Hz?

Postby piratejon » Mon Aug 27, 2018 12:57 am

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?

Shoyur
Posts: 3
Joined: Tue Nov 07, 2023 6:25 pm

Re: LEDC unable to attain 100% duty at 120Hz; no pulse at 60Hz?

Postby Shoyur » Thu Nov 09, 2023 11:12 pm

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.

Who is online

Users browsing this forum: Google [Bot] and 251 guests