Hi ESP32 Team,
I need to sample two analog channels using ADC with DMA in circular mode, but i'm not able to find any example to do that. I've found an example where it's used the ADC with the DMA but after each EOF DMA interrupt the ADC and the DMA are restarted. I don't want to do that, but I need which the DMA tranfers the ADC data from register to a buffer and trigger an interrupt without stopping. I usually divide the buffer into two peaces. While the DMA is trasferring the data into the first half buffer I can analyse the data that is present into the second half buffer.
Is there anyone that who has done something similar?
Thanks a lot,
Giulio
ESP32C3 ADC DMA Circular mode
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32C3 ADC DMA Circular mode
At least conceptually it's not hard... buffers have DMA descriptors, and those indicate where the next DMA buffer descriptor is. Simply let DMA descriptor 1 point at DMA descriptor 2, and DMA descriptor 2 point at DMA descriptor 1, and you have a circular buffer.
-
- Posts: 5
- Joined: Mon Mar 07, 2022 8:01 am
Re: ESP32C3 ADC DMA Circular mode
yes..."At least conceptually it's not hard..." but I'm not able to read continually an analog input. When DMA reaches the last descriptor, even if it is linked with the first one, DMA (or ADC I don't understand) stop to work.
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32C3 ADC DMA Circular mode
Can you post the code you're using?
Who is online
Users browsing this forum: Majestic-12 [Bot] and 155 guests