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

question regarding NRF_TIMER(0,1,2) clock source-nrf51822

Dear Nordic guy, I 'm developing LG product with nrf51822 chip. I have some question.

  1. Applcation SW timer use the rtc1 clock source.so, When NRF_timer interrupt expired during rtc1 SW timer handler code is executing, Does NRF_timer interrupt handler is executed immediately? Or Does NRF_timer interrupt handler is executed after finishing rtc1 SW timer handler code execution?
  2. As I know,NRF_timer use the 16Mhz main clock. How much current consumption is happened when we use this timer?
  • The current consumption (or the dependencies of each peripheral) can be found in the PS chapter 8. For the timer running in systemon mode, it will be HFCLK+TIMER current, which is (470 + 30) uA.

    There are four interrupt priorities in the nRF51x22, from 0 to 3 (0 is highest), which are available for the developer. If you are using any of the Softdevices, please note that it claims priority 0 and 2, leaving 1 and 3 open for the application.

    An "interrupt X" can interrupt an ongoing "interrupt Y" (sorry for the bad sentence) only if "interrupt X" is of higher priority than "interrupt Y". If they are equal or "interrupt Y" is of higher priority, the interrupt will be nested and executed when the previous is finished.

    This then depends on how you have setup the NVIC interrupt priority.

  • Dear Nordic guy,thank you for your consideration. I made the nrf timer1-1sec interval and I saw that timer interrupt is expired every 1sec and handler is executed. but there are one problem is happened. when I use the nrf timer1, It seems like that ble stack not working,not advertising.

    my code is that :

    static void NRF_Timer_init(uint8_t sec) { NRF_TIMER1->TASKS_STOP = 1; // Create an Event-Task shortcut to clear TIMER1 on COMPARE[0] event NRF_TIMER1->SHORTS = (TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos); NRF_TIMER1->MODE = TIMER_MODE_MODE_Timer << TIMER_MODE_MODE_Pos; NRF_TIMER1->BITMODE = (TIMER_BITMODE_BITMODE_32Bit << TIMER_BITMODE_BITMODE_Pos); NRF_TIMER1->PRESCALER = 9; // 32us resolution NRF_TIMER1->INTENSET = (TIMER_INTENSET_COMPARE0_Set << TIMER_INTENSET_COMPARE0_Pos);

    // With 32 us ticks, we need to multiply by 31.25 to get milliseconds.
    NRF_TIMER1->CC[0]          = (sec*1000) * 31;
    
  • Hi,

    I see that you have posted this specific question through our MyPage as well, and a colleague of mine is supporting you through the support portal. You are of course free to choose between devzone and the support portal, but please do not double post into both systems.

Related