Date: Wed, 8 Aug 2018 14:05:49 -0300 From: "Dr. Rolf Jansen" <rj@obsigna.com> To: Ian Lepore <ian@freebsd.org> Cc: freebsd-arm@FreeBSD.org Subject: Re: BeagleBone Black with a I2C Digital Analog Converter Message-ID: <3007D25E-4884-4652-8B0D-9C6A837D4ADB@obsigna.com> In-Reply-To: <1533743140.9860.99.camel@freebsd.org> References: <3C191052-1E2C-4D85-8CF1-AAC64F0500B7@obsigna.com> <1533743140.9860.99.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Am 08.08.2018 um 12:45 schrieb Ian Lepore <ian@freebsd.org>: >=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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3007D25E-4884-4652-8B0D-9C6A837D4ADB>