cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f4 4-channel PWM with phase shift and variable duty cycle

igor0428
Associate
Posted on April 01, 2015 at 11:51

Hello,

I'm stucked and want to ask for some clues.

I'm building an 4-phase interleaved boost converter and I need to run a 4-channel PWM with phase shift (90 degree on each channel) and variable duty cycle (same for all channels).

I tried to use OC Toggle Mode, but I was unable to change duty cycle.

In PWM1 I was unable to phase shift.

I tried to use one timer at 4xfreq and then in interrupts fire 4 separate timer, but it wasn't accurate.

Will appreciate for any hints, becouse I'm trying to manage it for a week.

#phase-shift #pwm #stm32
3 REPLIES 3
Posted on April 01, 2015 at 13:36

TIM+DMA pattern buffer into GPIOx->BSRR

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
igor0428
Associate
Posted on April 07, 2015 at 11:13

Clive1 sir, 

Could you tell sth more about your proposition or maybe provide any code example?

Posted on April 07, 2015 at 18:16

I believe I've posted several DMA to/from GPIO pin examples using either internal or external clock sources. The BSRR would allow you to set and clear specific pins within a GPIO bank, from a table, in a timed and sequenced fashion. The periodicity of the timer could be pulled in/out to change frequency, and the pattern/table adjusted to support different duty and phase relationships.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..