NXP Semiconductors PCF2123, PCF85x3 Century and leap year, Daylight Saving Time, Century tracking

Page 25

NXP Semiconductors

UM10301

 

User Manual PCF85x3, PCA8565 and PCF2123, PCA2125

11. Century and leap year, Daylight Saving Time

For details on how to implement century tracking and year / leap year tracking, please refer to the datasheets of the respective RTC since register set up differs from type to type. The product comparison in Table 2 shows which parts include century, year and leap year tracking.

11.1 Century tracking

The PCF8563 and PCA8565 contain an 8-bit year register which holds the current year coded in BCD format. These two RTCs further contain a century flag which is toggled when the year counter proceeds from 99 to 00.

PCF8583 and PCF8593 have a four year calendar only and no provision to deal with century change. Also the PCF8573 has no provision to deal with century change.

PCF2123 and PCA2125 contain an 8-bit year register which holds the current year coded in BCD format. There is no century flag. Therefore application firmware needs to deal with century change.

11.2 Year and leap year tracking

A leap year (or intercalary year) is a year containing one extra day in order to keep the calendar year synchronised with the astronomical or seasonal year. Adding an extra day to the calendar every four years compensates for the fact that a solar year is almost six hours longer than 365 days. However, the duration of a solar year is slightly less than

365.25days and therefore some exceptions to this rule are required. Years that are evenly divisible by 100 are not leap years unless they are also evenly divisible by 400. For example, 1600 and 2000 were leap years, but 2100, 2200 and 2300 will not be.

The PCF8563, PCA8565, PCF2123 and PCA2125 all contain an 8-bit year register which can hold values from 00 to 99 in BCD format. These real time clocks compensate for leap years by adding a 29th day to February if the year counter contains a value which is exactly divisible by 4, including the year 00. Therefore in the year 2100 these RTCs add one day to February, where they shouldn’t because it is not a leap year. Until then however leap year correction is correct and automatic.

PCF8583 and PCF8593 have a four year calendar only, which includes leap year tracking. The application firmware needs to deal with keeping track of the actual year.

The PCF8573 has a time counter which counts minutes, hours, days, and months, however, no years. It provides a calendar function in which firmware needs to track the years and which needs to be corrected once every four years to allow for leap year.

11.3 Daylight Saving Time (DST)

There is no provision to deal with day light saving time. Since DST is not implemented equally worldwide and can change often, it is usually better not to implement DST in the RTC but to have the application firmware deal with it. Therefore customers whose applications depend on proper adjustment to DST are advised to design their products such that firmware handles DST changes.

UM10301_1

 

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

User manual

Rev. 01 — 23 December 2008

25 of 52

Image 25
Contents Document information Info Content KeywordsAbstract NXP Semiconductors Contact informationRevision history Rev Date DescriptionIntroduction Features Address Register name Bit Register overview PCF8563Comparison Event counter modeComparison of six real time clocks FeaturesPower-on reset Power-on reset PORVoltage-low detector Voltage-low detection OscillatorOscillator-stop detection Overview of internal and external oscillator capacitors Pierce Oscillator equivalent diagramOscillator frequency determining components UM10301 + C Parameter Value Unit Source Typical values for crystal and surrounding capacitorsOscillation allowance Using an external oscillatorCrystal and crystal selection Modes which don’t work Effect of temperature− f nom Capacitors and capacitor selection Accuracy Influences on time accuracy Oscillator tuning Oscillator tuning 10.1 PCF2123 Offset register Century tracking Century and leap year, Daylight Saving TimeYear and leap year tracking Daylight Saving Time DSTInitialization of the RTC and setting the time Initialization and setting of alarm and timerBlock Diagram PCF8563 Setting the alarm AlarmBinary BCD Register Comments AddressAlarm function Setting the timer Setting the timerRegister Lithium Primary cells Backup power supplyBackup circuit using primary lithium cell NiCd and NiMH secondary batteries Backup circuit using secondary cell NiCd or NiMH13.3 Capacitors Charging the backup capacitor Some suggestions for diode D1 Diode selection1N4148 BAS716 BAS116 BAV170PCB layout guidelines PCB layout proposal for PCF8563 using leaded components Partial circuit switch down Protection diodes Hints to keep power consumption low0007 Rpmax as a function of bus capacitance 8473 ⋅ C bApplication diagram 2, SPI interface Application diagram 1, I2C-bus interfaceTimer delays First period inaccuracy when using the timerTimer Source clock frequency Delay for n = General countdown timer behaviourTimer source clock Minimum timer period Maximum timer period First period delay for timer counter value nTiming requirements for I2C read and write I2C interface Block diagram I2C interface and Time countersSequence of events example Read Oscillator startup time Checking for oscillation TroubleshootingNo communication via I2C-bus Wrong time and date, wrong clock speed ReferencesDefinitions Legal informationDisclaimers TrademarksContents