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

Power usage with SAADC

Testing with the NRF52840 dongle and the Power Profiler Kit. I see a reading of ~5uA when sleeping without SAADC enabled. 

I use this code to enable SAADC 

void saadc_init(void)
{
    ret_code_t err_code;
    nrf_saadc_channel_config_t saadc_channel_config = NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);

    nrf_drv_saadc_config_t nrf_drv_saadc_config = NRF_DRV_SAADC_DEFAULT_CONFIG;
     
    err_code = nrf_drv_saadc_init(&nrf_drv_saadc_config, saadc_callback);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_channel_init(0, &saadc_channel_config);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_buffer_convert(m_saadc_samples, SAADC_SAMPLES_IN_BUFFER);
    APP_ERROR_CHECK(err_code);
}

My power usage when sleeping is now 913uA

My final product will sleep for 2 minutes, wake by timer, read the SAADC value, advertising the value, sleeping for another 2 minutes. repeat.

My expectation is that I should uninit the SAADC before I call nrf_pwr_mgmt_run(). And then call saadc_init() when my product wakes. I'm not sure how to uninit the SAADC. 

Parents Reply
  • You are correct, the only change required is to set SAADC_CONFIG_LP_MODE. The difference between the low-power mode and normal mode is that in low-power mode the START task is not triggered until the sample function is called, while in normal mode, START task is triggered when the buffer_convert function is called to setup the buffers. The SAADC peripheral support EasyDMA, allowing sampling of channels directly to RAM using PPI, without CPU intervention. When low-power mode is enabled, the CPU is required to trigger sampling, and it will only work with a buffer size of 1 sample. In case of high sample rate, there is little or no benefit from the low-power mode.

    The low-power mode is implemented exactly for the scenario that you describe.

Children
Related