Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lfclk configuration initialization

I want to initialize LFCLK on startup to reduce power consumption. I am doing it as given below. Is this the correct approach of initializing LFCLK to reduce power consumption ? It is working in my code, but is there any pitfall in waiting in sleep mode, to complete the LFCLK initialization ?

SDK 17.0.2

int main(void)
{

ret_code_t err_code = nrf_drv_clock_init();
APP_ERROR_CHECK(err_code);

nrf_drv_clock_lfclk_request(NULL);


while(!nrf_drv_clock_lfclk_is_running())
{
idle_state_handle();
}

Parents
  • Hi,

    This looks like a sensible way to start the LFCLK using the clock driver. I am not sure why you mean this will result in a lower power consumption, though. Perhaps you can elaborate on what you are doing and how you want to save power?

  • Hi Einar, Thank you for your reply.

    If I don't start the LFCLK, it is consuming more current when I start using I2C or SPI. Why is it so ?

  • The TWI or SPI has no dependency on the LFCLK, but other parts of your application might. I cannot say without knowing more about your application. Generally speaking, if you do not use the LFCLK for anything, it would not matter, as the current consumption of the clock itself is so low. Perhaps you are using an RTC and as that does not work without the LFCLK running, it causes some problem with your app. Again, I cannot really say why whiteout knowing what you need the LFCLK for in your application.

Reply
  • The TWI or SPI has no dependency on the LFCLK, but other parts of your application might. I cannot say without knowing more about your application. Generally speaking, if you do not use the LFCLK for anything, it would not matter, as the current consumption of the clock itself is so low. Perhaps you are using an RTC and as that does not work without the LFCLK running, it causes some problem with your app. Again, I cannot really say why whiteout knowing what you need the LFCLK for in your application.

Children
Related