Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4060

Interfacing (DSI, CSI, I2C, etc.) • Re: i2cset not working on sc16is752

$
0
0
Sorry, I've not checked pimoroni overlay! link to the sources of the official kernel tree was provided here posting.php?mode=reply&t=370976&sid=179 ... #pr2223044

As I don't have such a display on hands I've used another I2C slave connected to the SW-I2C interface configured on GPIO10/11, configured the bus with below overlay:

Code:

// Overlay for i2c_gpio bitbanging host bus - pull-ups enabled/dts-v1/;/plugin/;#include <dt-bindings/gpio/gpio.h>/ {compatible = "brcm,bcm2835";fragment@0 {target-path = "/";__overlay__ {i2c_gpio: i2c@0 {reg = <0xffffffff>;compatible = "i2c-gpio";gpios = <&gpio 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP) /* sda */ &gpio 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN|GPIO_PULL_UP) /* scl */>;i2c-gpio,delay-us = <2>;        /* ~100 kHz */#address-cells = <1>;#size-cells = <0>;};};};fragment@1 {target-path = "/aliases";__overlay__ {i2c_gpio = "/i2c@0";};};fragment@2 {target-path = "/__symbols__";__overlay__ {i2c_gpio = "/i2c@0";};};__overrides__ {i2c_gpio_sda = <&i2c_gpio>,"gpios:4";i2c_gpio_scl = <&i2c_gpio>,"gpios:16";i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0";bus = <&i2c_gpio>, "reg:0";};};
to my config.txt below was added:

Code:

dtoverlay=i2c-gpio,bus=22,i2c_gpio_sda=10,i2c_gpio_scl=11
this gives me the SW I2C-bus as I2C-22 (what I was expecting to see on my CM4 DUT).

Code:

pi@raspberrypi:~ $ i2cdetect -li2c-20i2c       fef04500.i2c                    I2C adapteri2c-21i2c       fef09500.i2c                    I2C adapteri2c-22i2c       ffffffff00000001.i2c            I2C adapterpi@raspberrypi:~ $ sudo i2cdetect -y 22     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- 63 -- -- -- -- 68 -- -- 6b -- -- -- -- 70: -- -- -- -- -- -- -- --  
with another slave device

Code:

pi@raspberrypi:~ $ sudo i2cdetect -y 22     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: 70 -- -- -- -- -- -- --                         pi@raspberrypi:~ $ i2cdetect -li2c-20i2c       fef04500.i2c                    I2C adapteri2c-21i2c       fef09500.i2c                    I2C adapteri2c-22i2c       1600000002.i2c                  I2C adapterpi@raspberrypi:~ $ 
From my current understanding SW I2C bus numbers will start from numbers >21 as 21 is DDC1 on (everything) <Pi4 as

Code:

dtoverlay=i2c-gpio,i2c_gpio_sda=10,i2c_gpio_scl=11
- with no bus number predefined - results is

Code:

pi@raspberrypi:~ $ i2cdetect -li2c-20i2c       fef04500.i2c                    I2C adapteri2c-21i2c       fef09500.i2c                    I2C adapteri2c-22i2c       ffffffff00000002.i2c            I2C adapterpi@raspberrypi:~ $ sudo i2cdetect -y 22     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: 70 -- -- -- -- -- -- --                         pi@raspberrypi:~ $ 
--> please post the content of your config.txt!

Statistics: Posted by aBUGSworstnightmare — Wed May 22, 2024 6:27 am



Viewing all articles
Browse latest Browse all 4060

Trending Articles