PWM sequence in NCS

I want to implement a PWM up/down ramp that preferably runs with no CPU involvement. From the datasheet it seems I can do this by storing a sequence in RAM and having the PWM peripheral run it.

But the Zephyr PWM API docs make no mention of sequences.

How would I go about running a PWM sequence with the nRF Connect SDK?

  • Last time I looked at the Zephyr PWM driver, it lacked the features I needed.  So I disabled it in Kconfig/DTS and just called the NRFX functions directly: nrfx_pwm_init(), nrfx_pwm_simple_playback()

    Can share sample code privately

  • Yes, if you would want to do it without involvement of the CPU then you would have to use the PPI system which is not supported by Zephyr. Using nrfx for this would therefore be better. If you already have a sample code, then it would be nice if you could share it with  

  • I am also trying to achieve same thing but not working at high frequency. Can anyone please share the sample code?

  • Hi there,

    This ticket is a bit outdated but if you're looking for a PWM nrfx sample then you can find it NCS\modules\hal\nordic\nrfx\samples\src\nrfx_pwm

    regards

    Jared