[ntp:questions] Re: Looking for time sync hardware supported under Linux for under $400?

Terje Mathisen terje.mathisen at hda.hydro.com
Wed Jan 18 13:39:53 UTC 2006


Hal Murray wrote:

> [Context is Garmin GPS-18LVC]
> 
> 
>>You will need to shift the levels;  RS232 uses both positive and 
>>negative voltages for signaling.  I believe that there is a chip that 
>>will convert TTL to RS232 levels.  I vaguely recall a number like MC1447 
>>but that's just a vague recollection; get the facts before you spend 
>>your money!  You will, of course, need both positive and negative supply 
>>voltages; I think +/- 12VDC will get the job done and you might even get 
>>away with +/- 5VDC.
> 
> 
> Beware.  The normal RS-232 level shifting chips include an inverter.
> The signal coming out of the Garmin GPS-18LVC is right side up.  If
> you add the level shifting chip you will have to add an inverter to
> undo the inversion you don't want.
> 
> But why bother.  Just plug it in.  It won't have as much noise
> rejection as real RS-232 but it will work fine unless you need
> a long cable.  (If you need a long cable you have other problems
> to worry about.)
> 
> Mine is working fine.

So is mine!

Here's a copy of the howto post I made previously:

Date: Fri, 25 Nov 2005 13:27:36 +0100
From: Terje Mathisen <terje.mathisen at hda.hydro.com>
Newsgroups: comp.protocols.time.ntp
Subject: Garmin gps18: The best DIY gps refclock?

I decided to look into this interesting unit, both due the the low
price, and the fact that nearly all my other refclocks are Motorola Oncores.

The gps18lvc is an OEM model of the Garmin 12-channel/WAAS receiver,
packed together with an antenna into a small puck device. The PPS signal
is specified as "< 1 us", which means that the stability of the server
system clock will determine the actual performance.

At the other end of the (default) 3 m cable there's just a set of
colour-coded wires, carrying rs232-level send/receive/ground & pps
signals, as well as a pair of (slightly thicker) red/black power supply
wires.

I got the gps in a couple of days from a local distributor here in Oslo,
and picked up a 9-pin female rs232 connector with housing and a 1 m
small-size USB cable: Total cost was less than 1000 NOK, in the US I'm
guessing you could get the same for approx $100.

(Google... Yes, it seems like the gps itself is available for about $80!)

I then cut the USB cable and identified the +5V power wires (also
red/black coded!), I cut off the USB signaling wires with a small offset
between them to avoid any risk of a short circuit.

The only remaining task was to solder the signaling wires onto the rs232
connector:

pin 	signal	colour
----------------------
1	PPS	yellow
2	TX	white
3	RX	green
5	GND	black

and join the remaining red/black wires to the corresponding pair from
the USB cable.

After wrapping some electician's tape for insulation around the power
lead joins, I carefully fit everthing inside the 9-pin rs232 cap and
closed it up.

Total time was less than 2 hours, including the trip to pick up the
parts, and it worked immediately:


>>ntpq -c rv -p ntp1

assID=0 status=0464 leap_none, sync_uhf_clock, 6 events,
event_peer/strat_chg,
version="ntpd 4.2.0b at 1.1431-o Fri Nov 11 11:38:18 UTC 2005 (2)"?,
processor="i386", system="FreeBSD/6.0-RELEASE", leap=00, stratum=1,
precision=-19, rootdelay=0.000, rootdispersion=0.298, peer=9366,
refid=GPS, reftime=c7302007.2b87bce7  Thu, Nov 24 2005 12:18:31.170,
poll=4, clock=0xc730200a.a6e567d2, state=4, offset=0.010,
frequency=29.775, jitter=0.002, noise=0.002, stability=0.000, tai=0
  remote        refid   st t when poll reach delay offset jitter
================================================================
+ntp9.hda.hydro. .GPS.  1 u    2   16  377  0.625   0.023  0.006
-nontp1.hydroisp 136.15 2 u   34   64  377  1.523   0.560  0.287
+nontp2.hydroisp .GPS.  1 u   33   64  377  1.608   0.401  0.092
-nontp4.hydroisp 136.15 2 u   25   64  377  4.424  -0.212  0.975
-nontp5.hydroisp 163.34 2 u   20   64  377  4.446   0.292  1.751
-nontp8.hydroisp .GPS.  1 u    4   64  377  8.628   0.511  8.086
*GPS_NMEA(0)     .GPS.  0 l    3   16  377  0.000   0.010  0.002

I'm currently gathering clockstats info on the unit, my current
guesstimate would be something like ~5 us RMS time offset.

I used Garmin's SNSRCFG_280.exe program to setup the gps to work in NMEA
mode, sending out the most common time/position reports (including
GPRMC, which is preferred by the ntpd NMEA driver) once per second.

Using a spare USB plug as the power supply is a particularly nice
option, since any PC used as an ntpd server these days will have at
least one such port available!

Terje

-- 
- <Terje.Mathisen at hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"




More information about the questions mailing list