Lines Matching +full:pps +full:- +full:gpio
1 .. SPDX-License-Identifier: GPL-2.0
4 PPS - Pulse Per Second
22 --------
25 system several PPS sources.
27 PPS means "pulse per second" and a PPS source is just a device which
31 A PPS source can be connected to a serial port (usually to the Data
32 Carrier Detect pin) or to a parallel port (ACK-pin) or to a special
38 GPS receiver as PPS source, to obtain a wallclock-time with
39 sub-millisecond synchronisation to UTC.
43 ------------------
45 While implementing a PPS API as RFC 2783 defines and using an embedded
46 CPU GPIO-Pin as physical link to the signal, I encountered a deeper
55 task for a PPS API. But this assumption does not work for a single
56 purpose GPIO line. In this case even basic file-related functionality
58 precondition for the use of a PPS API.
60 The problem can be simply solved if you consider that a PPS source is
64 for instance) is a PPS source too, and if not they should provide the
65 possibility to open another device as PPS source.
67 In LinuxPPS the PPS sources are simply char devices usually mapped
71 PPS with USB to serial devices
72 ------------------------------
74 It is possible to grab the PPS from an USB to serial device. However,
76 the USB stack. Users have reported clock instability around +-1ms when
77 synchronized with PPS through USB. With USB 2.0, jitter may decrease
83 If your device doesn't report PPS, you can check that the feature is
90 --------------
92 To register a PPS source into the kernel you should define a struct
116 PPS source, "default_params" tells the system what the initial default
121 Once you have registered a new PPS source into the system you can
133 Please see the file drivers/pps/clients/pps-ktimer.c for example code.
137 -------------
141 $ ls /sys/class/pps/
144 Every directory is the ID of a PPS sources defined in the system and
147 $ ls -F /sys/class/pps/pps0/
155 $ cat /sys/class/pps/pps0/assert
161 * echo: reports if the PPS source has an echo function or not;
163 * mode: reports available PPS functioning modes;
165 * name: reports the PPS source's name;
167 * path: reports the PPS source's device path, that is the device the
168 PPS source is connected to (if it exists).
171 Testing the PPS support
172 -----------------------
174 In order to test the PPS support even without specific hardware you can use
175 the pps-ktimer driver (see the client subsection in the PPS configuration menu)
176 and the userland tools available in your distribution's pps-tools package,
177 http://linuxpps.org , or https://github.com/redlab-i/pps-tools.
179 Once you have enabled the compilation of pps-ktimer just modprobe it (if
182 # modprobe pps-ktimer
187 trying PPS source "/dev/pps1"
188 found PPS source "/dev/pps1"
190 source 0 - assert 1186592699.388832443, sequence: 364 - clear 0.000000000, sequence: 0
191 source 0 - assert 1186592700.388931295, sequence: 365 - clear 0.000000000, sequence: 0
192 source 0 - assert 1186592701.389032765, sequence: 366 - clear 0.000000000, sequence: 0
195 This is available in the pps-tools repository mentioned above.
199 ----------
201 Sometimes one needs to be able not only to catch PPS signals but to produce
207 ------------------------
210 may be neither necessary nor affordable. The cheap way is to load a PPS
211 generator on one of the computers (master) and PPS clients on others
218 1 STROBE *------ *
227 10 ACK * ------*
235 18-25 GND *-----------*
237 Please note that parallel port interrupt occurs only on high->low transition,
238 so it is used for PPS assert edge. PPS clear edge can be determined only
241 current parport PPS generator implementation (pps_gen_parport module) is