Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

PWM through IO Pi Plus Pins

2263 Views - Created 15/06/2017

15/06/2017

Posted by:
SamC-E

SamC-E Avatar

Location:
UK

Hello,In a python environment is it possible to generate software PWM through IO Pi Plus pins with a library such as RPI.GPIO? The key question I have being are you able to assign reference to a pin so I could refer to the IO pin required in a function call such as GPIO.PWM(PWM_PIN, 255)?Any help would be much appreciated.Many Thanks,Sam

15/06/2017

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

I am afraid it is not possible to generate a proper PWM output on the IO Pi Plus pins. The closest you could get is to toggle a pin on and off manually with a software timer to control the on and off durations but it takes around 0.4ms to change the state of a pin so you wouldn't be able to create a PWM output that is faster than around 100Hz and the accuracy would change depending on the CPU usage.

We do sell a dedicated PWM output board, the Servo Pi Zero, which can generate a 40Hz to 1000Hz PWM signal with a 12-bit resolution duty cycle.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.