AnsweredAssumed Answered

Cannot wake up 11u68 with pin interrupt by GPIO

Question asked by Lee Chen on Apr 17, 2018
Latest reply on Apr 22, 2018 by Magicoe Niu

I'm able to make my LPC11u68 into deep sleep mode, but i cannot wake it up. Can anyone help me?

 

The pin interrupt works if I don't put the MCU into Deep Sleep.  However, I cannot wake up the MCU if putting it to deep sleep mode by interrupting with GPIO.

#define GPIO_PININT_PIN               0     

#define GPIO_PININT_PORT              1

#define GPIO_PININT_INDEX             0

#define PININT_IRQ_HANDLER       PIN_INT0_IRQHandler     

#define PININT_NVIC_NAME         PIN_INT0_IRQn     

 

void PININT_IRQ_HANDLER(void)

{

     Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

}

 

 

int main(void)

{

     CHIP_PMU_MCUPOWER_T crntPowerSetting;

 

     SystemCoreClockUpdate();

     Board_Init();

     SysTick_Config(SystemCoreClock / 10000 / 30);

 

     Chip_IOCON_PinMuxSet(LPC_IOCON, GPIO_PININT_PORT, GPIO_PININT_PIN,

               (IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_CLKDIV(0) | IOCON_S_MODE(3)));

 

     Chip_GPIO_SetPinDIRInput(LPC_GPIO, GPIO_PININT_PORT, GPIO_PININT_PIN);

     Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_PINT);

     Chip_SYSCTL_SetPinInterrupt(GPIO_PININT_INDEX, GPIO_PININT_PORT, GPIO_PININT_PIN);

     Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

     Chip_PININT_SetPinModeEdge(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

     Chip_PININT_EnableIntLow(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

     NVIC_ClearPendingIRQ(PININT_NVIC_NAME);

     NVIC_EnableIRQ(PININT_NVIC_NAME);

 

     Chip_SYSCTL_EnablePeriphWakeup(SYSCTL_WAKEUP_GPIOINT1);

     crntPowerSetting = PMU_MCU_DEEP_SLEEP;

 

     while (1) {

          ProcessPowerState(crntPowerSetting);

     }

     return 0;

}

Outcomes