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

Problems with the use of ADC at low power

Hi, everyone,

I am pretty new to nRF52 development. Right now,I want to turn SAADC off at low power and turn it back on when wake up, but after  nrfx_saadc_uninit();When I use user_adc_init() again, the SAADC state is always busy.

Parents
  • Hello,

    I am pretty new to nRF52 development.

    Welcome!

    Right now,I want to turn SAADC off at low power and turn it back on when wake up, but after  nrfx_saadc_uninit();When I use user_adc_init() again, the SAADC state is always busy.

    First, could you tell me which SDK version you are working with, and whether you are using an nRF52 Development Kit, or a custom board?

    The nrf_drv_saadc_buffer_convert function will return NRF_ERROR_BUSY if SAADC calibration is ongoing, or if the SAADC already is setup with two buffers. Could you ensure that neither of this is the case? It is hard to be sure when only seeing select lines from your code.
    Could you possibly share the entire project's code? That would make spotting issues much easier. Is your application based on an example from the SDK, or code you have found elsewhere?

    Furthermore, I highly recommend triggering the sampling through the NRF_SAADC_TASK_SAMPLE task through PPI, rather than calling nrf_drv_saadc_sample every sample. I would also recommend that you do not use magic numbers in your code, to save yourself from a lot of troubles down the line, in your programming career! Slight smile

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Reply
  • Hello,

    I am pretty new to nRF52 development.

    Welcome!

    Right now,I want to turn SAADC off at low power and turn it back on when wake up, but after  nrfx_saadc_uninit();When I use user_adc_init() again, the SAADC state is always busy.

    First, could you tell me which SDK version you are working with, and whether you are using an nRF52 Development Kit, or a custom board?

    The nrf_drv_saadc_buffer_convert function will return NRF_ERROR_BUSY if SAADC calibration is ongoing, or if the SAADC already is setup with two buffers. Could you ensure that neither of this is the case? It is hard to be sure when only seeing select lines from your code.
    Could you possibly share the entire project's code? That would make spotting issues much easier. Is your application based on an example from the SDK, or code you have found elsewhere?

    Furthermore, I highly recommend triggering the sampling through the NRF_SAADC_TASK_SAMPLE task through PPI, rather than calling nrf_drv_saadc_sample every sample. I would also recommend that you do not use magic numbers in your code, to save yourself from a lot of troubles down the line, in your programming career! Slight smile

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Children
No Data
Related