[LinuxPPS] Trying to get parallel port client working on 2.6.26

Cirilo Bernardo cirilo.bernardo at gmail.com
Fri Sep 19 23:13:39 CEST 2008


On Sat, Sep 20, 2008 at 3:54 AM, Paul Simons <paul at thesimonet.org> wrote:
[snip]
> I notice that people seem to convert from TTL to RS232 and then use the
> serial port.  Why is that?

If you're attaching a serial interface to a GPS to the serial port, it
is more convenient (and neater) to run the PPS wire to the serial port
DCD pin rather than running a lone wire to the parallel port.  Most
contemporary built-in serial ports work with +/-5v these days and many
even work with 0,+5v  (which is a bit silly since that defeats some
design features of the RS232 electrical spec). So some people can
simply attach the TTL or 5/6v CMOS PPS signal to the DCD pin.

> I am using the parallel port (pin 10 - ACK, pin 24 - ACK ground) and just
> going straight TTL.  Everything seems to register fine:
>
> dmesg | grep -i pps
> LinuxPPS API ver. 1 registered
> PPS line discipline registered
> new PPS source parport0 at ID 0
> parport_pc 00:08: PPS source #0 "/dev/lp0" added
> dmesg | grep -i parport
> parport_pc 00:08: reported by Plug and Play ACPI
> parport0: PC-style at 0x378 (0x778), irq 7, dma 3
> [PCSPP,TRISTATE,COMPAT,ECP,DMA]
> lp0: using parport0 (interrupt-driven).
> new PPS source parport0 at ID 0
> parport_pc 00:08: PPS source #0 "/dev/lp0" added
>
> However, no joy:
>
> ./ppstest /dev/pps0
> trying PPS source "/dev/pps0"
> found PPS source "/dev/pps0"
> ok, found 1 source(s), now start fetching data...
> time_pps_fetch() error -1 (Connection timed out)
> time_pps_fetch() error -1 (Connection timed out)
> time_pps_fetch() error -1 (Connection timed out)
> ^C

In the case of the serial drivers, the UART channel is disabled until
the ttyS? device is opened.  I have never looked at the parallel port
code but it would probably be the same since this avoids servicing
interrupts for data which the user isn't even interested in.  So while
pps is running, try something like "less -f /dev/lp0".

[snip]
> I'd like to see this working as a first step.  Is that reasonable?  Should
> I start sprinkling printks to see where I'm going wrong?  I hooked up a
> digital multimeter and it twitches; should I get some sort of LED?  Should
> I convert to RS232 signaling?
>
> Okay, I'll stop now.
>
> --
> Paul Simons
> Covington, WA, USA

I don't see how printks will help; the multimeter is probably best.
An oscilloscope would be even better. However, these devices only help
you check the actual electrical signal up to the parallel port pin;
they have nothing to do with the software so except for verifying that
you're generating the signal, they are of no other use.   You can use
an LED with an appropriate resistor if you want to see a blinking
light, but how you do this depends on the circuitry - how much current
can the PPS pin source/sink (and the specific design of the output
stage).  If you load the line, the digital electronics may not react
as you expect.  You can check for signs that the line is loaded using
an oscilloscope - but if you had that you probably wouldn't be using
the multimeter.

- Cirilo



More information about the LinuxPPS mailing list