cancel
Showing results for 
Search instead for 
Did you mean: 

I am having troubles configuring ADC1 and ADC2 to run simultaneously using DMA. I was able to run multiple channels of ADC1 using DMA, but when I try to do it for ADC1 and ADC2, I only get one of them working. Any Advice?

KEria.1
Associate III

I am using STM32H753ZI Nuccleo board. When I configure it on cube, I am using independent mode (otherwise no ADC works).

I was only able to make them work together by stopping the running ADC in the conversion completion interrupt and raise a flag to start the other one. The problem is that I need both of them to run together without enabling and stopping the ADC_DMAs.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

You didn't answer the middle question, but if OVR is set, you're likely converting too fast.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

8 REPLIES 8
TDK
Guru

Examine registers when they don't work. Do any overflow flags get set? How fast are the conversions? What does the one "not working" mean exactly?

If you feel a post has answered your question, please click "Accept as Solution".
KEria.1
Associate III

..

KEria.1
Associate III

@TDK​  The one not working means there is no values read from the ADC. The ADC that works is the first one initialized. and yes, I have an OVR in the ISR register.

TDK
Guru

You didn't answer the middle question, but if OVR is set, you're likely converting too fast.

If you feel a post has answered your question, please click "Accept as Solution".
KEria.1
Associate III

I could use some help answering the middle question..

KEria.1
Associate III

I am having the 2 ADCs with the same settings, except for the GPIO pins and the DMA1Stream0/1

> I could use some help answering the middle question..

If ADCs are freerunning, as opposed to being triggered off of a timer, they are running as fast as possible. Since the bus is a shared resource, this can overwhelm the bus. If a new conversion is done before the DMA ships off the last value, the ADC will report an overrun and stop.

You can decrease the conversion rate by increasing the sample time under channel configuration settings, or setting it up to run off of a timer TRGO output.

Including relevant code along with your post, or an IOC file, can help explain what you're doing.

If you feel a post has answered your question, please click "Accept as Solution".
KEria.1
Associate III

OK, so I made the prescaler divided by 4, and it is working now. Thank you!