123
8331B–AVR–03/12
Atmel AVR XMEGA AU
10.3.3
Crystal Oscillator with Failure Monitor
The crystal oscillator (XOSC) supports connection of a external 32.768kHz crystal. It provides a
prescaled clock output selectable to 1.024kHz or 1Hz. The crystal oscillator is designed for ultra
low power consumption and by default is configured for low ESR and load capacitance crystals.
It is possible to enable a high ESR mode to drive crystals with high ESR or load capacitance, but
this will increase current consumption. The crystal oscillator failure monitor will detect if the crys-
tal is permanently or temporarily stopped and then set the crystal oscillator failure flag.
10.3.4
32-bit Real-time Counter
The 32-bit real-time counter (RTC) will count each clock output from the crystal oscillator. It pro-
vides a one-millisecond or one-second resolution, depending on the crystal oscillator clock
output selection. For more details on the 32-bit RTC, refer to the
.
10.3.5
Backup Registers
The two backup registers can be used to store volatile data parameters when Vcc is not present.
10.4
Configuration
During device initialization, the battery backup system and RTC must be configured before they
can be used. The recommended configuration sequence is:
1.
Apply a reset
2.
Set the access enable bit
3.
Optionally configure the oscillator output and ESR selection
4.
Optionally enable the crystal oscillator failure monitor and the required delay before
continuing configuration
5.
Enable the crystal oscillator
6.
Wait until the crystal oscillator ready flag is set
7.
Configure and enable the RTC
10.5
Operation
The main BOD monitors the main voltage (Vcc) level and controls the power switching. This
must always be enabled. In active and idle modes, the BOD must be in continuos mode. In deep
sleep modes, the BOD can be in continuos or sampled mode. The system is designed as a
power backup system for the RTC. Reset sources other than the BOD and power loss (i.e. exter-
nal reset, watchdog reset, and software reset) must be treated as a system reset. In this case,
the device state should be treated as unknown and lead to complete reinitialisation, including
battery backup system configuration.
10.5.1
Main Power Loss
When Vcc drops below the programmed BOD threshold voltage, the device will:
1.
Switch the battery backup system to be powered from the V
BAT
pin and enable the
BBBOD.
2.
Ignore any input signals to the system to prevent accidental or partial configuration.
3.
Stretch the 1Hz / 1.024kHz clock signal to avoid a clock edge when switching is active.
4.
Reset the part of the device not powered from the V
BAT
pin.
The battery backup system will continue to run as normal during the power switch and after-
wards. When main power is lost, it is not possible to access or read the status from the registers.