Open main menu

Wiki-Orange Pi β

Changes

Orange Pi Zero 3

335 bytes added, 15:45, 11 July 2023
26pin SPI test
<li><p>The spi1 is disabled by default in the Linux system and needs to be manually enabled before it can be used. The steps to open are as follows:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First run '''orangepi-config''', normal users remember to add &gt; '''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>Then use the arrow keys on the keyboard to navigate to the &gt; position shown in the figure below, and then use the '''space''' &gt; to select '''spi1-cs1-spidev'''</p>
<p>[[File:media/image177.png|392x57px]]</p></li>
<li><p>Then select '''&lt;Save&gt;''' to save</p>
<li><p>Then select '''&lt;Back&gt;'''然后选择'''&lt;Back&gt;'''</p>
<p>[[File:media/image89.png|395x91px]]</p></li>
<li><p>Then select '''&lt;Reboot&gt;''' to restart the system to make the &gt; configuration take effect</p>
<p>[[File:media/image90.png|374x187px]]</p></li></ol>
</li>
<li><p>Then check whether there is a '''spidev1.1''' device node in the Linux system. If it exists, it means that the configuration of SPI1 has taken effect</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ls /dev/spidev1*'''</p>
<p>/dev/spidev1.1</p>|}</li>
<li><p>Then you can use the '''spidev_test.py''' program in the examples to test the loopback function of the SPI. The '''spidev_test.py''' program needs to specify the following two parameters:</p>
<ol style="list-style-type: lower-alpha;">
</li>
<li><p>Do not short-circuit the mosi and miso pins of SPI1, the output result of running spidev_test.py is as follows, you can see that the data of TX and RX are inconsistent</p>
</li> {| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
Opening device /dev/spidev1.1
TX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…| RX | FF FF FF FF FF FF '''FF FF FF FF FF FF''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….|
RX | FF FF FF FF FF FF '''<span style="color:#FF0000">FF FF FF FF FF FF</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |.............….|
|}
</ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>Then use the Dupont wire to short-circuit the two pins of txd (pin 19 in the 26pin interface) and rxd (pin 21 in the 26pin interface) of SPI1 and then run the output of spidev_test.py as follows, you can see The data sent and received are the same, indicating that the SPI1 loopback test is normal</p>
</li> {| class="wikitable" style="width:800px;" |-| <p>root@orangepi:~/wiringOP-Python# '''cd examples'''</p></li></ol>
root@orangepi:~/wiringOP-Python/examples# '''python3 spidev_test.py \'''
Opening device /dev/spidev1.1
TX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…|
RX | FF FF FF FF FF FF '''<span style="color:#FF0000">40 00 00 00 00 95</span>''' FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |......@.......…||}</ol><span id="pin-i2c-test-1"></span>
<span id="pin-i2c-test-1"></span>
=== 26pin I2C test ===