Skip to main content
Gaston
Associate III
May 28, 2024
Solved

wrong ADC DMA Continous conversion data order

  • May 28, 2024
  • 4 replies
  • 2724 views

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 topic has been closed for replies.
Best answer by AScha.3

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

 

4 replies

AScha.3
Super User
May 28, 2024

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 on " Best Answer ".
Gaston
GastonAuthor
Associate III
May 28, 2024

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.

AScha.3
AScha.3Best answer
Super User
May 28, 2024

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 on " Best Answer ".