Pulse-per-second (PPS) Signal Interfacing


Some radio clocks and related timekeeping gear have a pulse-per- second (PPS) signal that can be used to discipline the local clock oscillator to a high degree of precision, typically to the order less than 50 us in time and 0.1 ppm in frequency. The PPS signal can be connected in either of two ways, either via the data leads of a serial port or via the modem control leads. Either way requires conversion of the PPS signal, usually at TTL levels, to RS232 levels, which can be done using a circuit such as described in the ./gadget directory of the xntp3 distribution.

The data leads interface requires regenerating the PPS pulse and converting to RS232 signal levels, so that the pulse looks like a legitimate ASCII character. The tty_clk module in the ./kernel directory inserts a timestamp following this character in the input data stream. The driver uses this timestamp to determine the time of arrival of the PPS pulse to within 26 us at 38.4 kbps while eliminating error due to operating system queues and service times. In order to use the tty_clk module, the xntp3 distribution must be compiled with CLK defined.

The modem control leads interface requires converting to RS232 levels and connecting to the carrier detect (CD) lead of a serial port. The ppsclock streams module in the ./ppsclock directory is used to capture a timestamp upon transition of the PPS signal. The driver reads the latest timestamp with a designated ioctl() system call to determine the time of arrival of the PPS pulse to within a few tens of microseconds. In order to use the ppsclock module, the xntp3 distribution must be compiled with PPS defined.

Both of these mechanisms are supported by the ATOM_PPS reference clock driver described in Appendix A. This driver is ordinarily used in conjunction with another clock driver that supports the radio clock that produces the PPS pulse. This driver furnishes the coarse timecode used to disambiguate the seconds numbering of the PPS pulse itself. The NTP daemon mitigates between the radio clock driver and ATOM_PPS driver as described in Appendix B in order to provide the most accurate time, while respecting the various types of equipment failures that could happen.

For the utmost time quality, a number of Unix system kernel modifications can be made as described in the README.magic and README.kernel files. Specifically, the ppsclock module can be used to interface the PPS signal directly to the kernel for use as discipline sources for both time and frequency. These sources can be separately enabled and monitored using the ntp_adjtime() system call described in README.kernel and the ./include/sys/timex.h header file in the xntp3 distribution. In order to use the kernel PPS signal, the xntp3 distribution must be compiled with KERNEL_PLL defined.

In some configurations may have multiple radio clocks, each with PPS outputs, as well as a kernel modified to use the PPS signal. In order to provide the highest degree of redundancy and survivability, the kernel PPS discipline, tty_clk module and ppsclock module may all be in use at the same time, each backing up the other. The sometimes complicated mitigation rules are described in Appendix B.


David L. Mills (mills@udel.edu)