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

Can I get data from an external ADC without using CPU time?

Hello,

I would like to make use of an external ADC that is connected to my nRF52832 through SPI & easyDMA,minimizing the use of the CPU (or without using the CPU).

The sampling frequency, when nRF52832 will request a sample to the ADC, is 25KHz. Furthermore, this external ADC doesn't have an internal buffer, would it be possible to use PPI feature of the nR52832 to store the ADC samples into memory so that I can avoid to make use of CPU time?

I see an possible issue with PPI memory buffer in that the memory pointer is not incremented each time I read a sample which would lead to lose the previous samples.

Any suggestions would be welcomed!

Thanks in advance,

Parents
  • I see an possible issue with PPI memory buffer in that the memory pointer is not incremented each time I read a sample which would lead to lose the previous samples.

    This could be somewhat migitated by the list feature in EasyDMA.

    If your ADC has a "data ready" pin, you can try using GPIOTE and PPI to trigger the SPIMx->TASKS_START on each sample.

    Note that keeping track of the sample count may need additional ressources (e.g. Timer+ PPI channel).

  • The EasyDMA feature will never reset the buffer address itself. It will just continue to increment the pointer to the buffer forever and you will have to control this in your software to avoid buffer overflows. So in other words, you are the one responsible for resetting the buffer start address.

Reply Children
No Data
Related