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

Understanding higher than expected current draw

I've got a custom board with an nrf51822 (ic rev 2, QFAA), and I'm trying to understand some unexpected current draw that I'm seeing from the board. Currently the entire custom board is drawing 139uA. Using the data sheets from the various peripherals that I'm using I know that they are drawing between 15.5uA - 23uA. This leave between 116uA - 123.5uA that seem to be coming from the processor. Some more details:

  • Using a 16MHz crystal
  • Using external 32kHz crystal
  • Using TWI controlled components, but making sure to disable TWI when not in use
  • No peripherals other than TWI
  • I'm seeing this current after a call to sd_app_evt_wait(). As a note here, there is no BLE running when this arises. The softdevice is enabled but it isn't advertising or connected.
  • I have timers enabled using this call, but I'm not using any. I found that my conn_params_init function was failing without timers initialized:

APP_TIMER_INIT(0, 2, 4, false);

  • I'm using the scheduler
  • SDK 8.0.0 with S110 8
  • I'm using GPIO pins as input. I know that I should be using them just to trigger PORT events but I'm somewhat unclear about how this works. The interrupts are working properly as I have them configured, but what is strange is that I don't see any change in current draw when I comment out my GPIOTE initialization method (which I have included below). Any thoughts on what this means? Also does the current draw of using inputs like this scale with number of inputs, or is it just the current to use GPIOTE?

void gpiote_init(void) { uint32_t err_code;

nrf_gpio_cfg_input(LIS2DH_PIN, NRF_GPIO_PIN_NOPULL); 
nrf_gpio_cfg_input(ADXL_PIN, NRF_GPIO_PIN_NOPULL); 
nrf_gpio_cfg_input(CHARGE_PIN, NRF_GPIO_PIN_PULLDOWN); 
nrf_gpio_cfg_input(CHARGE_PIN, NRF_GPIO_PIN_PULLUP);
NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_PORT_Msk;

APP_GPIOTE_INIT(APP_GPIOTE_MAX_USERS);

err_code = app_gpiote_user_register(&my_user_id,
							1 << LIS2DH_PIN | 1 << ADXL_PIN | 1 << CHARGE_PIN,
							1 << LIS2DH_PIN | 1 << CHARGE_PIN,
						         event_handler_int);
APP_ERROR_CHECK(err_code);

err_code = app_gpiote_user_enable(my_user_id);
APP_ERROR_CHECK(err_code);

}

Some additional related questions. My application uses BLE and S110, but most of the time it doesn't need to advertise or connect. The sensors I'm using trigger interrupts which wake up from sd_app_evt_wait calls and then turn on advertising. How should I go about turning off the 32kHz crystal while no BLE is occurring, but the softdevice and BLE stack are enabled? Does it do this already?

  • Hi

    Do you have a chance to run your custom code on standard development board, e.g. the nRF51 DK? If so, check what the current consumption is on that board in order to detect if this is a hardware or software problem. To further verify if the problem is caused by your custom board or not, try to run this example without softdevice, where you should be seeing ~3uA when you have pressed button 0.

    Try to disconnect any GPIOs from you board in order to see if the current consumption goes down.

    Also make sure you have the debug interface disconnected when measuring current.

    When you initialize the softdevice, you select which 32kHz clock source to use and that clock source is used until the softdevice is enabled. It is not possible to disable the 32kHz crystal when the softdevice is enabled. Anyway, the crystal should consume ~0.4uA so that is not the source for that high current consumption. After you have disabled the softdevice you can disable the 32kHz clock with

    NRF_CLOCK->TASKS_LFCLKSTOP = 1;
    
Related