11 years ago.

How to revert back to normal mode from DeepPowerDown?

Did i miss out something in this program?

#include "mbed.h"
#include "PowerControl/PowerControl.h"
#include "PowerControl/EthernetPowerControl.h"

DigitalOut led1 (LED1);
int a;
int main()
{
    while(1) {
        if(a == 4){ DeepPowerDown(); }
        a = a + 1;
        led1 = !led1;
        printf("Hello\n");
        wait(1);
    }
}

1 Answer

9 years, 2 months ago.

[This is an old thread, but in case anyone comes here:] "The LPC17xx can wake up from Deep power-down mode via the RESET pin or an alarm match event of the RTC" (datasheet section 8.29.6.4). There is an obvious third option not listed here, which is power on reset (POR). All reset the LPC1768 and then you check the flag(s) to see if it is an RTC alarm rather than Power On Reset (POR) or RESET pin pulse. As such, it will start your code from the beginning each time. Therefore you will never pass the a == 4 situation.