#include<LPC2103.h>
//==============================
void exint_ISR(void)__irq;
//==============================
int main()
{
IODIR |= 0xf0000000; //GPIO31-28 as output
PINSEL0 = 0x40000000; //GPIO15 as EINT
EXTMODE = 0x00; //edge sensitive
EXTPOLAR = 0x00; //default value foe falling edge
VICVectCntl0 = 0x00000020; //select a priority slot for a given interrupt
VICVectAddr0 = (unsigned)exint_ISR; //Get the address for Interrupt vector
VICIntEnable= 0x00010000; //enable exint2
while(1);
}
//==============================
void exint_ISR(void)__irq
{
EXTINT = 0x04; //clear interrupt flag
IOSET = 0xf0000000; //Set pin high
VICVectAddr = 0x00000000; //insert a dummy address to stop interrupt.
}
//==============================
void exint_ISR(void)__irq;
//==============================
int main()
{
IODIR |= 0xf0000000; //GPIO31-28 as output
PINSEL0 = 0x40000000; //GPIO15 as EINT
EXTMODE = 0x00; //edge sensitive
EXTPOLAR = 0x00; //default value foe falling edge
VICVectCntl0 = 0x00000020; //select a priority slot for a given interrupt
VICVectAddr0 = (unsigned)exint_ISR; //Get the address for Interrupt vector
VICIntEnable= 0x00010000; //enable exint2
while(1);
}
//==============================
void exint_ISR(void)__irq
{
EXTINT = 0x04; //clear interrupt flag
IOSET = 0xf0000000; //Set pin high
VICVectAddr = 0x00000000; //insert a dummy address to stop interrupt.
}
Comment