1

I'm using the pi 3a+ pwm to send sync informations to my music gear. When I stop the pwm, I don't use the pwm.stop(), but rather set the duty cycle to 0. This is because I run the pww from a different process, and can't stop() otherwise when I start again the frequency bugs (I think it's a known issue with GPIO from different process)

The issue is that when I restart, setting the duty cycle back to normal (50 in my case) the pwm signal doesn't go directly to HIGH, it finished the previous cycle (with the duty cycle of 0). This leads to sync errors with my music gear.

Any idea how I could fix that ? I've tried changing the frequency to something very high just before reseting the duty cycle to normal but didn't work

Thanks :)

  • Could your pwm process monitor a variable that the other process sets then issue the stop() ? – CoderMike Feb 3 at 7:35
1

Ok in the end I think there is no way to reset the PWM, so I tried solving the problem of using the pwm.stop() inside the process.

And I managed to do so by changing the frequency every time I restart the pwm. (by changing I mean redefining the same frequency as before)

This way the frequency doesn't bug any more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.