cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Timer interrupts immediately after start

Mohammad A
Senior
Posted on September 29, 2017 at 00:33

i don't know if it's a feature or bug, but starting a timer in interrupt mode will bring the code into the interrupt handler the first time mcu calls timer start function.

To solve this problem it's enought to clear the UIF bit from SR register right after timer initialization so there would be no pending interrupts.

But, is this safe to clear this bit?

#timer #hal #stm32 #bug #interrupt
1 REPLY 1
Posted on September 29, 2017 at 00:47

Update is when CNT == 0, so that's how it works.

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