Brown-out Detector

For the CPU to successfully decode and execute instructions, the supplied voltage must always stay above the minimum voltage level. This level is defined by the chosen operating frequency. For example, an operating frequency of 10 MHz on the Relevant Devices, an operating voltage of minimum 2.7V, must be supplied. If the voltage drops below this threshold, unexpected behavior of the microcontroller (MCU) might occur. This can include incorrect execution of instructions, corruption of CPU registers, Flash corruption, and unexpected toggling of pins. Also, it can cause logic to latch up, possibly entering into incorrect states.

To avoid the above issues, a Brown-out Detector (BOD) can be used. The Relevant Devices includes an on-board, configurable BOD, which monitors the power supply and compares the voltage with a programmable brown-out threshold level. When the BOD detects that the supply voltage crosses the configured threshold, it will assert the internal Reset. As long as the supply voltage remains below the configured threshold level, the device will be kept in Reset. When the supply voltage is above the threshold level, and normal operation can safely continue, the BOD will deassert the internal Reset, allowing the device to execute instructions.

After a Reset, the BOD settings are loaded from fuses. There are two fuses to control the BOD functionality, which are found in the BOD Configuration (BODCFG) under Fuses in the device data sheet.

The first fuse, ACTIVE, defines the operation mode while in Active or in Idle sleep mode. These bits can not be altered by software.

The second fuse, SLEEP, defines the operation mode while in Standby or Power-down sleep mode. These bits may be altered by software and are under the Configuration Change Protection (CCP).

The ACTIVE and SLEEP fuses can be configured in the following ways: Also, ACTIVE has a fourth option:

Sample Frequency (SAMPLEFREQ) and BOD Level (LVL) are also found in BODCFG. These control how the BOD behaves.

BOD Levels

The BOD compares the supply voltage to a threshold level. This threshold is programmable, and the user can select from 8 different levels. Table 1 shows the BOD levels from the ATtiny3217 data sheet. Always check the Relevant Devices data sheet for correct BOD levels.
Table 1. BOD Threshold Level Examples
Name Description
BODLEVEL0 1.80V
BODLEVEL2 2.60V
BODLEVEL7 4.30V

When setting the BOD level, several things come into consideration. As already mentioned, the BOD can protect the system from an unsafe operation. Also, the BOD can be used to ensure voltage levels, e.g., when using the ADC. If the ADC is set to sample using the 4.3V internal reference, and the supply voltage drops below this level, the ADC results will be incorrect.

If the BOD is unused, it will be set to the minimum level to ensure safe operation during an internal Reset and chip erase.