Timer related general questions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2013-07-31 3:33 AM
Posted on July 31, 2013 at 12:33
1. What is total delay produced by timer in STM32f205:
delay = ( (ARR+1) * (PSC+1) ) / Timer_freq or delay = ( (ARR) * (PSC+1) ) / Timer_freq ordelay = ( (ARR) * (PSC) ) / Timer_freq 2. I have a timer for 10ms, what is correct way of restarting the timer. After 5ms I stopped by timer by TIM2->CR1 &= (~0x0001). (due to some condition). After that I want to restart the timer for 10ms again, not for left 5 ms, is it the correct way TIM2->CNT = 0x0000; /* clear any previous cnt */ TIM2->EGR = 0x0001; // update register TIM2->CR1 |= 0x0001; //start
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2013-07-31 5:15 AM
Posted on July 31, 2013 at 14:15
delay = ( (ARR+1) * (PSC+1) ) / Timer_freq
Bit 7 (ARPE) of bit CR1, and Bit 0 (UG) of EGR would be the things I'd look at.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
