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 :)

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

1 Answer 1

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.

1
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Mar 7, 2020 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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