cancel
Showing results for 
Search instead for 
Did you mean: 

ADC DMA control of PWM duty cycle, but with second channel and deadtime

klauskvik
Associate II
Posted on October 27, 2012 at 01:43

Hi

We are using the STM32L151.

I want to use an analog input to control the duty-cycle of a PWM output. I am using DMA, so the CPU has no intervention since I will be running the duty-cycle updates fast.

However, I need the ADC value to control the duty-cycle of PWM channel 1 and have another channel (PWM channel 2) with the same duty-cycle, except it needs to have a deadtime before and after the reference dutychannel. (see

http://www.electronicsdesign.dk/tmp/deadtime.pdf

for how the signals should be)

The reference duty-cycle will be center alligned.

Is there a way to do this? (sorry if this is a basic question)

If this cannot be solved in SW, I guess I could use two ADC inputs, a seperate DMA transfer to make the individual PWM output, and add an offset voltage to the second ADC input to let the PWM output of this channel have a certain deadtime, but that is not very desirable, since it needs HW to configure the deadtime.

Thanks

Klaus

#adc-duty-cycle-dma-deadtime
0 REPLIES 0