odroid-h2:application_note:i2c

I2C

  • If you're using an older kernel than 4.18, tap the “Old kernel version”.
Pin# Pin Label dev node
18 I2C_6_SCL /dev/i2c-2
20 I2C_6_SDA
13 I2C_7_SCL /dev/i2c-3
15 I2C_7_SDA
Pin# Pin Label dev node
18 I2C_6_SCL /dev/i2c-5
20 I2C_6_SDA
13 I2C_7_SCL /dev/i2c-6
15 I2C_7_SDA

This instruction was tested on Ubuntu 19.4 on Kernel 5.0

Install package

sudo apt install i2c-tools
  • If you're using an older kernel than 4.18, tap the “Old kernel version”.

Find your device's address with “i2cdetect”.

sudo i2cdetect -y -r [2 or 3]

If you wired your device to pin #18 and #20, then you can find the device's address with the following command.

odroid@odroid:~$ sudo i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
odroid@odroid:~$

Otherwise, if you connect to pin #13 and #15, you can find the address with this command.

odroid@odroid:~$ sudo i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
odroid@odroid:~$

Find your device's address with “i2cdetect”.

sudo i2cdetect -y -r [5 or 6]

If you wired your device to pin #18 and #20, then you can find the device's address with the following command.

odroid@odroid:~$ sudo i2cdetect -y -r 5
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
odroid@odroid:~$

Otherwise, if you connect to pin #13 and #15, you can find the address with this command.

odroid@odroid:~$ sudo i2cdetect -y -r 6
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
odroid@odroid:~$

This instruction was tested on Ubuntu 18.10 on Kernel 4.18.

Install package

sudo apt install i2c-tools

Find your device's address with “i2cdetect”.

sudo i2cdetect -y -r [5 or 6]

If you wired your device to pin #13 and #15, then you can find the device's address with the following command.

odroid@odroid:~$ sudo i2cdetect -y -r 6
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
odroid@odroid:~$

Otherwise, if you connect to pin #18 and #20, you can find the address with this command.

odroid@odroid:~$ sudo i2cdetect -y -r 5
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
odroid@odroid:~$
  • Debian backport Kernel 4.18(4.18.0-0.bpo.1-amd64) could access the I2C channel #6 via /dev/i2c-2.

The default I2C speed is 400kHz. If you want to change the speed to 100kHz or 1MHz, first you should enter the BIOS.

1. Power off your ODROID-H2.
2. Press the Power button on your ODROID-H2, then Press “DEL” key while booting.
3. You can see the pic as follow.

Move to the Save & Exit tab. And then, select the “Save Changes and Exit” menu.

  • odroid-h2/application_note/i2c.txt
  • Last modified: 2020/06/11 18:39
  • by neal