2019-11-22 06:36 AM
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
2019-11-22 07:04 AM
ADC can trigger DMA after every conversion, and that's the intended way to use it.
JW
2019-11-22 08:05 AM
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.
2019-11-22 09:14 AM
I think I got it. I needed to disable continuous conversion mode on the ADC. Thank you for your help confirming correct operation.