Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 3 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
9 years, 2 months ago.
/mbed-src/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/pwmout_api.c
- define TIMER_PRECISION 4 4us ticks
- define TIMER_PRESCALER 6 4us ticks = 16Mhz/(2^6)
By default the timer prescaler is set to 4uS steps.