NXP Semiconductors PCA8565 Initialization and setting of alarm and timer, Block Diagram PCF8563

Page 26

NXP Semiconductors

UM10301

 

User Manual PCF85x3, PCA8565 and PCF2123, PCA2125

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.

OSCI

 

 

 

 

 

OSCILLATOR

DIVIDER

 

CLOCK OUT

 

32.768 kHz

 

 

 

 

 

OSCO

 

 

 

 

 

MONITOR

 

 

CONTROL

 

 

00

CONTROL_STATUS_1

 

 

 

 

 

 

01

CONTROL_STATUS_2

 

 

 

0D

CLKOUT_CONTROL

 

POWER ON

 

 

 

 

RESET

 

 

 

 

 

 

 

TIME

 

 

 

02

VL_SECONDS

 

 

 

03

MINUTES

VDD

 

 

04

HOURS

VSS

 

 

05

DAYS

 

 

06

WEEKDAYS

 

 

 

07

CENTURY_MONTHS

 

WATCH

 

08

YEARS

 

 

 

 

 

DOG

 

 

 

 

 

 

 

ALARM FUNCTION

 

 

 

09

MINUTE_ALARM

 

 

 

0A

HOUR_ALARM

SDA

I2C-BUS

 

0B

DAY_ALARM

SCL

INTERFACE

 

0C

WEEKDAY_ALARM

 

 

 

 

INTERRUPT

 

 

 

 

TIMER FUNCTION

 

PCF8563

0E

TIMER_CONTROL

 

0F

TIMER

 

 

 

 

 

 

 

001aah658

CLKOUT

INT

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.

UM10301_1

 

© NXP B.V. 2008. All rights reserved.

User manual

Rev. 01 — 23 December 2008

26 of 52

Image 26
Contents Abstract Info Content KeywordsDocument information Revision history Contact informationNXP Semiconductors Rev Date DescriptionIntroduction Features Register overview PCF8563 Address Register name BitEvent counter mode ComparisonFeatures Comparison of six real time clocksVoltage-low detector Power-on reset PORPower-on reset Oscillator-stop detection OscillatorVoltage-low detection Pierce Oscillator equivalent diagram Overview of internal and external oscillator capacitorsOscillator frequency determining components UM10301 + C Typical values for crystal and surrounding capacitors Parameter Value Unit SourceUsing an external oscillator Oscillation allowanceCrystal and crystal selection Effect of temperature Modes which don’t work− f nom Capacitors and capacitor selection Accuracy Influences on time accuracy Oscillator tuning Oscillator tuning 10.1 PCF2123 Offset register Year and leap year tracking Century and leap year, Daylight Saving TimeCentury tracking Daylight Saving Time DSTBlock Diagram PCF8563 Initialization and setting of alarm and timerInitialization of the RTC and setting the time Binary BCD AlarmSetting the alarm Register Comments AddressAlarm function Register Setting the timerSetting the timer Backup power supply Lithium Primary cellsBackup circuit using primary lithium cell Backup circuit using secondary cell NiCd or NiMH NiCd and NiMH secondary batteries13.3 Capacitors Charging the backup capacitor 1N4148 Diode selectionSome suggestions for diode D1 BAS716 BAS116 BAV170PCB layout guidelines PCB layout proposal for PCF8563 using leaded components Partial circuit switch down Hints to keep power consumption low Protection diodes0007 8473 ⋅ C b Rpmax as a function of bus capacitanceApplication diagram 1, I2C-bus interface Application diagram 2, SPI interfaceTimer Source clock frequency Delay for n = First period inaccuracy when using the timerTimer delays General countdown timer behaviourFirst period delay for timer counter value n Timer source clock Minimum timer period Maximum timer periodTiming requirements for I2C read and write Block diagram I2C interface and Time counters I2C interfaceSequence of events example Read Troubleshooting Oscillator startup time Checking for oscillationNo communication via I2C-bus References Wrong time and date, wrong clock speedDisclaimers Legal informationDefinitions TrademarksContents