25.
RTC – Real-Time Counter
25.1. Overview
The Real-Time Counter (RTC) is a 32-bit counter with a 10-bit programmable prescaler that typically runs
continuously to keep track of time. The RTC can wake up the device from sleep modes using the alarm/
compare wake up, periodic wake up, or overflow wake up mechanisms, or from the wake inputs.
The RTC can generate periodic peripheral events from outputs of the prescaler, as well as alarm/compare
interrupts and peripheral events, which can trigger at any counter value. Additionally, the timer can trigger
an overflow interrupt and peripheral event, and can be reset on the occurrence of an alarm/compare
match. This allows periodic interrupts and peripheral events at very long and accurate intervals.
The 10-bit programmable prescaler can scale down the clock source. By this, a wide range of resolutions
and time-out periods can be configured. With a 32.768kHz clock source, the minimum counter tick
interval is 30.5µs, and time-out periods can range up to 36 hours. For a counter tick interval of 1s, the
maximum time-out period is more than 136 years.
25.2. Features
•
32-bit counter with 10-bit prescaler
•
Multiple clock sources
•
32-bit or 16-bit counter mode
•
One 32-bit or two 16-bit compare values
•
Clock/Calendar mode
–
Time in seconds, minutes, and hours (12/24)
–
Date in day of month, month, and year
–
Leap year correction
•
Digital prescaler correction/tuning for increased accuracy
•
Overflow, alarm/compare match and prescaler interrupts and events
–
Optional clear on alarm/compare match
•
2 general purpose registers
•
8 backup registers with retention capability
•
Tamper Detection
–
Timestamp on event or up to 5 inputs with debouncing
–
Active layer protection
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
331