Microchip Technology MCU PIC PIC18F87K22-I/PTRSL TQFP-80 MCP PIC18F87K22-I/PTRSL Data Sheet

Product codes
PIC18F87K22-I/PTRSL
Page of 550
 2009-2011 Microchip Technology Inc.
DS39960D-page 227
PIC18F87K22 FAMILY
18.0
REAL-TIME CLOCK AND 
CALENDAR (RTCC)
The key features of the Real-Time Clock and Calendar
(RTCC) module are:
• Time: hours, minutes and seconds
• Twenty-four hour format (military time)
• Calendar: weekday, date, month and year
• Alarm configurable
• Year range: 2000 to 2099
• Leap year correction
• BCD format for compact firmware
• Optimized for low-power operation
• User calibration with auto-adjust
• Calibration range: 
2.64 seconds error per month
• Requirements: external 32.768 kHz clock crystal
• Alarm pulse or seconds clock output on RTCC pin
The RTCC module is intended for applications where
accurate time must be maintained for 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 18-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
RTCCFG
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)