
195
XMEGA A [MANUAL]
8077I–AVR–11/2012
18.
RTC32 – 32-bit Real-Time Counter
18.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
18.2
Overview
The 32-bit real-time counter (RTC32) is a 32-bit counter that typically runs continuously, including 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 18-1. 32-bit real-time counter overview.
18.2.1 Clock selection
An external 32.768kHz crystal oscillator must be used as the clock source. Two different frequency outputs are available
from this, and the RTC32 clock input can be 1.024kHz or 1Hz.
18.2.2 Clock Domains
The RTC32 is asynchronous, operating from a different clock source, and the counter is independent 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.
The Peripheral clock must be more than eight times faster than the RTC32 clock (1.024kHz or 1Hz) when any of the
Control or the Count register are accessed (read or written), more than 12 times faster when the Count register is written.
32.768 kHz
Crystal Osc
TOSC1
TOSC2
DIV32
CNT
PER
COMP
=
Compare
Match
Overflow
DIV1024
1.024 kHz