Best energy saving delay?

bobbyblank

New Member
Hey, im looking to use an 08m in a christmas gift for someone and wondering what the most energy saveing delay for the axe is. sleep, nap, pause, ext. It will have a LDR that i want to probe to check to make sure its dark, once dark enough, it will start the main loop in the program. I should only read the ADC once every few hours or so, i would like to put the chip in energy save mode until i need to probe. Ill have to go into my manuals again and do some more research when i get off work, just thought someone might have an easy way to do this. Thanks


bobby
 

Pekari

Senior Member
Manual_2:
The sleep command puts the microcontroller into low power mode for a period
of time. When in low power mode all timers are switched off and so the pwmout
and servo commands will cease to function. The nominal period is 2.3s, so sleep
10 will be approximately 23 seconds.
So I suggest:

Code:
sleep 1
 

moxhamj

New Member
Have a look at the Sleep command in the manual. There is mention too of DisableBOD in the Sleep information - this lowers the power even further.

Sleep 1 is 2.3 seconds. You can go right up to 65535 which is 65535*2.3 seconds.

This uses the least power. But - if you want to wake it up it won't wake till the timer runs out.

Or you can run Sleep 1, wake up briefly, add a counter, then go back to sleep again.

Note that if you do have long Sleep commands, and you go to download a new program, the picaxe may not respond and may appear to be damaged or dead. To get it back to life, cycle the power supply after hitting the download button.
 

lbenson

Senior Member
Your program can cycle through a main loop at slow clock speed (which is the most battery-saving way to run), waiting for something to happen (e.g., change of status on a pin), and then switch to high speed to do the necessary processing. This thread is about low power battery usage: http://www.picaxeforum.co.uk/showthread.php?t=8353

It covers the main power saving techniques as follows.

1. Run at slower speed. Poke the OSCCON register ("poke $8f,%00000000") to run at 31.250kHz instead of 4mHz (1/128th the speed). See "08M UNDER clocking"-- http://www.picaxeforum.co.uk/showthread.php?t=2233 ; also http://www.kranenborg.org/ee/picaxe/ (search for low-power) also search the forum for "OSCCON".

2. Run DISABLEBOD. This turns off the picaxe brown-out detection, which cause the picaxe to shut itself off at a bit below 3V. With DISABLEBOD, picaxes have been kept alive down to 1.3V. See manuka, et. al.: http://www.picaxeforum.co.uk/showthread.php?t=6513 ; also Mycroft2152, "Low Power PICAXE 08M - BOD" -- http://www.picaxeforum.co.uk/showthread.php?t=4826

3. If you are using occasional ADCs while on battery, turn off the ADC module between reads by poking the ADCON0 register ("poke $1f,value"). Bit0 of value turns it off, but the register should be read first so that other bits are preserved. See Dippy "So for low-power people (doing the occasional A/D) it looks like a quick poke might be in order to switch off ADC module" http://www.picaxeforum.co.uk/showthread.php?t=5950 ; also http://www.picaxeforum.co.uk/showthread.php?t=8346

4. Pull down all unused inputs to 0V, e.g. with 100K or even 1M resistors. See "problem with getting very low power consumption" http://www.picaxeforum.co.uk/showthread.php?t=2292

5. Current-limit any outputs to the degree possible. For example, at 4.5V, an LED with a 330 ohm resister uses about 13 milliamps. With a 22K2 resister it is much dimmer, but readable, and uses only .2 milliamps. Blink patterns can further reduce current usage while expanding the information provided.
 
Last edited:
Top