[time-nuts] Linux PPS clues?

Paul Boven p.boven at xs4all.nl
Fri Oct 21 01:37:35 EDT 2016

Hi Gabs, everyone,

On 2016-10-21 1:53:55, Gabs Ricalde wrote:
> The events can be timestamped by polling the PPS and event pins and
> using the cycle counter. A better approach would be to use the 100 MHz
> eCAP timers. The Beaglebone has two accessible eCAP pins, the PPS goes
> to one and the event goes to the other. The counters can be synchronized
> so the event timestamps can be referenced to the PPS timestamps.

This is a great idea, actually. At the moment, I'm using a BBB which I 
feed 24 MHz to tclkin, generated from a rubidium oscillator. The tclkin 
is used on run one of the dmtimers in capture mode for GPS PPS, so that 
gives about 42ns resolution. Using Dan Drown's Hardware Capture Driver 
(on Github) this 24MHz is set as the system clocksource. Works really 
well, but the 42ns resolution is a bit poor (or maybe I'm a time nut).

The eCAP runs from sysclk which I think is 200MHz on the BBB, and would 
provide 5ns resolution. Unfortunately the eCAP counter seems to only get 
input signals from the master clock, so it's not easy to provide them 
with a better input clock. But using them as a start/stop setup with the 
PPS from GPS as one input, and another PPS derived from a Rb would work 
quite nicely. In fact, that division by 24e6 from the Rubidium could 
probably be done by a second dmtimer also clocked from tclkin, keeping 
the parts count low.

Does that sound feasible?

Regards, Paul Boven.

More information about the time-nuts mailing list