I am using a timed scan of four ADC channels and DMA in circular mode to place them in an array.
My goal is to place each of the four ADC results in a separate 1024-element circular buffer using DMA or DMAMUX. Does anyone have some guidance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-01 8:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-02 12:08 AM
the DMA automatically interleaves the ADC values.
It will fill (as a circular buffer if configured that way ) the array you pass as an argument, no matter the length untill you stop it.
uint32_t ADCReadings[1024];
//DMA will take hadc1 readings(interleaving channels) and store them inside ADCReadings array, the circular buffer created has legth 1024
HAL_ADC_Start_DMA(&hadc1, (uint32_t*) ADCReadings, 1024);
DMA will fill ADCReadings as follows: (if 4 channels from adc are activated)
- ADCReadings[0]= value from 1st channel
- ADCReadings[1]= value from 2nd channel
- ADCReadings[2]= value from 3rd channel
- ADCReadings[3]= value from 4rd channel
- ADCReadings[4]= value from 1st channel
- ADCReadings[5]= value from 2nd channel
- ADCReadings[6]= value from 3rd channel
- ADCReadings[7]= value from 4rd channel
.............
1024.ADCReadings[1023]= value from 4rd channel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-02 6:34 AM
Thank you TDK.
You and Javier both gave me the same guidance.
I apprecieate your help.
SR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-02 6:36 AM
This will work very well for my needs.
Very nice explanation.
Thank you Javier.

- « Previous
-
- 1
- 2
- Next »