227
8331B–AVR–03/12
Atmel AVR XMEGA AU
19. RTC32 – 32-bit Real-Time Counter
19.1
Features
•
32-bit resolution
•
32.768kHz external crystal clock source with selectable prescaling
– 1.024kHz
– 1Hz
•
One compare register
•
One period register
•
Clear counter on period overflow
•
Optional interrupt/ event on overflow and compare match
19.2
Overview
The 32-bit real-time counter (RTC32) is a 32-bit counter that typically runs continuously, includ-
ing in low-power sleep modes, to keep track of time. It can wake up the device from sleep modes
and/or interrupt the device at regular intervals.
The reference clock is typically a 1Hz prescaled output from a high-accuracy crystal of
32.768kHz, a configuration optimized for low power consumption and 1s resolution. The faster
1.024kHz output can be selected if the timer needs 1ms resolution.
The RTC32 will give a compare interrupt and/or event when the counter equals the compare
register value, and a overflow interrupt and/or event when it equals the period register value.
Figure 19-1.
32-bit real-time counter overview.
19.2.1
Clock selection
An external 32.768kHz crystal oscillator must be used as the clock source. Two different fre-
quency outputs are available from this, and the RTC32 clock input can be 1.024kHz or 1Hz.
19.2.2
Clock Domains
The RTC32 is asynchronous, operating from a different clock source, and the counter is inde-
pendent of the main system clock and its derivative clocks, such as the peripheral clock. For
control and count register updates, it will take a number of RTC32 clocks and/or peripheral clock
cycles before an updated register value is available in the register or until a configuration change
has effect on the RTC. This synchronization time is described for each register.
32.768 kHz
Crystal Osc
TOSC1
TOSC2
DIV32
CNT
PER
COMP
=
=
Compare
Match
Overflow
DIV1024
1.024 kHz