disablebod and enablebod

chipwich

Member
Although I've been building solar powered picaxe projects for a while, I haven't used this command yet. But I suspect it will let me get a bit more performance out of my devices, however. Unfortunately, there are only a couple of prior postings on the use of "disablebod", although they are helpful.

Some questions I've had about "disablebod":

- Is there a risk of a picaxe becoming permanently unrecoverable due to corruption at low voltage?

- Could this command be embedded in the "sleep" command and hidden from the user?

Can anyone shed some more light on the use of disablebod and enablebod? Thanks.
 

Technical

Technical Support
Staff member
In simple terms a 'brown-out' is the situation when the power supply momentarily drops out of the normal operating range (e.g due a noise spike), but not low enough (or long enough) to reset the chip.

In very rare circumstances this can cause the chip to stop processing. To help prevent this you can either use an external brownout device on the reset pin (e.g MCP-100) or some chips have the internal equivalent of this built into the chip. Both devices switch the device on/off cleanly when voltage drops below a set value, about 2.7V for internal BOD.

The downside of BOD is that it draws a tiny current. As most people are not that worried about current drain, they leave BOD on all the time. However, particularly when using battery based systems that sleep a lot, disabling the BOD before sleep / nap / doze / hibernate will reduce the sleep current (ie make the batteries last longer).
 

chipwich

Member
So my understanding is that a permanent corruption of the 08M (which does not have a hardware reset pin) still could not occur. At worst, if the chip hangs, it could be powered down and then powered up and and this should *always* restore normal functioning behavior.

And the reason for not including the "enablebod" right into the "sleep" command is to eliminate the risk of brownout occurring after sleep is over but before the "enablebod" command could again be executed.

Is my description accurate? Thanks.
 

Technical

Technical Support
Staff member
Correct, there is no chance of possible corruption whatsoever! In worst case scenario the chip would simply stop working until it was properly reset (ie the power removed and/or rest switch pushed).

Brown-out has nothing to do with programming, you can't change the program in memory via a brownout.

Not all parts support internal BOD, so it is not a 'standard' sleep feature - hence the reason to use disablebod on chips that support it. However it actually is included by default within the new hibernate command (X1 parts)
 

kranenborg

Senior Member
Hello,

Just a tiny detail: according to the pic12f683 datasheet the brownout voltage for the picaxe-08m is approx. 2.0V, not 2.7V. I would have liked the latter value though, because most peripheral devices (i2c and 1-wire) properly work above 2.7V, so a system design may work unreliably when operating somewhere between 2.0 and 2.7V ...

Regards,
Jurjen
 
I have bench tested the DisableBOD command and run 08M's down to 1.3 volts quite happily. My test bed was just a 470uF capacitor that I let the 08M run down on over 10 - 20 minutes or a polycene cell which powered it for several days. I just let it run flat. No observable corruption or problems and I have not noticed a "lockout" yet.

TIPS:
* To get close to 1uA you need to hold pins fully high OR low in software or hardware.
* Remove the serial programming lead to drop another 6uA if you are bench testing.

Lots of potential for some fun low power projects or data loggers. We almost managed to power an 08M FROM a dozen LED's set up as a mini PV array.

I use the CR2032 Coin Cell - 3V Lithium 220mAh for simple student projects. The holders are cheap and the coin cell just snaps in.

220mAh x 1uAmp (standby only) = theoretical 25 years when in sleep / nap mode. Obviously what your project does for how often will make a big difference. E.g.

<A href='http://picaxe08.orcon.net.nz/Photos/Transducers/Force_Meter.jpg' Target=_Blank>External Web Link</a>
 
Top