Go Down

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

bamboosam

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

spirilis

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.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

bamboosam

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.

dc42

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.

bamboosam

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...

spirilis

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