2006-03-15 04:25 AM
2006-03-15 03:34 AM
Hello, I am using TIM0 PWM OCMPB interrupt to cause FIQ T0TIMI_FIQChannel interrupt. I am using the IAR compiler with their routines to activate and service the interrupt. I am seeing a double interrupt like the flags are not being cleared, yet after the second of each OCMPB interrupt, it would appear to be cleared till the next expected time. Here is the interrupt code:
void FIQ_Handler(void) { GPIO1->PD = ((GPIO1->PD) ^ P1_6); EIC_FIQPendingBitClear(T0TIMI_FIQChannel); TIM0->SR &= ~TIM_OCFB; // reset interrupt flag GPIO1->PD = ((GPIO1->PD) ^ P1_6); } Any clues as to why it appears the flags are not cleared the first time, but cleared the second ? Thanks, Bob B2006-03-15 04:25 AM
I found the problem. You need to clear the timer interrupt first before clearing the FIQ pending flag, otherwise the interrupt source would still be active when FIQ pending flag was cleared and it would immediately be reactivated. Need to reset the source first.