Interrupt Delay Problem

05 Jan 2011

I am trying to generate an external interrupt. I have configured a pin as an InterruptIn pin and I am inputting a 50kHz square wave pulse into the pin and I am toggling a DigitalOut pin high and low when entering and leaving the ISR. However, I am seeing a 5us delay when entering and leaving the ISR on the scope and I cannot see where this delay is coming from. Can anyone shed any light on this situation?

05 Jan 2011

Post your source so we can see it.

05 Jan 2011

Here is a section of the source code in question:

DigitalOut ClockOut (p22);

void Timer1_IRQHandler(void)
{
    LPC_TIM1->IR = 1;
    LPC_TIM1->MR0 = 469;
     PhaseTick++;
    ClockOut = 1;
    if (PhaseTick >= 4)
    {
        PhaseTick = 0;
        LookCounterA++;
        LookCounterB++;
        LookCounterC++;    
                
        QDacSync = 0;
        QDacData = Lookup[LookCounterA] >> 4;
        QDacData |= 0x0000;
        QDac.write(QDacData);  
        QDacSync = 1;
       
        QDacSync = 0;
        QDacData = Lookup[LookCounterB] >> 4;
        QDacData |= 0x1000;
        QDac.write(QDacData);  
        QDacSync = 1;
       
        QDacSync = 0;
        QDacData = Lookup[LookCounterC] >> 4;
        QDacData |= 0x2000;
        QDac.write(QDacData);  
        QDacSync = 1;
       
        //update all outputs
        QDacSync = 0;
        QDacData = 0xA00F;
        QDac.write(QDacData);  
        QDacSync = 1;
       
    }
    ClockOut = 0;
}