Skip to main content
Visitor II
January 14, 2008
Question

Problem with external interrupt

  • January 14, 2008
  • 5 replies
  • 1057 views
Posted on January 14, 2008 at 09:37

Problem with external interrupt

    This topic has been closed for replies.

    5 replies

    Visitor II
    December 7, 2007
    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

    }

    Visitor II
    December 7, 2007
    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

    Visitor II
    December 9, 2007
    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)

    Visitor II
    December 11, 2007
    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?

    Visitor II
    January 14, 2008
    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.