Skip to main content
Arman Ilmak
Senior
December 7, 2019
Solved

ADC DMA and interrupt

  • December 7, 2019
  • 2 replies
  • 984 views

Hey.

Im using adc dma to transfer data from adc to memory. After each sequence of conversion I need an interrupt.

My first question is that is using dma in my case something useless?

My second question is that after adc sequence of conversion interrupt flag is set,can I immediately read data from my dma buffer or the data is not transferred to memory yet and i need to get some flag from dma?

This topic has been closed for replies.
Best answer by Tesla DeLorean

DMA can generate a HT and TC to indicate half or all the buffer full.

You can use these to determine the inactive half for a ping pong buffer.

When you get the DMA interrupt the data is already in the buffer. The ADC will continue, so the buffer will continue to update/change.​

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
December 7, 2019

DMA can generate a HT and TC to indicate half or all the buffer full.

You can use these to determine the inactive half for a ping pong buffer.

When you get the DMA interrupt the data is already in the buffer. The ADC will continue, so the buffer will continue to update/change.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Arman Ilmak
Senior
December 7, 2019

__HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CCR & (__INTERRUPT__)))

Should I use this macro?

In the adc it has a __HAL_ADC_GET_IT_flag that i use .when i use __HAL_adc_GET_IT_SOURCE it doesnt work.Bur=t dma dont have __HAL_DMA_GET_IT_flag.What should i do?