Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PWM1 on H5

Featured Replies

On the Orange Pi Zero Plus the pwm1 port is available on the header instead of pwm0.

Ik have tried to create a custom overlay but it does create a pwm device but it is not working.

 

pwm1 is on PA6

I have created a folder: overlay-user in /boot

In this folder I created a sun50i-h5-pwm1.dts file with the following content:

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun50i-h5";

        fragment@0 {
                target = <&pio>;
                __overlay__ {
                        pwm1_pin: pwm1 {
                                pins = "PA6";
                                function = "pwm1";
                        };
                };
        };

        fragment@1 {
                target = <&pwm>;
                __overlay__ {
                        pinctrl-names = "default";
                        pinctrl-0 = <&pwm1_pin>;
                        status = "okay";
                };
        };
};

I converted this file with the command:

sudo dtc -O dtb -o sun50i-h5-pwm1.dtbo sun50i-h5-pwm1.dts 

 

after rebooting a pwmchip is available in the /sys/class/pwm

but if I try to export pwm1 I get an error

Quote

arnoud@orangepizeroplus:/sys/class/pwm/pwmchip0$ export sudo sh -c "echo 1 > export"  

sh: 1: echo: echo: I/O error

 

There seems to be a pwm0 but when I start this pwm no pwm output is given

Quote

arnoud@orangepizeroplus:/sys/class/pwm/pwmchip0$ export sudo sh -c "echo 1 > export"  

arnoud@orangepizeroplus:cd pwm0

arnoud@orangepizeroplus:/sys/class/pwm/pwmchip0/pwm0$ sudo sh -c "echo 1000000 > period"                                      

arnoud@orangepizeroplus:/sys/class/pwm/pwmchip0/pwm0$ sudo sh -c "echo 500000 > duty_cycle"
arnoud@orangepizeroplus:/sys/class/pwm/pwmchip0/pwm0$ sudo sh -c "echo 1 > enable"
 

 

Can someone please give me a hint in what I am doing wrong.

 

 

 

  • Author

OMG. I am looking in the docs of the datasheet of the Allwinner H5 and noticed the functions of the pinning is totally different and there is no pwm1

https://linux-sunxi.org/images/a/a3/Allwinner_H5_Manual_v1.0.pdf

 

A second look at the schematics of the orange pi zero plus confronted me with the fact they did not replaced the chip and have just used the H3 chip in the schematics.

https://drive.google.com/drive/folders/1RH2j3TY7MUZvV9V_cz6r5iDbeloxnEy6

 

Using pwm on this board is not usable for me, as I do not want to disable the ttyS0. 

As it is only for driving a buzzer I will probably replace the buzzer for an active buzzer.

 

So solved: Documentation of board is misleading.. 

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.