cancel
Showing results for 
Search instead for 
Did you mean: 

ADC1 and ADC2 in Dual regular simulataneous mode with DMA and Timer

Davood_Kesha
Associate II

Dear ST trams,

I am using STM32H750 for a project. In the STM32CubeMX, I configured two ADCs in Dual regular simultaneous mode only. Also I am using DMA and a timer for trigger. I have activated 6 channel for each ADC. The sequencing of channels is as below:
ADC1: ch18 -> ch16 -> ch2 -> ch14 -> ch15 -> ch3

ADC2: ch10 -> ch4 -> ch2 -> ch5 -> ch9-> ch7
In the Keil debugging mode, when I am checking the ADC_BUFFER, I see that the sequence of channels is different. It seems that ADC2 sequence is shifted by one (like this: ADC2: ch7 -> ch10 -> ch4 -> ch2 -> ch5-> ch9 ). Could you please help me in this issue?
Could the problem is the clock prescaler?
Best regards,
Davood.

4 REPLIES 4
mƎALLEm
ST Employee

Hello,

For such scenario you need always to provide what you did already: share your code + cubemx config so others can help you efficiently.

See How to write your question to maximize your chances to find a solution

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
TDK
Super User

Why would theclock prescaler cause buffer samples to be shifted? That makes no sense. Stay objective.

There's a bug in your code. We can't see it. So show us the code and show us why you think it's not working correctly.

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

With selecting Asynchronous clock mode, I can have the converted ADC value in ADC_BUFFER. But by choosing Synchronous clock mode there is nothing!
Should I change other thing in my code when selecting synchronous clock mode in STM32CubeMX?

Hello again,
I found the problem why I have shifted in channel sequence with dual mode for two ADCs. I applied the synchronous clock mode for ADC prescaler the problem is solved. But when I want to use HAL_ADCEx_Calibration_Start, the MCU gets stuck in a infinite loop. Is there any conflict between HAL_ADCEx_Calibration_Start and synchronous clock mode?