# Impossible to get I2C pinout/configuration information for Hummingboard Mate

**URL:** <https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503>\
**Category:** NXP i.MX8M Plus\
**Created:** [October 25, 2022, 9:50am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503 "2022-10-25T09:50:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Juan](https://community.solid-run.com/u/Juan)\
**Post date:** [October 25, 2022, 9:50am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/1 "2022-10-25T09:50:39Z")

</div>

Hi everyone,

I’m trying to setup an I2C communication by I2C between Arduino and Hummingboard Mate but I can’t find any information related with this. I have searched on schematics but I2C3 are connected with several different pins. How can I use I2C ports with smbus python library? Which SMBUS port is used for this? I¡m using this code:

```auto
from smbus import SMBus

addr = 8 # bus address
bus = SMBus(3) # indicates /dev/ic2-1

numb = 1

print ("Enter 1 for ON or 0 for OFF")
while numb == 1:

        ledstate = input(">>>> ")

        if ledstate == "1":
                bus.write_byte(addr, 1) # switch it on
        elif ledstate == "0":
                bus.write_byte(addr, 0) # switch it on
        else:
                numb = 0

```

Thank you so much.

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [October 26, 2022, 4:22am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/2 "2022-10-26T04:22:14Z")

</div>

I don’t specifically know the python smbus package, but if the linux device is /dev/i2c-1 then I would assume that you would use `SMBus(1)` I2C3 is the i2c bus on the SOC, but if other i2c interfaces aren’t used because their pins are used for other purposes then Linux will initialize the devices that are available numerically.

---

<div class="post-metadata">

**Author:** ![Juan](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Juan](https://community.solid-run.com/u/Juan)\
**Post date:** [October 26, 2022, 7:01am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/3 "2022-10-26T07:01:39Z")

</div>

Well, I’m using i2c-tools from Debian and I can’t detect any device in any port detected by i2cdetect.

```auto
debian@sr-imx8:~$ sudo i2cdetect -list
i2c-3 i2c 30a50000.i2c I2C adapter
i2c-1 i2c 30a30000.i2c I2C adapter
i2c-2 i2c 30a40000.i2c I2C adapter
i2c-0 i2c 30a20000.i2c I2C adapter

```

I’m using I2C ports provided by Mikrobus, I have tried with all numbers on SMBUS but it doesn’t work.

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [October 26, 2022, 7:43am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/4 "2022-10-26T07:43:47Z")

</div>

so if you run `i2cdetect -y 0` you are not able to see any devices?

---

<div class="post-metadata">

**Author:** ![Juan](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Juan](https://community.solid-run.com/u/Juan)\
**Post date:** [October 26, 2022, 8:02am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/5 "2022-10-26T08:02:28Z")

</div>

Running i2cdetect -y 0 I receive this:

```auto
debian@sr-imx8:~$ sudo i2cdetect -y 0
     0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

```

But my device is in address 18.

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [October 26, 2022, 8:52am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/6 "2022-10-26T08:52:06Z")

</div>

Then you should see that device address if you run `i2cdetect -y 2` the NXP devices all start their numbering at 1,2,3,4 etc however Linux enumerates starting at 0. So on the MikroBus header which uses i2c3 the linux device with be /dev/i2c2

---

<div class="post-metadata">

**Author:** ![Juan](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Juan](https://community.solid-run.com/u/Juan)\
**Post date:** [October 26, 2022, 8:58am UTC](https://community.solid-run.com/t/impossible-to-get-i2c-pinout-configuration-information-for-hummingboard-mate/503/7 "2022-10-26T08:58:57Z")

</div>

I receive this:

```auto
debian@sr-imx8:~$ sudo i2cdetect -y 2

     0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

```

The same code has been tested on Raspberry and it works fine.
