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.
| Feature | AVR® RTC | PIC32CM RTC |
|---|---|---|
| Counter Resolution | 16-bit | 32-bit (or two 16-bit) |
| Prescaler | 15-bit programmable | 10-bit programmable |
| Compare Registers | One | 1 (32-bit) or 2 (16-bit mode) |
| Period Register | One | One |
| Max Timeout (32.768 kHz) |
>18 hours (1s resolution) 2s (max resolution) |
>136 years (1s resolution) 36 hours (max resolution) |
| Clock/Calendar Mode | N/A | Supported (time/date, leap year correction) |
| Clock Correction | Crystal error correction | Digital frequency (prescaler) correction/tuning |
| Periodic Interrupt Timer (PIT) | Separate PIT function, independent of RTC | Integrated periodic wake-up/event functionality |
| Interrupts/Events | Overflow, compare match, periodic, PIT | Overflow, alarm/compare, prescaler, periodic |
| Clear on Match | On overflow | Optional on alarm/compare match |
