Question
[STM32L4] timer interrupt starts immediately
Posted on October 04, 2016 at 13:07
Hi, using TIM1 to get a simple 1ms delay (MCU@24MHz, PSC=24, ARR=1000) the interrupt triggers almost as soon as I set CR1:CEN=1.
I've found that I'm not the only one having this problem, have followed the advice given here and there, but still no luck. 1- Start peripheral (RCC) 2- Reset peripheral 3- Set registers (SR, CR1, SMCR, BDTR, CNT, ARR, PSC) 4- Do some read back to ensure propagation 5- Tried the EGR:UG=1 trick 6- Tried the CR1:URS=1 trick 7- Interrupt is cleared at the beginning of the ISR 8- Start the timer, interrupt triggers within 50us (about 1200 cycles) This is rather hard to get this thing working without deploying a whole army. #stm32l4-timer-interrupt-spurious #stm32l4-timer-interrupt-spurious #stm32l4-timer-interrupt-spurious #stm32l4-timer-interrupt-spurious #stm32l4-timer-interrupt-spurious