external interrupt in ARM lpc1768 not working

Status
Not open for further replies.

mahyarab

Newbie level 4
Joined
Jan 6, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
this is my code:

volatile uint32_t eint0_counter;

void EINT0_IRQHandler ()
{
LPC_SC->EXTINT = EINT0;
eint0_counter++;

if ( eint0_counter & 0x01 )
{
LPC_GPIO0->FIOSET = 1<<22;
}
else
{
}
}

uint32_t EINTInit()
{
LPC_PINCON->PINSEL4 = 0x00100000;
LPC_GPIO0->FIODIR = 1<<22;
LPC_GPIO2->FIOCLR = 0x000000FF;

LPC_GPIOINT->IO2IntEnF = 0x200;

LPC_SC->EXTMODE = EINT0_EDGE;
LPC_SC->EXTPOLAR = 0;

NVIC_EnableIRQ(EINT0_IRQn);
return 0;
}

i thinks its not have any bugs but its note works for me.
when i enable external interrupt its not do any thing.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…