Page 1 of 1

constant ADC Average via DMA

Posted: Fri Apr 16, 2021 12:10 pm
by jenspogo
Hello everyone,

I would like to have something like a continous ADC Average Value. Or at least maybe 1000 values that I can load from a buffer which is continously filled. But i don't want to use the CPU processing time. As far as I know that seems to be the functionality of DMA. Is this correct?
And I don't want to have an Interrupt - I want to acces the buffer whenever it is necessary controlled by the normal programm flow.

Is there any possibility to implement something like that any any kind of example?

Greetings,
Jens

Re: constant ADC Average via DMA

Posted: Fri Apr 16, 2021 1:25 pm
by stevestrong
DMA cannot do average, it just saves values in an array or one variable.
If you want average of some values that would inevitably involve CPU processing either in an ISR or on main level.

Re: constant ADC Average via DMA

Posted: Fri Apr 16, 2021 3:32 pm
by ag123
average needs to be done on the cpu, the analog alternatives are to low pass filter it (e.g. rc filter) before reading it with an adc