I2C

This guide will show you how to test the I2C interface on the phyCORE-i.MX8X development kit.

../_images/pcm-065_i2c-callout.png

Note

The phyCORE-i.MX8X SOM supports up to 9x I2C interfaces by default.

Only four of these are supported on the phyCORE-i.MX8X carrier board and three of those four are reserved for specific interfaces (2x for the MIPI display 1x for the MIPI camera interfaces).

I2C Paths

Interface

Sysfs Path

CSI0_I2C0

/dev/i2c-16

DSI0_I2C0

/dev/i2c-17

DSI1_I2C0

/dev/i2c-18

I2C1

/dev/i2c-19

Requirements

Hardware Setup

Connecting the I2C Device

I2C Device Signal

Carrier Board Signal

Carrier Board Connector-Pin

VCC

VCC_3V3

X60 - Pin 1

SCL

X_I2C1_SCL

X59 - Pin 7

SDA

X_I2C1_SDA

X59 - Pin 8

GND

GND

X59 - Pin 9

../_images/pcm-065_i2c-callout.png

Warning

Be sure that the development kit is powered off when connecting the I2C device.

Using I2C1

  • Power on the development kit and boot into Linux.

  • List the available I2C devices. There will be a few devices that pop up but /dev/i2c-19 corresponds to the I2C1 interface.

    Target (Linux)
    ls /dev/i2c*
    
    Expected Output
    /dev/i2c-16  /dev/i2c-17  /dev/i2c-18  /dev/i2c-19
    
  • Use the “i2cdetect” command to scan the bus for devices. This command outputs the address of all devices on the I2C1 bus.

    Note

    UU indicates that the device connected is tied to a kernel driver and you will be unable to communicate with the device via i2c commands (i2cset and i2cget).

Target (Linux)
i2cdetect -y -r 16
Expected Output
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  00: -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- --
  10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f
  40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  50: -- UU UU -- -- -- -- -- -- 59 -- -- -- -- -- --
  60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

The detected interfaces should match with the devices connected to I2C1 on the development kit.

I2C Interface Addresses

Interface

Address (7-bit

GPIO Expander

0x20

USB-C Controller

0x3F

EEPROM

0x51, 0x59

RTC

0x52

Audio

0x0A

Note

The EEPROM M24C32 has two different addresses (0x51 and 0x59) but one has been reserved in the device tree.