cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F NUCLEO -64 TIMER2 INTERRUPT WORKING ONLY ONCE

Nchun.1
Senior

Hi

I am trying to Toggle a pin using Timer2 interrupt in stm32 Nuclueo-64 ,

But it is going to ISR only once .please Help 

1 REPLY 1

Which STM32?

By using your own symbols and "magic values" instead of the symbols defined in CMSIS-mandated device header, you 1. increase the chance you introduce errors in constants, 2. decrease chance anybody wants to review your code.

To enable timer interrupts, you have to set some of the respective pins in TIMx_DIER. Here are some more tips to debug interrupts.

Also, in the ISR, clear the interrupt source in TIMx_SR immediately at the beginning of the ISR, and don't use read-modify-write to clear bits in TIMx_SR.

JW