cancel
Showing results for 
Search instead for 
Did you mean: 

When does ADC/DMA actually stop?

parsec
Associate III
Posted on January 05, 2017 at 15:20

In my project (F415RG) I'm running timer paced single channel ADC sampling with DMA transfers and Analog Watchdog coupled to the same ADC channel. When an out of window voltage occur I need to momentarily stop the ADC in the associated callback function but I'm not clear on if calling HAL_ADC_Stop_DMA() is instantaneous or if it keeps sampling until current buffer is Transfer Complete? I guess some extra samples after a halt is requested are unavoidable due to its CPU independent operation but are there any hard or approximate figures on how much this will be?

While I'm at it, a vaguely related question; Should global variables in any HAL_ADC_...() callback functions be declared volatile?

0 REPLIES 0