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.6. PWM test method
The development board can use up to 4 channels of PWM, and the positions of their pins are shown in the figure below:



Img 3.135

  • 1) In the Linux system, the pwm is closed by default, and it needs to be opened manually to use it. 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.136

    c. Then select Hardware



    Img 3.137

    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 the configuration corresponding to pwm



    Img 3.138

    Since the RX and TX pins of UART5 in the PWM1, PWM2 and 26pin interfaces are multiplexed, please make sure that the UART5 configuration is not selected (do not check ph-uart5) when turning on PWM1 and PWM2 (you need to select ph-pwm12). PWM3, PWM4 and the TX and RX pins in the debug serial port are multiplexed, so when using PWM3 and PWM4 (need to select ph-pwm34), please turn off the configuration of UART0 (need to select disable-uart0), after turning off UART0 The debug serial port cannot be used.

    e. Then select 'Save' to save



    Img 3.139

    f. Then select 'Back'



    Img 3.140

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



    Img 3.141

  • 2) After restarting, the PWM test can be started

    Please execute the following commands under the root user.

    a. Enter the following command on the command line to make pwm1 output a 50Hz rectangular wave

    root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/export
    root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm1/period
    root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle
    root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable

    b. Enter the following command on the command line to make pwm2 output a 50Hz square wave

    root@orangepi:~# echo 2 > /sys/class/pwm/pwmchip0/export
    root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm2/period
    root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm2/duty_cycle
    root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable

    c. Enter the following command on the command line to make pwm3 output a 50Hz rectangular wave

    root@orangepi:~# echo 3 > /sys/class/pwm/pwmchip0/export
    root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm3/period
    root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm3/duty_cycle
    root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm3/enable

    d. Enter the following command on the command line to make pwm4 output a 50Hz square wave

    root@orangepi:~# echo 4 > /sys/class/pwm/pwmchip0/export
    root@orangepi:~# echo 20000000 > /sys/class/pwm/pwmchip0/pwm4/period
    root@orangepi:~# echo 1000000 > /sys/class/pwm/pwmchip0/pwm4/duty_cycle
    root@orangepi:~# echo 1 > /sys/class/pwm/pwmchip0/pwm4/enable



    Img 3.142

     <         > 


  • Страница:   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