[LinuxPPS] Recommendation / Re: Stats & architectures

James Boddington boddingt at internode.on.net
Tue Mar 18 02:13:54 CET 2008


Bernhard Schiffner wrote:
> Am Montag, 17. März 2008 15:30 schrieben Sie:


>> get time stamp
>> outb(255,0x378) // trigger dcd via parallel port data line
>> read pps time stamp
>>
>> I got an average of 9.1us from triggering the parallel port to getting
>> the time stamp in irq/handle.c for irq 4.
> 
> 
> Do I understand the chain right?
> -*,* µs DCD 
> 0,0 µs PPS(1);  outb(255,0x378)
> 4,8 µs GPS_NMEA(0) 
> 9,1 µs  irq/handle.c for irq 4 (but isn't parport0 connected to irq 7 ?).
> 

Not quite. I am using the serial port (dcd) for the pps. In this case I sent 
data out on the parallel port to trigger the dcd line. /dev/ttyS0 uses irq 4 so 
in irq/handle.c I check if the irq that was just triggered was irq 4 and take 
my time stamp.

With a parallel data pin connected to dcd the sequence of events is

1. Take time stamp A
2. Set all data pins on the parallel port with outb(255, 0x378)
3. The parallel data pin changing state triggers the dcd
4. Irq 4 gets triggered because of dcd
5. Time stamp B is taken in irq/handle.c because it is irq 4.
6. Linuxpps time stamp gets taken. If the linuxpps checks show the event was a 
dcd assert then time stamp B is validated.

This is all done with a kernel module and not user space. Doing this in user 
space adds more delays. The average difference between time stamp B and time 
stamp A was 9.1us on the p3-600. The 9.1us also includes the time to use the 
parallel port to trigger dcd.

This would give me up to 9.1us from the signal hitting dcd to getting my time 
stamp and a further 4.8us till the linuxpps time stamp. Bit under 14us from pps 
  hits dcd to linuxpps.

What I don't know is how much of that 9.1us is taken setting the parallel port.

> Ok this helps.
> BTW Do you have PPS for parport enabled too?
> What says the PPS_Event if you short one output to the ACK(?) input pin 
> now? (9,1 + an other 4,8 µs ?) 
> 

Pps for the parport is not setup. I am setting up another machine so I can play 
and leave my time server alone in it's dark corner.

> My question goes a little bit further. I connected once 2 (on board) serial 
> inputs with with the same DCD-Signal. The registered PPS-Events were about 
> 50 µs shifted. This was one year ago, and I didn't find the peace to do 
> some extended testing on this. (shifting a signal some µs in hardware)
> This time I used 2.6.21(?)+pps+cfs+rt-patches and had some rt-audio working 
> so it is no real base for argumentation nowadays .

I have been wondering what would happen with pps signals on 2 different serial 
ports. Could the difference be the 2nd interrupt is waiting for the 1st 
interrupt to be serviced hence the delay?

-- 
    James



More information about the LinuxPPS mailing list