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?
Parents
  • 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;
    
Reply
  • 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;
    
Children
No Data
Related