ESP32S2 Simultaneous ADC/DAC DMA
ESP32S2 Simultaneous ADC/DAC DMA
I have sadly discovered that the ADC and DAC cannot both be used in continuous DMA mode. I assume this is because they share the same DMA controller from the SPI3 peripheral. Could there be a way to route another DMA to the ADC/DAC? I do not have the processing headroom to use one shot modes/ timers.
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32S2 Simultaneous ADC/DAC DMA
There's a limited amount of DMA channels, this is true, but given that you're not running out of them in general, DAC and ADC should work together. Is there any specific error you're getting?
-
- Posts: 1
- Joined: Wed Aug 30, 2023 7:12 pm
Re: ESP32S2 Simultaneous ADC/DAC DMA
Me too have the same problem. I didn't succeed to use adc and dac simultaneously. The error that I get is:
E (3388) spi: alloc_dma_chan(212): no available dma channel
assert failed: dma_chan_free spi_common.c:331 (spi_dma_chan_enabled & BIT(dma_chan))
If I stop the continuous DAC and try just continuous ADC, it work. Maybe jimbuk2 has right, both ADC and DAC can use only the same DMA of SPI3. and cannot be used both simultaneously.
E (3388) spi: alloc_dma_chan(212): no available dma channel
assert failed: dma_chan_free spi_common.c:331 (spi_dma_chan_enabled & BIT(dma_chan))
If I stop the continuous DAC and try just continuous ADC, it work. Maybe jimbuk2 has right, both ADC and DAC can use only the same DMA of SPI3. and cannot be used both simultaneously.
-
- Posts: 2
- Joined: Sun Mar 17, 2024 4:06 am
Re: ESP32S2 Simultaneous ADC/DAC DMA
I just ran into this issue, and it looks like the IDF is hardcoding SPI3_HOST for both the DAC and ADC:
Is there a reason that SPI3_HOST needs to be used specifically, or can this be dynamically allocated?
-
- Posts: 2
- Joined: Sun Mar 17, 2024 4:06 am
Re: ESP32S2 Simultaneous ADC/DAC DMA
Oh, the technical reference manual notes that the DMA channel is shared. So I guess it's a hardware limitation?
GP-SPI3 is also a general purpose SPI controller, but shares a DMA channel with ADC and DAC modules.
GP-SPI3 works as either a master or a slave. As a master, GP-SPI3 provides three CS lines, CS0 ~ CS2.
Who is online
Users browsing this forum: Bing [Bot] and 101 guests