#include <LPC214X.H>
__irq void isr(void)
{
if(EXTINT==1)
{
IO0SET |= (1<<0);
EXTINT=0;
}
}
int main()
{
PINSEL1=0x00000001;
IO0DIR |=(1<<0);
EXTINT=0x01;
EXTPOLAR=0x01; //important efine which triggers the intterrup whether the raising or fallin edge
IO0DIR &= ~((1<<16));
//VICIntSelect |= (1<<14) ;
VICIntEnable |= 0x00004000 ;
VICVectCntl10 |= (1<<5) | 14 ;
VICVectAddr10 |= (unsigned) isr;
while(1)
{ IO0CLR |= (1<<0);
//VICSoftInt |=(1<<14);
}
}
__irq void isr(void)
{
if(EXTINT==1)
{
IO0SET |= (1<<0);
EXTINT=0;
}
}
int main()
{
PINSEL1=0x00000001;
IO0DIR |=(1<<0);
EXTINT=0x01;
EXTPOLAR=0x01; //important efine which triggers the intterrup whether the raising or fallin edge
IO0DIR &= ~((1<<16));
//VICIntSelect |= (1<<14) ;
VICIntEnable |= 0x00004000 ;
VICVectCntl10 |= (1<<5) | 14 ;
VICVectAddr10 |= (unsigned) isr;
while(1)
{ IO0CLR |= (1<<0);
//VICSoftInt |=(1<<14);
}
}
No comments:
Post a Comment