Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4834

Troubleshooting • Re: Raspberry Pi 5 PWM control method inquiry

$
0
0
@gadgetoid Obviously you didn't check The python folder of my github.
I did not... unfortunately I have to go a little more generic and package something up into a library I can rely upon for the next N years... at least until the Linux maintainers deprecate sysfs PWM and bring about another character ABI.
You forget that GPIO 14 & 15 are also available if you don't want to choose GPIO 18 and 19!
Is this a new Pi 5 thing? I really should read-the-flippin'-manual.

Biggest blocker for me at the moment is finding some way to tell *which* pwmchipN node relates to which specific bit of PWM hardware. Looks like relating chips to channels to pins might have to be the remit of a Python library (somewhat like you're doing but... more so).

IE: the library figures out if PWM out on a given pin is possible on your hardware, preferring hardware PWM and falling back to PIO or GPIO alternatives when they are available.

Shelling out to "pinctrl" is absolutely cursed (and afaik not exactly standards compliant?), so in all cases it would have to rely on device tree to be setting up the right pins in the right places which really, really sucks for beginners (and for anyone who might just casually flip the output mode of a pin and disable PWM output).

And this is before the fun of potentially adding an external PWM device...

Statistics: Posted by gadgetoid — Wed Mar 06, 2024 4:19 pm



Viewing all articles
Browse latest Browse all 4834

Trending Articles