Enable and Disable ADC peripheral of nRF52840 to save power in nRF connect SDK

Is it possible to enable and disable the ADC peripheral of nRF52840 to save power in nRF connect SDK? In our application, we use ADC to get battery voltage samples after every 1 hour. I was thinking if it would be useful to enable and disable ADC peripherals during inactive use to save power. If Yes, how to do it in nRF connect SDK? I am not able to find any API. 

Parents Reply Children
  • Hi  ,

    Thanks for sharing this info.

    Now I have below conclusion and I want you to review it.

    1. To have the full control of the hardware like sleep mode in peripherials and easyDMA, etc, we should use nrfx drivers.

    2. If the answer for 1. is yes, Zephyr RTOS APIs useful for resource controls like thread, semaphores, etc.

    3. Does Nordic have any plan to implment NRFX specific APIs for Zephyr underlayer implementation in the case of Zephyr RTOS decided to introduced lower power sleep mode apis for each peripherals.

    Thanks

  • Robotics Gun said:
    1. To have the full control of the hardware like sleep mode in peripherials and easyDMA, etc, we should use nrfx drivers.

    Yes, nrfx will give you full control of the peripheral, and might be required for some use cases (high sample rate/hard requirements on sample interval). The Zephyr ADC driver should be implemented in a way to reduce power usage when the peripheral is not in use. I would recommend you to have a look at the ADC lesson in nRF Connect SDK Intermediate course on DevAcademy to learn more about this.

    Robotics Gun said:
    2. If the answer for 1. is yes, Zephyr RTOS APIs useful for resource controls like thread, semaphores, etc.

    Yes, you can still use the RTOS functions from Zephyr and use nrfx drivers for controlling the peripherals.

    Robotics Gun said:
    3. Does Nordic have any plan to implment NRFX specific APIs for Zephyr underlayer implementation in the case of Zephyr RTOS decided to introduced lower power sleep mode apis for each peripherals.

    Not sure I understand exactly what you are asking here. Zephyr already implements a Device Power Management module, which can be used to control the power state of peripherals. Most of the Zephyr drivers implements support for device power management. If you chose to use the nrfx drivers, you will lose this support and needs to handle power management for the peripheral(s) yourself.

Related