PWM on VIM3 Pro Ubuntu 4.9

Which Khadas SBC do you use?

VIM3 Pro

Which system do you use? Android, Ubuntu, OOWOW or others?


Which version of system do you use? Khadas official images, self built images, or others?

Khadas official image

Please describe your issue below:

@Frank Can you please upload linux-dtb-amlogic-4.9_0.9.2_arm64.deb actual it’s needed for start working PWM on my board

Post a console log of your issue below:

i haven't logs :)

@ZagTA You can use fenix to compile it. Roll back both kernel and fenix code to 0.9.2.

With current version the PWM doesn’t work?

Okay, I found the necessary package and installed it. After the reboot I ran the following commands:

khadas@Khadas:~$ sudo -i
[sudo] password for khadas:
root@Khadas:~# echo 1 > /sys/class/pwm/pwmchip4/export
root@Khadas:~# echo 1000000 > /sys/class/pwm/pwmchip4/pwm1/period
root@Khadas:~# echo 500000 > /sys/class/pwm/pwmchip4/pwm1/duty_cycle
root@Khadas:~# echo 1 > /sys/class/pwm/pwmchip4/pwm1/enable

And still the PWM doesn’t work…
I want to implement software dimming of LED backlight, but so far I can’t get PWM to work. I use IRFZ44N transistor in the power circuit of LED backlight, supply voltage is 12V

How you identify it doesn’t work? Have you an oscilloscope to check the PWM output?

LED is not glowing

It needs a current limiting resistor in series so you don’t “short” out the bus and/or burn the I/O pin out. Do you have a breadboard and some dupont wire for the setup?

Start out by doing a simple gpio(pin) on then do a gpio(pin) off to that same pin to verify the led is wired correctly. If that works proceed forward with the PWM.

Are you sure the directory: /sys/class/pwm/pwmchip4/pwm1/period exists?

$ ls /sys/class/pwm/pwmchip4/