How do I keep the 32KHz crystal active 100% of the time for testing?

I'm working on a design that is closing in on production. The design incorporates an nRF52840 with an external 32MHz and 32KHz crystal. The firmware is based on NCS 2.2.0. We are sending a sample to our crystal vendor to assist with crystal matching and testing due to concern about negative resistance. They requested that the crystals are on 100% of the time. The 32MHz crystal is on 100% of the time, however, the 32KHz crystal is only on when needed. Is there a way to force the 32KHz to stay on 100% of the time so that the crystal vendor can perform the required testing? 

Parents
  • The 32MHz crystal is on 100% of the time, however, the 32KHz crystal is only on when needed.

    Did you intend to say the opposite? By default, at least for the DK, the LFCLK is always enabled. HFCLK consumes more power and is turned off when not needed.

    Here is an example showing how to keep HFCLK running:

    https://github.com/nrfconnect/sdk-nrf/blob/main/samples/esb/esb_ptx/src/main.c#L71-L102

    You can check the .config-file in your build file to see which configs are enabled. It should look something like this:

    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC is not set
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_100PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_75PPM is not set
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_50PPM=y
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM is not set
    CONFIG_CLOCK_CONTROL_NRF_ACCURACY=50

Reply
  • The 32MHz crystal is on 100% of the time, however, the 32KHz crystal is only on when needed.

    Did you intend to say the opposite? By default, at least for the DK, the LFCLK is always enabled. HFCLK consumes more power and is turned off when not needed.

    Here is an example showing how to keep HFCLK running:

    https://github.com/nrfconnect/sdk-nrf/blob/main/samples/esb/esb_ptx/src/main.c#L71-L102

    You can check the .config-file in your build file to see which configs are enabled. It should look something like this:

    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC is not set
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_LOW_SWING is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_100PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_75PPM is not set
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_50PPM=y
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_30PPM is not set
    # CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM is not set
    CONFIG_CLOCK_CONTROL_NRF_ACCURACY=50

Children
Related