LP1549 PININT0_IRQHandler

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

LP1549 PININT0_IRQHandler

732 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bobi-one on Mon Apr 14 00:54:21 MST 2014
I have a button (PIO0.9 to GND) on my custom board( without external pull up). And tried the lpc open example. Unfortunetly the led is constantly blinking without pressing the button. I tried enabling the external pull-up
but that didnt help.

{BTN_PORT, BTN2_PIN,   (IOCON_MODE_INACT | IOCON_DIGMODE_EN | IOCON_MODE_PULLUP )},/* BTN2 (9)*/


Am i missing something in the configuration, or is the only sollution an external pull-up


#define BTN2_INDEX   0/* PININT index used for GPIO mapping */
#define BTN2_IRQ_HANDLER  PININT0_IRQHandler/* GPIO interrupt IRQ function name */
#define BTN2_NVIC_NAME    PIN_INT0_IRQn/* GPIO interrupt NVIC interrupt name */

                        Chip_PININT_Init(LPC_GPIO_PIN_INT);
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_PININT);// Enable PININT clock
Chip_SYSCTL_PeriphReset(RESET_PININT); //Reset the PININT block

Chip_INMUX_PinIntSel(BTN2_INDEX, BTN_PORT, BTN2_PIN);// Configure interrupt channel for the GPIO pin in INMUX block
Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(BTN2_INDEX));// Configure channel interrupt as edge sensitive and falling edge interrupt
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(BTN2_INDEX));
Chip_PININT_EnableIntLow(LPC_GPIO_PIN_INT, PININTCH(BTN2_INDEX));
NVIC_ClearPendingIRQ(BTN2_NVIC_NAME);// Enable interrupt in the NVIC
NVIC_EnableIRQ(BTN2_NVIC_NAME);

Regards,
Boyko
Labels (1)
0 Kudos
2 Replies

563 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bobi-one on Mon Apr 14 07:17:43 MST 2014
Forgive me I didn't post anything else. This is part of renamed version of the periph_pinint example. I posted only the initialisation of the interrupt, because the else is just a led toggle in the handler.
I browsed the datasheed and found that when a gpio is input  weak pull-ups are enabled,  and perhaps with the lack of external pull up the button is acting like an antenna. And falling edges are detected and the interrupt is involked because of the noise. I dont remember having the same problem with LPC1343. Is there some way i can set the strong pull up so noise could be picked up.
Regards,
Boyko
0 Kudos

563 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Apr 14 07:08:33 MST 2014
Hi Boyko,
Could you please let us know which example are you using? If you are using blinky example it will toggle a particular port pin. I think it is always to post detail information. like which version of LPCopen,tool chain version and the file was modified.
I do not see code to change the status of LED  if there is any.
0 Kudos