2017-02-06 10:12 AM
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
2017-02-07 12:43 PM
I made it work seamlessly, please check the discussion: