[LinuxPPS] How to use PPS to adjust system clock time ?

Ran Shalit Ran.Shalit at comm-it.com
Sat Feb 16 08:28:44 CET 2019


Hello,

In Linux PPS documentation it is said:

PPS means "pulse per second" and a PPS source is just a device which
provides a high precision signal each second so that an application
can use it to adjust system clock time.

But I haven't find out how to do this adjusting of system clock timer
(hwclock).
The requirement of pps in my system: the 1pps comes from GPIO and should be used for timetag of video captured frames from camers.  I rather not using ntp, and instead find a simpler way to achieve it, so that there is no overhead of ntp.

1. Is that possible to adjust system timer from PPS (without ntp) ? Is there an example showing how to do it ?

2. Is it that the time_pps_kcbind API is responsible to adjust system clock
with PPS ? Is there an example showing how to do it ?

I also don't fully understand the pps time interface,as can be read from
userspace using time_pps_fetch command (see ppstest.c example)

3. How is it that pps already have nsec resolution if it is a clock
which is only "pulse per second" ? Does it mean that the
time_pps_fetch already gives time which is synchronized with system
timer ?



Thank you!
ran


This email has been scanned for spam and viruses by Proofpoint Essentials.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.linuxpps.org/pipermail/discussions/attachments/20190216/80f56def/attachment.html>


More information about the discussions mailing list