5.3.3 Real-Time Counters (RTC)

The PIC16F and most PIC18F devices rely on TMR1 for basic RTC functionality, while some PIC18F and all PIC32CM families provide a dedicated, feature-rich RTC peripheral for modern embedded timekeeping needs. Table 5-13 provides a comparison of features between PIC16F, PIC18F and PIC32CM.

Table 5-13. PIC16F, PIC18F and PIC32CM RTC Features
FeaturePIC16F RTCC/TMR1PIC18F RTCC/TMR1PIC32CM RTC
RTC Peripheral

RTCC

TMR1 with 32.768 kHz crystal

RTCC

TMR1 with 32.768 kHz crystal

RTC
Counter ResolutionBinary Coded Decimal (BCD) format for time/dateBinary Coded Decimal (BCD) format for time/date32-bit (or two 16-bit)
Prescaler 2-bit programmable (Timer1)2-bit programmable (Timer1)10-bit programmable
Compare Registers Alarm registers for Sec/Min/Hour/Day/Month/WDAlarm registers for Sec/Min/Hour/Day/Month/WD2 (32-bit) or 4 (16-bit mode)
Period RegisterN/AN/AOne
Maximum Timeout (32.768 kHz)More than 100 years (1s resolution)More than 100 years (1s resolution)More than 136 years (1s resolution)
Clock/Calendar Mode Supported (time/date, leap year correction)Supported (time/date, leap year correction)Supported (time/date, leap year correction)
Clock Correction Periodic auto-adjustPeriodic auto-adjustDigital frequency (prescaler) correction/tuning
Periodic Interrupt Timer (PIT) Alarm repeat counter (up to 255 times)Alarm repeat counter (up to 255 times)Integrated periodic wake-up/event functionality
Interrupts/Events Alarm Match, Timer OverflowAlarm Match, Timer OverflowOverflow, alarm/compare, prescaler, periodic
Clear on MatchAvailable, resets counter to zero/initial date upon alarm matchAvailable, resets counter to zero/initial date upon alarm matchOptional on alarm/compare match
TimekeepingHardware clock and calendar or Software-implemented (TMR1-based)Hardware clock and calendar or Software-implemented (TMR1-based)Hardware clock and calendar, alarms, backup registers
Low-Power OperationTMR1 or RTCC can run in Sleep/Deep SleepTMR1 or RTCC can run in Sleep/Deep SleepRTC runs in Standby/Off
Alarm/Wake-up Function

RTC alarm

TMR1 interrupt

RTC alarm

TMR1 interrupt

Multiple alarms

Event triggers

Backup Battery SupportSupportedSupportedSupported
Event System IntegrationN/AN/ASupported