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

LFCLKSTAT status

I want to read the status of LFCLK,but I find that ,the value I have readed is awayls zero! my code is follow : LFCLK_State = ((NRF_CLOCK->LFCLKSTAT) >> 16) & 0x00000001; printf("LFCLK_State:%u\r\n",LFCLK_State);

   Is there any mistake here?

thanks and best regards

Parents
  • Yes I have faced similar problem. There is a wait time before register will be updated.

    Please add some - for example nrf_delay_ms(2) before reading register status.

    I guess you have following problem:

    1. reset
    2. starting LFCLK
    3. read status == not running.

    I proposed 2 ms between points 2 and 3 and it shall be far enough. Basically I believe you can change it to nrf_delay_us(30) or even less. You need to test it.

Reply
  • Yes I have faced similar problem. There is a wait time before register will be updated.

    Please add some - for example nrf_delay_ms(2) before reading register status.

    I guess you have following problem:

    1. reset
    2. starting LFCLK
    3. read status == not running.

    I proposed 2 ms between points 2 and 3 and it shall be far enough. Basically I believe you can change it to nrf_delay_us(30) or even less. You need to test it.

Children
No Data
Related