2008-01-14 12:37 AM
2007-12-06 07:41 PM
Hello,
i have a problem with the external interrupt on a Str710FZ2 controller. If i get an interrupt on one external interrupt line and i am in the interrupt service routine and at this moment i get another external interrupt on a other external interrupt line i get no recall of the interrupt service routine after exiting the first execution. I only clear the pending bit of the external interrupt which calls the interrupt service routine the first time. Code: ===== void XTI_IRQHandler(void) { unsigned short wInterruptLine; // Read the line number that generates the interrupt. wInterruptLine = XTI_InterruptLineValue(); ... if (wInterruptLine & XTI_Line4) { RCP1_Interrupt(); XTI_PendingBitClear(XTI_Line4); } if (wInterruptLine & XTI_Line5) { RCP2_Interrupt(); XTI_PendingBitClear(XTI_Line5); } .... -> and so on }2007-12-07 04:20 AM
This could be a race condition if you are using edge triggered external interrupts. The second edge transition could occur before the first has been cleared in the service routine, so you lose the second event. Have you checked the timing to see if the two events are far enough apart to allow for interrupt latency?
Jack Peacock2007-12-09 03:40 AM
Sorry, but i think you haven't understood my question correct.
I have configured 2 interrupts on the externel interrupt line (for example Port 2.8 and Port 2.9 as an interrupt line with falling edge). If i get an interrupt on the Port 2.8 and i am in the interrupt service routine and a new interrupt on Port 2.9 occurre i don't get this interrupt after exiting the first execution (i only clear the pending bit from the port 2.8)2007-12-10 07:27 PM
The code looks correct. Did you try to examine the contents of the interrupt pending registers XTI_PRL and XTI_PRH before and after the interrupt is lost?
2008-01-14 12:37 AM
Sorry for the delay (holiday) !
The problem is, that i can't make breakpoints to check this problem. Reason: ======= 1. The problem exists only when the interrupts overlap, not every time. 2. The problem occurs in the middle of a serial communication, if there is a breakpoint, the communication is lost.