Go Down

Topic: How to attach a function() that will initiate when BOD level is reached? (Read 1 time) previous topic - next topic


How to attach a function() that will initiate when BOD level is reached? I need to make sure some peripherals turn off before BOD level is reached... Thanks


I don't think that is possible, the whole point of BOD is to hold the chip in RESET mode until the voltage is high enough to safely run.

Jack Christensen

Not sure this is possible, the BOD just forces the MCU into reset and holds it there as long as voltage is too low. The whole point is to stop execution under conditions that could cause invalid results.

If by peripherals you mean circuitry not contained within the MCU, then perhaps monitoring the supply voltage with an analog input would work.


Yeah that is a good choice. It would be nice to be able to use BOD as interrupt. I am sure there are many applications that could benefit from that option.


If you especially want an interrupt when the power supply voltage drops, you could use the analog comparator and a voltage divider to monitor the supply voltage.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


I ended up using an N channel MOSFET, so when the BOD level is reached, it by default sets the pin low, turning what I need off.

But yes I think that would be the next best thing ^...

How exactly do you do that? I am sure I will need to do that at some point in the future...


Random side note, been reading in depth about the TI MSP430 mcu (i.e. the TI LaunchPad and its big brothers) and believe it or not it does have a way of doing this, called the SVS (Supply Voltage Supervisor).  Trigger voltage tweakable in software, its comparator output is accessible in software and it can be configured to issue a power-on-reset or just run an interrupt routine.  I think you can make it read a different voltage than Vcc if the model of mcu breaks out a pin for it.  Not sure if that's usable in the "value line" supported by the LaunchPad. edit: looks like it's not, guess that comes in higher end models.

Go Up