We're no longer updating This wiki!!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:c_hardware_i2c [2016/12/01 14:05]
odroid [Loading I2C driver]
en:c_hardware_i2c [2017/06/20 13:18] (current)
brian.kim [How to change the I2C clock speed]
Line 1: Line 1:
 ====== I2C ====== ====== I2C ======
-This page introduces how you can interface your I2C devices to **ODROID-C**.+This page introduces how you can interface your I2C devices to **ODROID-C** ​series.
 ===== H/W connection ===== ===== H/W connection =====
  
Line 24: Line 24:
 </​code>​ </​code>​
 This adds one line at end of the file, /​etc/​modules,​ and load the driver on boot automatically. 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.
 +<​code>​
 +sudo apt-get install device-tree-compiler i2c-tools
 +</​code>​
 +
 +Make a backup of DTB file.
 +<​code>​
 +cp /​media/​boot/​meson64_odroidc2.dtb /​media/​boot/​meson64_odroidc2.dtb.org
 +</​code>​
 +
 +Change the DTB file for i2c-1 (i2c channel #1)
 +<​code>​
 +fdtput -t i /​media/​boot/​meson64_odroidc2.dtb /​i2c@c1108500 master_i2c_speed "​100000"​
 +sync
 +reboot
 +</​code>​
 +
 +Change the DTB file for i2c-2 (i2c channel #2)
 +<​code>​
 +fdtput -t i /​media/​boot/​meson64_odroidc2.dtb /​i2c@c11087c0 master_i2c_speed "​100000"​
 +sync
 +reboot
 +</​code>​
 +
 +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 ===== ===== Tutorials =====
 [[wb_c_16x2lcd|{{:​en:​weather_board:​weatherboard16x2.jpg?​150|}}]] [[wb_c|{{:​en:​weather_board:​wb_odroidc5.png?​135|}}]] [[wb_c_16x2lcd|{{:​en:​weather_board:​weatherboard16x2.jpg?​150|}}]] [[wb_c|{{:​en:​weather_board:​wb_odroidc5.png?​135|}}]]
   * [[ wb_c_16x2lcd | WEATHER-BOARD with 16x2 LCD on ODROID-C ]]   * [[ wb_c_16x2lcd | WEATHER-BOARD with 16x2 LCD on ODROID-C ]]
   * [[ wb_c | WEATHER-BOARD on ODROID-C ]]   * [[ wb_c | WEATHER-BOARD on ODROID-C ]]
en/c_hardware_i2c.1480570506.txt.gz ยท Last modified: 2016/12/01 14:05 by odroid
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0