A common problem while designing embedded systems is the inaccuracy of the clocks of the microcontrollers used in the given system. This problem becomes especially important in the case of designing certain distributed systems, where the nodes in the system collect such information, that the exact time in which the information was acquired is crucial to the evaluation of the collected data. As a result, to build such systems, it is essential to synchronize the clocks of the devices in some way.
The aim of this thesis is to give an overview on the topic of clock synchronization, and on the principle of operation of the most widely used clock synchronization protocols for the reader. Furthermore, it shows the steps for implementing an Ethernet-based synchronously sampling data acquisition system using the Precision Time Protocol.
In this thesis, the necessity of clock synchronization is shown through the concept of a use case, namely the sound based localization. After this, the thesis presents the various timekeeping methods that are used in the world today, and besides that, two popular clock synchronization protocols, the Network Time Protocol and the Precision Time Protocol – the latter was used in the implemented system - are also shown.
Additionally, the devices, that were used to create the system, are introduced, and after that the process of building the system is shown step-by-step. During this process I first made a ported version from an already existing Precision Time Protocol implementation for the development environment I was using, then using this I implemented the program used for the data sampling. Lastly, the computer application for processing and displaying the collected data is reviewed.
Finally, at the end of my thesis, the measurements performed on the completed system are presented, and based on the results of these measurements, the accuracy of the system is specified. Then, by taking this accuracy into consideration, the possible use cases and future development options for the implemented synchronous data acquisition system are discussed.