Skip to main content
Visitor II
August 28, 2023
Question

STM32MP157 Slave ADC can not get correct value.

  • August 28, 2023
  • 2 replies
  • 2494 views

Dear all,

I have a question about ADC.
When i used adc in dual regular simultaneous mode, master adc can get correct value, but slave adc can not.
Does anyone have some idea?

These are my ADC 1 and 2 configuration.

In my understanding adcData_DMA = ADC_CDR so adcData_DMA bits[31:16] = ADC2 Data. Is it right?

Ken_102633_2-1693187253128.png

uint32_t adcData_DMA[5];

 if (HAL_ADCEx_MultiModeStart_DMA(&hadc1,(uint32_t*)adcData_DMA, 5) != HAL_OK)
 {
 Error_Handler();
 }

ADC1

Ken_102633_1-1693186962285.png

 

ADC2

Ken_102633_0-1693186930718.png

Thanks.

Best Regards.

 

 

    This topic has been closed for replies.

    2 replies

    Explorer II
    September 20, 2023

    Hi Ken!

    Were you able to solve it? I'm having the same question. I have to use two ADC's simultaneously.
    Thanks.
    Best Regards.

    Visitor II
    September 21, 2023

    Hi jutoroa,

    You can increase "delay between 2 sampling phases" to 5, 5 Cycles or more and try it again.

    I think that the sampling delay between the Slave ADC and Master ADC is too short, resulting in insufficient capacitor charging time, which affects the conversion values of the Slave ADC.

    If it works please let me know, thank you.

    Best Regards.

    Explorer II
    September 22, 2023

    Thank you Ken for the reply. I tried what you suggested without success. The data from the ADC2 is not correct. I think it's due to some issue with the DMAStream, because the Data is correct in the Common Data Register (I checked it with the debugger). I open a thread with more detail of my problem in case you have any other suggestions:
    https://community.st.com/t5/stm32-mcus-products/stm32mp157f-dk2-dual-adc-with-dma/td-p/592729 
    Thank you so much!