This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Only one external interupt is serviced when interupt inputs are paralled

Hello Experts,

Please help me to solve the below issue.
I have written a code to handle two external interrupts (ENT1 and ENT2) and toggle port pins to confirm the ISR's execution. When both the interrupts are paralleled (i.e. raising is given at same time) only ISR assigned to ENT1 is executed. But when the interrupt at other input is delayed or given at different incidents both are serviced.

Please let me know hwat is the mistake I have done in the code. I need to handle all four external interrupts simultaneously which may occur even together.
I am checking my code in Proteus. I am just a beginner in LPC2138.

Please help me.

__irq void eint1_srv (void);
__irq void eint2_srv (void);

unsigned long temp=0;

#include <LPC21xx.H>

int main(void)
{

IODIR0 = 0x0000FFFF;

EXTMODE = 0x0F;

EXTPOLAR = 0x0F;

PINSEL0 = 0xA0000000;

VICVectAddr1 = (unsigned long) eint1_srv;

VICVectAddr2 = (unsigned long) eint2_srv;

VICVectCntl1 = 0x20 | 15;

VICVectCntl2 = 0x20 | 16;

VICIntEnable = 0x0003C00C;

while(1)

{

++temp;

if (temp>1000) temp=0;

}
}

__irq void eint1_srv (void)
{

IO0PIN ^= 0x00000001;

EXTINT |= 1<<1; // Clear EINT1 interrupt flag

VICVectAddr = 0; // Acknowledge Interrupt

}

__irq void eint2_srv (void)
{

IO0PIN ^= 0x00000002;

EXTINT |= 1<<2; // Clear EINT2 interrupt flag

VICVectAddr = 0; // Acknowledge Interrupt

}

0