MAXIM INTEGRATED PRODUCTS
Evaluating the Accuracy of Maxim Real-Time Clocks (RTCs)时钟
Application Note 632: Aug 01, 2001
Evaluating the Accuracy of Maxim Real-Time Clocks (RTCs)
This app note describes methods for measuring the accuracy of the Maxim Real-Time
Clocks (RTCs) using available accurate time sources and the Maxim evaluation kits.
Evaluating the accuracy of Maxim real-time clocks (RTCs) can be simplified using the modern
personal computer (PC), an Internet connection, and RTC evaluation software. Whether you
use a Maxim evaluation kit and its associated software to evaluate the accuracy of a Maxim
real-time clock, or use your own software and hardware configuration, you can take advantage
of the easy methods presented here for long-term accuracy testing of RTCs.
RTC Evaluation Software
Figure 1 shows the main screen of typical Maxim RTC evaluation software. The "offset 1 sec"
in the current-time display section of the screen is computed as offset = RTC time - PC time.
This is now an easy and convenient way to keep track of the difference between the RTC time
and PC time and thus allows for long-term accuracy testing of the RTC.
When reading the RTC, the timekeeping registers are latched during a burst read. Even though
the RTC evaluation software reads the timekeeping registers approximately four times per
second, the best guaranteed resolution is 1 second, as all four reads could happen inside of a 1-
second update. Therefore, an initial offset calculation of ±1 second is within the resolution of
the setup when testing for long-term RTC accuracy.
The only issue now is the accuracy of the standard that the RTC time is being compared
against, the PC clock.
Page 1 of 8
Figure 1: The main screen of typical Maxim RTC evaluation software
PC Time Accuracy
As most of us know, PC clocks are not particularly good at keeping accurate time. Simple
clocks like a wristwatch and most of the clocks in your home keep better time than a standard
Each PC contains two clocks. Although they are known by several different names, we will call
them the "hardware clock" and the "software clock." The software clock runs when the PC is
turned on and stops when the PC is turned off. The hardware clock uses a backup battery and
continues to run even when the PC is turned off.
An Intel 8254 timer-counter (or functionally equivalent device) generates the software clock.
This timer-counter generates an interrupt every 54.936 milliseconds, or about 18.2 times per
second. The PC BIOS (basic input output system) contains a software routine that counts the
interrupt requests and generates a time-of-day clock that can be read or set by other software
programs. For example, the operating system might use the time-of-day information from the
software clock to date and stamp files.
The software clock is a poor timekeeper. Any change in the interrupt-request rates causes the
clock to gain or lose time. If the PC is left on for long periods of time, the software clock can
be off by large amounts. A minute or more per day that the PC was left on is not an uncommon
error rate. It is also possible for an ill-behaved software program to use the timer-counter for
another purpose and change the interrupt rate. This could cause the software clock to rapidly
gain or lose time.
When the PC is turned off, the software clock stops running and loses all of its time-of-day
information. For this reason, a hardware clock is also necessary. The hardware clock is either a
separate real-time clock or a RTC function integrated into the PC's chipset. The hardware clock
Page 2 of 8
is updated once per second and does not resolve to fractions of a second. Its timing accuracy is
determined by the quality of the crystal oscillator it uses as its time base. A typical crystal
usually is less than $1 in single quantities, with an initial frequency error of greater than
±20ppm, which will translate to greater than ±1.7 seconds per day. In actual operation, with
temperature effects included, most hardware clocks gain or lose 5 to 15 seconds per day.
When the PC is turned off, the hardware clock runs from a battery. When the computer is
turned back on, the software clock starts running again and sets itself (within 1 second) to the
hardware clock. Although the hardware and software clocks are synchronized at power-up, they
run at different rates and will gain or lose time relative to each other while the computer is
As you can see, neither the software nor the hardware PC clock is suitable as an accurate
timekeeping reference. Fortunately, there are easy ways to solve this PC timekeeping accuracy
problem. One of the easiest is to synchronize the PC clock to an Internet service.
Internet Time-Setting Services
If your PC is connected to the Internet, you can synchronize its clock to an Internet time server.
The process requires an active Internet connection and client software.
Internet time servers use several standard timing protocols. The major three are Time Protocol,
Daytime Protocol, and Network Time Protocol (NTP). The time servers are continually
listening for timing requests sent using any of these protocols. When the server receives a
request, it sends time to your computer in the appropriate format. The protocol depends upon
the type of client software used. Most client software requests that the time be sent using either
the Daytime Protocol or NTP. Client software that uses the Simple Network Time Protocol
(SNTP) makes the same timing request as an NTP client, but does less processing and provides
less accuracy. Table 1 summarizes the protocols and their port assignments.
Page 3 of 8
Table 1. Internet Time Protocols
Unformatted 32-bit binary number contains time
in UTC seconds since January 1, 1900.
Exact format not specified in standard. The only
requirement is that time code is sent as standard
The server provides a data packet that includes a
64-bit time stamp containing the time in UTC
seconds since January 1, 1900, with a resolution
RFC-1305 of 200 picoseconds. NTP provides accuracy of 1
to 50 milliseconds. NTP client software
normally runs continuously and gets periodic
updates from the server.
The data packet sent by the server is the same as
NTP, but the client software does less
processing and provides less accuracy.
NIST (National Institute of Standards and Technology) operates an Internet Time Service from
Boulder, Colorado, using multiple servers distributed around the country. The NIST servers
distribute time using the Time, Daytime, and NTP formats.
For a current list of IP addresses for the NIST servers and sample client software (Daytime
Protocol) that can be downloaded see the following:
NIST also maintains a listing of other client software packages for a variety of computers at:
UTC and NIST Time
Coordinated Universal Time (UTC) is a stable reference frequency used for counting seconds.
The frequency, or rate, of UTC is computed by the International Bureau of Weights and
Measures (BIPM), based near Paris, France. The BIPM uses a weighted average from about
250 atomic clocks located in about 50 national laboratories to construct a time scale called
International Atomic Time (TAI). Once TAI is corrected for leap seconds, it becomes UTC, or
the official world time scale. NIST distributes a real-time version of UTC called UTC(NIST), a
time scale referenced to atomic oscillators located in Boulder, Colorado, to the public through
their time and frequency services. At its source, UTC(NIST) is kept in as close agreement as
possible with other national and international standards (typically within a few nanoseconds).
Page 4 of 8
Other Accurate Time Alternatives
If your computer is not connected to the Internet, NIST also provides Dial-Up Time Setting
Service through a standard telephone line and analog modem. This service is called Automated
Computer Time Service (ACTS). With calibration, ACTS can set a computer clock with an
uncertainty of less than 10 milliseconds.
For more information about ACTS and to obtain software, see the following:
Alternately, you can get accurate time, all the time, by using a radio clock. Some are stand-
alone devices with a digital time display. These can often be interfaced to the PC with a serial
connection. For a list of radio clock manufacturers, see the following:
A last alternative for calibrating your PC clock, and the least desirable in terms of ease of use,
is to use a regular voice phone line service to check the current accurate time. Such a service is
provided by the Time Service Department, U.S. Naval Observatory, Washington, D.C. The
Land Line Voice Time, without delay, is 900-410-TIME (50 cents the first minute, 45 cents a
minute thereafter). NIST time can be accessed over the voice phone line at (303) 499-7111.
NISTIME 32: 32-Bit TCP Time Client
The main screen for the NIST TCP Time Client is shown in Figure 2. Selecting the Now option
in the Query Server drop-down menu will cause the current NIST time to be obtained and the
difference between the PC clock and NIST time computed, as shown in Figure 3. Clicking on
OK performs an adjustment of the PC clock to match NIST time. A verification of adjustment
then appears, as in Figure 4. Clicking on OK will remove this screen and return control to the
main screen for the NISTIME 32. If you are performing several cycles of calibration to reduce
the PC clock error in comparison to the NIST standard, you will need to wait between
calibrations until the message in the main screen changes from "No server selected" to a line
typically like "Server 2 selected using tcp port 13." At that time, another calibration can be
Figure 2. NISTIME 32 main screen
Page 5 of 8