Is it possible to store values of ADC every time it changes, I wanted to store them in DMA and do the average of samples? or Do i need to use an external sd card through i2c and store them in it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-08-22 6:42 AM
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-08-22 8: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-08-22 8: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-08-22 8: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
Up vote any posts that you find helpful, it shows what's working..
