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

NRF52840 SAADC High Current with FreeRTOS SDK15.2

Hello,

I am need to add voltage sampling functionality to existing FreeRTOS framework on a low-power BLE device. When I enable BLE, I get 3mA of current, which stays there permanently . I have read all sorts of posts and guides for low power SAADC with a multi-channel setup but cannot seem to figure out the culprit... I only need to sample this once every 2-5min so the original approach was to my intent is to enable ADC, sample and disable it completely. However, for some reason I cannot turn it off. My code is attached below, wls_adc_start_sample() is triggered by the main task. It runs like it's supposed to, the interrupt gets triggered and I can read correct values. The only issue is extremely high current, which I am having trouble resolving...

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/************************************************************************************************
LOCAL VARIABLES
*************************************************************************************************/
static nrf_saadc_value_t m_adc_buffer[SAADC_SAMPLES_IN_BUFFER];
//ADC config
const nrf_drv_saadc_config_t saadc_config = {
.resolution = NRF_SAADC_RESOLUTION_12BIT, \
.oversample = NRF_SAADC_OVERSAMPLE_DISABLED, \
.interrupt_priority = APP_IRQ_PRIORITY_LOW, \
.low_power_mode = true \
};
const nrf_saadc_channel_config_t channel_config_vbat = {
.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED, \
.gain = NRF_SAADC_GAIN1_2, \
.reference = NRF_SAADC_REFERENCE_INTERNAL, \
.acq_time = NRF_SAADC_ACQTIME_10US, \
.mode = NRF_SAADC_MODE_SINGLE_ENDED, \
.burst = NRF_SAADC_BURST_DISABLED, \
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Any insight on what I might be doing wrong is highly apprciated.

Thanks!