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

Analysis of Clock source

Hi ,

I am working on project which is based on nrf9160 Development board. 

could you please verify these points-

1. I am sharing the snapshot of the registers before going through the function nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC); 


According to the document  default behavior is to run on 64 MHz RC oscillator, status of HFCLKRUN register should get trigger before going to the nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC); function, But the status in register is not triggered. how we will ensure that it is working on which clock source before going to the function nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC). 

 According to the document nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC) can't be called when low frequency clock is running, that means it is working on different frequency before calling this function so the status get updated in register but it is not updating the status of registers.

2. Before going to the function nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC) the status of register are -

  after going through the function nrf_clock_lf_src_set(NRF_CLOCK, CLOCK_CONTROL_NRF_K32SRC)  the status of the register are- 

3. How we will change the clock source to different clock ?

Parents
  • Hi,

     

    There's two clock sources:

    * HFCLK

    * LFCLK (automatically started by the zephyr kernel)

     

    You are changing the LFCLK (32.768 kHz) and inspecting the HFCLK registers. Try triggering

    NRF_CLOCK->TASKS_HFCLKSTART = 1;

    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);

    Then checking HFCLKSTAT register.

     

    Kind regards,

    Håkon

  • Hi Hakon 
      

    Could you please verify these points also-

    1. According to initial values in LFCLKSTAT register which is [1:0] ,Board is using 32kHZ clock source initially. means 1 refers to the LFRC and 0 refers to the requested LFCLK source has not been started. 

    But why the status is not running . To show the status as running we need to trigger the NRF_CLOCK->TASKS_LFCLKSTART = 1; then what will be the difference . means both the cases using the same clock of 32kHz.

     

Reply
  • Hi Hakon 
      

    Could you please verify these points also-

    1. According to initial values in LFCLKSTAT register which is [1:0] ,Board is using 32kHZ clock source initially. means 1 refers to the LFRC and 0 refers to the requested LFCLK source has not been started. 

    But why the status is not running . To show the status as running we need to trigger the NRF_CLOCK->TASKS_LFCLKSTART = 1; then what will be the difference . means both the cases using the same clock of 32kHz.

     

Children
Related