8,367
edits
Changes
→40 pin SPI test
<li><p>The corresponding pins of SPI0 and SPI4 in 40pin are shown in the table below. SPI4_M1 and SPI4_M2 can only use one of them at the same time, and they cannot be used at the same time. They are all the same SPI4, but they are connected to different pins. Please don't think that they are two different sets of SPI buses.</p></li></ol>
{| class="wikitable" style="width:800px;"
|-
|
<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/image234.png|389x180px]]</p></li>
</li>
<li><p>After restarting, enter the system and first check whether there is a '''spidevx.x''' device node in the linux system. If it exists, it means that the SPI has been set up and can be used directly.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ls /dev/spidev*'''</p>
<p>/dev/spidev0.0 /dev/spidev0.1 /dev/spidev4.0 /dev/spidev4.1</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''The above is the result displayed after turning on spi0-m2-cs0-cs1-spidev and spi4-m1-cs0-cs1-spidev.'''</p></big>|}</li>
<li><p>Then do not short-circuit the MOSI and MISO pins of SPI0 or SPI4, the output result of running spidev_test is as follows, you can see that the data of TX and RX are inconsistent</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev4.0'''</p>
<p>'''or'''</p>
<p>bits per word: 8</p>
<p>max speed: 500000 Hz (500 KHz)</p>
<p>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 | ......@.…▒..................▒.</p><p>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 | ............................….</p>|}</li>
<li><p>Then short-circuit the MOSI and MISO pins of SPI0 or SPI4, and then run the output of spidev_test as follows. You can see that the sent and received data are the same, indicating that the SPI loopback test is normal.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev4.0'''</p>
<p>'''or'''</p>
<p>bits per word: 8</p>
<p>max speed: 500000 Hz (500 KHz)</p>
<p>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 | ......@.…▒..................▒.</p><p>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 | ......@.…▒..................▒.</p>|}</li></ol>
<span id="pin-i2c-test"></span>
=== 40 pin I2C test ===