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

NRF52 PWM library or driver?

Hello,

I am trying to build a remote control using NRF52832 SoC, SDK16.0.0 with softdevice S132 version 7, Keil 5.

I have to control a servo motor and i want to achieve this using the PWM HW integrated in the chip.

I am also using the softdevice S132.

Should i start with the examples from the PWM Library? or the ones from PWM driver?

The examples from PWM driver looks very complicated compared to the task that i have.

I also searched about servo examples using nrf52, but i didn't found a simple example which is working.

Is there a way to directly update the Compare register from the Timer with the calculated value in order to control the servo?

Thank you!

Parents
  • One more question regarding the PWM driver and PWM driver example:

    Is there a way to change the polarity of the pin?

    I am using BSP_LED_0 | NRF_DRV_PWM_PIN_INVERTED and also just BSP_LED_0 with the same effect, the pin is LOW until reaches the COMP value, then goes HIGH until  TOP.

    The pin is working correctly if i use the PWM_Libary example.

    Thanks

Reply
  • One more question regarding the PWM driver and PWM driver example:

    Is there a way to change the polarity of the pin?

    I am using BSP_LED_0 | NRF_DRV_PWM_PIN_INVERTED and also just BSP_LED_0 with the same effect, the pin is LOW until reaches the COMP value, then goes HIGH until  TOP.

    The pin is working correctly if i use the PWM_Libary example.

    Thanks

Children