Embedded systems are dedicated micro-computers, designed to perform specific tasks within a larger system. Temporal synchronization of these devices within the system is an important issue; different clocks oscillate at different frequencies, creating offsets between time signatures of data packets, sub-optimal system operation and possible errors in programs. Time offsets between devices within the network must be constantly corrected to maintain a desirable accuracy. In this work, we have implemented three widely used time synchronization methods on the Beaglebone Black development platform.
Network Time Protocol (NTP) is the oldest and most widely spread protocol for synchronization of network clocks, with a large global network of Internet servers for reference time access. Clients periodically query servers within a local network or on the Internet for time and using the synchronization algorithm apply a correction of time to the local system's clock.
Precision Time Protocol (PTP) can ensure very high synchronization accuracy within the local network. With proper hardware and connections between devices, the clock offset can be reduced to below one microsecond. It can also automatically establish a hierarchy of clocks within a network and react to changes in the network structure, but does not support queries over the world wide web.
Global Positioning System (GPS) transmits position and time data from a satellite network to receivers on Earth. Devices with such receivers can synchronize their clocks to GPS time, without having to be connected to a network. However, the quality of this method depends on the strength of the received satellite signal.
Synchronization accuracy, as well as accuracy of programs that depend on system clock, can be also affected by configuration of the network, other running programs, and other factors. We were interested specifically in the offset between programs that trigger signals at specific time on separate devices. Selected methods are compared based on performance in tests using an example device driver dependent on system clock.