2022-08-14 07:03 AM
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.
2022-08-14 07:17 AM
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.
2022-08-14 09:40 AM
#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 ? :)
2022-08-14 08:46 PM
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.