Atmel Xplained Pro Evaluation Kit ATSAMD20-XPRO ATSAMD20-XPRO Data Sheet

Product codes
ATSAMD20-XPRO
Page of 660
195
Atmel | SMART SAM D20 [DATASHEET]
Atmel-42129K–SAM-D20_datasheet–06/2014
18.
 RTC – Real-Time Counter
18.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.
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 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, and so 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. With the counter tick interval configured to 1s, the maximum time-out period is more 
than 136 years.
18.2
Features
z
32-bit counter with 10-bit prescaler
z
Multiple clock sources
z
32-bit or 16-bit Counter mode
z
One 32-bit or two 16-bit compare values
z
Clock/Calendar mode
z
Time in seconds, minutes and hours (12/24)
z
Date in day of month, month and year 
z
Leap year correction
z
Digital prescaler correction/tuning for increased accuracy
z
Overflow, alarm/compare match and prescaler interrupts and events
z
Optional clear on alarm/compare match
18.3
Block Diagram
Figure 18-1. RTC Block Diagram (Mode 0 — 32-Bit Counter)
COUNT
COMPn
=
Compare n
Overflow
0
MATCHCLR
10-bit
Prescaler
GCLK_RTC
CLK_RTC_CNT
32
Periodic
Events
32