cancel
Showing results for 
Search instead for 
Did you mean: 

When I am Starting timer interrupt it jumps to IRQHandler why?

imran.aftab
Associate III

when MCU execute this "HAL_TIM_Base_Start_IT(&htim2);" then at that instant program jumps to IRQHandler. And then it works normally.

How can I solve this issue?

Regards

Imran

1 REPLY 1

Clear the TIMx_SR just after initialization/before enabling interrupts. The initialization sets TIMx_EGR.UG to force new PSC to be used in the first period, and that sets the Update flag in SR.

JW

PS. Please change your username to a normal (nick)name.