LPC11U24 fails to wake from sleep on 2.7V

14 Mar 2012

My LPC11U24 fails to wake from a ticker timeout if powered by 2.7v on the VB pin - the simple example below should toggle led1, but just turns it on once when running on 2.7v. It works fine with 4v on VIN. Replace sleep with wait it works on 2.7v. It also fails to wake if configured for an external interrupt while powered from VB.

Any ideas why it isn't waking up?

#include "mbed.h"

Ticker timer;
DigitalOut led1(LED1);
int main(){
    timer.attach(NULL, 2);
    led1=0;
    while(1){
        led1 = !led1;
        sleep();
        //wait(2);
    }
}

Thanks

28 Mar 2012

Looks like you're using the Ticker to do the wakeup - but the clock for the Ticker is stopped during Sleep mode!

Try using an InterruptIn to prepare an external pin for wakeup purposes - then you can wake up when the pin changes state.

If you want to use a Timer to do the wakeup, you have to write the code using the CMSIS addressing of the timer directly. The "Timed Wakeup Example"for LPC1114 shows you how to do it:

http://ics.nxp.com/support/lpcxpresso/

but this is not simple code: you must configure the watchdog timer oscillator to run [at 9kHz] the timer during Sleep; you must set the MAT output of the timer to change state on Timeout, then use this state-change to trigger a wakeup interrupt in the GPIO pin that corresponds to the MAT output of the timer. Sadly the CMSIS in the example needs a fair bit of changing, too: the references to TMR32B0 must be changed to CT32B0 (etc) and the wakeup/startup logic is changed quite a bit between LPC1114 and LPC11U24.

Ouch, lot of work. BUT - when you have worked through all this,it does work very well.

29 Mar 2012

Many thanks for a pointer to an example. For some reason I was under the impression that the Ticker was supposed to run during Sleep – but clearly not! An external interrupt isn't much use for me so I'll have a go if I get time.

There seems to be more of a difference between providing power to VB and VIN than I was aware of – have I missed some documentation somewhere?

Mark