Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No PWM output on GPIO12 (PWM0) #16

Open
yahaggach opened this issue May 17, 2024 · 1 comment
Open

No PWM output on GPIO12 (PWM0) #16

yahaggach opened this issue May 17, 2024 · 1 comment

Comments

@yahaggach
Copy link

HI,

Thanks for the effort in putting the library up.

I have issues getting the PWM to output. I followed all the steps and i can see that the pwm module is correctly initialized with grep on terminal. But I do not get any output on the pin... This is my overlay : dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4

I actively use GPIO 18, GPIO 13 and GPIO 19 could it be that PWM when instanciated necessarily is routed to all pins defined in overlay and some conflict is happening that I am not aware of ?

Thanks for any tip

@JonasGUHasselt
Copy link

JonasGUHasselt commented May 18, 2024

Hello yahaggach

I don't know if you made the same mistake as I did, but your problem seems similar to mine. So I will give you the solution to my problem, hoping that it will help you with yours.

I received no PWM output on either of my pins too. So I started looking around for a solution. I found out that if you declare your PWM pin as output or input, your GPIO pin gets connected to a different circuitry, than when you don't declare it as output or input at all. In the latter case it will get connected to the PWM circuitry. (I found this as a response on the solution for this question from the user joan: https://raspberrypi.stackexchange.com/questions/143651/how-to-set-hardware-pwm-pins).

So after removing the line: GPIO.setup(pin, GPIO.OUT) with pin being the pin you want the PWM signal to be on, the PWM started working. Hope this helps!

P.S If the author of the library would read this answer, could you please add this information to the README.md so future users will not make the same mistake as I did. Thank you in advance!

Kind regards

JonasGUHasselt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants