sushil909
Newbie level 2
I am a beginner to the ARM series.
I want to use the 3 external interrupts. ENT1 as Fast interrupts and ENT2 and 3 as Vectored interrupt.
I simulated the code in my circuit in ISIS (proteus). none of the interrupt seems to be working.
Is there any problem in the code given below or is there anything i am missing.
Is there any way i can know whether my interrupts are working in keil uvision4.
I want to use the 3 external interrupts. ENT1 as Fast interrupts and ENT2 and 3 as Vectored interrupt.
I simulated the code in my circuit in ISIS (proteus). none of the interrupt seems to be working.
Is there any problem in the code given below or is there anything i am missing.
Is there any way i can know whether my interrupts are working in keil uvision4.
Code:
#include <LPC21xx.h>
#include "pwm.h"
void FIQ_Handler(void)
{
IOSET1=0xFF000000;
EXTINT = (1<<1);// Clear the peripheral interrupt flag for ENT1
}
void EXTINT2VectoredIRQ(void) __irq
{
IOSET1=0xFF000000;
EXTINT = (1<<2);// Clear the peripheral interrupt flag for ENT2
VICVectAddr = 0x00000000;
}
void EXTINT3VectoredIRQ(void) __irq
{
EXTINT = (1<<3); // Clear the peripheral interrupt flag for ENT3
VICVectAddr = 0x00000000;
}
int main()
{
IODIR1 = 0xFFF00000;
IODIR0 = 0x00F00000;
//initialize the interrupts
PINSEL0|=0xA00C0055; //enable pin functioning of UART0,I2C0,ENT1,ENT2,ENT3
VICIntSelect|=0x00008000; //set ENT1 as FIQ
EXTMODE|=0x0E; //edge interrupt for ENT1,ENT2 and ENT3
EXTPOLAR|=0x0E; //rising edege for all the interrupts
VICVectCntl0 = 0x00000030; //set ENT2 to vectaddress0
VICVectAddr0 = (unsigned long)EXTINT2VectoredIRQ;
VICVectCntl1 = 0x00000031; //set ENT3 to vectaddress1
VICVectAddr1 = (unsigned long)EXTINT3VectoredIRQ;
VICIntEnable =(1<<15)|(1<<16)|(1<<17); //enable ENT1,ENT2 and ENT3 interrupts
//-------------------------------------------------
pwmInit();
pwmFrequency (10);
while(1)
{
}
}