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

40uA on Power OFF nrf52832 s223

Hello, My problem is to much current c.a. 40uA in POWER OFF mode. Below attach code:

void power_down()
{
	nrf_gpio_pin_clear(22);			// Wylacz mostek tensometryczny
	nrf_delay_ms(10);
	nrf_gpio_pin_clear(20);			// Wylacz LDO 2V5
	nrf_delay_ms(10);

	timer_disable();
	saadc_sampling_event_disable();
	sd_clock_hfclk_release();
	
	// Disable TWI ready for sleep
	NRF_TWI0->ENABLE= TWI_ENABLE_ENABLE_Disabled << TWI_ENABLE_ENABLE_Pos;
		
	// shut down the dcdc
	sd_power_dcdc_mode_set(NRF_POWER_DCDC_DISABLE);
	
	sd_power_system_off();
}

int main(void)
{
    nrf_gpio_cfg_output(20);		// Ustaw EN LDO jako output
	nrf_gpio_pin_set(20);		// Wlacz LDO
	
	nrf_gpio_cfg_output(22);		// Ustaw mosfet jako output
	nrf_gpio_pin_set(22);		// Wlacz mostek tensometryczny
	
	nrf_gpio_cfg_input(14, NRF_GPIO_PIN_PULLUP);	// Ustaw mosfet jako input
	nrf_gpio_cfg_input(3, NRF_GPIO_PIN_PULLUP);		// Ustaw jako wejsicie INT1 z MMA8452
	nrf_gpio_cfg_input(18, NRF_GPIO_PIN_PULLUP);	// Ustaw jako wejsicie INT2 z MMA8452

	// ANT+ init
    uint32_t err_code;
    utils_setup();
    softdevice_setup();
    ant_state_indicator_init(m_ant_bpwr.channel_number, BPWR_SENS_CHANNEL_TYPE);
    simulator_setup();
    profile_setup();

	// This pin is used for waking up from System OFF and is active low, enabling sense capabilities.
    nrf_gpio_cfg_sense_input(PIN_GPIO_WAKEUP, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW);
		
	//Enable DCDC 
	err_code = sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
	APP_ERROR_CHECK(err_code);

    // Workaround for PAN_028 rev1.1 anomaly 22 - System: Issues with disable System OFF mechanism
    nrf_delay_ms(1);

    // TWI
    twi_init();
    //HMC5883L_init();
    //MMA8452Q_init();
		
    // SAADC
    saadc_sampling_event_init();
    saadc_init();
    saadc_sampling_event_enable();
						
    while(FORCE_SLEEP == 0)
    {
	   __SEV();
       __WFE();
	   __WFE();
    }
		
    power_down();
}

I think that any pherips is disabled... No chips connected to TWI. I would be gratefull for help.

Parents
  • Hi, are you measuring on the pca10040 DK or are you using a custom board? And what equipment are you using to measure current?

    It could be that the ADC is still running? Could you try to just run the below code and see what the current consumption is, just so we know that it's not any hardware or measurement issues. Also try to enable the peripherals one after another to see when the consumption goes up.

    int main(void)
    {
        utils_setup();
        softdevice_setup();
        sd_power_system_off();
        for (;;)
        {
            uint32_t err_code = sd_app_evt_wait();
            APP_ERROR_CHECK(err_code);
        }
    }
    

    Also, you always want to end your code with an infinite loop so that the CPU knows where to continue (e.g. if it returns from sd_power_system_off() (even though it might not do that))

Reply
  • Hi, are you measuring on the pca10040 DK or are you using a custom board? And what equipment are you using to measure current?

    It could be that the ADC is still running? Could you try to just run the below code and see what the current consumption is, just so we know that it's not any hardware or measurement issues. Also try to enable the peripherals one after another to see when the consumption goes up.

    int main(void)
    {
        utils_setup();
        softdevice_setup();
        sd_power_system_off();
        for (;;)
        {
            uint32_t err_code = sd_app_evt_wait();
            APP_ERROR_CHECK(err_code);
        }
    }
    

    Also, you always want to end your code with an infinite loop so that the CPU knows where to continue (e.g. if it returns from sd_power_system_off() (even though it might not do that))

Children
No Data
Related