User Manual Orange Pi Zero 3

  Features   |  Use   |    Linux     |  Linux SDK   |  Android   |  Android SRC   |

RU          EN  

Chapt 3. Instructions for use of Debian/Ubuntu Server and Xfce desktop system
Страница:   25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122  


3.18.3. 26pin SPI test

  • 1) According to the schematic diagram of the 26pin interface, the available spi is spi 1



    Img 3.113

  • 2) The spi 1 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:

    a. First run orangepi-config, normal users remember to add sudo permission

    orangepi@orangepi:~$ sudo orangepi-config

    b. Then select System



    Img 3.114

    c. Then select Hardware



    Img 3.115

    d. Then use the arrow keys on the keyboard to navigate to the position shown in the figure below, and then use the space to select spi1-cs1-spidev



    Img 3.116

    e. Then select 'Save' to save



    Img 3.117

    f. Then select 'Back'



    Img 3.118

    g. Then select 'Reboot' to restart the system to make the configuration take effect



    Img 3.119

  • 3) 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

    orangepi@orangepi:~$ ls /dev/spidev1*
    /dev/spidev1.1

  • 4) Do not short-circuit the mosi and miso pins of SPI1 first, the output result of running spidev_test is as follows, you can see that the data of TX and RX are inconsistent

    orangepi@orangepi:~$ sudo spidev_test -v -D /dev/spidev1.1
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 KHz)
    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 | ................................

  • 5) Then short the two pins of mosi (the 19th pin in the 26pin interface) and miso (the 21st pin in the 26pin interface) of SPI1, and then run the output of spidev_test as follows, you can see the sending and receiving same data

    orangepi@orangepi:~$ sudo spidev_test -v -D /dev/spidev1.1
    spi mode: 0x0
    bits per word: 8
    max speed: 500000 Hz (500 KHz)
    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 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 | ......@.... .................. .

     <         > 


  • Страница:   25    26    27    28    29    30    31    32    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96    97    98    99    100    101    102    103    104    105    106    107    108    109    110    111    112    113    114    115    116    117    118    119    120    121    122