Mostly all microcontrollers have built-in Brown-out Detection (BOD) circuit, which monitors supply voltage level during operation. BOD circuit is nothing more than the comparator, which compares supply voltage to a fixed trigger level.
If the microcontroller doesn’t have an On-Chip Brown-Out detector, then there can be an external circuit used :
In the image above, there is a discrete brown-out detector circuit. There are particular IC where additional delay circuitry and hysteresis used as normalizing of supply voltage may take some time in a real word. Such IC’s are cheaper than one built from discrete components.
Brownout is an important safety feature in electronics and microcontrollers. There are two main tasks of brown-out function in microcontroller – hardware and software.
- The hardware brown-out feature resets the microcontroller and keeps it until the power supply is returned to the operating range. This ensures that all parts of the circuit work correctly.
- Software brown-out part – an interrupt based functionality that detects falling voltage, which allows the software to take care of critical components like saving vital information to non-volatile memory before resetting.
What causes a brown-out
As an example, let us see how the Atmega128 microcontroller, which has an On-chip Brown-out detector, reacts to the brown-out event. The trigger level can be set to 2.7V or 4.0V by programming Fuse bits. Trigger level also has a hysteresis to avoid spiky operation. The hysteresis can be interpreted as VBOT+=VBOT+VHYST/2 and VBOT-=VBOT-VHYST/2.
If the Brown-Out circuit is enabled by the Fuse bit and Vcc voltage decreases to a value bellow trigger value (VBOT-), then the Brown-Out reset is activated. After supply voltage rises above the triggered level (VBOT+), the delay timer starts counting, which keeps MCU on the reset stage for some time, giving enough time for the power supply to normalize. After the timer counts up, the internal reset signal is released.