Skip site navigation (1)Skip section navigation (2)
Date:      07 Mar 2022 16:10:12 UTC
From:      Don Kuenz <mail@crcomp.net>
To:        <freebsd-arm@freebsd.org>
Subject:   Re: PCF8574 I2C configuration for 14.0-CURRENT on a RPi2B
References:  <9f337b5a-4e2d-a52f-2b99-4af69ad4c480@bunyatech.com.au>

| previous in thread | raw e-mail | index | archive | help
Brian Scott wrote:
>
> I think I'm like most people here, trying to guess what you are wanting
> to achieve. Pins 2 and 3 are already avalable as iic1 provided you include:
>
> dtparam=i2c_arm
>
> in your config.txt file. There's a little more magic needed on the rpi4
> but that doesn't effect you.
>
> Pin 3 (GPIO 2) is SDA and Pin 5 (GPIO 3) is SCL. This 'seems' to be the
> opposite of what you are doing in your dts snippet so I could be wrong,
> but I would have thought these functions would be hardwired in the SOC.
>
> As for your specific device, PCF8574; I don't have any direct experience
> but it looks like a standard IIC device that should work OK. I see there
> is a FreeBSD kernel module to support it but it is quite recent so
> probably only in CURRENT. As I said, I don't have experience with that
> particular device.
>
> Hope this helps,

It did indeed. Problem solved. Mucho gracias!

------------------------------------------------------------------------
root@generic:~ # cat /boot/msdos/config.txt
init_uart_clock=3000000
enable_uart=1
kernel=u-boot.bin
kernel7=u-boot.bin
dtoverlay=mmc
dtparam=i2c_arm

root@generic:~ # ls /dev | grep iic
iic0

root@generic:~ # i2c -sv
dev: /dev/iic0, addr: 0x0, r/w: r, offset: 0x00, width: 8, count: 1
Hardware may not support START/STOP scanning; trying less-reliable read method.
Scanning I2C devices on /dev/iic0:
27
------------------------------------------------------------------------

Danke,

-- 
Don, KB7RPU, https://www.qsl.net/kb7rpu
There was a young lady named Bright Whose speed was far faster than light;
She set out one day In a relative way And returned on the previous night.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>