external interrupts issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

external interrupts issue

876 Views
lpcware
NXP Employee
NXP Employee
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
Labels (1)
0 Kudos
Reply
2 Replies

826 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lollobrigido on Tue Mar 03 07:12:11 MST 2015
:O ...sorry, many thanks!
Now it is working!



0 Kudos
Reply

826 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Tue Mar 03 06:24:32 MST 2015

Quote: lollobrigido
What can be the problem? Why I’m not able to enable external interrupt?



Could be useful if you enable the interrupt which you are useing, which is EINT[color=#f00]1[/color]_IRQn with handler void PIOINT[color=#f00]1[/color]_IRQHandler(void) in your case  :D
0 Kudos
Reply