English
Language : 

DS80C320-MCG Datasheet, PDF (162/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
CALIBRATING THE RTC OSCILLATOR
Although the DS87C530 RTC accuracy is guaranteed for ± 2 minutes per month, users may occasionally
require greater accuracy. The RTC incorporates the ability to adjust the internal capacitance of the crystal
amplifier via the RTC Trim Bits (TRM2-0 and TRM2 - 0 ). This allows the user to more accurately match
the capacitance of the crystal amplifier to the crystal. Note that under most circumstances no adjustment
of the RTC crystal capacitance is necessary, as it will default to a minimum accuracy of ± 2 minutes per
month.
All of the crystal capacitance controls are located in the RTC Trim register (TRIM;96h). Setting the E4K
bit will enable the output of a 4096 Hz signal on P1.7. This signal is derived from a divide by 8 of the
32.768 kHz crystal. Because this is directly generated from the RTC, it can be used to determine the
actual frequency of the RTC. By adjusting the value of the TRMx bits, the internal capacitance of the
RTC can be varied, slightly slowing or speeding up the RTC frequency. The combination of TRMx bits
(TRIM.5–0) that causes the output on pin P1.7 to most closely approximate 4096 Hz will provide the
most accurate setting of RTC capacitance.
As a precaution against accidental corruption of the oscillator trim bit settings, the TRMx bits must be
programmed in the same instruction to the inverse of their respective TRMx bits. For example, if a trim
bit setting of 5 (101) was desired, the TRMx bits should be set to 2 (010). An illegal combination will
automatically reset the TRIM register to 0x100101b. This will disable the E4K signal on P1.7, but leave
the X12/6 bit unmodified.
More information on calibrating the RTC oscillator for improved accuracy is located in Application Note
79, Using the DS87C530 Real Time Clock.
162 of 175