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.
| Feature | PIC16F RTCC/TMR1 | PIC18F RTCC/TMR1 | PIC32CM RTC |
|---|---|---|---|
| RTC Peripheral |
RTCC TMR1 with 32.768 kHz crystal |
RTCC TMR1 with 32.768 kHz crystal | RTC |
| Counter Resolution | Binary Coded Decimal (BCD) format for time/date | Binary Coded Decimal (BCD) format for time/date | 32-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/WD | Alarm registers for Sec/Min/Hour/Day/Month/WD | 2 (32-bit) or 4 (16-bit mode) |
| Period Register | N/A | N/A | One |
| 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-adjust | Periodic auto-adjust | Digital 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 Overflow | Alarm Match, Timer Overflow | Overflow, alarm/compare, prescaler, periodic |
| Clear on Match | Available, resets counter to zero/initial date upon alarm match | Available, resets counter to zero/initial date upon alarm match | Optional on alarm/compare match |
| Timekeeping | Hardware 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 Operation | TMR1 or RTCC can run in Sleep/Deep Sleep | TMR1 or RTCC can run in Sleep/Deep Sleep | RTC runs in Standby/Off |
| Alarm/Wake-up Function |
RTC alarm TMR1 interrupt |
RTC alarm TMR1 interrupt |
Multiple alarms Event triggers |
| Backup Battery Support | Supported | Supported | Supported |
| Event System Integration | N/A | N/A | Supported |
