8,367
edits
Changes
→40pin I2C Test
# From the table below, the I2C available for Orange Pi 3B is I2C2, I2C3, and I2C4 a total of three groups of I2C bus.
::[[File:pi3b-img266.png]]
::{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''It can be seen from the above table that i2c4_m0 and spi3_m0 are pins. The two cannot be opened at the same time. i2c3_m0 and uart3_m0 are also reused. The two cannot be opened at the same time'''</big>|}::{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''In the Linux system, the i2c in 40Pin is closed by default, and it needs to be opened manually to use.'''
'''Add the configuration of the red font part below to the /boot/orangepiEnv.txt, and then restart the Linux system to open the i2c2, i2c3, and i2c4 at the same time. If you only need to open one, then fill in one.'''</big>
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
'''<span style="color:#FF0000">overlays=i2c2-m1 i2c3-m0 i2c4-m0</span>'''|}
<ol start="2" style="list-style-type: decimal;">
<li>After starting the Linux system, first confirm that the i2c device node exists under/dev</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~# '''ls /dev/i2c-*'''
/dev/i2c-0 '''/dev/i2c-2''' '''/dev/i2c-3''' '''/dev/i2c-4''' /dev/i2c-6|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Then connect a i2c device on the i2c pin of the 40Pin connector</li></ol>
{| class="wikitable" style="width:800px;text-align: center;"
|-
|
|i2c4-m0
|-
| Sda Pin
|Corresponding to No. 3 pin
|Corresponding to No. 27 pin
|Corresponding to No. 19 pin
|-
| Sck Pin
|Corresponding to No. 5 pin
|Corresponding to No. 28 pin
|Corresponding to No. 23 pin
|-
| Vcc Pin
|Corresponding to No. 1 pin
|Corresponding to No. 1 pin
|Corresponding to No. 1 pin
|-
| Gnd Pin
|Corresponding to No. 6 pin
|Corresponding to No. 6 pin
|Corresponding to No. 6 pin
|}
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then use the '''i2cdetect -y''' command if the address of the connected I2C device can be detected, it means that the I2C can be used normally</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ sudo i2cdetect -y 2 #i2c2 command
orangepi@orangepi:~$ sudo i2cdetect -y 4 #i2c4 command
|}
<div class="figure">
[[File:pi3b-img267.png]]
</div></ol>
<span id="pin-uart-test"></span>
=== 40pin UART test ===