Embassy - unexplained high duty cycle when starting PWM sequencer

Hi !

I recently took inspiration from Embassy's examples and wrote a test to loop through multiple color gradients on my nRF52840 Dongle's onboard RGB LED with the press of a button. I rely on the hardware PWM.

I can loop through the gradients as expected but, unfortunately, I noticed something strange.
Each time a new SingleSequencer is started the RGB LED flashes white, with the following characteristics :

  • it only happens when starting a sequencer
  • on subsequent repetitions of a sequence, this flash does not happen
  • it seems highly dependent on the content of the seq_words Array. For example, longer arrays seems to lead to a higher and/or longer duty cycle. Small arrays (8 values) make it imperceptible.

I read the nRF52840 documentation and could not find any explanation. Nothing seems to point to a high duty cycle on initialization.

I am unfortunately unable to identify the source of this behavior.

  • am I using Embassy incorrectly ?
  • did I miss something in the nRF PWM docs ?

Thanks !

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.