90
8331B–AVR–03/12
Atmel AVR XMEGA AU
The value that should be written to the COMP register is given by the following formula:
When the DFLL is enabled, it controls the ratio between the reference clock frequency and the
oscillator frequency. If the internal oscillator runs too fast or too slow, the DFLL will decrement or
increment its calibration register value by one to adjust the oscillator frequency. The oscillator is
considered running too fast or too slow when the error is more than a half calibration step size.
Figure 7-7.
Automatic run-time calibration.
The DFLL will stop when entering a sleep mode where the oscillators are stopped. After wake
up, the DFLL will continue with the calibration value found before entering sleep. The reset value
of the DFLL calibration register can be read from the production signature row.
When the DFLL is disabled, the DFLL calibration register can be written from software for man-
ual run-time calibration of the oscillator.
7.8
PLL and External Clock Source Failure Monitor
A built-in failure monitor is available for the PLL and external clock source. If the failure monitor
is enabled for the PLL and/or the external clock source, and this clock source fails (the PLL
looses lock or the external clock source stops) while being used as the system clock, the device
will:
• Switch to run the system clock from the 2MHz internal oscillator
• Reset the oscillator control register and system clock selection register to their default values
• Set the failure detection interrupt flag for the failing clock source (PLL or external clock)
)
(
RCnCREF
OSC
f
f
hex
COMP
=
DFLL CNT
COMP
0
t
RCnCREF
Frequency
OK
RCOSC fast,
CALA decremented
RCOSC slow,
CALA incremented
clk
RCnCREF