Sign in

How can I compare two clock signals for synchronization and drift between them?


There are several ways to compare two clock signals in a capture. However, before going further, it is recommended to review the worst case channel to channel skew introduced by the logic analyzer recording: What is the worst case channel to channel skew?

There are several ways to compare two clock signals.

Visual Inspection First, if you are looking at a relatively small number of clocks, say less than one dozen, then you could easily visually verify their alignment. In this case, just use one of the timing markers to help visually verify that the clock edges are aligned. Please be sure that you are zoomed in enough to see any variation in time between the two edges. For the highest accuracy recording, try to sample at the fastest digital sample rate possible, and disable unused channels when possible. Zoom all the way in to the capture using either the mouse wheel or the up/down arrow keys.

Quick Measurement Based Verification In the more likely case, a large number of clock cycles will need to be compared. There are several ways to do this. First, if you wish to perform quick, basic tests, you can use the measurement annotation feature of the software to count total clock cycles and measure average frequency and duty cycle over a range of time for a specific channel. Try placing two measurements, one on each channel in question, over identical time ranges. Then enable the calculations for average frequency, average duty cycle, and complete periods. You can add a measurement using the (M) key on the keyboard, and then click twice - once over the channel at the start time, and again on the same channel at the end time. You can edit the active measurements by right-clicking the measurement.

Excel Based Analysis To Measure the drift of each clock edge pair individually and produce statistics over a range of time, use the export data feature in the software. You will want to export 2 files. Each will contain all of the time stamped transitions from one channel.

  • First, place a timing marker pair around the region you would like to compare, if you do not wish to compare the two channels over the entire capture.
  • Then, to create the first CSV file, open the main options menu and select Export Data.
  • Change the "Channels to Export" from "Export all channels" to "Chose which channels to export"
  • In the newly displayed list box, right click and select "De-select all"
  • Select only the first channel you would like to compare.
  • If you wish to only export between the timing markers, change the "Samples to Export" from "All time" to "Between Timing Markers: A1 - A2"
  • Leave the "Export Format" set to "CSV"
  • The CSV settings may vary if your capture contained an analog channel. This will not matter, and skip any settings that are not available Use the following CSV settings: Include column headings Comma delimited Use timestamps [s] Output one column for every bit Output one row per change
  • Select export and save to a csv file named Channel1.csv or similar.
  • Repeat the process for the second channel.

Now you should have two csv files which you can open in excel, containing the precise time stamp for every transition. There are many different methods for making comparisons between these files, but initially you will need to copy-paste the contents of one file into the other. You may want to copy the second file into new rows in the first file, or you may want to paste the contents into the same rows, at the bottom of the first file, most likely moving the transition data into a new column but leaving the timestamps in the first column. This will allow you to sort by time stamp. From there, you can use excel formulas to calculate the magnitude of the difference in time between the transitions on the two channels. Note, if the two clock signals are at different frequencies, or if one channel skips transitions or is in general out of sync with the other, more advanced excel analysis will be required. Feel free to contact us for advice.

trello ID: 55f0ec2ac2f7b3b0cbe32c4e
Have more questions? Submit a request


Powered by Zendesk