8,367
edits
Changes
→26pin I2C test
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config''', normal users remember to add > '''sudo''' permission</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo orangepi-config'''</p>|}</li>
<li><p>Then select '''System'''</p>
<p>[[File:media/image85.png|398x194px]]</p></li>
<li><p>Then select '''Hardware'''</p>
<p>[[File:media/image86.png|393x202px]]</p></li>
<li><p>d. Then use the arrow keys on the keyboard to navigate to the > position shown in the figure below, and then use the '''space''' > to select '''ph-i2c3'''</p>
<p>[[File:media/image179.png|401x59px]]</p></li>
<li><p>Then select '''<Save>''' to save</p>
</li>
<li><p>After starting the linux system, first confirm that there is an i2c3 device node under /dev</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ls /dev/i2c-3'''</p>
<p>'''/dev/i2c-3'''</p>|}</li>
<li><p>Then start testing i2c, first install i2c-tools</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo''' '''apt-get install -y i2c-tools'''</p>|}</li>
<li><p>Then connect an i2c device to the i2c3 pin of the 26pin connector, here we take the DS1307 RTC module as an example</p>
<p>[[File:media/image186.png|180x153px]]</p></li></ol>
{| class="wikitable" style="width:800px;"
|-
| style="text-align: left;"| '''Pins of the RTC module'''
| style="text-align: left;"| '''Pin 5'''
|}
</li></ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then use the '''i2cdetect -y 3''' command, if the address of the connected i2c device can be detected, it means that the i2c device is connected correctly</li></ol>
[[File:media/image187.png|388x203px]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li><p>Then you can run the '''ds1307.py''' test program in the '''examples''' to read the RTC time</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p>
<p>root@orangepi:~/wiringOP-Python/examples# '''python3 ds1307.py --device \'''</p>
<p>Thu 2022-06-16 04:35:48</p>
<p>^C</p>
<p>exit</p>|}</li></ol>
<span id="pin-uart-test-1"></span>
=== 26pin UART test ===