7 Real Time Counter (RTC) and Periodic Interrupt Timer (PIT)
The RTC offers two timing functions: the Real Time Counter (RTC) and the Periodic Interrupt Timer (PIT). Both peripherals share the same clock source, either a 32.768 kHz external crystal or an internal, ultra-low power 32.768 kHz oscillator while operating independently. When using a crystal oscillator, the RTC can correct for up to ±127 PPM of error. The clock source can be scaled down with a 15-bit prescaler.
The RTC can generate interrupts on a compare match and an overflow, while the PIT can generate an interrupt on a power-of-2 number of clock cycles (e.g.: 2/4/8/…/32768). It can be noted that the RTC and PIT interrupts are not necessarily synchronous (e.g.: will occur at the same time). The PIT must be used for ultra-low power applications, as it is one of the only timers that continues to function in Power-Down mode, while the RTC uses a little bit more power, but supports longer periods. With a 1 Hz scaled clock, the RTC timeout period can exceed 18 hours.