This is an old revision of the document!
Table of Contents
I2C
This page introduces how you can I2C interface using Expansion Board.
The Expansion Board have two I2C devices.
You can use the devices via I2C-A(H/W I2C) or I2C-B(GPIO-I2C).
H/W I2C (I2C-A)
Kernel 3.10.y (node name) | Kernel 4.9.y (node name) | Pin Number (XU3/XU4 - CON10) | Net Name | Export Number | Description |
---|---|---|---|---|---|
/dev/i2c-4 | /dev/i2c-1 | 16 | GPB3[2](I2C_1.SDA) | 209 | SDA |
14 | GPB3[3](I2C_1.SCL) | 210 | SCL |
S/W I2C (I2C-B)
Kernel 3.10.y (node name) | Kernel 4.9.y (node name) | Pin Number (XU3/XU4-CON10) | Net Name | Export Number | Description |
---|---|---|---|---|---|
/dev/i2c-10 | 27 | GPX3[1](XEINT_25) | 33 | SDA | |
25 | GPX1[7](XEINT_15) | 23 | SCL |
How to check Expansion board with i2c-tools.
Install i2c-tools package.
odroid@odroid:~$ sudo apt-get install i2c-tools
I2C Device check command
- Usage : i2cdetect -y -r [i2c node name]
Using the S/W I2C(I2C-B) with Expansion Board
Upload the module
GPIO-I2C driver probe [ i2c-gpio-custom driver option : id,sda,scl[,udelay,timeout,sda_open,scl_open,scl_outonly]
odroid@odroid:~$ sudo modprobe i2c-gpio-custom bus0=10,33,23,10,10
I2C Device check
odroid@odroid:~$ sudo i2cdetect -y -r 10 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 77 odroid@odroid:~$
- The 0x29 is BH1780 slave address.
- The 0x77 is BMP180 slave address.
Get BMP180 ID using i2cget.
odroid@odroid:~$ sudo i2cget 10 0x77 0xD0
Using the HW I2C(I2C-A) with Expansion Board
odroid@odroid:~$ sudo i2cdetect -y 4 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- 29 -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 77 odroid@odroid:~$
- The 0x29 is BH1780 slave address.
- The 0x77 is BMP180 slave address.
Get BMP180 ID using i2cget.
odroid@odroid:~$ sudo i2cget 4 0x77 0xD0