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

SAADC is disabled after every sample

I am trying to setup a PPI channel to trigger the SAADC in simple mode.
However, it appears as though the SAADC module is disabled after every read.
I.e. if I write:

NRF_SAADC->Enable = 1;

nrf_saadc_task_trigger(NRF_SAADC,NRF_SAADC_TASK_START);
nrf_saadc_task_trigger(NRF_SAADC,NRF_SAADC_TASK_SAMPLE);

It works correctly.

However, removing NRF_SAADC->Enable = 1 stops the module from working.

nrfx_saadc_mode_trigger() is called earlier in the code so my understanding is that the module should still be enabled.

Manually enabling the SAADC module once does not seem to fix it either.

I apologize for the generational, the code is protected by a NDA, so I am limited in how much information I can show.

Basically the flow goes like this:
The module is initialized and a single sample is requested by nrfx_saadc_mode_trigger().

There is a loop that runs at 3ms, with the tasks start and sample called within them.

Enabling the SAADC module before the start and sample tasks allows it to work.

Removing it prevents it from working.

Since the end goal is to use PPI, simply enabling the module before each read is not an option.

Also is there anywhere to get more examples utilizing the NRFX libraries?

All of the existing SAADC examples I have found are using the old nrf_drv_ functions.

Parents Reply Children
No Data
Related