From owner-freebsd-arm@freebsd.org Wed Aug 8 17:06:00 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16CCF10629E4 for ; Wed, 8 Aug 2018 17:06:00 +0000 (UTC) (envelope-from rj@obsigna.com) Received: from mail.cyclaero.de (ec2-18-195-62-44.eu-central-1.compute.amazonaws.com [18.195.62.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A545A86699; Wed, 8 Aug 2018 17:05:58 +0000 (UTC) (envelope-from rj@obsigna.com) Received: from mail.obsigna.com (unknown [191.182.171.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.cyclaero.de (Postfix) with ESMTPSA id BC04271; Wed, 8 Aug 2018 19:05:56 +0200 (CEST) Received: from rolf.projectworld.net (rolf.projectworld.net [192.168.222.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.obsigna.com (Postfix) with ESMTPSA id 2AE7B1350F91A; Wed, 8 Aug 2018 14:05:50 -0300 (BRT) From: "Dr. Rolf Jansen" Message-Id: <3007D25E-4884-4652-8B0D-9C6A837D4ADB@obsigna.com> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: BeagleBone Black with a I2C Digital Analog Converter Date: Wed, 8 Aug 2018 14:05:49 -0300 In-Reply-To: <1533743140.9860.99.camel@freebsd.org> Cc: freebsd-arm@FreeBSD.org To: Ian Lepore References: <3C191052-1E2C-4D85-8CF1-AAC64F0500B7@obsigna.com> <1533743140.9860.99.camel@freebsd.org> X-Mailer: Apple Mail (2.3445.9.1) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:06:00 -0000 > Am 08.08.2018 um 12:45 schrieb Ian Lepore : >=20 > On Wed, 2018-08-08 at 10:59 -0300, Dr. Rolf Jansen wrote: >>=20 >> ... >> Please can somebody, check this, and perhaps give some hints in case = I got something wrong? I don't have an oscilloscope, a multimeter only, = can I check somehow if I specified the correct pins? >>=20 >> What needs to be done next? I guess, I need to write a simple device = driver, don't I? Or can I use somehow the iicbb(4) =E2=80=93 I2C generic = bit-banging driver, since actually that DAC chip needs bit banging only = -- repeatedly write 3 byte in row. I yes, how can I use it for my = purpose? >=20 > At this point, i2c(8) is your friend, it lets you do i2c bus > transactions from the commandline without a device-specific driver for > each i2c device. A good starting point is a bus scan: >=20 > i2c -f /dev/iic1 -s >=20 > If the bus is working you should see something like: >=20 > Scanning I2C devices on /dev/iic1: 60 >=20 > You can also use i2c(8) to transfer data to and from the device, but > that's something I've never done myself, so I can't give a working > example here. >=20 > Writing a custom driver for an i2c device is usually pretty simple. = For > chips with just a few registers, it's common to provide a userland > interface with sysctl, allowing each register to be read or written by > reading or setting a sysctl var. Some examples exist in the > sys/dev/iicbus directory. Ian, thank you very much for your response. As a matter of fact, the source of all my doubts told in the initial = post above is that yesterday after hours in a trial&error circle, I was = not able to get a sensible response from the exact bus scan command = which suggested: i2c -f /dev/iic1 -s -v Up to now, by no means I was able to see anything else than: dev: /dev/iic1, addr: 0x0, r/w: r, offset: 0x00, width: 8, count: 1 Hardware may not support START/STOP scanning; trying less-reliable read = method. This START/STOP thing let me to think that I perhaps need to get = attached a device driver. I am also still in doubt, whether I really got the pinmux straight. I = checked very carefully the physical connections, anyway I am stuck at = this point. Best regards Rolf