The stdlib.h file contains a exit() function, but my compiler complains when I try to use that.
How can I completely shut-off a MCU (from code) so that it consumes no more power?
How to exit a function
Re: How to exit a function
Hi,
From code, you can put it in the Sleep mode, in which it will consume minimal power.
Regards,
Filip.
From code, you can put it in the Sleep mode, in which it will consume minimal power.
Regards,
Filip.
Re: How to exit a function
filip wrote: From code, you can put it in the Sleep mode, in which it will consume minimal power.
Filip.
Thanks, but I want to do better than sleep. I want to shut-down the MCU and consume no power. Is that possible?
Re: How to exit a function
Hi,
Unfortunately, this cannot be achieved from the code as far as I know.
Regards,
Filip.
Unfortunately, this cannot be achieved from the code as far as I know.
Regards,
Filip.
-
- Posts: 1179
- Joined: 24 Nov 2005 20:07
- Location: Colorado, USA
Re: How to exit a function
If the MCU is completely shut down how do you expect to wake it back up?Thanks, but I want to do better than sleep. I want to shut-down the MCU and consume no power. Is that possible?
What you should consider is using a PIC that offers the XLP capability. If done right the sleep current on some of these parts can be as low as 20-60nA, which in many cases is far lower than the self consumption rate of many battery technologies.
http://www.microchip.com/en_us/technolo ... ducts.html
Re: How to exit a function
For my application, I can re-power the unit to get it going again.Sparky1039 wrote:If the MCU is completely shut down how do you expect to wake it back up?Thanks, but I want to do better than sleep. I want to shut-down the MCU and consume no power. Is that possible?
What you should consider is using a PIC that offers the XLP capability. If done right the sleep current on some of these parts can be as low as 20-60nA, which in many cases is far lower than the self consumption rate of many battery technologies.
http://www.microchip.com/en_us/technolo ... ducts.html
I think your solution may work here. I'll do some research and give it a try. Thanks.
-
- Posts: 1179
- Joined: 24 Nov 2005 20:07
- Location: Colorado, USA
Re: How to exit a function
If you are going to power cycle the device you might consider this circuit.
Using 2 mosfets reduces leakage in the off state.
The push button initally routes power around the p-ch fets to get the PIC powered up. Once the PIC is running the first task is to clear the port tied to the p-ch fet gates (low). This will sustain VDD once the push button is opened. When the time comes to kill power the PIC sets the mosfet gates high. This shuts down everything and a button push is the only way to get it started again.Using 2 mosfets reduces leakage in the off state.