Skip to main content
LSmil.1
Associate II
Aug 14, 2022 2:03 PM UTC
Question

How do I set ADC DMA sample rate?

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.

This topic has been closed for replies.

3 replies

MasterT
Lead II
Aug 14, 2022 2:17 PM UTC

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
Super User
Aug 14, 2022 4:40 PM UTC

#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 on " Best Answer ".
S.Ma
Principal
Aug 15, 2022 3:46 AM UTC

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.