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