Electronic – How create a high precision clock in an FPGA

fpgajitteroscillatortime

FPGAs can easily run at 100 to 500 MHz and create time resolutions of 10 to 2 ns. That frequency can be used to create timestamp counters, which are in turn used to create very fine grained time measurements / timestamps for profiling.

However, these counters rely on an external oscillator and sometimes also on internal clock modification blocks (CMBs like PLL, MMCM, …). External oscillators have a precision or jitter of 50 (20) ppm at 100 Mhz reference frequency. This gives a possible time error of 50 us per 1 second.

In a customer's system, multiple FPGA boards are coupled via Ethernet and PTP (Precision Time Protocol). One board acts as a server, the others as slaves. PTP can synchronize 2 stations within 10 ns accuracy, whereas the FPGA based master and slaves can not hold the time precision between PTP updates.

Is there any way to increase the timestamp counter accuracy in an FPGA (Zynq UltraScale+) to below 10 us?

Is it possible to measure time drifts (wander) and adjust the timestamp counter?

Best Answer

You can get better oscillators: reasonably cheap temperature-compensated crystal oscillators (TCXO) can reach 1 PPM.

Some TCXO can be steered with a control voltage (a VCTCXO). You can count the clock cycles of your TCXO with the FPGA and discipline it to a GPS 1PPS signal or PTP. You will have to figure out a good feedback law between the count minus the PTP value and the control voltage. The response time of the loop must be picked wisely.

There is an open-source design from CERN using that method. Checkout page 2 on the schematics