Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Mar 2016 07:54:36 +0100
From:      =?utf-8?Q?Peter_Ankerst=C3=A5l?= <peter@pean.org>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Karl Denninger <karl@denninger.net>, freebsd-stable@freebsd.org
Subject:   Re: PPS input on a generic GPIO pin on Raspberry Pi.
Message-ID:  <EDF36350-65A9-4DB8-886E-6BCD852F2CE6@pean.org>
In-Reply-To: <1457114408.13785.150.camel@freebsd.org>
References:  <8C90C80B-AC5F-4B12-8E84-84193B8C55C4@pean.org> <56D9BDB6.6040903@denninger.net> <1457114408.13785.150.camel@freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]


> On 4 mars 2016, at 19:00, Ian Lepore <ian@freebsd.org> wrote:
> 
>> On Fri, 2016-03-04 at 10:54 -0600, Karl Denninger wrote:
>>> On 3/3/2016 12:57, Peter Ankerstål wrote:
>>> Hi!
>>> 
>>> I have sort of exactly the same question as Erik:
>>> http://lists.freebsd.org/pipermail/freebsd-questions/2014-July/2590
>>> 55.html
>>> 
>>> I have bought a https://learn.adafruit.com/adafruit-ultimate-gps an
>>> d want to use the PPS output to discipline my clock.
>>> 
>>> But the only source of information on how PPS works in FreeBSD I
>>> could find is this: 
>>> https://docs.freebsd.org/doc/8.0-RELEASE/usr/share/doc/ntp/pps.html
>>> and it clearly states the two ways to provide a PPS signal. "The
>>> PPS signal can be connected in either of two ways: via the data
>>> carrier detector (DCD) pin of a serial port or via the acknowledge
>>> (ACK) pin of a parallel port”
>>> 
>>> Since the Pi doesn´t have any DCD pin i would like to use a generic
>>> GPIO for this. There is a linux kernel module for this: http://lxr.
>>> free-electrons.com/source/drivers/pps/clients/pps-gpio.c?v=3.6
>> GPIO is supported on the Pi, I'm using it on 11-Current on my home
>> control software to drive relays on my pool hardware (e.g. valves,
>> heater, VFD motor drive, etc) and it is working very well.  I don't
>> believe tapping into that at the kernel level to expose a pps signal
>> (e.g. on /dev/pps or something of the like) would be very difficult
>> at
>> all, since the low-level driver capability is already present.
>> 
>> If I get some free time I'll dig around a bit and see if I can cobble
>> something up.  It's of some interest to me as well since I have a GPS
>> clock here that currently talks to a serial port on an Intel-based
>> machine and being able to move that to a $35 "appliance" for NTP
>> using
>> the Adafruit setup looks sort of attractive given that the Pi plus
>> the
>> module would be under $100 all-in.
> 
> Don't "cobble something up" just yet... there is "a right way" to fix
> this, which is a generic gpio-pps driver.  The problem is that it
> requires support from the new INTRNG, and the rpi hasn't been converted
> to that yet.  I'm checking around to see if someone has done the
> conversion for rpi and it just hasn't been reveiwed/committed yet; if
> not, I guess I'll try to do it myself.
> 
> Writing the actual gpio-pps driver will be pretty quick and easy once
> we have the intrng support, I think it'll take me a couple hours.
> 
Oh, so there is hope. Thanks for looking into it. 

Im not a programmer myself but im willing to help if I can. 

> Also, FYI, another option with PPS is to use a usb-serial adapter and
> feed the PPS in on the CTS or DCD pin.  I tested that on rpi a few
> months ago and it worked fine.  There's surpisingly little jitter even
> when the usb bus is heavily loaded with other traffic such as disk or
> network IO.
> 
Yes that was going to be my plan B. Good to know that it works.

/Peter. 
[-- Attachment #2 --]
0	*H
010	+0	*H
000
	*H
010	UIL10U

StartCom Ltd.1+0)U"Secure Digital Certificate Signing1806U/StartCom Class 1 Primary Intermediate Client CA0
150120233316Z
160121194839Z0810Upeter@pean.org10	*H
	peter@pean.org0"0
	*H
0
2RSk"eFdnKaz쪋ǺO?_+^=JR&p†UsZݡlCw508+Vuʠ0ffZ`|m	d\fPE룏2gd|53hH[NJ]XWe,94YVYc΢dk=;:^X8r&W
8`'z
-~=θxj#ԉ H("@Pŏ00	U00U0U%0++0U<)4{zZ{10U#0Sr풜\|~5NԸQ0U0peter@pean.org0LU C0?0;+70*0.+"http://www.startssl.com/policy.pdf0+00' StartCom Certification Authority0This certificate was issued according to the Class 1 Validation requirements of the StartCom CA policy, reliance only for the intended purpose in compliance of the relying party obligations.06U/0-0+)'%http://crl.startssl.com/crtu1-crl.crl0+009+0-http://ocsp.startssl.com/sub/class1/client/ca0B+06http://aia.startssl.com/certs/sub.class1.client.ca.crt0#U0http://www.startssl.com/0
	*H
"DsG]qSatTZ!'D~."8u.PdLIeYEj)Ld=HeJM^nƩ'iAC_ I"$W5R&՗T"כ{7_Q%DmwUnɴq!baV@zIAaet~nFM%-&zpۦ]:0mԣ($EjC%6YYRfEha1o0k0010	UIL10U

StartCom Ltd.1+0)U"Secure Digital Certificate Signing1806U/StartCom Class 1 Primary Intermediate Client CA0	+0	*H
	1	*H
0	*H
	1
160305065436Z0#	*H
	1f]G)htP0	+710010	UIL10U

StartCom Ltd.1+0)U"Secure Digital Certificate Signing1806U/StartCom Class 1 Primary Intermediate Client CA0*H
	1010	UIL10U

StartCom Ltd.1+0)U"Secure Digital Certificate Signing1806U/StartCom Class 1 Primary Intermediate Client CA0
	*H
?Vh=W.JAt_9"按}2sH[uݰno
]T@q *i"r}6tU"ާrM;$%
sY3	
ꦢfR6}d	^i~xjh=.;~<0ߐg⳿Bz2Y_RaZ	ɽ&s㥙12#evN㡀=pѨYC)ذa{	m\A`Հpw
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EDF36350-65A9-4DB8-886E-6BCD852F2CE6>