Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 3B

507 bytes added, 14:46, 11 August 2023
40pin I2C test
<ol start="5" style="list-style-type: decimal;">
<li>As can be seen from the table below, the I2C available for Orange Pi 3B is I2C2, I2C3, and I2C4 a total of three groups of I2C bus</li></ol>
[[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.'''
'''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>
<ol start="6" style="list-style-type: decimal;">
<li>After starting the Linux system, first confirm the I2C device node under/dev.</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~# '''ls /dev/i2c-*'''
/dev/i2c-0 &nbsp;&nbsp;&nbsp;&nbsp; '''/dev/i2c-2''' &nbsp;&nbsp;&nbsp;&nbsp; '''/dev/i2c-3''' &nbsp;&nbsp;&nbsp;&nbsp; '''/dev/i2c-4''' &nbsp;&nbsp;&nbsp;&nbsp; /dev/i2c-6|}</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Then connect a I2C device on the I2C pin of the 40PIN connector. Here is an example of the DS1307 RTC module.</li></ol>
{| class="wikitable" style="width:800px;text-align: center;"
|-
|
[[File:pi3b-img273.png]]
</ol>
<ol start="8" 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-img274.png]]
</div></ol>
<ol start="9" style="list-style-type: decimal;">
<li>You can then run the time of the ds '''ds1307.py''' test program in '''examples''' to read the RTC time</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~/wiringOP-Python# '''cd examples'''
exit
|}
</ol>
<span id="pins-uart-test."></span>
<span id="pins-uart-test."></span>
=== 40pin's UART test ===