Hi
My external interrupt is not working. I am using LPC2388 ,configured P2.13 as EINT3 , My interrupt source is a active low signal., i configured EINT3 as falling edge. Do i need to change any code in start file. Please help me in correcting the code.
#include <LPC23xx.h> volatile unsigned long eint3_counter; /****************************************************************************** EINT3 interrupt service function ****************************************************************************** ** Function name: EINT3_IRQHandler ** ** Descriptions: external INT handler ** Toggles Port2.0 to p2.7 ** parameters: None ** Returned value: None ** *****************************************************************************/ __irq void EINT3_IRQHandler(void) { eint3_counter++; if ( eint3_counter & 0x01 ) /* alternate the LED display */ { FIO2SET = 0x0000000F; /* turn off P2.0~3 */ FIO2CLR = 0x000000F0; /* turn on P2.4~7 */ } else { FIO2SET = 0x000000F0; /* turn on P2.0~3 */ FIO2CLR = 0x0000000F; /* turn off P2.4~7 */ } EXTINT = 8; /* Clear EINT3 interrupt flag */ VICVectAddr = 0; /* Acknowledge Interrupt */ } /****************************************************************************** External interrupts:Ext. interrupt 3 mode: Edge sensitivity / Falling edge / wake on interrupt 3 is Off Vector interrupt initialization ******************************************************************************/ void EINTInit() { FIO2DIR = 0x000000FF; /* P2.0~7 GPIO output */ FIO2CLR = 0x000000FF; /* turn off LEDs */ PINSEL4=0x04000000; /* set P2.13 as EINT3 (External Interuupt)*/ IO2_INT_EN_F = 0x00002000; /* Port2.10 is falling edge. */ EXTMODE=0x08; /* Edge sensitivity */ EXTPOLAR=0x00; /* Falling edge */ INTWAKE |=0x0008; /* wake on interrupt 3 is Off */ EXTINT=0x08; /* clear the external interrupt flags */ VICVectAddr17 = (unsigned long) EINT3_IRQHandler; /* set interrupt vector 17 */ VICVectPriority17 = 15 ; /* default priority is 15 (lowest), can be set between 0-15 */ VICIntEnable |= ((unsigned long)1<<17); /* Enable EINT3 Interrupt */ } int main(void) { EINTInit(); while(1) { } }