cancel
Showing results for 
Search instead for 
Did you mean: 

DMA reset?

SWenn.1
Senior III

I have an A/D circular DMA that collects 192 samples...There can be times when an asynchronous push button event interrupts this while it is collecting. Can someone tell me the quickest solution for resetting the DMA so that after I service the push button event it will start collecting at the beginning again?

3 REPLIES 3
Javier1
Principal

not saying is the fastest way but i use: hal_tim_stop

HAL_TIM_IC_Stop_DMA(ICtimerpointer, ICtimerRisingedgeChannel);
HAL_TIM_IC_Start_DMA(ICtimerpointer, ICtimerRisingedgeChannel, DMAcapturedriseData, DMAbufferSize);

we dont need to firmware by ourselves, lets talk
SWenn.1
Senior III

Hi Javier.....

But does it reset the pointer so the circular buffer is back at the beginning? That is important to me that when I get done processing the button I don't want my DMA to pick up where it left off as that would mean samples from different times.....

>>But does it reset the pointer so the circular buffer is back at the beginning?

I believe it does? set some debugging breaks in your code and let me know.

we dont need to firmware by ourselves, lets talk