wrong ADC DMA Continous conversion data order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 10:37 AM
Hi,
I cannot understand acquired ADC data order using this configuration on a STM32G030C6 device:
I want to acquire 9 input channels + 2 internal channels (Temperature Sensor + Vbat). Continuous mode w/ Circular DMA
Here's my Initialization routine
static uint32_t adc_values[11];
HAL_ADCEx_Calibration_Start(&hadc1);
// DMA continous requests: ENABLED
HAL_ADC_Start_DMA(&hadc1, adc_values, 11);
Everything works as expected except the channels order.
- adc_values[0] ---> OK
- adc_values[1] ---> OK
- adc_values[2] ---> OK
- adc_values[3] ---> OK
- adc_values[4] ---> OK
- adc_values[5] ---> KO This should be (afaik) the internal temperature sensor channel but I see the IN8 adc value.
- adc_values[6] ---> KO This should be (afaik) the IN8 channel but I see the IN9 channel.
- adc_values[7] ---> KO Does not match either.
- adc_values[8] ---> KO Does not match either.
- adc_values[9] ---> KO Does not match either.
- adc_values[10] ---> KO Does not match either.
Does anyone know what the problem is?
I'm not able to find any example with similar configuration.
Thanks in advance,
Gaston
Solved! Go to Solution.
- Labels:
-
ADC
-
DMA
-
STM32G0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 12:39 PM - edited ‎2024-05-28 12:40 PM
Oh, ok , on G030 ...
So check, whats the "ch numbers" ...this is the sequence then.
see rm...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 12:03 PM - edited ‎2024-05-28 12:04 PM
Hi,
the sequence depends on the Rank numbers - what you set ?
On every Rank you can choose, which channel is it , to convert. So you decide about the sequence !
see:
I set 3 conversions, but 2. is temp channel...because i choose it for Rank 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 12:12 PM - edited ‎2024-05-28 12:13 PM
Thank you for replying. I know this but I see no way to select Rank numbers in this ADC configuration. Notes that Sequencer is set to not fully configurable as I need IN15 and IN16 input channels.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 12:39 PM - edited ‎2024-05-28 12:40 PM
Oh, ok , on G030 ...
So check, whats the "ch numbers" ...this is the sequence then.
see rm...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-28 11:17 PM
Blessed RM :folded_hands: I should have checked it before raising the question. Now it makes sense.
Thank you very much AScha.3!
Gaston
