From owner-freebsd-arm@freebsd.org Fri Jan 27 06:23:53 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908E1CC3D58 for ; Fri, 27 Jan 2017 06:23:53 +0000 (UTC) (envelope-from tony@tndh.net) Received: from express.tndh.net (express.tndh.net [IPv6:2001:470:e930:1240:20d:56ff:fe04:4c0a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA74A63; Fri, 27 Jan 2017 06:23:53 +0000 (UTC) (envelope-from tony@tndh.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tndh.net; s=dkim; h=Subject:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:In-Reply-To:References:To:From; bh=Xg/PdRBAQQXZ/7gbStmfEmAsKpx5mTJ46wyJUvBsp2c=; b=A2vTtcID56wPWM4NoTpA7iSrYKMtoEHS+js/IkJ6xIZA1qdxif66kKhXcbHf89foT40uxf9RYL5EMQSF2TxatstFC0898otj6zfI1KzVEfZR1dKTfIUjWaEjaDXHCByv0BnP0hi5D9jE4D3SXb1ZiwULTqTy9HXISjK6LREAi2DsSyaQ; Received: from express.tndh.net ([2001:470:e930:1240:20d:56ff:fe04:4c0a] helo=eaglet) by express.tndh.net with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1cWzwe-000IoS-8c; Thu, 26 Jan 2017 22:23:51 -0800 From: "Tony Hain" To: "'Ian Lepore'" , References: <03a801d2776e$cae997e0$60bcc7a0$@tndh.net> <1485400906.30533.54.camel@freebsd.org> <03bb01d2779d$45d6edd0$d184c970$@tndh.net> <03c101d277ae$70f142c0$52d3c840$@tndh.net> <1485445768.30533.68.camel@freebsd.org> <040101d27816$3f7547b0$be5fd710$@tndh.net> <1485466405.30533.96.camel@freebsd.org> <041a01d2782d$bee11850$3ca348f0$@tndh.net> <1485490656.30533.111.camel@freebsd.org> In-Reply-To: <1485490656.30533.111.camel@freebsd.org> Date: Thu, 26 Jan 2017 22:23:36 -0800 Message-ID: <041b01d27865$e4c54810$ae4fd830$@tndh.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQEImxvIZ6VEPYS1CTeMHuF4SjTdHgFGeuiPAfagOS8BXCmlWAJOLTryAjf7KeUBQ5O/qAF4PpfTARF4btuieCtE4A== Content-Language: en-us X-SA-Exim-Connect-IP: 2001:470:e930:1240:20d:56ff:fe04:4c0a X-SA-Exim-Mail-From: tony@tndh.net X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on express.tndh.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=4.5 tests=ALL_TRUSTED,RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Subject: RE: BBB uarts & pps dts definitions X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on express.tndh.net) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2017 06:23:53 -0000 Ian Lepore wrote: > > > > snip > > > > This is so close, there must be something really trivial that I = am > > > > overlooking... > > > > > > > > Tony > > > I'm using a 5v->3.3v level shifter right now, but I have in the = past > > > succesfully used resistive dividers. =A0My PPS output device is > > > designed to drive 5v into a 50 ohm load, so when using a divider I > > > just try various values I have handy until my scope says the = voltage > > > high level is somewhere in the 2.8-3.3v range. =A0Usually I use > > > resistance that adds up to somewhere between 40-100 ohms when I do > > > that (depends on what resistors pop out first when I reach into = the > > > bag of loosies). > > > > > > -- Ian > > That makes some degree of sense based on what I am seeing, though = that > > is a very low input impedance on the BBB. I was expecting ~100k. My > > source is a > > 555 on an ancient ttl/RS232 board I built because the 20 us pulse = from > > the GPS was too fast (between the slew rate of the 3232 and the DCD > > detection window on the com port) to go with a simple level > > conversion. Sounds like it might be best to do an active 3.3v driver > > at this point. > > > > Tony > > >=20 > Well you were right, it all boiled down to electrical trouble, but it = was caused > by software, and I just committed a fix as r312859. =A0I'll MFC the = fix to 11 in a > few days (you could just grab the patch/source from -current and build = a > new kernel now). >=20 > Even though the code was asking the pinmux driver to configure the pin = as > an input, there is also a bit in the timer control register that configures the pin > as input or output for capture vs. pulse mode. =A0That setting = apparently > overrides the pinmux choice, so the timer block was driving a signal = onto that > pad. =A0(The code had a comment next to one bit in the control = register defines > "no description in datasheet". > =A0That goes back to the original timer driver from years ago. =A0A = newer copy of > the manual is where I discovered that the bit is now described as > input/output config.) >=20 > I think my testing was working because my level-shifter was able to = out- > muscle the weaker drive in the TI chip. =A0As soon as I switched to a passive > voltage divider it stopped working. =A0Now with the pin configured = correctly it > works fine for me, and probably will for you too. >=20 > I find that it captures pulses as narrow as 100nS perfectly now. =A0A = 10nS pulse > it captures maybe 35% of the time. =A0(My timing hardware has no = choices > between 10nS and 100nS to try.) Glad to hear. I have been investigating alternatives for a driver, and = the mosfet approach I was gravitating toward would likely not have made any difference if the BBB was driving the signal because it is active low = with an even higher resistance pull-up. I will look into building a kernel, = I know there are instructions for the cross-compile tools, so it should be straight forward.=20 Last item, do you know if the DTS src includes the Beaglebone-Green? If = not, what can I do to help make that happen. Once I get the Black running, I = have a Green to build as its ~twin. Tony =20