NXP Semiconductors UM10301 PCA2125 User Manual
NXP Semiconductors UM10301 PCA2125 User Manual

NXP Semiconductors UM10301 PCA2125 User Manual

Real time clocks

Advertisement

Quick Links

UM10301
User Manual for NXP Real Time Clocks PCF85x3, PCA8565
and PCF2123, PCA2125
Rev. 01 — 23 December 2008
Document information
Info
Content
PCF8563, PCF8573, PCF8583, PCF8593, PCA8565, PCF2123,
Keywords
PCA2125, PCF2120, RTC, real time clock, timekeeping, crystal,
32.768 kHz, backup.
This application note aims to assist a user of above mentioned Real Time
Abstract
Clocks in achieving succesful design-in and application. It contains useful
hints with respect to electrical schematic and PCB layout as well as code
examples for the well established NXP PCF8563 and related Real Time
Clocks. Also the more recent Real Time Clocks PCF2123 and PCA2125
have been taken into account.
User manual

Advertisement

Table of Contents
loading

Summary of Contents for NXP Semiconductors UM10301 PCA2125

  • Page 1 UM10301 User Manual for NXP Real Time Clocks PCF85x3, PCA8565 and PCF2123, PCA2125 Rev. 01 — 23 December 2008 Document information Info Content PCF8563, PCF8573, PCF8583, PCF8593, PCA8565, PCF2123, Keywords PCA2125, PCF2120, RTC, real time clock, timekeeping, crystal, 32.768 kHz, backup. This application note aims to assist a user of above mentioned Real Time Abstract Clocks in achieving succesful design-in and application.
  • Page 2: Contact Information

    NXP Semiconductors Revision history Date Description 20081223 Initial version. This application note / user manual is a complete update of a previous publication titled: “Application note for the Philips Real Time Clocks PCF8563,73,83,93” which did not have an official AN/UM number and is superseded by this document.
  • Page 3: Introduction

    NXP Semiconductors 1. Introduction The real time clocks from NXP (previously Philips Semiconductors) have a long tradition and are used in numerous application fields. Starting from applications like VCR, they have been used in a wide variety or products like burglar alarm systems, water...
  • Page 4: Features

    NXP Semiconductors 2. Features The NXP real-time clock portfolio includes types for low power, types for automotive and other high temperature applications and applications that need additional RAM. A third family of highly accurate temperature compensated real time clocks will be dealt with in a separate application note.
  • Page 5 NXP Semiconductors In BCD every digit of the decimal system is represented by a 4-bit group. For example: = 0001 0101 0111 This is not the same as binary representation. It is clear that BCD is not the most efficient way of coding since every 4-bit group (nibble) could represent numbers 0 through 15, but in BCD never represents numbers bigger than 9.
  • Page 6: Comparison

    NXP Semiconductors The PCA8565 and PCA2125 oscillators operate over a wider temperature range (up to 125 ºC) and are suitable for use in the harsh environments found within automobiles. Power consumption remains low — only 700 nA at 2 V. Serial interface is I All the RTCs have ESD protection that exceeds 2000 V HBM per JESD22-A114, 200 V MM per JESD22-A115.
  • Page 7 NXP Semiconductors Table 2. Comparison of six real time clocks Features Unique features Type of interface Interface bus speed Scratch pad RAM Year / leap year tracking Year counter 100 ms, 10 ms time register Electronic tuning register Programmable alarm and timer...
  • Page 8: Power-On Reset (Por)

    NXP Semiconductors 4. Power-on reset (POR) Traditionally a power-on reset circuit is a circuit that generates a reset pulse once the supply voltage has reached a certain value upon power-up. The purpose is to ensure a defined behavior at start-up. This type of power-on reset is not present in these RTCs.
  • Page 9: Oscillator

    NXP Semiconductors The implementation in the PCF2123 is slightly different. There a bit OS (Oscillator Stopped) is present instead of VL. The OS flag is set whenever the oscillator is stopped, and therefore also when this is due to the supply voltage dropping too low. The flag can only be cleared by software and only if the oscillator is running again.
  • Page 10 NXP Semiconductors is a result of parasitic capacitances due to PCB traces, IC pins etc. and is directly STRAY in parallel with C these parasitic capacitances as low as possible since it will add to the load capacitance and this load capacitance must meet the specified value for the crystal that is being used.
  • Page 11 NXP Semiconductors The values used in practice will be a bit smaller than the theoretically required values due to parasitic capacitances present in the application which add to the external physical capacitor. For the PCF2123 the integrated C requires a load capacitance of 7 pF. If a crystal with required load capacitance of 12.5 pF is used still a small external capacitor is required, otherwise the clock will run too fast.
  • Page 12 NXP Semiconductors capacitances. The external components of the oscillator have to be chosen such that the actual value of C not run exactly at its specified frequency resulting in the clock running slow or fast. The crystal manufacturer can manufacture crystals for any load capacitance, but in practice some standard values are used.
  • Page 13 NXP Semiconductors Now in order to determine the value of C and C STRAY effectively in series; the 32 kHz signal goes from OSCI through C to C and then through C the remainder of this discussion, whenever in formulas C...
  • Page 14 NXP Semiconductors Taking the numbers from Table 4 yields for L This L of around 11000 H resulting in a Q of around 42000 explains why starting up the oscillator as well as stopping it can easily take more than a second. An oscillating quartz crystal is actually a mechanical oscillation and starting or stopping this takes time.
  • Page 15: Oscillation Allowance

    NXP Semiconductors 6.1 Oscillation allowance Fig 4 shows the Pierce oscillator schematic with the external crystal. For an oscillation to take place the real component of the oscillator impedance has to be larger than the motional resistance R take place since no operating point can be reached.
  • Page 16: Crystal And Crystal Selection

    NXP Semiconductors levels can be tuned such that they are similar to those when the internal oscillator is used. Suppose that the RTC is supplied with 3.3 V and that the amplitude of the external CLK is 5 V (from 0 V to 5 V). Using 1 M and 220 k resistors the signal could be reduced to (220 / 1220) x 5 V = 0.9 V.
  • Page 17: Modes Which Don't Work

    NXP Semiconductors value is really too high start up problems may occur, but up to 100 kΩ no start up problems are expected. See 6.1”Oscillation allowance”. The frequency accuracy of the oscillator depends mainly on the accuracy of the crystal...
  • Page 18 NXP Semiconductors The frequency of a typical crystal at a specific temperature T is given by: Further f Here f is the nominal frequency as specified and f frequency which is a result of production spread, both at room temperature.
  • Page 19: Capacitors And Capacitor Selection

    NXP Semiconductors handle this temperature. Generally metal can quartzes are not recommended for high temperatures because the termal cycling (expansion of package) will cause leakages in the hermetically sealed package. Micro Crystal of Switzerland manufactures a wide range of crystals which include crystals designed to operate up to 125 °C.
  • Page 20: Accuracy

    NXP Semiconductors to +80 %. Its only redeeming feature is its high permittivity which allows high capacitance values, typically ranging from 1 nF to 4.7 µF. Good for bypass and coupling applications. It has low price, small size and low temperature stability.
  • Page 21 NXP Semiconductors Fig 8. Influences on time accuracy The various influences indicated in Fig 8 are described below: 1. The line at the top indicates the frequency tolerance of the crystal in this example. The distance between two vertical lines represents (at the top) 1 s/day or 11.57 ppm.
  • Page 22: Oscillator Tuning

    NXP Semiconductors 5. Tuning C to the spread of C well compensated for. 6. Here the influence on accuracy due to aging of the crystal is given. This shift occurs mainly during the first year of the crystal’s life and in the graph a range of about 420 ms/day to 850 ms/day is indicated (±10 ppm).
  • Page 23 NXP Semiconductors Fig 9. Oscillator tuning Accuracy: In order to be able to adjust the clock with accuracy better than 1 s/day, the frequency counter used to check the output at CLKOUT should have at least an 8 digit reading with an accuracy of 1 ppm.
  • Page 24: Pcf2123 Offset Register

    NXP Semiconductors • In the datasheets of PCF8583 and PCF8593 the following method is described: Using the alarm function (via the I at the interrupt output for fast setting of a trimmer. Procedure: Power-on; Initialization (alarm functions). Routine: Set clock to time T and set alarm to time T + ∆T At time (T + ∆T) (Interrupt) repeat the routine.
  • Page 25: Century And Leap Year, Daylight Saving Time

    NXP Semiconductors 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.
  • Page 26: Initialization And Setting Of Alarm And Timer

    NXP Semiconductors 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.
  • Page 27: Alarm

    NXP Semiconductors Table 5. Sequence of commands / data to be sent Binary (BCD) 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
  • Page 28 NXP Semiconductors Binary (BCD) 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...
  • Page 29: Setting The Timer

    NXP Semiconductors 12.3 Setting the timer The internal timer is an 8-bit countdown timer which is controlled by the timer control register. The timer counts down from a software-loaded 8-bit binary value. It can be clocked by four different source clock frequencies: 4096 Hz, 64 Hz, 1 Hz or 1/60 Hz.
  • Page 30: Backup Power Supply

    NXP Semiconductors 13. Backup power supply A real time clock is a clock that keeps track of the time as humans use it (hours, minutes, seconds, years etc.) and usually even when the rest of the system is turned off.
  • Page 31 NXP Semiconductors The mentioned IEC/UL standard states that circuits employing lithium batteries shall be designed to prevent forced charge and discharge if this would result in a hazard. Practically this means that the application must ensure that both charging and...
  • Page 32: Nicd And Nimh Secondary Batteries

    NXP Semiconductors evaporation can be neglected. At elevated temperatures of for example 60 °C electrolyte evaporation will be much higher. Refer to the manufacturer’s datasheet. Vendors of lithium batteries include Panasonic, Sanyo and Varta. 13.2 NiCd and NiMH secondary batteries The well known Nickel-Cadmium and Nickel-Metal Hydride batteries can also be used to provide backup power to an RTC.
  • Page 33: Capacitors

    NXP Semiconductors The recommended trickle charge current for a NiCd or NiMH is expressed as a fraction of C and is typically in the range C/50…C/20. Refer to the datasheet of the selected battery. A too small trickle current will not properly keep the battery fully charged, a too high current leads to overcharging and this will limit the life time of the battery.
  • Page 34: Charging The Backup Capacitor

    NXP Semiconductors If backup is only needed for a few minutes to deal with short interruptions in power, it is possible to use a small inexpensive electrolytic capacitor. Supercaps can not be bought from as many vendors as ordinary electrolytic capacitors.
  • Page 35: Diode Selection

    NXP Semiconductors Using C·V = I·t: backup Assuming that the PCF8563 is used, that V consumption is 250 nA and a backup capacitor value of 0.47 F it is possible to estimate the available backup time. The oscillator stops running when V backup As one day contains 86400 seconds this thus corresponds to 50 days.
  • Page 36: Pcb Layout Guidelines

    NXP Semiconductors 14. PCB layout guidelines The tuning fork crystal’s drive level is extremely low (< 1 μW) and the input of the amplifier used in the oscillator (pin OSCI) has a very high impedance. This makes the circuit susceptible to signals generated by other circuits on the board, or further away.
  • Page 37 NXP Semiconductors (1) In practice the input capacitor C Fig 14. PCB layout proposal for PCF8563 using leaded components Alternatively to the last point listed above and in order to achieve highest noise immunity, a guard ring can be placed around the crystal which must be tied to ground to isolate the crystal from unwanted noise pickup.
  • Page 38: Partial Circuit Switch Down

    NXP Semiconductors Fig 15. PCB layout proposal for PCF8563 using SMD components and guard ring Remark: Take precautions when cleaning PCBs containing tuning fork crystals using ultrasound. The resonance vibration may damage the crystal. Consult the supplier of the crystal in case of doubt.
  • Page 39: Hints To Keep Power Consumption Low

    NXP Semiconductors Fig 16. Protection diodes 16. Hints to keep power consumption low For some applications low power consumption is a key requirement. Power consumption can be minimized by applying several measures: • Select PCF8563 (I consumption which is further decreased when a crystal is selected that has a load capacitance of 7 pF instead of the more standard 12.5 pF (a lower load capacitance...
  • Page 40 NXP Semiconductors • Access the RTC as little as possible in order to reduce the dynamic current consumption by the I • Disable the CLKOUT in battery backup mode. If CLKOUT needs to be enabled select the pull-up resistor as large as possible. However, CLKOUT enabled will dominate current consumption and severely limit battery backup time;...
  • Page 41 NXP Semiconductors (max) (1) Standard-mode (2) Fast-mode (3) Fast-mode Plus Fig 17. R Below R p(max) has been rounded down to E6 standard values. 400 kHz I 100 kHz I Two examples of an application diagram are shown in Fig 18 and Fig 19. In these examples the INT output is left unused.
  • Page 42 NXP Semiconductors Fig 18. Application diagram 1, I The following example is with PCA2125 and SPI interface. The 1 Farad capacitor is used as a standby/backup supply. With the RTC in its minimum power configuration i.e. timer off and CLKOUT off, the RTC may operate for several months.
  • Page 43: First Period Inaccuracy When Using The Timer

    NXP Semiconductors 17. First period inaccuracy when using the timer This chapter describes why the programmed delay is not always exactly as expected and what to do in order to be as accurate as possible. The enable instruction for the timer is generated by the I source clock.
  • Page 44 NXP Semiconductors The timer counts down from a software-loaded 8-bit binary value, n. Loading the counter with 0 effectively stops the timer. Values from 1 to 255 are valid. When the counter reaches 1, the countdown Timer Flag (TF) will be set and the counter automatically re- loads and starts the next timer period.
  • Page 45: Timing Requirements For I

    NXP Semiconductors As an example, the desired timer period is 5 seconds. If the timer source clock frequency is set to 1 Hz and n = 5, the minimum possible timer period will be (5-1) + 15.625 ms = 4.015625 s. The maximum possible timer period will be 5 + 15.625 ms = 5.015625 s. The resulting timer period will have a duration somewhere within these limits.
  • Page 46 NXP Semiconductors C interface reset Fig 21. Block diagram I C interface and Time counters When there is no I operation is initiated, the I time counters from counting. Additionally this results in the watchdog no longer being reset. At the next rising edge of the 1 Hz clock, time does not increment because the registers have been frozen.
  • Page 47 NXP Semiconductors Fig 22. Sequence of events (example READ) From this follows: • A I C read must be terminated within one second of initiation; • The RTC will automatically terminate the read if it remains active for longer than one second;...
  • Page 48: Troubleshooting

    NXP Semiconductors chapter could occur. First, the data could change while a single register is being read. Second, the data could change during the time between reading two registers. Therefore in order to avoid this from happening it is necessary to read all time registers in one single read operation, using the auto-increment function.
  • Page 49: No Communication Via I C-Bus

    NXP Semiconductors 19.3 No communication via I When no communication with the RTC is possible, it is also not possible to set and read time. Normally the I phase problems may occur that hang up the bus. One reason may be that spikes on the...
  • Page 50: Wrong Time And Date, Wrong Clock Speed

    NXP Semiconductors 19.4 Wrong time and date, wrong clock speed When writing into the RTC registers care has to be taken that only valid values are written. For example, seconds only should go to 59, but it is possible to write for example 61 into the seconds register.
  • Page 51 Right to make changes — NXP Semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice.
  • Page 52: Table Of Contents

    NXP Semiconductors 22. Contents Introduction ...3 Features ...4 Comparison ...6 Event counter mode ...6 Power-on reset (POR) ...8 Voltage-low detector ...8 Oscillator...9 Oscillation allowance...15 Using an external oscillator ...15 Crystal and crystal selection...16 Modes which don’t work ...17 Effect of temperature...17 Capacitors and capacitor selection ...19...

This manual is also suitable for:

Pcf2123Pcf85x3Pca8565

Table of Contents