Changes

Jump to: navigation, search

Orange Pi 3B

423 bytes added, 14:41, 11 August 2023
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.'''</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 spi4.'''
 
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
'''<span style="color:#FF0000">overlays=spi3-m0-cs0-spidev</span>'''|}
<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 and can be used 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><p>You can then use the spi back function under the '''spidev_test.py''' program in Examples. The '''spidev_test.py''' program needs to specify the following two parameters: </p>
<li><p>'''--port''': Specify the port number of SPI</p></li></ol>
</li>
<li><p>Do not pick up the two pins of the SPI3 MOSI and MISO in short, and run the output result of the spidev_test.py as shown below. You can see that the data of TX and RX are inconsistent</p></li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~/wiringOP-Python# '''cd examples'''
Opening device /dev/spidev3.0
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="5" style="list-style-type: decimal;">
<li>Then use the TXD (No. 19 pins in the 40Pin interface) and RXD (No. 21 pins in the 40pin interface) of the DuPont line short connection SPI3. Like sending and receiving data, it means that the SPI3 loop test is normal</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~/wiringOP-Python# '''cd examples'''
Opening device /dev/spidev3.0
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>
=== 40pin I2C test ===

Navigation menu