2013-07-31 03:33 AM
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; //start2013-07-31 05:15 AM
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.