[LinuxPPS] LinuxPPS GPIO Generator

Ricardo Martins rasm at fe.up.pt
Wed Aug 24 22:06:52 CEST 2011


Hi Tom

On 24 August 2011 13:56, Alexander Gordeev <lasaine at lvk.cs.msu.su> wrote:
> В Wed, 24 Aug 2011 13:43:22 +0200
> Tom Kurmann <tkurmann at gmail.com> пишет:
>
>> Hello,
>>
>> For a project I need to to synchronize a handful of Cortex A8 based devices
>> to a master clock so I can time stamp data which is coming from an ADC. The
>> master clock should be synchronized to GPS and the slaves will be locally
>> synchronized with PTP. The ADCs have a SYNC input which I would like to sync
>> with a GPIO generating a PPS. Since I have been away from the Linux Kernel
>> for a couple of years these questions may sound dumb, but a lot has changed
>> since I last worked on the kernel...I need a synchronization of around 50 us
>> in the network.
>>
>> - Is it correct that the IRQ time stamping for say a GPS PPS happens before
>> the ISR gets called? Since the interrupt latency on the cortex a8 is max.
>> around 120 us and the jitter is quit high i would assume that the time
>> stamping has to be done before the ISR gets called.
>
> No, this is done in ISR.
>
>> - I see that there are no drivers yet to generate a PPS on a GPIO, which
>> would mean I could try to contribute something here :) Since hrtimers has
>> been implemented I think it should be possible to generate an interrupt
>> every full second for a gpio (the full second is to ensure that the clocks
>> are synced), but again the problem with the interrupt latency comes up. If I
>> have say an average of 100 us latency and a jitter of 50 us I would be at
>> the limits of the specifications. Or is the hrtimer interrupt handled
>> differently from external interrupts?
>
> Please look at how pps-gen-parport and pps-parport work together. There
> are some problems, but it works very well for me.
>
> pps-gen-parport produces precise signal of 30 us duration where the
> clear edge is the second boundary.
>
> The key is that the interrupt in pps-parport is generated when the
> signal goes down (assert edge) and then it polls for the signal to go
> up again (clear edge). This way the accuracy of timestamping of the
> clear edge is about 1-2us (time to read/write a port on x86) without
> any interrupt-related latency.

Have you seen the pps-gpio module ?

>
> --
>  Alexander
>
> _______________________________________________
> 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