I2C
- If you're using an older kernel than 4.18, tap the “Old kernel version”.
kernel 4.18 or higher
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 |
Old kernel version
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 |
How to find I2C slave address of devices on Ubuntu
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”.
kernel 4.18 or higher
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:~$
Old kernel version
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.
How to change I2C speed on BIOS
The default I2C speed is 400kHz. If you want to change the speed to 100kHz or 1MHz, first you should enter the BIOS.
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.