English
Language : 

PIC18F87J90 Datasheet, PDF (166/450 Pages) Microchip Technology – 64/80-Pin, High-Performance Microcontrollers with LCD Driver and nanoWatt Technology
PIC18F87J90 FAMILY
15.2.2 CLOCK SOURCE
As mentioned earlier, the RTCC module is intended to
be clocked by an external Real-Time Clock crystal,
oscillating at 32.768 kHz, but can also be an internal
oscillator. The RTCC clock selection is decided by the
RTCOSC bit (CONFIG3L<1>).
Calibration of the crystal can be done through this
module to yield an error of 3 seconds or less per month.
(For further details, see Section 15.2.9 “Calibration”.)
FIGURE 15-4:
CLOCK SOURCE MULTIPLEXING
32.768 kHz XTAL
from SOSC
Internal RC
1:16384
Clock Prescaler(1)
Half Second
Clock
Half second(1)
One Second Clock
CONFIG 3L<1>
Second
Hour:Minute
Day
Day of Week
Month
Year
Note 1: Writing to the lower half of the MINSEC register resets all counters, allowing fraction of a second
synchronization; clock prescaler is held in Reset when RTCEN = 0.
15.2.2.1 Real-Time Clock Enable
The RTCC module can be clocked by an external,
32.768 kHz crystal (Timer1 oscillator) or the Internal RC
oscillator, which can be selected in CONFIG3L<1>.
If the external clock is used, the Timer1 oscillator
should be enabled by setting the T1OSCEN bit
(T1CON<3> = 1). If INTRC is providing the clock, the
INTRC clock can be brought out to the RTCC pin by the
RTSECSEL<1:0> bits in the PADCFG register.
15.2.3 DIGIT CARRY RULES
This section explains which timer values are affected
when there is a rollover.
• Time of Day: from 23:59:59 to 00:00:00 with a
carry to the Day field
• Month: from 12/31 to 01/01 with a carry to the
Year field
• Day of Week: from 6 to 0 with no carry (see
Table 15-1)
• Year Carry: from 99 to 00; this also surpasses the
use of the RTCC
For the day to month rollover schedule, see Table 15-2.
Considering that the following values are in BCD for-
mat, the carry to the upper BCD digit will occur at a
count of 10 and not at 16 (SECONDS, MINUTES,
HOURS, WEEKDAY, DAYS and MONTHS).
TABLE 15-1: DAY OF WEEK SCHEDULE
Day of Week
Sunday
0
Monday
1
Tuesday
2
Wednesday
3
Thursday
4
Friday
5
Saturday
6
TABLE 15-2: DAY TO MONTH ROLLOVER
SCHEDULE
Month
Maximum Day Field
01 (January)
02 (February)
31
28 or 29(1)
03 (March)
31
04 (April)
30
05 (May)
31
06 (June)
30
07 (July)
31
08 (August)
31
09 (September)
30
10 (October)
31
11 (November)
30
12 (December)
31
Note 1: See Section 15.2.4 “Leap Year”.
DS39933D-page 166
 2010 Microchip Technology Inc.