AnsweredAssumed Answered

Question on ADC with DMA circular mode

Question asked by Hoang Phuc on Feb 6, 2017
Latest reply on Feb 7, 2017 by T J

Hi everyone,

I'm a newbie and I'm working on ADC with DMA in circular mode like pictures below:

 

 

and a part of my code is:

 

HAL_ADC_Start_DMA(&hadc1,(uint32_t*)buffer,sizeof(buffer));

while(1){

for(i=0;i<=255;i){}

}

 

When I debug with STM Studio and also in practical, I found that DMA in Circular mode become a loop, which mean the code cannot go in the while loop, it just keep reading continuous the ADC value. But when i change DMA to Normal mode, the DMA code read one time and go to the while loop (this is right). I think that the circular mode must update the ADC value continuously when the while loop running and we can use that ADC value to process in the while loop. 

I'm I right? I watched videos and read very much but I can't find the solution for my issue.

Please help me everyone!

Thanks

Outcomes