Driving PPS from GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Driving PPS from GPIO

7,515 Views
jaynadeau
Contributor I

Hi everyone,

I am looking for some help here, as I am currently stuck.

I have an i.MX6Q with a Linux kernel built using bitbake.

I have enabled PPS and GPIO support using the Linux menuconfig method.

I also have a uBlox GPS receiver powered and connected through GPIO pins.

I can see that there are PPS devices in my device tree and I can also manipulate and export GPIOs using sysfs. Also, I have installed ktimer to ensure that PPS is working and it looks fine here.

My question is, how can I tell LinuxPPS that I want to use an arbitrary GPIO as a PPS source coming from my GPS receiver?

Any help here would be greatly appreciated.

Thank you,

Jay

Labels (1)
0 Kudos
3 Replies

4,318 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jay

one can look at linux documentation

Linux/Documentation/devicetree/bindings/pps/pps-gpio.txt - Linux Cross Reference - Free Electrons

[LinuxPPS] linuxpps and devicetree support

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

4,319 Views
jaynadeau
Contributor I

Hi Igor,

Thanks for your help.

Here is what I have done so far:

I have added the following to imx6qdl-var-dart.dtsi and imx6qdl-var-som.dtsi:

pps {
compatible = "pps-gpio";
gpios = <&gpio1 1 0>;
assert-falling-edge;
};

This is what is listed after re-building the kernel:

pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
pps pps0: new PPS source ptp0
pps pps1: new PPS source ktimer
pps pps1: ktimer PPS source registered
pps_ldisc: PPS line discipline registered
pps pps2: new PPS source pps.21.-1
pps pps2: Registered IRQ 161 as PPS source

pps2 is new after adding the code to the dtsi file. It seems correct so far, but how can I verify that it is in fact working? I.e., how can I see whether the pps signal is being recieved from my GPS?

Any help is greatly appreciated.

Thank you,

Jay

0 Kudos

4,319 Views
jaynadeau
Contributor I

Hi,

Just a quick update.

Using this command I can see some value:

cat /sys/class/pps/pps2/assert

Here is the result:

0.000000000#0

For comparison sake, here is pps1 (ktimer):

cat /sys/class/pps/pps1/assert

1450814279.313042658#89420

So, I suppose that either it is not working, or I do not have a GPS lock and therefore, no PPS signal from my GPS.

I will try to verify GPS lock.

Thanks,

Jay

0 Kudos