English
Language : 

DS-72-34 Datasheet, PDF (12/18 Pages) Cymbet Corporation – I2C Real-Time Clock/Calendar with Integrated Backup Power
Preliminary
CBC34803 EnerChip™ RTC
Initial Timing Calibration Algorithm
To initially calibrate out any crystal frequency inaccuracies and any parasitic load inaccuracies, the following
procedure should be run using a timing measurement device that can resolve better than one ppm in less
than a half-second. This device could be a frequency counter with a good calibration, a custom circuit built on
the device-under-test (DUT) board of the system tester that includes an accurate oscillator of 10MHz or better
and a counter that can count how many tenths of microseconds between the edges of the clock output from
the CBC34803, or possibly the system tester itself if it can be calibrated to resolve tenths of microseconds
between edges of the output clock. The procedure is as follows:
1. Set the OFFSETX, CMDX, and XTCAL register fields to 0 to make sure the oscillator is running
without any calibration taking place. The CMDX and OFFSETX fields are both in the CAL_XT register. The
XTCAL bits are in the Osc Control register.
2. Select the XT oscillator by setting the OSEL bit of the Osc register to 0.
3. Configure a square wave output on one of the output pins of frequency Fnom (for example 16Hz). See
register SQW in the datasheet for information on how to do this.
4. Measure the pulse width of several cycles of the square wave with a resolution of better than 0.25ppm
(resolve edges to 15ns or better using averaging if needed) and convert to a frequency Fmeas by taking the
reciprocal of the pulse width.
5. Compute the pulse adjustment value (PADJ) required in ppm as:
((32,768 - Fmeas)*1000000) / 32,768 = PADJ.
6. Compute the adjustment value in steps as PADJ / (1000000 / 2^19) = Padj / (1.90735) = ADJ.
7. If ADJ < -320 the XT frequency is too high to be calibrated. Contact Cymbet for design assistance.
8. Compensate by starting at the top of this table and proceeding down until the pertinent condition is
met and set the fields XTCAL, CMDX, and OFFSETX as indicated:
If ADJ is as below
set XTCAL = set CMDX = set OFFSETX =
ADJ < -256 3 1 (ADJ + 192)/2
-256 < ADJ < -192
3
0
(ADJ + 192)
-192 < ADJ < -128
2
0
(ADJ + 128)
-128 < ADJ < -64
1
0
(ADJ + 64)
-64 < ADJ < 64
0
0
(ADJ)
64 < ADJ < 128 0 1 (ADJ)/2
Otherwise, XT is too low to calibrate. Contact Cymbet.
The calibration register values can be saved in nonvolatile memory in the final system’s microprocessor for
reloading when system power is recovered.
Timing Calibration Settings Calculator
Cymbet has created a Timing Calibration Settings Calculator for the CBC34803. This Excel spreadsheet can be
found here: http://www.cymbet.com/pdfs/Spreadsheet-to-set-EnerChip-RTC-348x3-values.xls.
To measure the timing error that might need correction, test your system with the CBC34803 over a period of
time and measure any clock drift. Once testing is complete, enter the Measured Error to Correct (seconds) and
the time duration of the test (seconds, hours, days, weeks) in the yellow indicated fields. If the ADJ range is
valid (green) , the Calculator will then compute the values for the following registers: OFFSETX, CMDX, XTCAL
and OSEL.
Additional information on crystal oscillator use can be found in this Application Note:
AN- 1058 Using CBC348xx EnerChip RTC in High Accuracy Applications
©2014-2015 Cymbet Corporation • Tel: +1-763-633-1780 • www.cymbet.com
DS-72-34 V.20
Page 12 of 18