Analog Dialogue 43-11, November (2009) 1
Synchronizing Device Clocks
Using IEEE 1588 and Blackn
Embedded Processors
By Jiang Wu and Robert Peloquin
Introduction
The IEEE 1588 standard, introduced in 2002, denes a protocol
to synchronize distributed clocks on a network. It is becoming
the preferred clock synchronization method for many different
applications, including test and measurement, telecommunications,
and multimedia streaming. This standardized method for
synchronizing clocks is cost-effective, supports heterogeneous
systems, and provides nanosecond-level synchronization precision.
This article provides an introduction to both the original IEEE
1588-2002 standard and the enhancements incorporated as part
of the updated IEEE 1588-2008 version. Dedicated hardware
support for IEEE 1588 has been integrated into the ADSP-BF518
1
Blackfin
®
embedded processor because of the increasing
importance of IEEE 1588 in some of its targeted applications. An
overview of its capabilities is provided, followed by an example
showing clock synchronization performance results obtained by
an ADSP-BF518 processor solution.
What Time Is It?
It is common for a system to need to maintain its own sense of time
using a local oscillator. Figure 1 shows how hardware and software
combine to generate time information within a system.
SOFTWARE
APPLICATION HARDWARE
CLOCK OUTPUT
LOCAL TIME SYSTEM
NUMBER OF
PULSES
H:M:S TIME
APPLICATION
DIVIDER
COUNTEROSCILLATOR
FREQUENCY
CONVERSION
TIME
HOUR:MIN:SEC
EPOCH
HARDWARE
APPLICATION SOFTWARE
API FUNCTIONS
Figure 1. Local timekeeping.
This time information can be used by both hardware and software
resources within the system. In hardware, one or more physical
clock signals (clock outputs) are derived from the oscillator’s clock
and can be used to drive or trigger other parts of the system. The
time maintained in software is typically referred to as system time.
The system time can be represented in the form of numbers of clock
pulses or in second/nanosecond notation. The system software
derives the time from the number of oscillator clock pulses and
its frequency information, and provides application-programming-
interface (API) functions that other parts of the software use to
retrieve and set the time. If an absolute time is desired, the provided
time is associated with a predened epoch, which identies a
reference point in time.
Synchronize Your Watches
Many applications require two independent devices to operate in
a synchronized fashion. If each device were to rely solely on its
own oscillator, differences between the specic characteristics
www.analog.com/analogdialogue
and operating conditions of the individual oscillators would limit
the ability of the clocks to operate synchronously. Some possible
simplistic solutions to address these limitations include:
• All the devices could use a single physical oscillator. This is only feasible
for distributed systems in close proximity; a high-frequency clock
signal cannot be reliably delivered over a long distance.
• All the devices could utilize oscillators with nearly identical
characteristics. This approach is impractical due to the difculty
of acquiring nearly identical oscillators and keeping them from
drifting apart over time. More importantly, each oscillator will
be subjected to different operating conditions.
• If all the devices are interconnected via a communications network
such as Ethernet, they can dynamically adjust their individual clocks
to a single “master” clock by exchanging time messages over the
network. With network time protocol (NTP), the traditional time
synchronization protocol, every device in the system adjusts
its clock according to the time information it retrieves from
an NTP time server. However, this protocol can only achieve
synchronization accuracy on the order of milliseconds.
IEEE 1588 denes a newer protocol capable of nanosecond
synchronization accuracy. How it can achieve this level of clock
synchronization is discussed in the following sections.
What IEEE 1588 Does
The IEEE 1588 standard denes a protocol for time-synchronizing
devices that are geographically dispersed but interconnected by
some form of communications technology, for example, Ethernet.
By exchanging timing messages between devices they can maintain
the same absolute system time, which is represented in seconds
and nanoseconds.
An intuitive way to achieve this goal is for one device, which has
the “best” (most accurate) clock, and is designated as the master-
clock device, to broadcast its time to the other devices. The other
dev ices will adjust their times to match t he t ime sent by t he master
clock. This solution has several limitations, though:
1. The master-clock device cannot broadcast the time at
innitesimal intervals, so the “slave” clock devices have to use
their own independent and “inferior” oscillators to interpolate
the time points between two broadcasts from the master-clock
device. This results in degraded synchronization during the
time between updates from the master clock.
2. Delays inevitably exist on the broadcast path, with magnitudes
depending on the communications technology—the time that
a physical signal takes to travel along a wire from one device to
another, for example. This delay results in an additional offset
between the master clock and each slave clock.
3. Differences among the broadcast paths between the master-
clock device and each slave-clock device will further degrade
the synchronization between individual slave-clock devices.
IEEE 1588 species a protocol that solves the second and third
problems by measuring path delay. It also allows the slave clock
to be adjusted to match the master clock’s pace so as to mitigate
the rst problem. Where possible, the rst problem can be
further reduced by using smaller broadcasting intervals and
higher-quality oscillators.
How IEEE 1588 Measures Communication Delay
IEEE 1588-2002
2
defines four messages to measure the
communication delay of the forward (master to slave) and
backward (slave to master) paths: Sync, Followup, DelayReq, and
DelayResp. The newer version, IEEE 1588-2008,
3
prov ides further
mechanisms to measure the peer-to-peer delay with three additional
messages: PdelayReq, PdelayResp, and PdelayRespFollowup.