The good news is that hardware PWM works and the jitter observed with RPi.GPIO is nowhere to be seen.
The bad news is that it doesn't appear to be supported by Python directly so far as I can see.
The other good news, though, is that it's fairly easy to do. It's like doing manual GPIO manipulation via /sys/class. You write a "0" to /sys/class/pwm/pwmchip0/export and in response you'll see /sys/class/pwm/pwmchip0/pwm0/ show up. Inside pwm0 you'll find "period", "duty_cycle" and "enable". Write a cycle period in nanoseconds (1000000 for 1 kHz) into "period", write the number of nanoseconds you want it to be high (e.g. 100000 for 10%) into "duty_cycle" and a "1" into "enable".
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.