Hello,
I'm trying to measure battery voltage on nRF52832 chip using SAADC based on examples/peripheral/saadc
and examples/ble_peripheral/ble_app_proximity
and noticed that just enabling saadc makes my device consume ~7mA constantly.
This is the code for initialization, sampling is later done once per second.
saadc_init code:
ret_code_t err_code;
nrf_saadc_channel_config_t channel_config =
NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_VDD);
err_code = nrf_drv_saadc_init(NULL, _saadc_callback);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_saadc_channel_init(0, &channel_config);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], BATTERY_SAADC_SAMPLES_IN_BUFFER);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], BATTERY_SAADC_SAMPLES_IN_BUFFER);
APP_ERROR_CHECK(err_code);
It doesn't matter if I later sample with nrf_drv_saadc_sample();
or not, the current is being constantly consumed. Just commenting out the code above makes the consumption drop to acceptable levels.
Does anyone had such experience before? I understand that ADC sampling comes at a cost but I didn't expect it to be a constant one.