4 years, 2 months ago.

[LPC1114] How to wake up from deepsleep?

Hi, im trying an LPC1114 on breadboard, my goal is to wake up after deepsleep() call with an interrupt on a gpio state change. My code looks like this:

lpc1114 sleep example

#include "mbed.h"
InterruptIn button(dp24);
void wake() {
    //wake routine, do something before next sleep
int main() {
    button.fall(&wake);  // attach the address of the flip function to the rising edge
        //code here below never execute

The MCU just doesnt catch the interrupt, if i remove the deepsleep call the interrupt is catched without probem. Do i miss something?

I'm using uVision5 IDE.

Regards, Michele

1 Answer

3 years, 9 months ago.

You need to enable wake up based on that GPIO interrupt by turning corresponding LPC_SYSCON->STARTERP0 bits to 1. Here's example using dp2 (PIO0_9)