LEDC dual PWM with phase control

samisabz
Posts: 1
Joined: Mon Feb 14, 2022 6:11 pm

LEDC dual PWM with phase control

Postby samisabz » 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 ?

alecamaracm
Posts: 7
Joined: Sat Jul 24, 2021 3:41 pm

Re: LEDC dual PWM with phase control

Postby alecamaracm » Thu Feb 17, 2022 6:38 pm

I would recommend having a look at the RMT peripheral. I am pretty sure you can configure it according to your needs.

Who is online

Users browsing this forum: No registered users and 91 guests