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

SAADC low power scan mode

FormerMember
FormerMember

Greetings,

I have a setup where I have a periodic single channel low power SAADC implementation. In this the configuration is

  • A single SAADC channel is initialized (10 us acquisition time, differential, gain 4, 12 bit, internal reference)
  • RESULT.MAXCNT=1,
  • Oversampleing 4x with burst mode
  • Interrupt is enabled for NRF_SAADC_INT_CH0LIMITH and NRF_SAADC_INT_CH0LIMITL
  • SAADC channel limits are set

The PPIs set up are

  • SAADC_EVENT_STARTED -> SAADC_TASK_SAMPLE
  • RTC_EVENT_COMPARE_0 -> SAADC_TASK_START -> RTC_TASK_CLEAR (RTC clear is fork)
  • SAADC_EVENT_END -> SAADC_TASK_STOP

The RTC CC[0] is set to fire an event every 20 ms. With this setup, when the SAADC samples every 20 ms. When the sample results don't cross the limits the interrupt is not fired and the processor doesn't wake up. In this case with the processor always sleeping I get around 11 uA current consumption according to the power profiler kit, which is amazing!

The problem occurs when a second channel is initialized and its limits are set, with the rest of the settings exactly the same. The functionality of two channels sampling works, but the power consumption goes to 600-700 uA. I read somewhere that the EasyDMA causes this. But since RESULT.MAXCNT=1, even with two channels, the EasyDMA shouldn't be used right? Is there any low power way to have two channels sampling periodically with the processor waking up only if any of the two channels cross its limits?

Cheers!

Update: To provide some context, I'm working on detecting motion from two PIR sensors, one with a narrow angle lens and the other with a wide angle lens. Here's a pic of the board. The code that is described in the question can be found here github.com/.../main.c

image description

Parents
  • Hi,

    First, you should not use oversampling with scan mode (multiple channels enabled), due to the reason described here. Also, burst mode would not give you any benefit in this setup, and should be disabled.

    I modified this example (based on SDK 11) to work with two channelse and a sampling rate of ~20 ms (make sure RTC frequency is set to 32768). With these settings, the PPK reports an average current consumption of ~30 µA. The example does use EasyDMA, but it will disable the SAADC periheral between sampling, which also turns off EasyDMA. I guess you can try to tweak it further, but at least it is better than the 6-700 you got. You can use this as reference for your own development if you want.

    Note that the example is not thoroughly tested and is not an official release from Nordic.

    saadc_low_power_multiple_channels.zip

    Best regards,

    Jørgen

Reply
  • Hi,

    First, you should not use oversampling with scan mode (multiple channels enabled), due to the reason described here. Also, burst mode would not give you any benefit in this setup, and should be disabled.

    I modified this example (based on SDK 11) to work with two channelse and a sampling rate of ~20 ms (make sure RTC frequency is set to 32768). With these settings, the PPK reports an average current consumption of ~30 µA. The example does use EasyDMA, but it will disable the SAADC periheral between sampling, which also turns off EasyDMA. I guess you can try to tweak it further, but at least it is better than the 6-700 you got. You can use this as reference for your own development if you want.

    Note that the example is not thoroughly tested and is not an official release from Nordic.

    saadc_low_power_multiple_channels.zip

    Best regards,

    Jørgen

Children
Related