1

Is there a way to use DMA with multiple ADCs at the same time?

I know you can scan multiple channels on one ADC, but I currently use 5 different ADCs on my STM32G4.

I use the HAL library function HAL_ADC_Start_DMA(). Do I have to stop the DMA request to the ADC to request from other? I tried to do HAL_ADC_Start_DMA() on all ADCs, but the code gets stuck on the second one, even when the first ADC is DMA1 and second ADC is DMA2.

ocrdu
  • 8,705
  • 21
  • 30
  • 42
Taavi
  • 11
  • 1
  • For my application the speed is important. Using them sequentially would probably be slower than using 1 ADC. So that is probably a better option? – Taavi Jan 29 '23 at 16:50
  • MOST ADC conversions in many applications dont happen at the speed of mega samples per second which is why I wrote they can be done sequentially. If they are done with hardware and DMA, of course, they can be done concurrently. but reading conversion results is always sequential. ADC Clock is derived from system clock so conversions can be done completely with hardware. It seems that are you triggering ADC conversions with software. In that way you are actually doing sequential conversions. Choose your design which suits your requirements. – Amit M Jan 30 '23 at 17:19
  • I would also love to hear an answer on this. How do you actually get the data from the second ADC? I don't see how you can use HAL_ADC_ConvCpltCallback() for each ADC. – Ryan Coleman Jul 20 '23 at 18:00

0 Answers0