2018-08-22 06:42 AM
Solved! Go to Solution.
2018-08-22 08:31 AM
"Every time it changes" is a bit vague, every time the conversion completes it triggers a DMA transfer to a buffer, you can get an interrupt for the HT (Half) and TC (Complete) points in the buffer, which you want reasonably deep to reduce interrupt loading, and then you can do a running average of the inactive half of the buffer.
2018-08-22 08:31 AM
"Every time it changes" is a bit vague, every time the conversion completes it triggers a DMA transfer to a buffer, you can get an interrupt for the HT (Half) and TC (Complete) points in the buffer, which you want reasonably deep to reduce interrupt loading, and then you can do a running average of the inactive half of the buffer.
2018-08-22 08:42 AM
thanks for the response, which brings me to a hypothesis DMA can store the values of ADC after conversion.???? after storing i would like to do the average of all the numbers stored in them.
2018-08-22 10:02 AM
Ok, so you'd traverse the array in the interrupt, summing the values, and computing your average.
DMA in this context just auto-fills the array in the back ground, and you get an interrupt at various fill levels/points.
What the DMA can't do is wait for the value on the ADC to vary, or do the summing.