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

nrf52DK 32k crystal current higher than RC

Testing on nrf52DK (QFAAB0), without softdevice, unfortunately still on SDK10 and NRF52 sleeping on RTC. Programming pins disconnected.

Measured:

  • low frequency clock source being external crystal with 3.05uA,
  • running on RC oscillator it shows (without calibration) 2.0 uA.

Product specification v1.3 reads as follows:

  • I_LFXO Run current for 32.768 kHz crystal oscillator: typ. 0.25uA

  • I_LFRC Run current for 32.768 kHz RC oscillator: typ. 0.6 uA max. 1uA

I can't understand why does running on external crystal consume more than on RC (>1uA (3.05 - 2.0) more, whereas it sould be ~0.35 (I_LFXO - I_LFRC) less instead)?

Found one errata issue thats somewhat similar, though there is no soft reset occuring: [101] CLOCK: Sleep current increases after soft reset

  • //Working code based on SDK 12.2. Exactly the same results.

    #include "nrf.h"
    #include "nrf_gpio.h"
    #include "nrf_drv_rtc.h"
    #include "nrf_drv_clock.h"
    #include "app_error.h"
    #include <stdint.h>
    #include <stdbool.h>
    
    const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(0);
    
    static void rtc_handler(nrf_drv_rtc_int_type_t int_type)
    {
    }
    
    static void lfclk_config(void)
    {
        ret_code_t err_code = nrf_drv_clock_init();
        APP_ERROR_CHECK(err_code);
    
        nrf_drv_clock_lfclk_request(NULL);
    }
    
    static void rtc_config(void)
    {
        uint32_t err_code;
    
        //Initialize RTC instance
        nrf_drv_rtc_config_t config = NRF_DRV_RTC_DEFAULT_CONFIG;
        err_code = nrf_drv_rtc_init(&rtc, &config, rtc_handler);
        APP_ERROR_CHECK(err_code);
    
        //Set compare channel to trigger interrupt after COMPARE_COUNTERTIME seconds
        err_code = nrf_drv_rtc_cc_set(&rtc,0, 30 * RTC_DEFAULT_CONFIG_FREQUENCY,true);
        APP_ERROR_CHECK(err_code);
    
        //Power on RTC instance
        nrf_drv_rtc_enable(&rtc);
    }
    
    static void dk_gpio_pins_low_power_init()
    {
    	for(int i = 0; i < 32; i++)
    		nrf_gpio_cfg_input(i, NRF_GPIO_PIN_PULLDOWN);
    // DK leds
    	nrf_gpio_cfg_input(17, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(18, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(19, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(20, NRF_GPIO_PIN_PULLUP);
    // DK buttons
    	nrf_gpio_cfg_input(13, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(14, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(15, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(16, NRF_GPIO_PIN_PULLUP);
    // DK I2C com
    	nrf_gpio_cfg_input(26, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(27, NRF_GPIO_PIN_PULLUP);
    // DK Prog UART
    	nrf_gpio_cfg_input(5, NRF_GPIO_PIN_PULLUP);	// CTS
    	nrf_gpio_cfg_input(6, NRF_GPIO_PIN_PULLUP);	// RxD
    	nrf_gpio_cfg_input(7, NRF_GPIO_PIN_PULLUP);	// RTS
    	nrf_gpio_cfg_input(8, NRF_GPIO_PIN_PULLUP);	// TxD
    // DK SWO RES
    	nrf_gpio_cfg_input(18, NRF_GPIO_PIN_PULLUP);
    	nrf_gpio_cfg_input(21, NRF_GPIO_PIN_PULLUP);
    }
    
    int main(void)
    {
    	dk_gpio_pins_low_power_init();
    
        lfclk_config();
    
        rtc_config();
    
        while (true)
        {
            __SEV();
            __WFE();
            __WFE();
        }
    }
    
  • Try nrf_gpio_cfg_default() for all those pins - this should yield less current consumtion.

  • Thank you so much Now on Xtal consumes around 2,1uA and RC 2.0uA. Coming from Atmel world where unconfigured floating inputs always drew unexpected amounts (at least tinys)... So this must be possible because of true input-disconnect...

Related