PPS through GPIO 26
I would like to use UP Board as GPS time server. There is no problem connecting GPS module to the board using uart or usb. I need more precise time measurements, leading to time synchronization via PPS pulse produced by GPS chip.
I would like to use some free GPIO pin (eg. pin 26) as a PPS device. Can anyone point me at a right direction of doing that? Kernel has pps-gpio module, but it needs to specify device in device tree, which is sadly not possible on x86 arch od UP Board.
PPS-GPIO driver is available as a module on our kernel (for Ubuntu) but we have not tested the functionality.
I am not sure if you need to configure it in any way before enabling, but you should be able to do it via modproble or adding the modules to the default load list.
Regarding the PIN 26 on UP board, at the moment there is a bug (we are going to update the wiki with this information as we recently find out) where the pin is stuck as CS1 for the SPI interface.
You can use another pin, 29, which you can refer via linux sysfs as gpio 5 or gpio 338
Thank you for prompt answer!
I may have confused you regarding PIN number, PIN 26 is 26 in sysfs, physically it corresponds to pin 37 on 40-pin header. The one above GND pin. I was able to configure it via sysfs as input and read its value with GPS connected (vals are 0 and cca once per second there is 1 as expected). For GPS daemon I need it to operate as a pps device though. But I will try different PIN as you suggest.
I am indeed using Ubuntu image, tried both 16.04 and 18.04 with UP Board kernel 4.15. There is no problem with loading pps-gpio module, but it sadly takes no parameters (e.g. GPIO number would be nice ). I was able to make it work on Odroid XU4 (arm architecture) by modifying device tree by adding:
/* add for pps-gpio */
compatible = "pps-gpio";
gpios = <&gpx1 2 GPIO_ACTIVE_HIGH>;
status = "okay";
Is there any way of achieving this on x86 architecture?
I have found this on Odroid regarding defining the gpio pin for pps: https://wiki.odroid.com/odroid-c2/application_note/gpio/pps
The pin you have used might be good too, as long as you don't use pin 26 of the header.
To enable the pin at startup you would need to add a script to export and set the right configuration on a systemd service and enable it.
Yes, I am aware of Odroid C2, but it uses custom 3.14 kernel with different parametrized version of pps-gpio module tailored to Odroid C2. Sadly pps-gpio version in UP Board's 4.15 kernel is different:
Odroid C2 pps-gpio:
UP Board's pps-gpio:
I was hoping there is another way than doing it by creating custom version of pps-gpio kernel module. E.g. like on Odroid XU4 with device tree.
@DCleri Hello again, I want to use physical pin 22, linux gpio 25 as a pps input gpio. I managed to salvage some free time and I am rewriting kernel module from Odroid C2 . Should I refer this pin in my kernel module code as 25, or add some base number (resulting in 358 i guess?)
On UP board Pin22 can be refereed as 25 or 246 (if using the base number).
@DCleri Thank you! How can I find reference using base number for other pins? It would be handy for future purposes.
we will update the UP pinout page soon with the extra information
Hi did this ever get resolved?
I am trying to move my USB based GPS receiver (Ublox EVK-M8T) from a Raspberry Pi to an upBoard. Without the dtoverlay assignment for GPIO I cannot see how to assign the PPS to a GPIO.
I can see the GPIO is working (checking /sys/class/gpio23/value) but the upBoard seems to assign pps0 to /dev/ttyACM0 (dmesg | grep pps). The module pps-gpio is the same on RPI and UpBoard (v1.2.0).
How to mimic the dtoverlay assignment process? Or assign a new /dev/ppsX device to the GPIO pins?
- 303 All Categories
- 104 Announcements & News
- 52 Product News - New Product/Product Change Notice/ End-of-life
- 184 Welcome Developers!
- 53 Unboxing & Project Sharing
- 24 Tech Updates
- 595 UP Products
- 6 UP Xtreme i12
- 1 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 13 UP Squared V2
- 41 UP 4000
- 24 UP Xtreme i11
- 34 UP Squared 6000
- 49 UP Squared Pro
- 140 UP Xtreme
- 828 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 221 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 215 Starter Kits & Peripheral