xpress_embedo
Advanced Member level 4
Hello!! Everyone i had just started using ARM LPC2148..
I am having problem with using Interrupts...
I am trying to use external interrupt EINT1 P0.14 Pin
Here is my Program and it is not working...
I searched on internet and found the way to define isr routine as
void FIQ_Handler(void) __fiq;
But whenever i write this i am getting error, but the above code is compiling fine. but i think it is not going in interrupt.
Just stay in while loop..
May be i am not able to manage how to write the isr routine..
Please Someone help me...
I am having problem with using Interrupts...
I am trying to use external interrupt EINT1 P0.14 Pin
Here is my Program and it is not working...
Code:
#include <LPC214X.H>
//Function Prototype
void Init_EXT_1(void);
void FIQ_Handler(void);
unsigned char flag;
int main()
{
flag = 0xAA;
Init_EXT_1();
while(1);
}
//Function Definitions
void Init_EXT_1()
{
PINSEL0 |= (1<<29); //Enable Pin for receiving External-1 Interrupt P0.14
IO1DIR = 0x00FF0000; // Port1 16-23 as output
IO1CLR = 0x00FF0000;
VICIntSelect = 0x00008000; // External Interrupt-1 as FIQ Interrupt
VICIntEnable = 0x00008000; // Enable External Interrupt-1
}
void FIQ_Handler()
{
if(flag == 0xAA)
{
IOSET1 = 0x00FF0000; //Set the LED pins
}
else if(flag == 0x55)
{
IOCLR1 = 0x00FF0000; //Clear the LED Pins
}
flag = ~flag;
EXTINT = 0x00000002; //Clear the peripheral interrupt flag
}
I searched on internet and found the way to define isr routine as
void FIQ_Handler(void) __fiq;
But whenever i write this i am getting error, but the above code is compiling fine. but i think it is not going in interrupt.
Just stay in while loop..
May be i am not able to manage how to write the isr routine..
Please Someone help me...