PWM available on which dock?
-
Hi.
I'm wondering on which boards the PWM function is available?
Mainly I'm interested if I can use PWM on the power board and mini dock.Regards
-
There's no PWM mechanism in Omega 2 itself so I think there's no way it is available on the mini dock or power board.
But, hey, look at the docs: https://docs.onion.io/omega2-docs/pwm-expansion.html
-
@LaurentN The PWM Expansion can generate 16 free-running PWM signals, see the docs here: https://docs.onion.io/omega2-docs/pwm-expansion.html and the store page here: https://onion.io/store/servo-pwm-expansion/
Alternatively, you can use
fast-gpio
to generate software PWM (less reliable) on the Omega's GPIOs:
https://docs.onion.io/omega2-docs/using-gpios.html#fast-gpio
-
@Patryk-Wychowaniec said in PWM available on which dock?:
There's no PWM mechanism in Omega 2 itself so I think there's no way it is available on the mini dock or power board.
Of course there is! The MT7688 has a four channel PWM unit, 2 of them can be made available on Omega2 gpio pins 18 and 19 (using
omega2-ctrl
).
I use these PWM units to drive WS28xx-type LED chains.There's even standard kernel support for these PWMs - see "Using PWMs with the sysfs interface" paragraph of this document. Problem here is that this is not enabled in the standard Omega FW build so far, and because that build is still not fully open source (to lament once again) , there's no easy way to enable it. But if you can build your own LEDE FW images, the PWMs are easy to use and very precise.
-
@luz said in PWM available on which dock?:
build is still not fully open source
It is now! Let us know which configuration to select or submit a PR
-
@Lazar-Demin I'm really glad about the open source LEDE tree! Thanks!
As I am just on my way to vacation right now, I can't dig deep into it right now
But regarding PWM, the only thing that seems missing (I couldn't actually test, just compared my tree / .config with yours) is actually enabling it in the device tree.
I had to append
&pwm { status = "okay"; };
at the end of
target/linux/ramips/dts/OMEGA2.dtsi
to make the /sys/class/pwm interface work for me with kernel 4.4 (lede-17.01), so it should work for the Onion FW build.With kernel 4.9 however, (LEDE master) there seems to be some resource conflict over GPIO18 and 19, which makes the PWM driver fail at load. Couldn't find out details yet.