AnsweredAssumed Answered

LPC4330 GPIO Pin Interrupt

Question asked by Torin Ford on Nov 15, 2019
Latest reply on Nov 19, 2019 by Sabina Bruce

We're using an LPC4330FET180 and I want to get a GPIO interrupt on pin D4. D4 maps to P4_0 or GPIO2[0] in the user's manual. Assuming the electrical side of things is correct, I'm questioning my software setup code. We have the pin brought out to a debug pin that I can watch with the scope. The scope is showing an interrupt when I expect one, but I'm never hitting the handler in the software. I pretty much cut/paste the code from periph_pinint and have this:

 

#define INT_PORT 2
#define INT_PIN 0
Chip_SCU_PinMuxSet(INT_PORT, INT_PIN, (SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0));
Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, INT_PORT, INT_PIN); // Output
Chip_SCU_GPIOIntPinSel(0, INT_PORT, INT_PIN);

Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(0));
Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(0));
Chip_PININT_EnableIntHigh(LPC_GPIO_PIN_INT, PININTCH(0));

NVIC_ClearPendingIRQ(PIN_INT0_IRQn);
NVIC_EnableIRQ(PIN_INT0_IRQn);

 

Am I missing something?

 

Thanks,

 

Torin

Outcomes