Is possible to generate 4 different pwm with the NRF51822 ?
Is possible to generate 4 different pwm with the NRF51822 ?
Hi Augusto,
Since a timer only has 4 capture compare CC[] registers, you can create maximum 3 PWM with 1 timer. So to have 4 timer you would need to use 2 timers or use CPU instead of PPI. There is an example of making 3 PWM from one timer here: devzone.nordicsemi.com/.../is-there-an-example-code-for-using-pwm-on-the-nrf51822-with-a-softdevice
To elaborate a bit on the limitations: When using SoftDevice, 8 PPI channels are available. One PWM needs 2 PPI channels. 4 PWM would indeed be possible by using 2 timers (TIMER1 and TIMER2), but 5 would not because we run out of PPI channels. Am I correct?
Hi Mst,
Yes, you are correct, current Softdevice now occupies 8 PPI channel leaving only 8 left. But in the future version, we may get more since the Softdevice will start to use the predefined PPI channel instead.
Does the same apply for the 51422? If i need four PWM's can i generate them from two timers?