User's Manual
NXP Semiconductors
UM10301
User Manual PCF85x3, PCA8565 and PCF2123, PCA2125
UM10301_1 © NXP B.V. 2008. All rights reserved.
User manual Rev. 01 — 23 December 2008 26 of 52
12. Initialization and setting of alarm and timer
Setting the clock is a straightforward procedure, setting first the mode and then the actual
time. This example is for the PCF8563 and for reference its block diagram is given in
Fig 10 which shows the registers and their addresses. The procedure for the other RTCs
is similar but there are small differences in register structure and therefore the
appropriate datasheet should be consulted first.
001aah658
PCF8563
OSCILLATOR
32.768 kHz
DIVIDER CLOCK OUT
INTERRUPT
CLKOUT
INT
MONITOR
POWER ON
RESET
WATCH
DOG
I
2
C-BUS
INTERFACE
OSCI
SCL
SDA
OSCO
V
DD
V
SS
TIMER FUNCTION
TIMER_CONTROL0E
TIMER0F
CONTROL
CONTROL_STATUS_100
CONTROL_STATUS_201
CLKOUT_CONTROL0D
TIME
VL_SECONDS02
MINUTES03
HOURS04
DAYS05
ALARM FUNCTION
MINUTE_ALARM09
HOUR_ALARM0A
DAY_ALARM0B
WEEKDAY_ALARM0C
WEEKDAYS06
CENTURY_MONTHS07
YEARS08
Fig 10. Block Diagram PCF8563
Examples for initialisation and setting of time, alarm and timer are given below.
12.1 Initialization of the RTC and setting the time
Table 5 on the next page shows the sequence of commands to be sent to the RTC for
initialization and setting the time.
In this example the time to be set is Friday, July 16 2008, 2:45 pm.