Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 5 Plus

302 bytes added, 11:11, 7 June 2023
PWM test method
<li><p>From the table below, the PWMs available for Orange Pi 5 Plus include PWM0, PWM1, PWM11, PWM12, PWM13, and PWM14 a total of six PWM</p>
<p>[[File:media/image304.png|575x137px]]</p></li>
<li><p>The corresponding pins of PWM in 40pin are shown below. PWM0_M0 and PWM0_M2, PWM1_M0 and PWM1_M2, PWM14_M0 and PWM14_M2 can only be used at the same time. They cannot be used at the same time. They are the same PWM, but they only get different pins. Please think that they are two different PWM bus</p></li></ol>
{| class="wikitable" style="width:800px;"
|-
| style="text-align: left;"| '''PWM bus'''
| style="text-align: left;"| '''No. 7 pin'''
|}
</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>In the Linux system, the PWM in 40 PIN is closed by default, and it needs to be opened manually to use. The detailed steps are shown below:</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First add the following configuration to &gt; the'''/boot/extlinux/extlinux.conf'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>[orangepi@orangepi ~]$ '''sudo vim /boot/extlinux/extlinux.conf'''</p>
<p>LABEL Orange Pi</p>
<p>LINUX /Image</p>
<p>FDT /dtbs/rockchip/rk3588-orangepi-5-plus.dtb</p>
<p>'''<span style="color:#FF0000">FDTOVERLAYS /dtbs/rockchip/overlay/rk3588-pwm0-m0.dtbo</span>'''</p>|}<p>The red font demonstrates the configuration of the '''pwm0-m0'''. The other configurations are shown in the table below, and the corresponding dtbo configuration can be added behind '''<span style="color:#FF0000">FDTOVERLAYS</span>'''</p></li></ol></li></ol>
{| class="wikitable" style="width:800px;"
|-
| style="text-align: left;"| '''PWM bus'''
| style="text-align: left;"| '''/dtbs/rockchip/overlay/rk3588-pwm14-m2.dtbo'''
|}
</ol>
<ol style="list-style-type: lower-alpha;">
<li>Then '''<span style="color:#FF0000">restart the OPi OS Arch system</span>'''</li></ol></li></ol>
<!-- -->
<ol start="4" style="list-style-type: decimal;">
<li><p>After opening a pwm,In the'''/sys/class/pwm'''/, there will be an additional pwmchipX (x is a specific number). For example, after opening PWM14,viewing'''/sys/class/pwm/'''down Pwmchipx will change from two to three.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>[orangepi@orangepi ~]$ '''ls /sys/class/pwm/'''</p>
<p>pwmchip0 pwmchip1 pwmchip2</p>|}</li>
<li><p>Which pwmchip corresponds to pwm14 above? Let's first check out the output of '''ls /sys/class/pwm/ -l''' command, as shown below:</p>
<div class="figure">
<li><p>Then from the table below, the base address of the PWM14 register is FEBF0020, and then look at the output of the '''ls /sys/class/pwm/ -l''' command. You can see that the link in PWMCHIP2 is connected to Febf0020.PWM, so the PWM14 corresponds to PWMCHIP2</p>
<p>[[File:media/image318.png|575x287px]]</p></li>
<li><p>Then use the following command to allow the PWM14 to output a 50Hz square wave (please switch to the root user first, and then execute the following command)</p></li></ol>
{| class="wikitable" style="width:800px;"
|-
|
[root@orangepi ~]# '''echo 0 &gt; /sys/class/pwm/pwmchip2/export'''
[root@orangepi ~]# '''echo 1 &gt; /sys/class/pwm/pwmchip2/pwm0/enable'''
|}
[[File:media/image319.png|575x346px]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>The other pwm testing methods in the pwm14 demonstration above are similar。</li></ol>
<span id="cans-test-method"></span>
 
=== CAN's test method ===