Hi, I've setup LPC1768 for external falling edge interrupt on EINT0 pin and in the interrupt handler, I just clear the interrupt flag and make a pin (P0.0) low and immediately high again. When I check the EINT0 pin and the output pin P0.0 on an oscilloscope, there is a huge lag, about 520ns between the falling edge of EINT0 & the P0.0 becoming low.
I use the LPCxpresso complier and I confirm the LPC is running at full
100MHz (from the clkout pin).Here is the interrupt handler:
======================================================= void EINT0_IRQHandler (void) { // Clear interrupt LPC_SC->EXTINT = EINT0_CLR;
LPC_GPIO0->FIOCLR0|=0x01;//make P0.0 low LPC_GPIO0->FIOSET0|=0x01;//make P0.0 high } =======================================================
Here is the disassembly from the compiler:
=======================================================
000001d8 :void EINT0_IRQHandler (void) { // Clear interrupt LPC_SC->EXTINT = EINT0_CLR; 1d8: 4b06 ldr r3, [pc, #24] (1f4 ) 1da: 2201 movs r2, #1 1dc: f8c3 2140 str.w r2, [r3, #320]
LPC_GPIO0->FIOCLR0|=0x01;//make P0.0 low
1e0: 4a05 ldr r2, [pc, #20] (1f8 ) 1e2: 7f13 ldrb r3, [r2, #28] 1e4: f043 0301 orr.w r3, r3, #1 ; 0x1 1e8: 7713 strb r3, [r2, #28] LPC_GPIO0->FIOSET0|=0x01;//make P0.0 high 1ea: 7e13 ldrb r3, [r2, #24] 1ec: f043 0301 orr.w r3, r3, #1 ; 0x1 1f0: 7613 strb r3, [r2, #24] } 1f2: 4770 bx lr =======================================================I cannot find out why it is taking so long. The number of instructions do not add up to anywhere close to 500ns. Any ideas?
--------------------------------------- Posted through