2010-03-29 06:27 AM
Dual Interrupts from single UEV on TIM1 (STM32f103 )
2011-05-17 04:45 AM
Are you clearing the interrupt at the ''start'' of the ISR or at the ''end''?
For example, in my TIM ''Hello world'', I use this... void TIM2_IRQHandler() { TIM_ClearITPendingBit(TIM2, TIM_IT_Update); // toggle bit GPIOC->ODR ^= GPIO_Pin_12; } If you're clearing it at the ''end'', maybe it's calling the ISR again (the double) before it gets the clear bit set...2011-05-17 04:45 AM
void TIM2_IRQHandler()
{ if (TIM_GetITStatus(TIM2, TIM_IT_Update) == SET) { TIM_ClearITPendingBit(TIM2, TIM_IT_Update); // toggle bit GPIOC->ODR ^= GPIO_Pin_12; } } >>If you're clearing it at the ''end'', maybe it's calling the ISR again (the double) before it gets the clear bit set... You'd have to be doing a lot of stuff, but it will have longer to clear before exiting and being checked again. Perhaps the better way to attack this is to see which of the 8 interrupts is pending, and make sure that they are ALL cleared. If interrupts aren't cleared on the STM32 you basically get a crap storm of interrupts and it won't execute any user space code. -Clive2011-05-17 04:45 AM
Gentlemen, thanks a lot!!!
You were right, the ISR was called multiple times due to my clearing of the IRQ in the end of my code. I discovered it also when I unintentionally forgot to clear the IRQ, then I got a crazy amount of calls to my ISR, but at the time I couldnt fully understand it.2011-05-17 04:45 AM
Problem solved!