cancel
Showing results for 
Search instead for 
Did you mean: 

DMA enabled ADC with FreeRTOS

jephua
Associate II
Posted on August 19, 2014 at 05:39

I enabled ADC with DMA as such:

0690X00000603JQQAY.jpg

With the DMA continuous requests, the program will just loop in DMA1_Channel1_IRQHandler and the FreeRTOS thread will never run.

Does anyone have any idea how to resolve this? I have already tried setting the NVIC configuration to level 3 for the DMA 1 Channel 1 global interrupt...

Thanks!

#stm32l0-adc-dma
2 REPLIES 2
bluevault
Associate II
Posted on July 13, 2015 at 18:43

I have the same issue. Did you have any luck solving it?

Posted on July 13, 2015 at 19:00

Ok, well then you need to consider the conversion rate and quantity. If you do ONE sample, and it occurs every 30-40 machine cycles, the machine is going to saturate into and out of the interrupt handler.

So, a) pace the conversions at a realistic rate you can actually process them, b) do enough conversions before processing, thereby decimating the interrupt loading.

The normal way to do this would be to have a large buffer which you can bisect in a ping/pong fashion with the DMA HT and TC interrupts providing the End-Of-Conversion signal for the block of samples. You'd configure a timer to trigger the conversions at a desired rate, say 44.1 KHz or whatever.

If you just want the ADC+DMA to load data into a variable or array in the background, so that whenever you read the data it has the most current values, do you need to interrupt at all?

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