5.3.3 Real-Time Counters (RTC)

AVR and PIC32CM RTC peripherals are designed for accurate timekeeping, periodic interrupts, and low-power operation. The RTCs can run continuously in low-power modes, wake the device from sleep, and generate interrupts or events on compare match or overflow. Both RTCs also offer mechanisms for clock correction to improve long-term accuracy. Table 5-13 shows a comparison of features between AVR and PIC32CM.

Table 5-13. AVR® and PIC32CM RTC Features
FeatureAVR® RTCPIC32CM RTC
Counter Resolution16-bit32-bit (or two 16-bit)
Prescaler15-bit programmable10-bit programmable
Compare RegistersOne1 (32-bit) or 2 (16-bit mode)
Period RegisterOneOne
Max Timeout (32.768 kHz)

>18 hours (1s resolution)

2s (max resolution)

>136 years (1s resolution)

36 hours (max resolution)

Clock/Calendar ModeN/ASupported (time/date, leap year correction)
Clock CorrectionCrystal error correctionDigital frequency (prescaler) correction/tuning
Periodic Interrupt Timer (PIT)Separate PIT function, independent of RTCIntegrated periodic wake-up/event functionality
Interrupts/EventsOverflow, compare match, periodic, PITOverflow, alarm/compare, prescaler, periodic
Clear on MatchOn overflowOptional on alarm/compare match