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

SAADC power on/off

My environment: DK 10040, nRF52832, SD 6.1.1, SDK 15.2, SES 3.52

When does the SAADC use power?  And when does it stop using power?  

I searched the 52832 specification and DevZone but could not find a clear explanation.  My best guess is that power consumption begins when the START task is triggered and it will continue to draw power until the buffer is filled and the END event occurs. Is this correct?  I found a couple posts that suggest you need to issue the STOP command and disable the SAADC but I do not see this happening in the driver even when low power is enabled.

My guess is based on the low power mode in the driver (nrfx_saadc) which seems to follow this sequence:

  1. Configure saadc and channels
  2. Enable saadc
  3. Start a timer
  4. Timer expires and triggers START task
  5. SAADC IRQ receives STARTED event and triggers SAMPLE task
  6. SAADC IRQ receives END event
  7. Data is ready for use
  8. Timer repeats this loop...

Assuming this is correct, I wonder if we can eliminate the CPU interrupt for the STARTED event and instead use the PPI to trigger the SAMPLE task when the STARTED event occurs. This approach would eliminate one CPU interrupt and it would make the timing of the SAMPLE task more deterministic. The new sequence would be:

  1. Configure saadc and channels
  2. Enable saadc
  3. Start a timer
  4. Timer expires
  5. PPI triggers START task
  6. SAADC sends the STARTED event
  7. PPI triggers the SAMPLE task
  8. SAADC sends the END event
  9. IRQ handles the END event
  10. Timer repeats this loop...

I coded this up and it seems to work fine. I plan to measure power as soon as I get the required tools.  Do you see any concerns with this approach? Are there other ways to save power?

Currently I use a timer with frequency 31250Hz.  Would I save a lot of power if I use RTC instead?   Thanks!

Parents
  • After replacing the TIMER with RTC and replacing all CPU interrupts with PPI the average power is down from 1100ua to 750ua. This is sampling a single pin at 200hz while BLE is connected and notifications sending every 20ms.  Very good IMO.  However, when I go to sample two pins I ran into this issue which brings the power consumption back up to 1.4ma.  I hope someone can find a workaround to the other issue, or suggest a better way to design the application to get 32x oversample with two pins. 

Reply
  • After replacing the TIMER with RTC and replacing all CPU interrupts with PPI the average power is down from 1100ua to 750ua. This is sampling a single pin at 200hz while BLE is connected and notifications sending every 20ms.  Very good IMO.  However, when I go to sample two pins I ran into this issue which brings the power consumption back up to 1.4ma.  I hope someone can find a workaround to the other issue, or suggest a better way to design the application to get 32x oversample with two pins. 

Children
No Data
Related