I2C

This page introduces how you can interface your I2C devices to ODROID-C series.

H/W connection

I2CA (/dev/i2c-1)

Pin NumberNet NameExport Number
C0/C1/C1+C2
3I2CA.SDA74205
5I2CA.SCL75206

I2CB (/dev/i2c-2)

Pin NumberNet NameExport Number
C0/C1/C1+C2
27I2CB.SDA76207
28I2CB.SCL77208

Loading I2C driver

Dedicated pins for I2C are configured for GPIO, these pins can be configured as I2C bus while change the pin configuration. In order to change the configuration, you must load the driver.

$ modprobe aml_i2c

If you have to load the driver every time whenever your ODROID-C starts, simply you can register the driver into /etc/modules.

$ echo "aml_i2c" | sudo tee /etc/modules

This adds one line at end of the file, /etc/modules, and load the driver on boot automatically.

How to change the I2C clock speed

To change the I2C clock speed, you need to modify the DT(Device Tree) file.

Install required packages.

sudo apt-get install device-tree-compiler i2c-tools

Make a backup of DTB file.

cp /media/boot/meson64_odroidc2.dtb /media/boot/meson64_odroidc2.dtb.org

Change the DTB file for i2c-1 (i2c channel #1)

fdtput -t i /media/boot/meson64_odroidc2.dtb /i2c@c1108500 master_i2c_speed "100000"
sync
reboot

Change the DTB file for i2c-2 (i2c channel #2)

dtput -t i /media/boot/meson64_odroidc2.dtb /i2c@c11087c0 master_i2c_speed "100000"
sync
reboot

If you want to go back to original 300Khz mode, change “100000” to “300000”.

Actual I2C clock speed (Measured with an oscilloscope)
In 300Khz mode : 270Khz
In 100Khz mode : 80Khz

Default I2C clock speed
C1/C1+/C0 : 100Khz mode
C2 : 400Khz mode

Tutorials

en/c_hardware_i2c.txt · Last modified: 2017/03/08 16:22 by odroid
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0