2023-12-15 02:42 AM
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.
12bit ADC clock freq = 6.25MHZ
This is program
please check and correct where i'm doing wrong
Solved! Go to Solution.
2023-12-15 08:10 AM
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.
2023-12-15 08:10 AM
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.
2023-12-18 02:27 AM
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.
what can cause this problem?
2023-12-18 06:24 AM
How is that channel connected? What is the desired output you're expecting?
See here for general ADC accuracy tips:
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.
2023-12-21 12:43 AM
hi @TDK
I have some Douts regarding the ADC configuration in STM32F410 chip.
We have connected three channels to ADC peripheral.
The hardware is NTC thermistor as temperature sensor.
we are using 12-bit ADC.
please tell me correct configuration for these channels.
1) what is continues conversion mode? is this suitable for our above requirement.
2) discontinues conversion mode. Is this suitable for our above requirement.
3) what is scan conversion mode? is this suitable for our above requirement.
4) EOC at end all conversion is suitable or EOC and end single conversion suitable.?
5) DMA requirement?
6)how calculate the sampling time for channels? what happens with wrong sampling time?
7)what is ideal frequency for application?
I have gone through the data sheet and reference manual, but I couldn't understand much
please explain it will be helpful.
2023-12-21 06:51 PM
If you cannot understand those things, then you have to step back and first learn something basic that you can understand.
2023-12-21 08:16 PM
hello @Piranha
I understand these things just I not getting desired I wanted.
one channel values are coming properly, and other channels values are changing even it has fixed voltage as input.
please check previous topics.
2023-12-21 08:53 PM
There is no "correct" way to do things. It can be accomplished in multiple ways. I would suggest using an existing ADC DMA if you have no other experience or preference on how to do things.
> The hardware is NTC thermistor as temperature sensor.
Okay, you have a thermistor, attached in some unspecified manner, and you're taking readings on 3 ADC channels. A lot of details are missing here.
> I have gone through the data sheet and reference manual, but I couldn't understand much
Perhaps go from some existing code then. Or re-read. Not sure how me explaining it here will have different results.