Dear All,
I am trying to measure the current consumption for an application I am developing on the nRF52833 DK.
The code that I am running is the following:
int main(void)
{
// Configure UICR_REGOUT0 register only if it is set to default value.
if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) != (UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos)) {
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) | (UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos);
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
// System reset is needed to update UICR registers.
NVIC_SystemReset();
}
#if defined(CONFIG_NFCT_PINS_AS_GPIOS)
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)) {
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos; // Write Enable
while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos; // Read-only Enable
while (NRF_NVMC->READY == NVMC_READY_READY_Busy) {}
// UICR changes require a reset to be effective
NVIC_SystemReset();
}
#endif
bool erase_bonds;
// Initialize.
lfclk_config();
log_init();
timers_init();
power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();
peer_manager_init();
flash_init();
gpio_init();
initialize_leds();
wdt_init(WATCHDOG_TIMEOUT);
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
sleep_mode_enter();
}
static void sleep_mode_enter(void)
{
ret_code_t err_code;
// Go to system-off mode (this function will not return; wakeup will cause a reset).
err_code = sd_power_system_off();
APP_ERROR_CHECK(err_code);
}Based on the product specification, I should be measuring something like 0.6uA (link).
Instead what I am measuring, using the Nordic PPK is 0.2uA. So I am really puzzled whether the measurement is accurate or not and what am I missing.
In order to perform the measurement, I prepared the DK, by cutting the SB40 trace and I set the 2 switches of the PPK to the DK.
So the question is why do I measure completely different values than the ones expected?