Periodic events are independent of the prescaler setting used by the RTC counter, except if
CTRLA.PRESCALER is zero. Then, no periodic events will be generated.
Figure 25-5. Example Periodic Events
CLK_RTC_OSC
PER0
PER1
PER2
PER3
25.6.8.2. Frequency Correction
The RTC Frequency Correction module employs periodic counter corrections to compensate for a too-
slow or too-fast oscillator. Frequency correction requires that CTRLA.PRESCALER is greater than 1.
The digital correction circuit adds or subtracts cycles from the RTC prescaler to adjust the frequency in
approximately 1ppm steps. Digital correction is achieved by adding or skipping a single count in the
prescaler once every 8192 CLK_RTC_OSC cycles. The Value bit group in the Frequency Correction
register (FREQCORR.VALUE) determines the number of times the adjustment is applied over 128 of
these periods. The resulting correction is as follows:
Correction in ppm = FREQCORR.VALUE
8192 ⋅ 128
⋅ 10
6
ppm
This results in a resolution of 0.95367ppm.
The Sign bit in the Frequency Correction register (FREQCORR.SIGN) determines the direction of the
correction. A positive value will add counts and increase the period (reducing the frequency), and a
negative value will reduce counts per period (speeding up the frequency).
Digital correction also affects the generation of the periodic events from the prescaler. When the
correction is applied at the end of the correction cycle period, the interval between the previous periodic
event and the next occurrence may also be shortened or lengthened depending on the correction value.
25.6.8.3. Backup Registers
The RTC includes eight Backup registers (BKUPn). These registers maintain their content in Backup
sleep mode. They can be used to store user-defined values.
Related Links
on page 188
25.6.8.4. Tamper Detection
The RTC provides up to five selectable polarity external inputs (INn) that can be used for tamper
detection. The RTC also supports an input event (TAMPEVT) for generating a tamper condition from
within the Event System.
A single interrupt request (TAMPER) is available for all tamper sources. The polarity for each input is
selected with the Tamper Level bits in the Tamper Control register (TAMPCTRL.TAMPLVLn). The tamper
input event is enabled by the Tamper Input Event Enable in the Event Control register
(EVCTRL.TAMPEVIE). The action of each input pin is configured using the Input n Action bits in the
Tamper Control register (TAMPCTRL.INnACT). Tamper inputs support the following actions:
•
Off: Detection for INn is disabled.
•
Wake: A transition on INn matching TAMPCTRL.TAMPLVLn will be detected and the tamper
interrupt flag (INTFLAG.TAMPER) will be set. The RTC value will not be captured in the
TIMESTAMP register
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
340