1 = Pulse-Per-Second (PPS) Signal Interfacing
2 include::include-html.ad[]
4 [cols="10%,90%",frame="none",grid="none",style="verse"]
5 |==============================
6 |image:pic/alice32.gif[]|
7 {millshome}pictures.html[from 'Alice's Adventures in Wonderland', Lewis Carroll]
9 Alice is trying to find the PPS signal connector.
11 |==============================
15 include::includes/misc.adoc[]
19 * link:#intro[Introduction]
20 * link:#opsys[Operating System Support]
21 * link:#use[Using the Pulse-per-Second (PPS) Signal]
28 Most conventional time sources (radio clocks and GPSes) are connected
29 using a serial or USB port operating at speeds of 9600 bps. The
30 accuracy using typical clock-radio timecode formats, where the on-time
31 epoch is indicated by a designated ASCII character such as
32 carriage-return +<cr>+, is normally limited to 100 μs; NMEA streams
33 from GPSes have a similar limit. Some are worse; the SiRF line of
34 consumer-grade GPSes, for example, has a long-period wander of over
37 Using carefully crafted averaging techniques, the NTP algorithms can
38 whittle this down to a few tens of microseconds. However, some time
39 sources produce a pulse-per-second (PPS) signal which can be used to
40 improve the accuracy to a few microseconds. This page describes the
41 hardware and software necessary for ntpd to use the PPS signal.
43 The simplest way to collect a PPS signal is from a GPS over a serial
44 handshake pin, typically DCD; Linux supports this. On FreeBSD systems
45 (with the PPS_SYNC and pps kernel options) it can be connected
46 directly to the ACK pin of a parallel port. Clock radios are more
47 complicated; their PPS signal levels are usually incompatible with
48 serial port interface signals. Note that NTPsec no
49 longer supports connection via the RD pin of a serial port.
52 == Operating System Support
54 Both the serial and parallel port connection require operating system
55 support, which is available in a few operating systems, including
56 FreeBSD, Linux, and Solaris. The kernel interface described on the
57 link:kernpps.html[PPSAPI Interface for Precision Time Signals] page is
58 the only interface currently supported. Older PPS interfaces based on
59 the +ppsclock+ and +tty_clk+ streams modules are no longer supported.
60 The interface consists of the +timepps.h+ header file, which should be
61 in the /usr/include/ or /usr/include/sys directory of your file
66 PPS support is built into some drivers, in particular the NMEA
67 driver, and may be added to other drivers in future. Alternatively,
68 the PPS driver described on the link:driver_pps.html[PPS Clock
69 Discipline] page can be used. It operates in conjunction with another
70 source that provides seconds numbering. The selected source is
71 designated as a 'prefer peer' using the +prefer+ option, as described on
72 the link:prefer.html[Mitigation Rules and the +prefer+ Keyword]
73 page. The prefer peer is ordinarily the radio clock that provides the
74 PPS signal, but in principle another radio clock or even a remote
75 Internet server could be designated preferred. Note that the +pps+
76 configuration command has been obsoleted by this driver.
79 == Using the Pulse-per-Second (PPS) Signal
81 The PPS signal can be used in three ways: using the NTP
82 grooming and mitigation algorithms, or using the kernel PPS
83 signal support described in the link:kern.html[Kernel Model for
84 Precision Timekeeping] page, or via the shared-memory interface. The presence
85 of kernel support is automatically detected during the NTP build process and
86 supporting code automatically compiled. Regardles of mechanism, the PPS signal
87 must be present and within nominal jitter and wander tolerances. Additionally,
88 the prefer peer must be a truechimer; that is, survive the sanity checks and
89 intersection algorithm. Finally, the offset of the system clock relative
90 to the prefer peer must be within ±0.4 s. The kernel maintains a
91 watchdog timer for the PPS signal; if the signal has not been heard or
92 is out of tolerance for more than some interval, currently two minutes,
93 the kernel discipline is disabled and operation continues as if it were
96 An option flag in the driver determines whether the NTP algorithms, the
97 kernel support, or the shared-memory interface is enabled (depending upon
98 availability). For historical reasons, the NTP algorithms are selected by
99 default, since performance is generally better when using older, slower
100 systems. However, performance is generally better with kernel support or
101 shared-memory support when using newer, faster systems.
105 include::includes/footer.adoc[]