Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SAADC + EasyDMA + timer

Is there an example that shows the "Nordic way" of "continuous" conversions using DMA? I think a timer and PPI are needed to generate a conversion task for each timer compare event?

Also, the SAADC END (of EasyDMA transfers for a conversion round) event is still available for interrupt?

I didn't find library support for ADC with DMA.

The idea is to let timer to trig several "rounds" of multi-channel conversions that DMA would store in a buffer. After pre-defined number of rounds a new buffer is taken into use by the N:th SAADC END interrupt, and the old buffer is used for further calculations.

Parents
  • Hello,

    Is there an example that shows the "Nordic way" of "continuous" conversions using DMA? I think a timer and PPI are needed to generate a conversion task for each timer compare event?

    Additionally, you can check out how things are done in this github repository - please not that the NordicPlayground repositories are just intended as simple demos, and are not as thoroughly tested as our SDK examples.

    I didn't find library support for ADC with DMA.

    The saadc peripheral uses easyDMA, by extension so does the nrfx_saadc and nrfx_saadc2 drivers.

    Also, the SAADC END (of EasyDMA transfers for a conversion round) event is still available for interrupt?

    No, the END event is not part of the nrfx_saadc driver - this is only available to the driver itself, or in the SAADC HAL.
    I would advice against mixing from both SAADC HAL and the nrfx driver, as this may place the driver in an invalid state.
    I would also recommend using the driver instead of implementing the functionality yourself from HAL - since a lot of this work is already done for you in the driver.

    If you want to do continuous sampling you should use the double buffering feature, and instead do your data processing once one buffer fills up - generating the DONE event.

    Please do not hesitate to ask if anything should be unclear, or if you should encounter any issues or questions!

    Best regards,
    Karl

  • Also, does timer always generate interrupts internally? I was hoping to set the HW up such that timer compare just trigs an ADC scan (conversion of 4 channels) with DMA, and I only get an interrupt (event) after the DMA is finished, to start the next timer compare (and ADC scan).

Reply Children
No Data
Related