[LinuxPPS] LinuxPPS GPIO Generator

Tom Kurmann tkurmann at gmail.com
Wed Aug 24 23:21:14 CEST 2011


**
Hi Ricardo,
On 24.08.2011 22:06, Ricardo Martins wrote:

Hi Tom

On 24 August 2011 13:56, Alexander Gordeev <lasaine at lvk.cs.msu.su>
<lasaine at lvk.cs.msu.su> wrote:

 В Wed, 24 Aug 2011 13:43:22 +0200
Tom Kurmann <tkurmann at gmail.com> <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 ?


 Yes I saw the pps-gpio module and I am going to test in the next couple of
days with a omap3 based platform. I saw that you wrote the client module so
maybe you can answer me this.
As I wrote I need to synchronize ADCs on different platforms using a 1 PPS
GPIO generated output (or less). As PPS is defined I would like to generate
a pulse at the beginning of every second. On a microcontroller I would just
use a simple timer with an interrupt, but since under Linux the interrupt
latencies are still too high I think this is likely not going to work. Since
I am not a huge fan of polling, especially on an embedded system, I would
like to ask you if any other approach would be possible?

Thanks

Tom

 --
 Alexander

_______________________________________________
LinuxPPS mailing
listLinuxPPS at ml.enneenne.comhttp://ml.enneenne.com/cgi-bin/mailman/listinfo/linuxpps
Wiki: http://wiki.enneenne.com/index.php/LinuxPPS_support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ml.enneenne.com/pipermail/linuxpps/attachments/20110824/4b1dae6e/attachment.htm 


More information about the LinuxPPS mailing list