Making DMA/I2S output to LEDC PWM?

aj22rr
Posts: 1
Joined: Thu Dec 16, 2021 6:58 pm

Making DMA/I2S output to LEDC PWM?

Postby aj22rr » Thu Dec 16, 2021 7:14 pm

Hi. I know that I2S can connect directly to the DAC and output data through DMA but is it possible to have it output data to the PWM controller (duty cycle)?
Also, I've noticed that when I change the LEDC PWM frequency the signal on the output pin is constantly high/low for, I'm guessing, one PWM cycle or as long as it takes to reset the LEDC PWM controller. It would be great if i could change the PWM modulation frequency every single cycle (20-30kHz).

ankostis
Posts: 1
Joined: Tue May 03, 2022 8:45 am

Re: Making DMA/I2S output to LEDC PWM?

Postby ankostis » Tue May 03, 2022 9:36 am

I was thinking the same, and i would try to use interrupts, to modify the duty-cycle at the end of each cyce.
In principle, you don't need to modify the PWM frequency to replicate ADC signal, you should achieve similar effects by modifying just the duty-cycle (PWM controllers have custom logic for fast control).

I would take inspiration from the way ESP_IDF ledc-driver has achieved fade-in/out effects synced with the duty cycle (if my understanding is correct).
Please keep this post updated if you have any success with it.

Who is online

Users browsing this forum: Bing [Bot] and 92 guests