BeagleBone Black with a I2C Digital Analog Converter

Dr. Rolf Jansen rj at obsigna.com
Wed Aug 8 17:06:00 UTC 2018


> Am 08.08.2018 um 12:45 schrieb Ian Lepore <ian at freebsd.org>:
> 
> On Wed, 2018-08-08 at 10:59 -0300, Dr. Rolf Jansen wrote:
>> 
>> ...
>> 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?
>> 
>> 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) – 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?
> 
> 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:
> 
>   i2c -f /dev/iic1 -s
> 
> If the bus is working you should see something like:
> 
>   Scanning I2C devices on /dev/iic1: 60
> 
> 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.
> 
> 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



More information about the freebsd-arm mailing list