.. _i2c-8x: I2C ==== This guide will show you how to test the I2C interface on the phyCORE-i.MX8X development kit. .. image:: ../../images/phycore-imx8x/pcm-065_i2c-callout.webp :width: 800px .. 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). .. list-table:: I2C Paths :header-rows: 1 * - Interface - Sysfs Path * - CSI0_I2C0 - /dev/i2c-16 * - DSI0_I2C0 - /dev/i2c-17 * - DSI1_I2C0 - /dev/i2c-18 * - I2C1 - /dev/i2c-19 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. .. code-block:: none :caption: Target (Linux) ls /dev/i2c* .. code-block:: none :caption: 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). .. code-block:: none :caption: Target (Linux) i2cdetect -y -r 16 .. code-block:: none :caption: 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. .. list-table:: I2C Interface Addresses :header-rows: 1 * - 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.