Page 1 of 1

LEDC dual PWM with phase control

Posted: Mon Feb 14, 2022 6:48 pm
by samisabz
Hi,

I'm trying to generate two pwm signals using the LEDC controller, and I need one pulse to be exactly starting after the first one. With settings usually around 50 - 400 Hz and pulse width of around 30 - 150 uS

My approach is use ets_delay_us() to delay the start on the second ledc timer by the pulse width of the first pwm signa. This works but I did not find an accurate way to do so and delaying by the pulse width does not always yield perfect alignement of the two pulses. Is there any way to do this properly ?

Re: LEDC dual PWM with phase control

Posted: Thu Feb 17, 2022 6:38 pm
by alecamaracm
I would recommend having a look at the RMT peripheral. I am pretty sure you can configure it according to your needs.