7 years, 7 months ago.

LPC824 Power Consumption

Hello With a few tests, we found that the power consumption during deep sleep is about 1mA. however if we include SPI it goes upto 2mA. Questions are 1) How can i "turn off" SPI before going to deep sleep (if SPI can consume power) 2) When going to deep sleep what else can/should i turn off?

Thanks

3 Answers

7 years, 7 months ago.

You can 'turn off' SPI by setting all the SPI pins as output pins.

To get current consumption down more, set all other pins that you use to output as well, turn them low, and disable pull-down and pull-up on all pins. But the biggest win will be seen when you switch to power-off mode instead of deep-sleep. Some background and actual measured consumption are in this thread on lpcware.com.

Jan Apprecciate your response. Here are a few followup questions

1) I am already using SPI, can I "remap' them to just output pins before going to sleep? Is that possible 2) can I also dynamically change LPC_SYSCON->SYSAHBCLKDIV to reduce or increase clock speed?

Thanks again.

posted by siva surendar 15 Sep 2016

Re: 1. Yeah, remap them before going to sleep. About 2... Not completely sure. I think there are other clocks derived from the main clock divider, so don't know what will happen when you change that around during execution...

posted by Jan Jongboom 15 Sep 2016

Jan, Thanks. Just to be sure My code will like this?

<code>

Start

SPIDevice acc(P0_11, P0_16,P0_28,P0_10, P0_25)

Before Going to Sleep

DigitalOut dummy0(P0_11,0);

DigitalOut dummy1(P0_16,0);

After Coming back from Sleep

SPIDevice acc(P0_11, P0_16,P0_28,P0_10, P0_25)

</code>

posted by siva surendar 15 Sep 2016

I tried above, I think I cant do SPIDevice acc(P0_11, P0_16,P0_28,P0_10, P0_25) because I will be repeatedly recreating without releasing

Would you kindly show me how to reassignments please?

posted by siva surendar 15 Sep 2016

What do you mean with "I think I cant do SPIDevice acc(P0_11, P0_16,P0_28,P0_10, P0_25) because I will be repeatedly recreating without releasing" ?

posted by Jan Jongboom 15 Sep 2016

Jon FYI: We have a SPIDevice class which is a subclass of SPI. IT takes 3 SPI pins and two more pins for 2 Chip Selects. Hence the SPIDevice (pin1-pin5)

Back to your question I create SPIDevice at the start of the program (rather at the definition level). I have to allocated these pins to DIGITALOUT before going to sleep and come back to SPIDevice when woken up.

I tried to do new SPIDEVICE(pin1..pin5) but it worked for two cycles and said no more SPI devices and the program stopped. So I am guessing I am not "releasing the old pins"

How can i do the reassignment?

posted by siva surendar 16 Sep 2016
7 years, 7 months ago.

LPC824 deepsleep power consumption should be in the micro-Amp range! Disabling the brownout detector can help with that, but that is also a power consumption of way less than 1mA (brown out detection and wakeup timer are the only ones active in powerdown if I remember correctly). The mbed library is (unless someone changed it) for the LPC8xx series already set to go into powerdown mode when you call deepsleep (since there really is very little reason to use deepsleep over powerdown).

I have read the story about having to set all unused pins as output: I have never been able to reproduce this with any NXP or (legacy) Freescale MCU! All of them could reach low power consumption (uA range for the low-power ones) with pins either set as output, or as input with pull up or pull down enabled (input with pull up is the default state for NXP MCUs afaik). What you should not do is set them as floating inputs without something externally connected that forces it either high or low. But this is not the default state.

How are you measuring your current consumption? Only on the MCU, or also on other devices? And in general the normal way to have too much current consumption is that something is leaking. So if you set something externally to zero, while you have a pull up resistor enabled.

Erik,

We had to briefly step off of this project and are coming back. I can give you a better estimate shortly.

Meanwhile

1) We are checking power on the entire device. It has a buck convertor using TPS54240 (to bring to 4v) and 4v to 3.3v LDO. All other components have been turned off (during this testing)

2) We are using your Wakeup function to wake up form deep sleep.

3) In the next few days we will test by turning BOD and WWDT off (which are running as per lpc824 doc)

Best Regards

Surendar

posted by siva surendar 14 Oct 2016

