cancel
Showing results for 
Search instead for 
Did you mean: 

TIM3 problem in stm32 cube HAL library

yafisdamda
Associate II
Posted on November 30, 2015 at 09:52

Hello.

I am using STM32F0xx with stm32cube lib as the dev platform. 

My application requires TIM3 peripheral. I am using __HAL_TIM_SET_COUNTER to set the cnt value at runtime. I need the timer count value for some calculation and i re-set it using the above macro every fixed interval. What i am observing is when set the counter value, stop the timer and restart it. It doesnt report interrupts. 

What is the correct procedure to set the counter value while the timer is running??

#stm32-cubemx-tim-interrupt
2 REPLIES 2
matic
Associate III
Posted on November 30, 2015 at 23:10

I don't understand why would you like to set CNT register manually? To which value?

Posted on December 01, 2015 at 01:30

I generally prefer to read two successive values and compute a delta between them, rather than reset or change the counter asynchronously.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..