Skip to main content
Visitor II
June 18, 2025
Question

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

  • June 18, 2025
  • 2 replies
  • 466 views

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.

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    June 18, 2025

    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

    Visitor II
    June 18, 2025

    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?

    Super User
    June 18, 2025

    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.

    Visitor II
    June 18, 2025

    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?