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

why timer of SDK 9.0 needn't code to trigger the clock.

I read timer example of SDK7.0/6.0, and found that often we write some code to tigger the clock. but the same example of SDK9.0 needn't. why ?

the code of SDK7.0: NRF_CLOCK->TASKS_HFCLKSTART = 1; to trigger the clock.

/**

  • @brief Function for timer initialization. */

static void timer_init()

{ // Start 16 MHz crystal oscillator. NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1;

// Wait for the external oscillator to start up.
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0)
{
    // Do nothing.
}

NRF_TIMER0->MODE        = TIMER_MODE_MODE_Timer;       // Set the timer in Timer Mode.
NRF_TIMER0->PRESCALER   = 9;                           // Prescaler 9 produces 31250 Hz timer frequency => 1 tick = 32 us.
NRF_TIMER0->BITMODE     = TIMER_BITMODE_BITMODE_16Bit; // 16 bit mode.

}

Related