cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set ADC DMA sample rate?

LSmil.1
Associate II

Hi there,

I'm using DMA to circular sample ADC channels. I'm getting the ADC complete interrupt - its all good. The question is, how do I set the sampling rate of the DMA, let's say that I need those samples every 2 milisec - how to I set the DMA to perform a 2 milisec sample?

THanks,Lior.

3 REPLIES 3
MasterT
Lead

In case of ADC linked to DMA, ADC is a master. ADC does conversion on it's own clock settings, and request dma transfer when event "conversion complete" happened . DMA serves request.

AScha.3
Chief II

#Lior, what you want is ADC at a fixed sample rate . So take any of the many timers, generate a trigger event at your desired frequency and set the ADC on triggered by xx-event, and DMA will bring the data to your array. simple - eh ? :)

If you feel a post has answered your question, please click "Accept as Solution".
S.Ma
Principal

The maximum ratr depends on adc frequency, sample and hold time and averaging etc... adc config

Now for lower rates, each adc round of conversion can wait for a trigger signal coming from timer (pwm mode), or a pin to visualise and better debug through a pin to pin external jumper wire.