Skip to main content
Associate II
December 15, 2023
Solved

ADC multi channel configuration(STM32F410)

  • December 15, 2023
  • 7 replies
  • 6139 views

Hello,

I'm using STM32F410 for ADC in which i have configured two channels means two conversions.

For IN7 channel the input voltage is 1.89V and for IN8 input voltage is 2.0v(This channel we have connected trimpot voltage can varied ) 

Please  check the configuration snap attached.

 when we configure  IN8 channel alone the conversion is happening properly  as per the input voltage(single conversion).

the problem is when we configure both channel at a time for both channel conversion if EOC Is set for single conversion means both channel value are coming same with same configuration if we set the EOC after all channel conversion both channel values are drifting drastically.

please guide me what is problem and what are parameter to consider while using multi channel 

Please  check the configuration snap attached.

 

Advance_tech_0-1702636700536.png

12bit ADC clock freq = 6.25MHZ

Advance_tech_1-1702636828356.png

This is program 

please check and correct where i'm doing wrong

 

 

 

 

  

This topic has been closed for replies.
Best answer by TDK

Use DMA to convert multiple ADC channels in sequence. You could also do one conversion, then switch channels, then do the other. But there's no good way to convert both channels in a sequence in polling mode on this chip.

7 replies

TDK
TDKBest answer
December 15, 2023

Use DMA to convert multiple ADC channels in sequence. You could also do one conversion, then switch channels, then do the other. But there's no good way to convert both channels in a sequence in polling mode on this chip.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
December 18, 2023

Hello @TDK Thanks for solution.  

I have another problem.

 In one of channel the  ADC values are shifting drastically i have checked voltage going to controller is correct (1.89v)

but I'm not getting desired output whereas another channel values as per input voltage.

 

please check the snap attached how the values changing in 7th channel.

ADC_MULTI_CHANNEL_18-12-23.png

what can cause this problem?

TDK
December 18, 2023

How is that channel connected? What is the desired output you're expecting?

 

See here for general ADC accuracy tips:

https://www.st.com/resource/en/application_note/an2834-how-to-optimize-the-adc-accuracy-in-the-stm32-mcus-stmicroelectronics.pdf

In particular, sampling time can increase accuracy for high impedance signals.

 

Connecting that signal to GND and verifying ADC output is near 0 can also help to double check that it's connected correctly and that the pin is initialized properly.

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