5 years, 10 months ago.

Hardware timer on nRF51822

I am trying to achieve a 15.625 kHz (doesn't have to be exact) frequency PWM signal with a 10-bit duty cycle resolution on the nRF51822. The chip has a 16 mHz clock, so it should work, but I am not getting there with the PwmOut lib. Is it using hardware timers on the nRF51822? Is there something else I am missing?

Thanks in advance, Tom

Question relating to:

1 Answer

5 years, 9 months ago.


  1. define TIMER_PRECISION 4 4us ticks
  2. define TIMER_PRESCALER 6 4us ticks = 16Mhz/(2^6)

By default the timer prescaler is set to 4uS steps.