Using the DS87C530/DS5250 Real

[09-13 17:03:26]   来源:http://www.88dzw.com  控制技术   阅读:8357

文章摘要:Although the DS87C530 RTC is designed to oscillate at exactly 32.768kHz, variations in the device, crystal, temperature, and board layout can produce minor timing variations. By adjusting the RTC Trim Bits located in the RTC Trim Register (TRIM;96h), the internal capacitance of the RTC circuitry can

Using the DS87C530/DS5250 Real,标签:计算机控制技术,工厂电气控制技术,http://www.88dzw.com
Although the DS87C530 RTC is designed to oscillate at exactly 32.768kHz, variations in the device, crystal, temperature, and board layout can produce minor timing variations. By adjusting the RTC Trim Bits located in the RTC Trim Register (TRIM;96h), the internal capacitance of the RTC circuitry can be slightly adjusted to improve timing accuracy beyond the minimum specified. Although the trim bits do not correspond to an absolute value of capacitance or frequency shift, they provide a relative adjustment.

Please note that under normal circumstances, adjusting the RTC Trim Bits is not necessary. Upon a no-battery reset, the DS87C530 will reset its internal capacitance to a default value which will guarantee the minimum accuracy specified. If you do not require accuracy better than 2 minutes per month, please skip this section.

To aid the user in determining the true frequency of the RTC, a 4096Hz signal derived from the 32.768kHz crystal is available on the P1.7 pin by setting the E4K bit (TRIM.7). This can be measured with a frequency counter to determine the RTC frequency. Do not attempt to measure the frequency of the RTC at the leads of the crystal. The capacitance of oscilloscope probes will distort the operation of the crystal and report erroneous values. The error of the RTC in minutes per month can be calculated from the following formula:

(P1.7 Frequency - 4096.000Hz)*(10.547) [minutes/month]

Note that this error is calculated at a specific temperature and voltage. Crystal characteristics change over temperature, and the designer is advised to characterize the error over the system's range of expected operating conditions.

The trim register features extensive protection to avoid accidental corruption. All of the bits of the trim register require a Timed Access procedure to modify them. In addition, writes to the trim register must be done in complementary pairs. Each of the three trim bits has a complement bit which must be set simultaneously. This is to ensure that any writes to the TRIM register are intentional. If an invalid bit sequence is written to the trim bits, the TRIM register will reset to 0x100101 binary. This is the no-battery reset value, except that the X12/6 bit will remain unchanged. The settings of the TRIM bits do not correspond to an absolute value of capacitance or frequency, and are only used to provide a relative adjustment.

To adjust the RTC trim bits, place the device into the target system with the selected crystal and remove any sources of loading from P1.7. Then attach a frequency counter to P1.7 and perform the following procedure.
  1. Perform a Timed Access procedure
  2. Set TRIM.7, E4K, and modify the TRMx bits, writing their complements to the TRMx bits in the same instruction. This will enable the external 4096Hz signal on P1.7.
  3. Record the frequency
  4. Repeat steps 1-3 eight times until all combinations of TRM0, TRM1, TRM2 have been measured.
After all the measurements have been taken, the measurement closest to 4096.00Hz is the most accurate setting of the TRMx bits. Program this value into the TRIM register for the maximum accuracy. An example program is provided below.

Program Example: RTC Calibration

The following program example is provided to assist system designers in calibrating their RTC for maximum accuracy. It demonstrates how to set the RTC trim bits and pause the program to allow time to read the frequency output on P1.7.

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  下一页


Tag:控制技术计算机控制技术,工厂电气控制技术控制技术

《Using the DS87C530/DS5250 Real》相关文章