cancel
Showing results for 
Search instead for 
Did you mean: 

Using a timer to trigger DMA to read ADC.

Rocko
Associate

Hello,

I'm using the STM32F779.

I have a timer configured to to trigger an ADC (single channel) using the timers TRGO.

This is working great but I'd like to have a DMA handle the transfer.

The timer triggers every 2ms and I'm running the timer for several seconds.

I'd like the DMA to copy the ADC value into a buffer on each trigger. When I turn the timer off I'll have a buffer full of values for post processing.

I think I need to have the timer trigger the DMA instead of the ADC. Then configure the DMA to do a peripheral to memory transfer? Can I still have the DMA tied to the ADC when trigger by a timer?

Thanks,

-Rocko

3 REPLIES 3

ADC can trigger DMA after every conversion, and that's the intended way to use it.

JW

S.Ma
Principal

Yep, timer gets a triggering event to the ADC

When the ADC gets data out, the DMA will grab and store in a circular buffer for example.

For debug purpose, you can route the Timer output to a GPIO which would be manually wired to the ADC trigger GPIO pin. This way you can check it works fine both stages.

Rocko
Associate

I think I got it. I needed to disable continuous conversion mode on the ADC. Thank you for your help confirming correct operation.