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

nRF51822 and PWM

Hi all,

I see that the nRF51 doesn't have a PWM module and a software PWM library is needed. How well does the software module actually run? I've had rather bad experiences with software I2C in the past (on another processor), so I wonder how stable, efficient, etc. the PWM library is.

Thanks

  • PWM on nRF51 is implemented using TIMER, PPI and GPIOTE, so it is not software in the sense that gpio is toggled in software. It is more a combination of different hardware peripherals to do what a hardware PWM does.

    I would recommend to use the PWM library from SDK 10 or 11. The PWM library had some issues prior to SDK 10 that the signal was inverted, but this is now fixed. Unfortunately the PWM library you linked to also have had reported issues of inverting.

    The PWM library from SDK 10 or 11 implemented a way of fixing this. It does have some limitiations described here which includes duty cycle update latency, number of channels per timer and frequency of PWM signal. For most users this is not a problem.

Related