2019-05-06 07:57 AM
2019-05-06 07:59 AM
Hello,
I want to do 2 PWM, 1 on TIM 1 the other one on TIM8 and i'd like to synchronize both on the same clock. How can i do it please ?
I use CubeMX and keil uvison 5 and HAL functions...
Thanks
2019-05-06 08:08 AM
Tell first why you want to use two timers for 2 PWMs. One N-Channel Timer can do N-PWM that are synchronized. Otherwise read the timer docs how to start timers synchronous.
2019-05-06 09:41 AM
I would guess that both timers should be enabled by a common trigger signal. Dig through the spec (reference manual and datasheet) for more details.
With 2 advanced timers you can have up to 6 PWM plus their negate outputs (dual motor control drive for example)
2019-05-06 10:00 AM
You didn't tell us which STM32 are you using, but there are ample examples in the Cubes, e.g. for 'F446, [CubeF4]\Projects\STM32446E_EVAL\Examples\TIM\TIM_Synchronization , for yours you'll find it at a similar path, for one of the related devboards.
JW
2019-05-07 12:34 AM
I use STM32F4 discovery (STM32F407VG). I've to pilot 4 command that are complementary 2 to 2, for 2 synchronous BOOST.
So i need 4 signals, and i use 2 timers in PWM mode to generate 4 signals (Tim 1 : CH1 and CH1N and Tim 8 : CH1 and CH1N).
I succeeded this step, now I want to phase shift the timers 1 and 8 of pi but i can't put them on a same clock...
I hope u understand what i mean ..
2019-05-07 12:42 AM
I show you the code and settings of Cube MX. If you have an idea...
Thanks a lot !