Trouble activating PWM on PA6 of Orange Pi One using DTSO and WiringOP

273 Views Asked by At

I'm attempting to activate PWM on pin PA6 of an Orange Pi One board. I've tried using a Device Tree Blob Overlay (DTBO) and accessing the sysfs interface, as well as using the WiringOP library, but I'm encountering issues.

I'm using Armbian 23.08.0-trunk Bookworm with Linux 6.4.1-sunxi.

For the DTSO approach, I've created the following DTSO file:

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun8i-h3";

    fragment@0 {
        target-path = "/chosen";
        __overlay__ {
            /delete-property/ stdout-path;
        };
    };

    fragment@1 {
        target = <&uart0>;
        __overlay__ {
            status = "disabled";
        };
    };

    fragment@2 {
        target = <&pio>;
        __overlay__ {
            pwm0_pin: pwm0 {
                pins = "PA6";
                function = "pwm0";
            };
        };
    };

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

I've exported the PWM in sysfs and configured it with the following commands:

echo 0 > /sys/class/pwm/pwmchip0/export;
echo 10000000 > /sys/class/pwm/pwmchip0/pwm0/period;
echo 5000000 > /sys/class/pwm/pwmchip0/pwm0/period;
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable 

However, I'm not getting any output from the board.

When attempting to use the WiringOP library, I receive the message:

OrangePi Pi wiringPi PWM test program the pin you choose is not surport hardware PWM you can select PI3 for PWM pin or you can use it in softPwm mode please use soft pwmmode or choose PWM pin

According to the processor's documentation, there should be PWM support on this pin. I'm unsure of what to do next.

I would greatly appreciate any insights or suggestions on how to successfully enable PWM on PA6 of the Orange Pi One board.

0

There are 0 best solutions below