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

Multiple SAADC Channels at different intervals

Hello, I've been reading over different examples and questions on the Nordic Developer Zone but still have some questions about multiple SAADC channels.

1 - If I initialized multiple SAADC channels it goes to scanning mode right? Does this mean they can only be sampled via non-blocking mode or can I also sample them in blocking mode?

2 - If sampling via the SAADC callback EasyDMA is used which makes power consumption higher right? Would sampling via a timer handler function with blocking functions not use EasyDMA and consume less power?

3 - If sampling from timer via handler function with blocking functions does it make sense to turn off the SAADC every time a sample is taken?

4 - Would sampling the SAADC with the SAADC_Callback (EasyDMA) function for one channel while sampling another channel with a blocking function be possible

  • Hi,

    I assume you are talking about the SAADC driver in the SDK, since you are talking about blocking/non-blocking modes. In hardware, the SAADC is task/event driven.

    1. Yes, when multiple channels are enabled the SAADC will automatically enter scan mode. The blocking function in the SAADC driver take the channel as parameter and sample this channel. All other channels will be disabled when this function is called.
    2. The SAADC peripheral will allways use EasyDMA when sampling. When the SAADC is enabled, the EasyDMA current of ~1.2 mA will be added. Using blocking functions for SAADC sampling might cause higher current, as the CPU is busy-looping while waiting for the sample to finish, contrary to having the possibility to put the CPU in sleep mode when waiting for the end event, when using non-blocking mode functions.
    3. If your sample rate is low, it makes sense to disable the SAADC peripheral between every sample to save power. This is independent on whether you use blocking or non-blocking setup.
    4. No, the SAADC peripheral can only sample one channel at a time. When the blocking function is called, it will disable all enabled channels before setting up the peripheral for sample of the requested channel. If non-blocking sampling is allready setup, a call to the blocking sample function will return with the error code NRF_ERROR_BUSY, indicating that the driver is allready busy with other sampling.

    If you are doing regular sampling using the SAADC peripheral, it makes no sense to use blocking over non-blocking setup. This only makes sense if you just need a single sample. You can find an example of low power SAADC on our GitHub. It you have multiple channels enabled, you might need to use this version to get it running with low power.

    Best regards,

    Jørgen

Related