oahmad
Newbie level 5
I have setup a board with a momentary button on Port 2.10; I setup the code as a gpio interrupt on falling edge, it doesn't interrupt. I am using an LPC1768 and CMSIS. Also, I read in the user's manual that gpio interrupts on ports 0 and 2 are tied to external interrupt 3. Why have 'external' interrupts on these pins when the gpio interrupts accomplish the same functionality?
Here's my non working code:
Here's my non working code:
Code:
// Setup External Interrupt
void EINT3_init (void)
{
// Set PINSEL4 [21:20] = 01 for P2.10 as gpio
LPC_PINCON->PINSEL4 &= ~(0x11 << 20);
//LPC_PINCON->PINSEL4 |= (0x01 << 20);
//set the interrupt 2.10 for falling edge
LPC_GPIOINT->IO2IntEnF &= ~(1<<10);
// Enabled External Interrupt 0 (the ISP button on RDB1768).
NVIC_EnableIRQ(EINT3_IRQn );
}
// ***** EINT2 Interrupt Handler*****
void EINT3_IRQHandler(void)
{
// Clear interrupt
//LPC_SC->EXTINT = EINT0_CLR;
//*****why doesn't this work???
LPC_GPIOINT->IO2IntClr |= (1<<10);
}