[ntp:questions] Fwd: Re: NetBSD GPS/PPS using 4.2.6p3

Dave Hart davehart at gmail.com
Tue Aug 23 17:37:32 UTC 2011

On Tue, Aug 23, 2011 at 13:02, Thomas Laus <lausts at acm.org> wrote:
> The capture / assert configuration options does
> not select reading the leading or trailing edge of a PPS pulse, NTP
> only reads timestamps to the on the leading edge and you may require
> an inverter to swap polatity for NetBSD to read and sync to your PPS
> pulse.

Actually, fudge flag2 does determine whether ntpd refclocks using the
common PPSAPI code (such as the atom/PPS, NMEA, and WWVB drivers)
request timestamps for the assert or clear transition.  See
ntp_refclock.c refclock_params():

	 * Solaris serial ports provide PPS pulse capture only on the
	 * assert edge. FreeBSD serial ports provide capture on the
	 * clear edge, while FreeBSD parallel ports provide capture
	 * on the assert edge. Your mileage may vary.
	if (mode & CLK_FLAG2)
		ap->pps_params.mode = PPS_TSFMT_TSPEC | PPS_CAPTURECLEAR;
		ap->pps_params.mode = PPS_TSFMT_TSPEC | PPS_CAPTUREASSERT;
	if (time_pps_setparams(ap->handle, &ap->pps_params) < 0) {
		    "refclock_params: time_pps_setparams: %m");
		return (0);

As the comment notes, not all PPSAPI implementations can actually
timestamp either edge.  So it's not a limitation of ntpd, but of
NetBSD's timepps.h, in your case.

Dave Hart

More information about the questions mailing list