2023-08-27 06:50 PM
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?
uint32_t adcData_DMA[5];
if (HAL_ADCEx_MultiModeStart_DMA(&hadc1,(uint32_t*)adcData_DMA, 5) != HAL_OK)
{
Error_Handler();
}
ADC1
ADC2
Thanks.
Best Regards.
2023-09-20 01:35 PM
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.
2023-09-20 05:25 PM
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.
2023-09-22 05:40 AM
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!