2016-04-06 02:28 PM
Hi,
The black waveform is the output of TIMER1, PWM mode on CH1. Now I want to start TIMER2 when there is match on TIMx_CCRx like the image below. I was trying to set up it on STM32CubeMx. I attached the project if you want to take a look into the STM32CubeMXhttps://my.st.com//public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Attachments/65036/timer.zip
project. I'm trying to use the Master/Slave function of timers.https://my.st.com//public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Attachments/65036/timers.png
#timer-synchronisation #pwm2016-04-07 06:13 AM
Hi xavier.jose,
In your case, you want to synchronize both TIMER1 and TIMER2 to make the Timer2's counter start counting when TIMER1 CCR1 event occurs ( counter matches the compare value), you should proceed like follow:Timer1 :Master mode selected Master Output trigger = OC1REF (
OK in your code
)Timer 2 :Slave mode : trigger (
Ok in your code
) The pulse values of both Timer shouldn't be reset, you should define the content of the TIMx_CCRx register to get the match like you want between CCRx and counter values. (not Ok in your code
) -Hannibal-