cancel
Showing results for 
Search instead for 
Did you mean: 

Reset of Timer

blue_dolphin1987
Associate II
Posted on March 07, 2014 at 03:15

Hi ,

I have a timer programmed to monitor a timeout event using timer interrupt(every 100ms). If the event occurs within the time (100ms) i would like to refresh the timeout. Is the below code able to do it ?

TIM_Cmd(TIM14, DISABLE);
TIM_Cmd(TIM14, ENABLE);

Is there a better way ? Thanks. I am using stm32f4.
2 REPLIES 2
Posted on March 07, 2014 at 03:28

TIM14->CNT = 0; //??

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
blue_dolphin1987
Associate II
Posted on March 07, 2014 at 03:37

Hi clive1, 

Thanks. It works.

From your answer i found 

TIM_SetCounter(TIM_14,0); // same as TIM14->CNT = 0.

Thanks