2019-01-23 03:12 AM
Hello,
what whould be the ideal mode to generate a shifted 4-channel PWM for a Phase-Shift Converter?
A timing diagram is attached. The Turn-On- times of all switches are equal.
kind regards
Michael
2019-01-23 04:39 AM
In the generic STM32 timer you can't generate shifted waveforms at its different channels - the signals are always aligned with the update (rollover) with one of the edges. In some newer STM32 there are timers where outputs can be ANDed together which could be used for such shifting; but that also means a reduced number of output channels.
So, at the end of the day, you'd need to chain master-slave timers. You didn't care to give us the STM32 model you are intending to use, but in many models especially the higher end there may be combinations of 1 master driving 3 slaves simultaneously, available.
I don't Cube and I believe this would be a major pain in the bottom undertaking to implement in Cube, even if certainly possible.
jW
2019-01-23 04:49 AM
Would probably just DMA a pattern buffer into the GPIO->BSRR, triggered by a timer.
2019-01-23 04:52 AM
Sorry for neglecting the controller type. Iam using STM32F429. Thanks for your answer!
2019-01-23 05:53 AM
Take a timer with 4 channels, make the period long enough to time cover all pulses, then program all 4 channels compare values to toggle, get an interrupt every compare match. You should have 2x4 interrupts during one repeat period. Then, if this works, try to use dma in cyclic mode, if availablr, ti relax core time.