8,367
edits
Changes
→PWM test method
# From the table below, the pwm11 available for Orange Pi 3B
::[[File:pi3b-img270.png]]
::{| class="wikitable" style="width:800px;"
|-
|
'''In the Linux system, the pwm 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 pwm11.'''
orangepi@orangepi:~$ '''sudo vim /boot/orangepiEnv.txt'''
'''<span style="color:#FF0000">overlays=pwm11-m1</span>'''|}
<ol start="2" style="list-style-type: decimal;">
<li>After opening a pwm, a pwmchipX (X is a specific number) will be available in'''/sys/class/pwm/'''</li></ol>{| class="wikitable" style="width:800px;" |-|
orangepi@orangepi:~$ '''ls /sys/class/pwm/'''
pwmchip0 pwmchip1
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>Which pwmchip corresponds to pwm11 above? Let's first check out the output of '''ls /sys/class/pwm/ -l''' command, as shown below: </p></li>
<li><p>The base address of the pwm11 register is Fe6F0030. Then see the output of '''ls /sys/class/pwm/ -l''' command, you can see that the fe6f0030.pwm is connected to the pwmchip1, so the PWM11 corresponding pwmchip is pwmchip1</p></li></ol>
<div class="figure">
[[File:pi3b-img271.png]]
</div></ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then use the following command to allow pwm11 to output a 50Hz square wave (please switch to the root user first, and then execute the following command)</li></ol>{| class="wikitable" style="width:800px;" |-|
root@orangepi:~# '''echo 0 > /sys/class/pwm/pwmchip1/export'''
root@orangepi:~# '''echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable'''
|}
[[File:pi3b-img272.png]]
</ol>
<span id="how-to-install-and-use-wiringop-python"></span>