Without WWDT WakeUp won't work though ;). Brownout is not required and the larger one of the two. But if possible, try if you can check the power to the LPC824 itself.

Also what you can try it just using a very simple program that does not do more than call deepsleep, and set the pins that really need to be set properly for this.

I happened to have looked with someone else for a similar issue, where half of it was software which was doing something wrong, and the other half was a wrongly read datasheet of an LDO, and which consumed 30 times what the microcontroller consumed in deepsleep.

posted by Erik - 14 Oct 2016

Erick,

Few more pointers. I hope you can help us

1)We are using MCP1801. do you anticipate a problem with that?

2) The current consumption wtih a simple program is about 1mA when on DeepSleep. I thought you said that itself was high. We will try to remove BOD and see that makes it any better

Have been trying to respond to this thread and the "Post a comment" started working just this AM and hence the delay

posted by siva surendar 25 Oct 2016

That LDO seems fine. Removing BOD should help, but not even close to 1mA. More like ten(s) of uAs.

One thing to make sure is no pull-up/pull-downs are using power. And also no pins high to other chips which have no supply voltage.

posted by Erik - 28 Oct 2016

Erik, Heres some more info When I use my hardware wiih a simple digitalout (with no peripherals and practically no other code) and move to deepsleep (for 10 seconds) the current (as per our multimeter) is 3mA @12v and about 5mA@12v on regular operation (for 10 seconds again).

When I remove the digitalout ( and no other peripherals are used) the deepsleep current is 1mA@12v and on regular operation is about 2mA@12v

I have ensured that the actual digitalout pin is not connected to any circuit so I dont think "power draining" is a problem. Also putting DigitalOut with default high (1) or default low (0) does not seem to make a difference

Any help please?

Best regards Surendar

posted by siva surendar 28 Nov 2016

Do you have the standard LPC824 board and what do you measure on that one? 2mA is way too much, but it really shouldn't be affected by the state of DigitalOut. Are you power cycling the device after programming it? Problem is I don't have an LPC824 myself, so I really cannot check for myself.

posted by Erik - 28 Nov 2016

Erik,

I will try on the main board.

What do you mean by power-cycling the the device after programming? We push to code to our board and restart it.

More infomation

1) We have added just the code to lpc824 and have also provided a 1OHM resistor to track the current at 3.3v

2) When no Digital pin outs are used its at < 1mA

3) When 24 Digital outs are defined (all turned to 0 before going to power-down) its about 11mA at 3.3v

4) If i use about 14 digitalout pins (all turned to 0 before going to power-down) its about 6mA at 3.3v

I will try with the dev board and let you know

Best Regards

Surendar

posted by siva surendar 05 Dec 2016

I mean after programming disconnect the power and reconnect it.

posted by Erik - 05 Dec 2016

Erik

I feel kind of stupid after this multi-month run-around :) We think we found the problem.

We had pulled up a few pins for the following reasons

1) One of it was open drain (pin 10 or 11) and we using it actively in SPI MOSI. So we had pulled it upto 3.3v

2) We had pulled up the reset pin so as to not accidentally restart the chip

We were, by default pulling all of these down before going to sleep and I think that was causing the problem. We have since then kept these pins at high before going to sleep and the current is NOT 11mA (at 3.3) but more like 1mA. While its a significant improvement i thikn we can make it better and are continuing to research.

That leads to another question (Maybe I will also post the answer out of this in antoher thread in case people are benefited)

In case I need to switch pin function on the fly for the following situation, Is it ok to dynamically use the SWM to pinmux? This way will help me define these variables globally and avoid redefinitions.

1) SPI pin to digital pin (to move to zero before going to sleep), OR

2) move UART0 from one set of pins to another (so I can get 4 uarts instead of 3),

Best Regards

Surendar

PS: Truly appreciate your help.

posted by siva surendar 07 Dec 2016

Yeah that should be fine. Just make sure you don't create glitches by for example moving your RX pin to another pin that is low at that time, or during a UART transaction.

posted by Erik - 07 Dec 2016
7 years, 7 months ago.

I've built a motion detector with LPC812 and a RFM69 radio module. In deep power down I experienced also too much power consumption. The reason were the floating SPI wires, I had to add external pull ups to fix this.