cancel
Showing results for 
Search instead for 
Did you mean: 

wrong ADC DMA Continous conversion data order

Gaston
Senior

Hi,

I cannot understand acquired ADC data order using this configuration on a STM32G030C6 device:

Gaston_0-1716916097772.png

I want to acquire 9 input channels + 2 internal channels (Temperature Sensor + Vbat). Continuous mode w/ Circular DMA

Gaston_1-1716916217782.png

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

 

This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions

Oh, ok , on G030 ...

AScha3_0-1716925031305.png

So check, whats the "ch numbers" ...this is the sequence then.

see rm...

AScha3_1-1716925218551.png

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
AScha.3
Super User

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:

AScha3_0-1716922962198.png

I set 3 conversions, but 2. is temp channel...because i choose it for Rank 2.

If you feel a post has answered your question, please click "Accept as Solution".

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.

Oh, ok , on G030 ...

AScha3_0-1716925031305.png

So check, whats the "ch numbers" ...this is the sequence then.

see rm...

AScha3_1-1716925218551.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Blessed RM :folded_hands: I should have checked it before raising the question. Now it makes sense.

Thank you very much AScha.3!

Gaston