21.2 Overview

The Real-Time Counter (RTC) is a 32-bit counter with a 10-bit programmable prescaler and frequency correction functionality. The RTC typically runs continuously to keep track of time in the system. It can operate as a 32-bit or 16-bit counter, as well as a clock/calendar with alarm functionality. The RTC can wake the device from sleep modes and it can generate events and interrupts at overflow, periodically, or when a compare or alarm match occurs.

The 10-bit programmable prescaler can scale down the clock source. This allows a wide range of resolutions and time-out periods can be configured, ranging from microseconds to years, making it suitable for a variety of time-based functions.

With frequency correction, the RTC can compensate for oscillators operating too slowly or fast.