cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with external interrupt

stefanwecker9
Associate II
Posted on January 14, 2008 at 09:37

Problem with external interrupt

5 REPLIES 5
stefanwecker9
Associate II
Posted on December 07, 2007 at 04:41

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

}

jpeacock2
Associate II
Posted on December 07, 2007 at 13:20

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 Peacock

stefanwecker9
Associate II
Posted on December 09, 2007 at 12:40

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)

kleshov
Associate II
Posted on December 11, 2007 at 04:27

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?

stefanwecker9
Associate II
Posted on January 14, 2008 at 09:37

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.