rbis2101
Posts: 2
Joined: Wed Jul 03, 2019 2:29 am

PWM specs

Wed Jul 03, 2019 2:46 am

I've looked in the forums and for other on line documentation. I just need a few simple answers. What is the resolution of the PWM the pi3 is capable of (%DC)? How many pins on the header are PWM capable?

User avatar
HermannSW
Posts: 1392
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: PWM specs

Wed Jul 03, 2019 10:30 am

rbis2101 wrote:
Wed Jul 03, 2019 2:46 am
What is the resolution of the PWM the pi3 is capable of (%DC)?
With software PWM between 320Hz and 16000Hz with pigpio library:
http://abyz.me.uk/rpi/pigpio/pigs.html#PFS
How many pins on the header are PWM capable?
All pins can do software PWM. In addition Pi allows for two hardware PWMs [GPIO(12|18) and GPIO(13|19)]:
http://abyz.me.uk/rpi/pigpio/pigs.html#HP
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

rbis2101
Posts: 2
Joined: Wed Jul 03, 2019 2:29 am

Re: PWM specs

Sat Jul 06, 2019 2:35 am

Hermann thanks for your reply. It sounds like the frequency range is impressive, however I'm particularly in the duty cycle - you know the ratio of the time high to time low for each cycle. Can it be as low as 1% even with the software outputs or even <1%?

User avatar
joan
Posts: 14193
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: PWM specs

Sat Jul 06, 2019 7:18 am

The pigpio software PWM defaults are 800 Hz with 250 steps (internally mapped to 0-255). If you lower the frequency you get more resolution. If you higher the frequency you get less resolution. E.g. at 8000 Hz there are 25 steps, at 200 Hz there are 1000 steps.

The pigpio hardware PWM defaults are 250 million / frequency steps.

Return to “Interfacing (DSI, CSI, I2C, etc.)”