Impossible to get I2C pinout/configuration information for Hummingboard Mate

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:

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.

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.

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

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.

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

Running i2cdetect -y 0 I receive this:

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.

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

I receive this:

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.