122
8331B–AVR–03/12
Atmel AVR XMEGA AU
10.3
Battery Backup System
The battery backup system consists of a V
BAT
power supervisor, a power switch, a crystal oscil-
lator with failure monitor, a 32-bit real-time counter (RTC), and two backup registers.
Figure 10-1.
Battery backup system and its power domain implementation.
10.3.1
Power Supervisor
The power supervisor monitors the voltage on the V
BAT
pin. It performs three main functions:
The power-on detection (BBPOD) function detects when power is applied to the V
BAT
pin, i.e.,
when the backup battery is inserted. When this happens the battery backup power-on detection
flag (BBPODF) is set and the power switch is disconnected to prevent the backup battery from
being drained before the device is configured.
The brown-out detection (BBBOD) function monitors the V
BAT
voltage level when the system is
powered from the V
BAT
pin. If the V
BAT
voltage drops below a threshold voltage, the battery
backup bod flag (BBBODF) is set. The BBBOD samples the V
BAT
voltage level at around a 1Hz
rate, and is designed for detecting slow voltage changes. The BBBOD is turned off when the
device runs from the main power.
The power detection (BBPWR) function controls the V
BAT
voltage after a reset. If no voltage is
present on the V
BAT
pin, the battery backup power flag will be set. This indicates that the backup
battery is not present or has been drained. BBPODF, BBBODF, and the BBPWR flag are later
referred to as the power supervision flags.
10.3.2
Power Switch
The power switch switches between main power and the V
BAT
pin to power the system. This
happens automatically, and is controlled from the main BOD in the device.
Power
switch
VDD
VBAT
TOSC1
TOSC2
V
BAT
power
supervisor
Crystal
Oscillator
RTC
Failure
monitor
Backup
Registers
Main
power
supervision
Oscillator &
sleep
controller
FLASH,
EEPROM
& Fuses
Watchdog w/
Ooscillator
Internal
RAM
GPIO
XTAL2
XTAL1
OCD &
Programming
Interface
Level shifters / Isolation
CPU
&
Peripherals