LEDC dual PWM with phase control
Posted: Mon Feb 14, 2022 6:48 pm
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 ?
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 ?