Question
Timer related general questions
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