Microchip Technology DM183037 Data Sheet

Page of 696
 2012 Microchip Technology Inc.
DS30575A-page 297
PIC18F97J94 FAMILY
17.0 REAL-TIME CLOCK AND 
CALENDAR (RTCC)
The key features of the Real-Time Clock and Calendar
(RTCC) module are:
• Hardware Real-Time Clock and Calendar (RTCC)
• Provides hours, minutes and seconds using 
24- hour format
• Visibility of one-half second period
• Provides calendar – weekday, date, month and 
year
• Alarm configurable for half a second, one second, 
10 seconds, one minute, 10 minutes, one hour, 
one day, one week or one month
• Alarm repeat with decrementing counter
• Alarm with indefinite repeat – chime
• Year 2000 to 2099 leap year correction
• BCD format for smaller software overhead
• Optimized for long term battery operation
• Fractional second synchronization
• Multiple clock sources
- SOSC
- LPRC
- 50  Hz
- 60  Hz
• User calibration of the 32.768 kHz clock crystal 
frequency with periodic auto-adjust
• Calibration to within ±2.64 seconds error per 
month
• Calibrates up to 260 ppm of crystal error
The RTCC module is intended for applications where
accurate time must be maintained for an extended
period with minimum to no intervention from the CPU.
The module is optimized for low-power usage in order
to provide extended battery life, while keeping track of
time.
The module is a 100-year clock and calendar with auto-
matic leap year detection. The range of the clock is
from 00:00:00 (midnight) on January 1, 2000 to
23:59:59 on December 31, 2099.
Hours are measured in 24-hour (military time) format.
The clock provides a granularity of one second with
half-second visibility to the user.
FIGURE 17-1:
RTCC BLOCK DIAGRAM 
RTCC Prescalers
RTCC Timer
Comparator
Compare Registers
Repeat Counter
YEAR
MTHDY
WKDYHR
MINSEC
ALMTHDY
ALWDHR
ALMINSEC
with Masks
RTCC Interrupt Logic
RTCCON1
ALRMRPT
Alarm
Event
0.5s
RTCC Clock Domain
Alarm Pulse
RTCC Interrupt
CPU Clock Domain
RTCVALx
ALRMVALx
RTCC Pin
RTCOE
32.768 kHz Input
from SOSC Oscillator
Internal RC
(LF-INTOSC)