Do you clear the interrupt in the handler? That might explain why the second one is not triggered.
You might also be forgetting some initialization. Here's how it's done in the sample from NXP:
/* LED pin in byte style on P1 */
#define POLL_LED (1<<4) // P1.28
#define INT0_LED (1<<5) // P1.29
#define INT3_LED (1<<7) // P1.31
#define LED2_MASK ((1<<2) | (1<<3) | (1<<4) | (1<<5) | (1<<6))
#define LED1_MASK (POLL_LED | (INT0_LED) | (INT3_LED))
/**
* @brief Delay function
*/
void delay (void) {
unsigned int i;
for (i = 0; i < 0x100000; i++) {
}
}
/**
* @brief External Interrupt 0 Handler
*/
void EINT0_IRQHandler(void)
{
int i;
SC->EXTINT |= 0x1; //clear the EINT0 flag
for (i= 0; i<10; i++)
{
FIO_ByteSetValue(1, 3, INT0_LED);
delay();
FIO_ByteClearValue(1, 3, INT0_LED);
delay();
}
}
/**
* @brief External Interrupt 3 Handler
*/
void EINT3_IRQHandler(void)
{
int j;
if (GPIOINT->IO0IntStatF == 0x02000000)
{
GPIOINT->IO0IntClr = 0x02000000;
for (j= 0; j<10; j++)
{
FIO_ByteSetValue(1, 3, INT3_LED);
delay();
FIO_ByteClearValue(1, 3, INT3_LED);
delay();
}
}
}
// Main Program
int main (void)
{
PINSEL_CFG_Type PinCfg;
SystemInit();
// Set Vector table offset value
#if (__RAM_MODE__==1)
NVIC_SetVTOR(0x10000000);
#else
NVIC_SetVTOR(0x00000000);
#endif
//p1.31 , P1.29 and P1.28 are outputs
FIO_ByteSetDir(1, 3, LED1_MASK, 1);
FIO_ByteSetDir(2, 0, LED2_MASK, 1);
// Turn off all LEDs
FIO_ByteClearValue(1, 3, LED1_MASK);
FIO_ByteClearValue(2, 0, LED2_MASK);
//Initialize EXT registers
SC->EXTINT = 0x0;
SC->EXTMODE = 0x0;
SC->EXTPOLAR = 0x0;
/* edge sensitive */
SC->EXTMODE = 0xF;
/* falling-edge sensitive */
SC->EXTPOLAR = 0x0;
/* External Interrupt Flag cleared*/
SC->EXTINT = 0xF;
/* P2.10 as /EINT0 */
PinCfg.Funcnum = 1;
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = 0;
PinCfg.Pinnum = 10;
PinCfg.Portnum = 2;
PINSEL_ConfigPin(&PinCfg);
// Enable GPIO interrupt P0.25/AD0.2
GPIOINT->IO0IntEnF = 0x02000000;
NVIC_SetPriorityGrouping(4); //sets PRIGROUP to 3:2 (XXX:YY)
NVIC_SetPriority(EINT0_IRQn, 0); //000:00 (bit 7:3) assign eint0 to group 0, sub-priority 0 within group 0
NVIC_SetPriority(EINT3_IRQn, 4); //001:00 (bit 7:3) assign GPIO int to group 1, sub-priority 0 within group 1
NVIC_EnableIRQ(EINT0_IRQn);
NVIC_EnableIRQ(EINT3_IRQn);
while (1)
{
FIO_ByteSetValue(1, 3, POLL_LED);
delay();
FIO_ByteClearValue(1, 3, POLL_LED);
delay();
}
}
I have attached fine wires to pins 51 and 52 and connected them to my dual pulse generator that emits two pulses delayed by a settable interval in the 10s to 100s of nanoseconds.
Initially I set both interrupts for edge-sensitive rising-edge mode and saw nothing in my interrupt handlers.
I changed to level sensitivity and found that I could only get one handler to respond at a time - for instance if I set LPC_SC->EXTPOLAR = 2 , then EINT1_IRQHandler() responded OK, and if I put LPC_SC->EXTPOLAR = 4 , then EINT2_IRQHandler() responded OK.
So my wiring is OK.
But if I set LPC_SC->EXTPOLAR = 6 expecting both interrupts to fire, one delayed from the other, only the EINT1_IRQHandler() gets fired. The delay between the pulses for these test was about 500ns.
Any help or pointers would be very gratefully appreciated.
John Robbins.