8,367
edits
Changes
→40pin SPI Test
# From the schematic diagram of the 40PIN interface, the SPI available for Orange Pi 3B is spi3
::[[File:pi3b-img264.png]] ::{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''In the Linux system, the SPI3 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 spi3.'''
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
'''<span style="color:#FF0000">overlays=spi3-m0-cs0-spidev</span>'''</big>|}
<ol start="2" style="list-style-type: decimal;">
<li>First check whether there is a '''spidev3.0''' device node in the Linux system. If it exists, it means that the SPI3 has been set. You can use it directly</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''ls /dev/spidev3.0'''
/dev/spidev3.0
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Do not shorten the two pins of the SPI3 MOSI and MISO, and run the output result of the spidev_test as shown below. You can see that the data of TX and RX is inconsistent</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev3.0'''
max speed: 500000 Hz (500 KHz)
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="4" style="list-style-type: decimal;">
<li>Then the two pins of the SPI3 MOSI (No. 19 pins in the 40pin interface) and MISO (No. 21 in the 40PIN interface) run the output of SPIDEV_TEST as follows.You can see that sending and receiving data is the same.</li></ol>
[[File:pi3b-img265.png]]
{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''sudo spidev_test -v -D /dev/spidev3.0'''
max speed: 500000 Hz (500 KHz)
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"></span>
=== 40pin I2C Test ===