Real-Time Counter (Rtc); Features; Overview - Microchip Technology megaAVR 0 Series Manual

Hide thumbs Also See for megaAVR 0 Series:
Table of Contents

Advertisement

21.

Real-Time Counter (RTC)

21.1

Features

16-bit resolution
Selectable clock sources
Programmable 15-bit clock prescaling
One compare register
One period register
Clear timer on period overflow
Optional interrupt/Event on overflow and compare match
Periodic interrupt and Event
Crystal Error Correction
21.2

Overview

The RTC peripheral offers two timing functions: the Real-Time Counter (RTC) and a Periodic Interrupt
Timer (PIT).
The PIT functionality can be enabled independently of the RTC functionality.
RTC - Real-Time Counter
The RTC counts (prescaled) clock cycles in a Counter register, and compares the content of the Counter
register to a Period register and a Compare register.
The RTC can generate both interrupts and events on compare match or overflow. It will generate a
compare interrupt and/or event at the first count after the counter equals the Compare register value, and
an overflow interrupt and/or event at the first count after the counter value equals the Period register
value. The overflow will also reset the counter value to zero.
The RTC peripheral 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 the 32 KHz output from an external crystal. The RTC can also be clocked
from an external clock signal, the 32 KHz internal Ultra Low-Power Oscillator (OSCULP32K), or the
OSCULP32K divided by 32.
The RTC peripheral includes a 15-bit programmable prescaler that can scale down the reference clock
before it reaches the counter. A wide range of resolutions and time-out periods can be configured for the
RTC. With a 32.768 kHz clock source, the maximum resolution is 30.5 μs, and timeout periods can be up
to two seconds. With a resolution of 1s, the maximum timeout period is more than 18 hours (65536
seconds).
The RTC also supports correction when operated using external crystal selection. An externally calibrated
value will be used for correction. The RTC can be adjusted by software to an accuracy of ±1PPM. The
RTC correction operation will either speed up (by skipping count) or slow down (by adding extra count)
the prescaler to account for the crystal error.
©
2018 Microchip Technology Inc.
Datasheet Preliminary
®
megaAVR
0-Series
Real-Time Counter (RTC)
DS40002015A-page 255

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the megaAVR 0 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Atmega4808Atmega4809Atmega3208Atmega3209

Table of Contents