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

external 32.768K start up question

in sdk16 "examples\peripheral\usbd_hid_composite" example, i found that after those code

ret = nrf_drv_clock_init();
APP_ERROR_CHECK(ret);

nrf_drv_clock_lfclk_request(NULL);
while(!nrf_drv_clock_lfclk_is_running())
{
/* Just waiting */
}

the external 32.768 clock is not running through this register:NRF_CLOCK->LFCLKSTAT, it indicates internal RC is running ,not external RC;

my question is ,in the while loop, why "nrf_drv_clock_lfclk_is_running" doesn't judge it is internal RC or external RC?

seems like it is a bug.

Parents
  • Hello,

    As you said, it only checks if the LF clock is running or not. Not what the clock source is. If you want that you can wait for the LF clock started event instead, as explained in the PS. I think the main point here is to actually have a running LF clock before starting the app timer and not what the clock source is. It should be ok to run the RTC of the less accurate RC while waiting for the crystal to ramp up.

Reply
  • Hello,

    As you said, it only checks if the LF clock is running or not. Not what the clock source is. If you want that you can wait for the LF clock started event instead, as explained in the PS. I think the main point here is to actually have a running LF clock before starting the app timer and not what the clock source is. It should be ok to run the RTC of the less accurate RC while waiting for the crystal to ramp up.

Children
No Data
Related