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

[nRF52] Best practise for ultra low power SAADC 4 channel conversion

What is the best practise for multichannel SAADC conversion in ultra low power devices? For example I have to measured 4 channel in interval 250ms. Below what I try:

  1. I'm set RTC for interupt 250ms. In RTC handler I initialized SAADC channel 0 and start conversion. In SAADC end of conversion handler i uintialized SAADC, get result from channel 0 and initialized for channel 1 and start conversion. Same for channels 3 and 4 but in channel 4 I'm not start new conversion but Im set RTC for 333ms Handler. I try it and I get strange result.

If I have only one channel I've get current consuption: image description

avarage current is around 10uA ( it's ok for my aplication ). but if I enabled conversion for 4 channel, one by one ( as I descripted above ) I've got something like that: image description

Current is 2 times higher! I don't know why density of the current spikes is in that level.

Mayby I should use PPI? i read this topic: devzone.nordicsemi.com/.../

or maybe different method?

Parents Reply Children
  • Another question on that Project:

    In the saadc_callback, nrf_drv_saadc_buffer_convert() is called, and immediately followed by  nrf_drv_saadc_uninit():

            err_code = nrf_drv_saadc_buffer_convert(p_event->data.done.p_buffer, SAADC_SAMPLES_IN_BUFFER);  //Set buffer so the SAADC can write to it again. This is either "buffer 1" or "buffer 2"
            APP_ERROR_CHECK(err_code);
            
            :
            : // UART logging stuff
            :
    
            nrf_drv_saadc_uninit();                                                                   //Unintialize SAADC to disable EasyDMA and save power
            NRF_SAADC->INTENCLR = (SAADC_INTENCLR_END_Clear << SAADC_INTENCLR_END_Pos);               //Disable the SAADC interrupt
            NVIC_ClearPendingIRQ(SAADC_IRQn);                                                         //Clear the SAADC interrupt if set
            m_saadc_initialized = false;  
    doesn't the nrf_drv_saadc_uninit() render the nrf_drv_saadc_buffer_convert() pointless?

  • awneil said:
    So, as this is supposed to be specifically a low-power example, why is it set to 4 ?!

    Because this is a modified version of the single-channel example, with low power support for 4 channels. I did not modify the comments, as this is just a quick modification of the example that I posted in this support case. Setting this to 1 would not make enough space in the buffer to sample all 4 channels.

    awneil said:
    doesn't the nrf_drv_saadc_uninit() render the nrf_drv_saadc_buffer_convert() pointless?

    Yes, it does. It can be removed. Note that this is not production quality code or example, it is simply posted to help customers understand how low power sampling can be achieved with multiple channels enabled.

Related