9 years, 4 months ago.

mbed LPC11U24 Power Down Mode

Hello All. Using mbed LPC11U24 I can't get low power consumption. Device powered by VB pin with +3.3V. In the NXP documentation power-down mode is about 2uA. But I got the 330uA in the Power Down. I can't understand what I do wrong. May be parasitic power of the "magic" chip via pullups, or current consumption of the unknown U8 chip... Here is the code... I need any suggestions.

// ---- PM Power mode ----
// 0 Default. The part is in active or sleep
// 1 ARM WFI will enter Deep-sleep mode.
// 2 ARM WFI will enter Power-down mode.
// 3 ARM WFI will enter Deep-power down (ARM Cortex-M0 core powered-down)
LPC_PMU->PCON = 0x2; 

LPC_SYSCON->PDSLEEPCFG = (0x1UL << 6) | (0x1UL << 3); // Watchdog oscillator power-down (see lock too), BOD power-down

setSystemMainClock(0); // IRC clock

LPC_SYSCON->PDAWAKECFG = LPC_SYSCON->PDRUNCFG;

// enable external signals to wake-up
NVIC_EnableIRQ(FLEX_INT0_IRQn);
NVIC_EnableIRQ(FLEX_INT1_IRQn);
NVIC_EnableIRQ(FLEX_INT2_IRQn);
NVIC_EnableIRQ(FLEX_INT3_IRQn);

SCB->SCR = 0x1UL << SCB_SCR_SLEEPDEEP_Pos;

__WFI();

setSystemMainClock(3); // PLL output clock

// disable external signals to wake-up
NVIC_DisableIRQ(FLEX_INT0_IRQn);
NVIC_DisableIRQ(FLEX_INT1_IRQn);
NVIC_DisableIRQ(FLEX_INT2_IRQn);
NVIC_DisableIRQ(FLEX_INT3_IRQn);

2 Answers

9 years, 4 months ago.

Thats close to what I measured when I looked into it, the 'magic chip' shouldn't be powered, but possibly via parasitic routes (ESD diodes for example) there still leaks current. Compared to the average board it is quite low what its power will be, but for real low power operations you need either another board, or just have it stand alone.

I know for the mbuino platform they did reach the correct current consumption after setting some GPIOs correct to stop pull up/down resistors from using power: http://developer.mbed.org/platforms/Outrageous-Circuits-mBuino/ (Also with whole bunch of other boards, but that one uses also the LPC11u24).

Accepted Answer

Thank you Erik.

posted by Anton D. 09 Dec 2014
9 years, 4 months ago.

Quick disclaimer: I don't have that specific board so this is based off the schematics and experience with other boards but I can't think any reason it shouldn't apply.

No matter what you do there will be a reverse current through D3. The datasheet for a BAT60A as used indicates that this would typically be 300uA at 5V so at 3.3V it should be lower. That could well be a fair chunk of the current you are seeing but it's probably not all of it. Swapping that diode would help. A BAT54 has a leakage of about 2uA but a max current of 200mA. Enough for the CPU and the 4 LEDs but you'd have to be a little careful what else you hung off the CPU.

Other than that the main issue will be GPIO line states. Undefined GPIO pins default to having a pullup enabled so the thing to look for is an external pull down on the pin. On the mBuino a single pull down on an undefined pin was using 120uA. Define the pin as an input with no pullup and the current went away.

Make sure you define all 4 LEDs and turn them off, they are effectively pull downs so that will be be a big hit.

Other than that the only possible issues I can see are on P0.0 and P0.1 P0.0 is also a reset signal and goes to the magic chip. If that is being pulled high while the magic chip is powered down that could cause some current draw. Defining that pin as an input with no pull or a pull down may help but I don't know if that will mess with the other functionality on that pin.

P0.1 also goes to the magic chip but in this case it also has an external pullup. So no matter what the CPU does there is going to be 3.3V connected to a GPIO on the unpowered magic chip, that is going to cost you some current. About all I can think of for that would be to define the pin as an input with no pull and then change R24 so that it uses 3.3V_IF rather than 3.3V_TGT.

It looks like you've already written it yourself but the code here should work for your board to put it into all the different sleep modes. http://developer.mbed.org/users/AndyA/code/mBuino_Sleep_Minimal/

Oops. Just looks again at the schematic. I had the logic on those reset lines and P0.0 wrong.

R1, R2 and R6 are all pulling magic chip IO lines up to the target IC voltage. U8 then combines the 3 different reset sources and the output of that goes to P0.0. I can't see any easy way to eliminate this without making a real mess of the board.

It looks like removing the current (if any) flowing into the magic chips GPIO pins when it is powered down is going to be tricky so the best course would probably be to fix the other problems and then see where you are.

Change D3 to something like a BAT54, explicitly turn all the LEDs off and then measure again. And just be careful that you don't try to drive any more LEDs or high current devices signals from CPU IO lines or 3.3V_TGT, the new diode won't cope.;

posted by Andy A 08 Dec 2014

Thank you very much Andy and Erik for answers. So, I have removed the diode, and have disabled some pull-ups. I got approx. 70 ... 80 uA. Usually in most of mcu-based devices I always configure unused pins as 0-outputs. And disable pulls for all mcu outputs. But seems mbed was not designed for usage in the low-power applications. Tnaks again.

posted by Anton D. 09 Dec 2014

Well obviously it was designed for that, most boards have WAY more power consumption, simply due to for example LDOs which have milli-amps quiescent current (which the LPC11u24 also has, but you bypass them when using the Vbat).

It is true you can do alot better on a standalone board. The LPC11u24 deepsleep code has some issues (don't ask, long story), but a whole bunch of mbed MCUs in general have <5uA deepsleep current. The total board power consumption then is another story :). In general for battery applications you sadly need to go to custom boards though.

Btw regarding inputs/outputs. my own experience is that pull-ups/downs or digital outs work both fine. In both cases of course assuming there isn't also an external pull effective (so no pull-up with an active high LED on the same pin).

posted by Erik - 09 Dec 2014