Subject: Re: setting up serial port for GPS NTP source
To: None <netbsd-help@netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: netbsd-help
Date: 08/23/2000 10:31:12
D.Thomas@imb.uq.edu.au (Danny Thomas) writes:
> 2) I tried changing the speed of the com port without success
>      www2# stty -f /dev/tty01 speed 4800

In general you need to get the program that is using tty01 to change
the speed.  The speed reverts back to the default speed on the last
close of the tty line, which in your example is when stty exits.

If you really want to hack around, you *might* be able to change the
speed using stty after your program has opened tty01.  That assumes
that it didn't do an exclusive open.

> 3) apart from the speed, are there other changes I should make to
>    serial port ?
>    I'm expecting "cat /dev/ty01" to produce a serial stream like I saw
>    with the MSDOS terminal

try tip(1).  Put this in your /etc/remote and type "tip nmea".

        nmea:br#4800:dc:pa=none:dv=/dev/01

> 4) I believe I hook-up the PPS signal to DCD (FWIW I'm using 9pin port)
>    do I really need a TTL/RS232 level converter ?
>    if so, I'll use one of the 5V powered single chip ones
>    I assume they preserve signal polarity
>    is there an easy way to test the PPS is working (outside of ntp) ?

Not on most ibm-pc hardware.  0-5v transitions are detected with no
problem on any x86/PC hardware I've come across.

The one problem you will find with netbsd is that the kernel time
stuff is lagging some of the other open source projects.  You only get
millisecond resolution with NetBSD while both FreeBSD and Linux have
nanosecond resolution.  

I'm told that Netbsd's 1ms limitation doesn't make much of a
difference, but then I'm not sure why I'm seeing adjtime act as if it
is silently dropping most 50uS - 100uS slew requests.

-wolfgang
-- 
       Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
		    http://www.wsrcc.com/wolfgang/
Coming soon: GPS mapping tools for Open Systems. http://www.gnomad-mapping.com/