Connect TIMER2 to TIMER1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-04-06 2:28 PM
Posted on April 06, 2016 at 23:28
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 #pwm
Labels:
- Labels:
-
TIM
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-04-07 6:13 AM
Posted on April 07, 2016 at 15:13
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-