19c2daa00SOllivier Robert<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 29c2daa00SOllivier Robert<html> 39c2daa00SOllivier Robert<head> 4ea906c41SOllivier Robert<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 59c2daa00SOllivier Robert<meta name="generator" content="HTML Tidy, see www.w3.org"> 6*2b15cb3dSCy Schubert<title>Pulse-Per-Second (PPS) Signal Interfacing</title> 79c2daa00SOllivier Robert<link href="scripts/style.css" type="text/css" rel="stylesheet"> 89c2daa00SOllivier Robert</head> 99c2daa00SOllivier Robert<body> 10*2b15cb3dSCy Schubert<h3>Pulse-Per-Second (PPS) Signal Interfacing</h3> 119c2daa00SOllivier Robert<img src="pic/alice32.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> 129c2daa00SOllivier Robert<p>Alice is trying to find the PPS signal connector.</p> 13*2b15cb3dSCy Schubert<p>Last update: 14*2b15cb3dSCy Schubert <!-- #BeginDate format:En2m -->10-Mar-2014 05:17<!-- #EndDate --> 15*2b15cb3dSCy Schubert UTC</p> 169c2daa00SOllivier Robert<br clear="left"> 179c2daa00SOllivier Robert<h4>Related Links</h4> 18*2b15cb3dSCy Schubert<script type="text/javascript" language="javascript" src="scripts/misc.txt"></script> 19*2b15cb3dSCy Schubert<h4>Table of Contents</h4> 20*2b15cb3dSCy Schubert<ul> 21*2b15cb3dSCy Schubert <li class="inline"><a href="#intro">Introduction</a></li> 22*2b15cb3dSCy Schubert <li class="inline"><a href="#gadget">Gadget Box</a></li> 23*2b15cb3dSCy Schubert <li class="inline"><a href="#opsys">Operating System Support</a></li> 24*2b15cb3dSCy Schubert <li class="inline"><a href="#use">Using the Pulse-per-Second (PPS) Signal</a></li> 25*2b15cb3dSCy Schubert</ul> 269c2daa00SOllivier Robert<hr> 27*2b15cb3dSCy Schubert<h4 id="intro">Introduction</h4> 28*2b15cb3dSCy Schubert<p>Most radio clocks are connected using a serial port operating at speeds of 9600 bps. The accuracy using typical timecode formats, where the on-time epoch is indicated by a designated ASCII character such as carriage-return <tt><cr></tt>, is normally limited to 100 μs. Using carefully crafted averaging techniques, the NTP algorithms can whittle this down to a few tens of microseconds. However, some radios produce a pulse-per-second (PPS) signal which can be used to improve the accuracy to a few microseconds. This page describes the hardware and software necessary for NTP to use the PPS signal.</p> 29*2b15cb3dSCy Schubert<p> The PPS signal can be connected in either of two ways. On FreeBSD systems (with the PPS_SYNC and pps kernel options) it can be connected directly to the ACK pin of a parallel port. This is the preferred way, as it requires no additional hardware. Alternatively, it can be connected via the DCD pin of a serial port. However, the PPS signal levels are usually incompatible with the serial port interface signals. Note that NTP no longer supports connection via the RD pin of a serial port.</p> 30*2b15cb3dSCy Schubert<div align="center"> 31*2b15cb3dSCy Schubert <p><img src="pic/gadget.jpg" alt="gif"></p> 32*2b15cb3dSCy Schubert <p>A Gadget Box built by Chuck Hanavin</p> 33*2b15cb3dSCy Schubert</div> 34*2b15cb3dSCy Schubert<h4 id="gadget">Gadget Box</h4> 35*2b15cb3dSCy Schubert<p>The gadget box shown above is assembled in a 5"x3"x2" aluminum minibox containing the the circuitry, serial connector and optional 12-V power connector. A complete set of schematics, PCB artwork, drill templates can be obtained via the web from ftp.udel.edu as <a href="ftp://ftp.udel.edu/pub/ntp/hardware/gadget.tar.Z">gadget.tar.Z</a>.</p> 36*2b15cb3dSCy Schubert<p> The gadget box includes two subcircuits. One of these converts a TTL positive edge into a fixed-width pulse at EIA levels and is for use with a timecode receiver or precision oscillator with a TTL PPS output. The other converts the timecode modulation broadcast by Canadian time/frequency standard station CHU into a 300-bps serial character stream at EIA levels and is for use with the <a href="drivers/driver7.html">Radio CHU Audio Demodulator/Decoder</a> driver.</p> 37*2b15cb3dSCy Schubert<h4 id="opsys">Operating System Support</h4> 38*2b15cb3dSCy Schubert<p>Both the serial and parallel port connection require operating system support, which is available in a few operating systems, including FreeBSD, Linux (with PPSkit patch) and Solaris. Support on an experimental basis is available for several other systems, including SunOS and HP/Compaq/Digital Tru64. The kernel interface described on the <a href="kernpps.html">PPSAPI Interface for Precision Time Signals</a> page is the only interface currently supported. Older PPS interfaces based on the <tt>ppsclock</tt> and <tt>tty_clk</tt> streams modules are no longer supported. The interface consists of the <tt>timepps.h</tt> header file which is specific to each system. It is included automatically when the distribution is built.</p> 399c2daa00SOllivier Robert<h4>PPS Driver</h4> 40*2b15cb3dSCy Schubert<p>PPS support requires is built into some drivers, in particular the WWVB and NMEA drivers, and may be added to other drivers in future. Alternatively, the PPS driver described on the <a href="drivers/driver22.html">Type 22 PPS Clock Discipline</a> page can be used. It operates in conjunction with another source that provides seconds numbering. The selected source is designate a prefer peer, as using the <tt>prefer</tt> option, as described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. The prefer peer is ordinarily the radio clock that provides the PPS signal, but in principle another radio clock or even a remote Internet server could be designated preferred Note that the <tt>pps</tt> configuration command has been obsoleted by this driver.</p> 41*2b15cb3dSCy Schubert<h4 id="use">Using the Pulse-per-Second (PPS) Signal</h4> 42*2b15cb3dSCy Schubert<p>The PPS signal can be used in either of two ways, one using the NTP grooming and mitigation algorithms and the other using the kernel PPS signal support described in the <a href="kern.html">Kernel Model for Precision Timekeeping</a> page. The presence of kernel support is automatically detected during the NTP build process and supporting code automatically compiled. In either case, the PPS signal must be present and within nominal jitter and wander tolerances. In addition, the prefer peer must be a truechimer; that is, survive the sanity checks and intersection algorithm. Finally, the offset of the system clock relative to the prefer peer must be within ±0.5 s. The kernel maintains a watchdog timer for the PPS signal; if the signal has not been heard or is out of tolerance for more than some interval, currently two minutes, the kernel discipline is disabled and operation continues as if it were not present. </p> 43*2b15cb3dSCy Schubert<p> An option flag in the driver determines whether the NTP algorithms or kernel support is enabled (if available). For historical reasons, the NTP algorithms are selected by by default, since performance is generally better using older, slower systems. However, performance is generally better with kernl support using newer, faster systems.</p> 449c2daa00SOllivier Robert<hr> 459c2daa00SOllivier Robert<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> 469c2daa00SOllivier Robert</body> 479c2daa00SOllivier Robert</html> 48