ESP32S3 ADC sampling using DMA
Posted: Tue Aug 13, 2024 10:58 am
Dear All,
I have been trying to design a C++ class for wrapping ADC sampling with DMA based on a circular buffer.
I was not able to make the DMA work although i was able to compile and write the ADC continuous mode config code.
What i want to accomplish is the following:
- I am hopping for a CPU free of load for ADC sampling if possible.
- I was thinking a circular buffer of 100-1000 bytes somewhere in that range.
- A pointer to the element that was just fed with the last ADC sample.
- The ADC sampling must constantly be populating the buffer in a circular manner.
I am using ESP IDF 5.1.1 with PlatformIO in VSCode.
So far i was only able to work with the oneshot mode.
Are all the above doable? (circular buffer and such)
Any example would be gold.
Thanks in advance.
Regards
Manos
I have been trying to design a C++ class for wrapping ADC sampling with DMA based on a circular buffer.
I was not able to make the DMA work although i was able to compile and write the ADC continuous mode config code.
What i want to accomplish is the following:
- I am hopping for a CPU free of load for ADC sampling if possible.
- I was thinking a circular buffer of 100-1000 bytes somewhere in that range.
- A pointer to the element that was just fed with the last ADC sample.
- The ADC sampling must constantly be populating the buffer in a circular manner.
I am using ESP IDF 5.1.1 with PlatformIO in VSCode.
So far i was only able to work with the oneshot mode.
Are all the above doable? (circular buffer and such)
Any example would be gold.
Thanks in advance.
Regards
Manos