[LinuxPPS] FW: Linux PPS with Garmin 18xLVC using 2.6.35.7 linux Kernel

Hal V. Engel hvengel at gmail.com
Thu Oct 28 23:56:58 CEST 2010


On Thursday, October 28, 2010 12:33:14 pm Kent Headley wrote:
> Hi Hal, thanks for your note.
> 
> The PC I'm using (Asus Eee PC) doesn't have any external serial or parallel
> ports. It is a convenient platform of opportunity to try out linuxPPS, so
> if it PPS support can't be done using USB-serial adapters, I'll have to
> move to another platform with real serial ports. Ultimately, I want to use
> a small single board computer, so this was the closest computer I have on
> hand.

A lot of the single board computers have serial ports and in some cases they 
have more than one (I have seen some with 4 and 5 serial ports).
> 
> Does linuxPPS require a 8250/16550 UART?
> 
> So it is NTP that needs the links names gps0 and gpspps0 - thanks for
> clarifying that.

Specifically the NTP clock driver needs these because it is expecting certain 
logical devices.

> 
> The /dev/ttyUSB0 device works fine - I can see NMEA messages (e.g. cat
> /dev/ttyUSB0). Also, utilities like statserial will show that the DCD pin
> (where PPS is connected) is changing reliably. I'm not sure how statserial
> detects DCD changes (interrupts? polling?), but perhaps it's not the same
> mechanism used by linuxPPS.
> 
> It seems like the USB serial device uses a usb serial driver rather than
> the core serial drivers. lsmod shows
> 
>     serial_core 12121   1 8250
>     usbserial   21796   3 keyspan
>     usbcore     96374   7 keyspan, usbserial (and others)
>     pps_ldisc   1358    1
>     pps_core    5257    1 pps_ldisc
> 
> I don't see any dependencies between the pps modules and any serial modules
> though.

I think there is PPS specific stuff in the 8250 serial and parallel drivers.  
After all the accuracy of the time stamp that is gathered right after the DCD 
interrupt is critical and I remember from looking at the serial code that the 
time stamp code was moved around (perhaps around the kernel 2.6.25 version of 
LinuxPPS) to be nearly the first thing that happens in the serial interrupt 
handler when PPS is enabled.

> 
> Does linuxPPS use a particular serial driver (module)?

The basic serial driver (8250) in the kernel has pps hooks.

> How does linuxPPS detect changes in the PPS source (GPIO, serial pin,
> parallel pin, etc.)?

It doesn't since the device driver has to have some hooks for this and if the 
USB to serial driver has not been modified for PPS support then it likely will 
not work (no hooks).  In addition pps is enabled with the ldattach command.  I 
think that currently only the 8250 serial and parallel drivers have the 
necessary hooks but I could be wrong.  

I know that at some point around 2.6.24 someone used a GPIO pin for this but 
he had to modify the kernel to make it work.  I don't think these mods have 
made it into the kernel yet.  I think the mod was fairly simple.  I also think 
that modifying the usbserial driver for this should not be difficult.  But if 
the driver uses polling to detect the state change on pin 1 then you will not 
see the same level of accuracy as a standard serial port where this is 
interrupt driven.  I am sure that patches for this would be welcome even if 
the performance was not as good as a standard serial port. You might want to 
have a look at some of the last pre-kernel inclusion LinuxPPS patches to the 
8250 serial driver to see what needs to be modified.

> 
> Cheers,
> Kent
> 
> On 10/28/10 12:08 PM, "Hal V. Engel" <hvengel at gmail.com> wrote:
> > On Thursday, October 28, 2010 09:13:10 am Kent Headley wrote:
> >> Thanks for your reply Venu,
> >> 
> >> The GPS has only RS232 output, which is connected to a Keyspan 19-HS
> >> USB-serial converter.
> > 
> > I am not sure that this is supported.  Why not just use a serial port?
> > 
> >> The Keyspan nominally behaves as a full 9-pin serial port.
> >> For example, statserial can detect changes in the handshaking lines on
> >> /dev/ttyUSB0.
> >> 
> >> The PPS signal is connected to Keyspan serial pin 1 (DCD).
> >> So both the NMEA and PPS signals are passed to the PC via the Keyspan
> >> (/dev/ttyUSB0).
> >> 
> >> Is it OK for the NMEA and PPS signals to arrive on the same serial
> >> connector? I have seen this at various sites on the web (PPS wired to
> >> DCD), so figured it¹s OK.
> > 
> > PPS and the GPS data stream can either be connected to the same device or
> > to separate devices.   This is why ntp needs two device sym links since
> > these are logically separated even if they are on the same port.
> > 
> >> With your uBlox GPS, what pin was the PPS signal attached to?
> >> 
> >> The comments about sym links for gps0 and gpspps0 are interesting; is
> >> that required by NTP, or does linuxPPS need these links also?
> > 
> > NTP only and the logical device created by the sym link is specific to
> > the clock driver and how it is configured.
> > 
> >> I just tried creating the links you suggested, exactly as you recommend,
> >> but also with
> >> 
> >>     ln -s /dev/ttyUSB0 /dev/gps0
> >>     ln ­s /dev/ttyUSB0 /dev/gpspps0
> >> 
> >> instead of
> >> 
> >>     ln -s /dev/ttyUSB0 /dev/gps0
> >>     ln ­s /dev/ttyS0 /dev/gpspps0
> >> 
> >> since my PPS is arriving via /dev/ttyUSB0 (on my system, ttyS0 doesn¹t
> >> seem to have an actual UART associated with it).
> >> However, neither of these seems to have the desired effect.
> >> 
> >> Do you know if any special permissions for /dev/ttyUSB0 (currently
> >> /dev/ttyUSB0 system has ³rw-rw---- root dialout² ).
> >> 
> >> Thanks again!
> > 
> > Since I don't use a serial to USB device I have no idea how this should
> > be configured or even if it can be made to work.  But you can separate
> > the PPS output and route it to either a serial port or parallel port. 
> > Do you have a parallel port on your machine?
> > 
> > Also have you checked to see what kind of stuff is happening on
> > /dev/ttyUSB0? Can you see the NMEA messages?
> > 
> >> Cheers,
> >> Kent
> >> 
> >> On 10/28/10 1:11 AM, "Venu Gopal" <neo.venu at gmail.com> wrote:
> >>> Hello Kent,
> >>> 
> >>> NTP requires NMEA messages and the PPS signal.
> >>> If I am not wrong, the GPS receiver is connected to the PC via USB
> >>> (/dev/ttyUSB0),
> >>> though which the NMEA messages are read. And how is PPS connected to
> >>> the PC if it doesn't have serial ports ?
> >>> 
> >>> I have used uBlox GPS receiver with both USB and serial connectivity.
> >>> You need to create soft links for NMEA and PPS as shown below:
> >>> 
> >>> 1. For NMEA data:
> >>> ln -s /dev/ttyUSB0 /dev/gps0
> >>> 
> >>> 2. For PPS:
> >>> ln -s /dev/ttyS0 /dev/gpspps0
> >>> 
> >>> You need to have PPS signal reaching to PC either over a serial port or
> >>> a parallel port.
> >>> 
> >>> Regards,
> >>> Venu
> > 
> > _______________________________________________
> > LinuxPPS mailing list
> > LinuxPPS at ml.enneenne.com
> > http://ml.enneenne.com/cgi-bin/mailman/listinfo/linuxpps
> > Wiki: http://wiki.enneenne.com/index.php/LinuxPPS_support



More information about the LinuxPPS mailing list