cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP157 Slave ADC can not get correct value.

Ken_102633
Associate II

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.

 

 

3 REPLIES 3
jutoroa
Associate III

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.

Ken_102633
Associate II

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.

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!