Skip to main content
ADIt
Associate II
Sep 10, 2018 11:27 AM UTC
Solved

Continuous multiple ADC conversion and transfer by DMA implementation without any interrupts?

Can we avoid the ADC and DMA transfer interrupts and check a status of DMA transfer done for new values converted by ADC with multiple channels?

My MCU is : STM32L1

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Sep 10, 2018 11:35 AM UTC

Yes, you could inspect the DMA TC or HT flags.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

3 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Sep 10, 2018 11:35 AM UTC

Yes, you could inspect the DMA TC or HT flags.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ADIt
ADItAuthor
Associate II
Sep 10, 2018 11:56 AM UTC

Hi is the Following code to do this OK?

Thanks

int adc_data_ready(void){

 int ret;

 ret = DmaHandle.DmaBaseAddress->ISR;

 if(ret&DMA_FLAG_TC1){

  __HAL_DMA_CLEAR_FLAG(DmaHandle,DMA_FLAG_TC1);  /* Clear TC Flag */

  ret = 1;

 }else{

  ret = 0;

 }

 return ret;

}

Tesla DeLorean
Guru
Sep 10, 2018 3:36 PM UTC

It might, check it and see.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..