Replies: 1 comment
-
I am unable to reproduce this issue locally. Can you provide example application code for reproducing this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
PWM usage under Zephyr seems to be a little odd, possibly because I'm not cleaning up the previous PWM states during initialization.
I can reproduce the issue easily under nRF52840, nRF52833 (Microbit v2) and STM32.
For example, if I have two LEDs connected to PWM1 channels 0 & 1, and the third LED to PWM2 channel 0, driving one of the PWM, say PWM1 0 works fine, as expected. However, the other two LEDs on the PWM1 channel 1 & PWM2 channel 0 will also light up. A workaround, at least on the PWM not driving the PWM signal, is to explicitly set the other LED LOW and somehow also turn off the PWM1 channel 1 LED.
If I use the same code with the Arduino Core, the problem doesn’t arise. Arduino appears to clear the previous PWM states on initialization. I expect that I'm not clearing the previous state of the PWMs before use.
Has anyone else seen the above or similar behavior?
What’s the best way to make sure that any previous PWM states have been cleared before use? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions