Hello.
I'm using a LPC55S28JBD100 and i'm trying to trigger an interrupt from a GINT, later on for wakeup it from power down, but it not trigger. The PCB have a button connected to an expander and then connected to the pin PIO1_30 of the micro, if i use a PINT for the interrupt it function right, but if i use a GINT it not work.
This is the configuration
static void initWakeUpPins (bool exitLowPower)
{
CLOCK_EnableClock(kCLOCK_Iocon);
// Enables the clock for the GPIO0 module
CLOCK_EnableClock(kCLOCK_Gpio0);
CLOCK_EnableClock(kCLOCK_Gpio1);
IOCON->PIO[WAKEUP_DIG_IN_2_PORT][WAKEUP_DIG_IN_2_PIN] =
((IOCON->PIO[WAKEUP_DIG_IN_2_PORT][WAKEUP_DIG_IN_2_PIN] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
| IOCON_PIO_MODE(0x0u) // No pullup
| IOCON_PIO_INVERT(0x0u) // Selects pin function.
| IOCON_PIO_FUNC(WAKEUP_DIG_IN_2_ALT_FUNC)
| IOCON_PIO_DIGIMODE(0x01u)); // Select Digital mode: Enable
IOCON->PIO[WAKEUP_INT_MCP_PORT][WAKEUP_INT_MCP_PIN] =
((IOCON->PIO[WAKEUP_INT_MCP_PORT][WAKEUP_INT_MCP_PIN] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
| IOCON_PIO_MODE(0x0u) // No pullup
| IOCON_PIO_INVERT(0x0u) // Selects pin function.
| IOCON_PIO_FUNC(WAKEUP_INT_MCP_ALT_FUNC)
| IOCON_PIO_DIGIMODE(0x01u)); // Select Digital mode: Enable
IOCON->PIO[WAKEUP_WSN_BOARD_PORT][WAKEUP_WSN_BOARD_PIN] =
((IOCON->PIO[WAKEUP_WSN_BOARD_PORT][WAKEUP_WSN_BOARD_PIN] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
| IOCON_PIO_MODE(0x0u) // No pullup
| IOCON_PIO_INVERT(0x0u) // Selects pin function.
| IOCON_PIO_FUNC(WAKEUP_WSN_BOARD_ALT_FUNC)
| IOCON_PIO_DIGIMODE(0x01u)); // Select Digital mode: Enable
GPIO_PinInit(WAKEUP_DIG_IN_2_GPIO,
WAKEUP_DIG_IN_2_PORT,
WAKEUP_DIG_IN_2_PIN,
&(gpio_pin_config_t){kGPIO_DigitalInput, 0});
GPIO_PinInit(WAKEUP_INT_MCP_GPIO,
WAKEUP_INT_MCP_PORT,
WAKEUP_INT_MCP_PIN,
&(gpio_pin_config_t){kGPIO_DigitalInput, 0});
GPIO_PinInit(WAKEUP_WSN_BOARD_GPIO,
WAKEUP_WSN_BOARD_PORT,
WAKEUP_WSN_BOARD_PIN,
&(gpio_pin_config_t){kGPIO_DigitalInput, 0});
// INPUTMUX_Init(INPUTMUX);
// INPUTMUX_AttachSignal(INPUTMUX, kPINT_PinInt0, WAKEUP_PINT_PIN_INT0_SRC);
// INPUTMUX_AttachSignal(INPUTMUX, kPINT_PinInt1, WAKEUP_PINT_PIN_INT1_SRC);
// INPUTMUX_AttachSignal(INPUTMUX, kPINT_PinInt2, WAKEUP_PINT_PIN_INT2_SRC);
// INPUTMUX_Deinit(INPUTMUX);
//
// PINT_Init(WAKEUP_PINT_PIN_INT_BASE);
// PINT_PinInterruptConfig(WAKEUP_PINT_PIN_INT_BASE, kPINT_PinInt0, kPINT_PinIntEnableRiseEdge, App_mcpIsr);
// PINT_EnableCallbackByIndex(WAKEUP_PINT_PIN_INT_BASE, kPINT_PinInt0);
// PINT_PinInterruptConfig(WAKEUP_PINT_PIN_INT_BASE, kPINT_PinInt1, kPINT_PinIntEnableRiseEdge, App_mcpIsr);
// PINT_EnableCallbackByIndex(WAKEUP_PINT_PIN_INT_BASE, kPINT_PinInt1);
// PINT_PinInterruptConfig(WAKEUP_PINT_PIN_INT_BASE, kPINT_PinInt2, kPINT_PinIntEnableFallEdge, App_mcpIsr);
// PINT_EnableCallbackByIndex(WAKEUP_PINT_PIN_INT_BASE, kPINT_PinInt2);
GINT_Init(GINT0);
GINT_SetCtrl(GINT0, kGINT_CombineOr, kGINT_TrigEdge, App_mcpIsr);
GINT_ConfigPins(GINT0, kGINT_Port0,GINT0_POL_MASK, GINT0_ENA_MASK);
GINT_EnableCallback(GINT0);
}
then i call it in the main for the initialization.
Pressing the button go to the expander that generate the interrupt, this arrive to the micro but not trigger. Pressing a resistor nier the botton trigger it. What can be and someone know how resolve it?
Hi,
I do not see any NVIC configuration, pls try to add the code:
NVIC_EnableIRQ(GINT0_IRQn);
Pls check if the interrupt happens or not.
If the GINT0 interrupt does not happen, pls check the GINT0->PORT_ENA1 register in the debugger.
Hope it can help you
BR
Xiangjun Rong