Hi,
Below is the example code which is readily available on net for non-vectored interrupt to be used for LPC microcontroller. But even when I am giving an interrupt the ISR is not responding. Following are more details:
IDE: Keil uvision Target: LPC2138
Steps considered:
1. After building the project when I go for debugging then Pin Connect Block is working fine and the pin P0.14 is selected as EINT1.
2. In VIC window I can see the default address (0x00000018 in my case). I verified the address from disassembler also.
3. In VIC window I can see '1' in the IntEnable column. Which means the interrupt is enabled.
4. Now when I tried to give an interrupt from the GPIO 0 window then in the "External Interrupt" window I can see the flag has been set for EINT1.
But the program is not able to reach ISR.
#include <LPC21xx.h> void NonVectoredIRQ (void) __irq { if(VICIRQStatus & 0x00008000)//Test for the interrupt source { IOSET1= 0x00FF0000; //Set the LED pins EXTINT = 0x00000002; //Clear the peripheral interrupt flag } VICVectAddr = 0x00000000; //Dummy write to signal end of interrupt } int main (void) { IODIR1 =0x00FF0000; //Set the LED pins as outputs PINSEL0 = 0x20000000; //Enable the EXTINT1 interrupt P0.14 VICDefVectAddr = (unsigned long)NonVectoredIRQ; //pass the address of the IRQ VICIntEnable= 0x8000; //Enable EXTINT0 in the VIC while(1); }
Please Help. Regards