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

nRF 52832 Timer Interrupt and Frequency adjustment

Hello,

I need my timer to work at 9600 bps frequency. So accordingly my frequency is 16MHz and to get 9600 Hz I calculated the prescaler to be 10.7 ~ 11. But in the timer code (pca10040) I couldnt find any provision to set the prescaler as required. I see there are only 10 fixed frequency values for the prescaler. So how to I get my timer to work at 9600 bps along with its interrupt (IRQ handler ) ?

These are the prescaler values I am talking about

/**
* @brief Timer prescalers.
*/
typedef enum
{
NRF_TIMER_FREQ_16MHz = 0, ///< Timer frequency 16 MHz.
NRF_TIMER_FREQ_8MHz, ///< Timer frequency 8 MHz.
NRF_TIMER_FREQ_4MHz, ///< Timer frequency 4 MHz.
NRF_TIMER_FREQ_2MHz, ///< Timer frequency 2 MHz.
NRF_TIMER_FREQ_1MHz, ///< Timer frequency 1 MHz.
NRF_TIMER_FREQ_500kHz, ///< Timer frequency 500 kHz.
NRF_TIMER_FREQ_250kHz, ///< Timer frequency 250 kHz.
NRF_TIMER_FREQ_125kHz, ///< Timer frequency 125 kHz.
NRF_TIMER_FREQ_62500Hz, ///< Timer frequency 62500 Hz.
NRF_TIMER_FREQ_31250Hz ///< Timer frequency 31250 Hz.
} nrf_timer_frequency_t;

Parents Reply Children
No Data
Related