This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM Library - glitch definition/status?

What exactly are the "glitch" issues with the PWM master library? I see there have been some recent updates, but no clear indication as to what issues remain or have been resolved? I take it the 4 channel (non-glitchless?) version still glitches or has some issues?

My project needs 4 PWM channels. Its very important the output is predictable and that the waveform can never unintentionally invert.

  • Hi

    The naming in the latest version is probably a bit misleading, as both drivers should now be glitchless.

    If you need 4 channels without glitches you should use the latest version of nrf_pwm.c. The drawback of this driver is that it uses the timeslot API for the SoftDevice, which limits the maximum update frequency of the PWM. If you don't use a SoftDevice the timeslot API is not needed, but the PWM will require to run at the highest interrupt priority when updating the duty cycle.

    To minimize overhead when using the new nrf_pwm.c driver it is recommended to update several channels in a row using the nrf_pwm_set_values(..) function, rather than updating each channel individually.

    To summarize, nrf_pwm.c should work well now without glitches, so please try that out. If you do experience any issues please let us know :)

    Regards Torbjørn

Related