AnsweredAssumed Answered

STM32F4 using timer channels to generate shifted pulses

Question asked by Zieli_ski._ukasz on Nov 8, 2016
Latest reply on Nov 9, 2016 by Clive One
Hi, I want to generate short pulses on channels 1, 2 and 3 of TIM4. Pulses on each channel must be shifted relative to other channels, just like on image below:
tim4.jpg
Main idea is:
At first I set TIM4 mode to TIM_OCMode_Active, then set different CCRx values to each channel, then in TIM4 interrupt handler i managed to add to CCRx constant value (my pulse width) and set TIM4 mode to TIM_OCMode_Inactive. In the next interrupt CCRx and TIM4 mode were set to the original values.
After many tests it doesn't work, even single channel. I'm not able to paste here my code right now, if needed i can do this later. Is the idea good, is it even possible to do this or am i convicted to use 3 different timers? If it is possible can someone help me with some working code?

Outcomes