News:

Let's find out together what makes a PIC Tick!

Main Menu

Extreme Low-Power Management

Started by trastikata, May 09, 2023, 01:55 PM

Previous topic - Next topic

trastikata

Hi all,

I am trying to get a PIC18F25K50 to nano-Amp current consumption but for the love of God can't get nowhere near that.

I disable all the peripherals, disable the band-gap, LDO is off and only the ULP Regulator is active, then put the device in Sleep. Removed everything else that could draw any current from the board.

Still the current consumption drops only to 30uA?

Any ideas what might be happening?

top204

#1
The state of the pins can make a huge difference to the sleep current, so make sure none of them are left a floating input, or set low with a pull-up resistor attached or set high with a pull-down resistor attached.

Also, make sure you have actually disabled the USB tranceiver, and not left it to defaults.

Disable the Brown-Out-Reset peripheral, because it can draw up to 20uA when the device is asleep.

When I have created projects that require a device to sleep, I create three procedures to make life a bit easier. Setup_Before_Sleep(), GoTo_Sleep() and Setup_After_Wake(). The Setup_Before_Sleep procedure manipulates all the pins and peripherals required, and is called from the GoTo_Sleep procedure before the device is placed into sleep mode. Then after the Sleep mnemonic and the cycle waits and mandatory settings, the Setup_After_Wake procedure is called, to re-enable the pins and peripherals required for the program's operation.

So the main program just calls the GoTo_Sleep procedure and it takes care of everything it should.

Also remember, the 18F25K50 device is now quite a dated type, so it may not go to sleep as well as the newer types, but you should be able to better 30uA with some code changes. Also, check what the surrounding circuit is taking in current when the microcontroller is not placed in circuit.

trastikata

#2
Thank you Les, thanks to your comment for the BOR, I found the reason for the high current consumption. It is actually normal but I've omitted something in the datasheet:

The nano-Amp rating is for the PIC18LF25K50 which have 10nA Basic current in Sleep mode, while the standard 18F25K50 devices have 13uA Basic current in Sleep mode - something that is shown only at the end of the datasheet in the Electrical tables.

Then adding 5uA for the BOR (which I disabled by your suggestion), 0.5uA WDT, 5uA for HLVD ... so I was able to get it down to 18uA.

It's quite strange to see such a misleading information in the device datasheet:

PIC1 - First in the device brief it is written "Sleep mode: 20 nA, typical" - thus one would assume for all devices from the family.

PIC2 - Then you go to the device overview and see "All of the devices in the PIC18(L)F2X/45K50 family incorporate a range of features that can significantly reduce power consumption during operation."

PIC3 - And then  at the end of the datasheet one founds out that the nano-Amp rating is only for the PIC18LF25K50 devices.

Quite the marketing trick :)
 
PIC18F25K50_XLP1.jpg

PIC18F25K50_XLP2.jpg

PIC18F25K50_XLP3.jpg   

top204

#3
Nicely spotted trastikata, and 18uA is not a bad sleep current in a real circuit.

Over the years I have learned never to fully trust the specifications of a manufacturer's datasheet, because they are usually incorrect, or made to be a form of false advertising by the company. :-)

I have never actually gotten a microcontroller to go to sleep and only draw nA of current in a "real" circuit. It usually ends up at around about 5uA to 10uA.

On a laboratory bench with nothing connected to the microcontroller and in perfect temperature conditions with the microcontroller doing nothing whatsoever with a perfect power source, it may go down to that type of current draw, but the real world is a very different place, so I tend to ignore a lot of the manufacturer specs.

Unfortunately, we live in a world where lying and deceite is the normal practice, and people can actually go to university to learn how to lie but in a way that is legal in the farcical legal system we have. It is called marketeering, and is also very dominant in politics. :-)