lpcware

external interrupts issue

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by lollobrigido on Tue Mar 03 04:54:00 MST 2015
I’m using LPC1115 on a custom board.
IDE: LPCXpress v7.6.2 [Build 326]
I’d like to catch external interrupt using a switch and a pullup resistor connected to PIO1_10.

This is my simple code

#define INT_PORT 1
#define INT_PIN  10
#define INT_IOCON  IOCON_PIO1_10

void PIOINT0_IRQHandler(void)
{
    /* Clear interrupt */
    Chip_GPIO_ClearInts(LPC_GPIO, INT_PORT, (1 << INT_PIN));
}

int main(void)
{
SystemCoreClockUpdate();

Chip_GPIO_Init(LPC_GPIO);

Chip_IOCON_PinMuxSet(LPC_IOCON, INT_IOCON,(IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_DIGMODE_EN));

Chip_GPIO_SetupPinInt(LPC_GPIO, INT_PORT, INT_PIN, GPIO_INT_BOTH_EDGES);

Chip_GPIO_EnableInt(LPC_GPIO, INT_PORT, (1 << INT_PIN));

NVIC_EnableIRQ(EINT0_IRQn);

while(1);
}

I used code from pinint.c example

I really don’t know why when I press the button nothing happen.
I’m using a debug setting a break point inside ISR routine but It doesn’t enter.
I tried changing pins of micro, moving switch to other pin of other port, but result is still the same.
What can be the problem? Why I’m not able to enable external interrupt?
Thanks a lot

Outcomes