EasyManuals Logo

ORANGE Pi 3B User Manual

ORANGE Pi 3B
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #215 background imageLoading...
Page #215 background image
range Pi User Manual Copyright reserved by Shenzhen Xunlong Software Co., Ltd
207
3) First check whether there is a spidev3.0 device node in the Linux system. If it exists,
it means that SPI3 has been set up and can be used directly
orangepi@orangepi:~$ ls /dev/spidev3.0
/dev/spidev3.0
4) 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:
a. --channelSpecify the channel number of SPI
b. --portSpecify the port number of the SPI
5) Do not short-circuit the mosi and miso pins of SPI3, the output of running
spidev_test.py is as follows, you can see that the data of TX and RX are inconsistent
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# python3 spidev_test.py \
--channel 3 --port 0
spi mode: 0x0
max speed: 500000 Hz (500 KHz)
Opening device /dev/spidev3.0
TX | FF FF FF FF FF FF 40 00 00 00 00 95 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 |.................|
6) Then use the Dupont wire to short-circuit the two pins of txd (pin 19 in the 40pin
interface) and rxd (pin 21 in the 40pin interface) of SPI3 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 SPI3 loopback test is normal
root@orangepi:~/wiringOP-Python# cd examples
root@orangepi:~/wiringOP-Python/examples# python3 spidev_test.py \
--channel 3 --port 0
spi mode: 0x0
max speed: 500000 Hz (500 KHz)
Opening device /dev/spidev3.0
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ORANGE Pi 3B and is the answer not in the manual?

ORANGE Pi 3B Specifications

General IconGeneral
EthernetGigabit Ethernet
BluetoothBluetooth 5.0
USB2x USB 2.0, 1x USB 3.0
Power Supply5V/3A via USB-C
RAM4GB LPDDR4
StorageMicroSD card slot
WirelessWi-Fi 5 (802.11ac)
Video OutputHDMI 2.0
Operating SystemAndroid