HI FLOKS,I HAVE DOUBT ON TIMER
WHAT IS TIMER TICKS AND WHAT IS THE FORMULA TO CALCULATE IT?
WHY TIMER IS CONVERTING INTO TIMER TICKS?
HI FLOKS,I HAVE DOUBT ON TIMER
WHAT IS TIMER TICKS AND WHAT IS THE FORMULA TO CALCULATE IT?
WHY TIMER IS CONVERTING INTO TIMER TICKS?
Hi,
The TIMER peripheral runs off the 16 MHz high-frequency clock, which does not necessarily match any standard time-unit. The frequency of the timer is determined by the configured PRESCALER. When the timer is running, it will tick at a given interval, determined by the frequency. For instance if the PRESCALER is 0, the timer will tick every 1/16MHz = 62.5 ns.
We have functions in the SDK (nrfx_timer_ms_to_ticks()/nrfx_timer_us_to_ticks()) that can be used to calculate time to ticks. You can look at the implementation of these functions on how to calculate the ticks.
Best regards,
Jørgen