cancel
Showing results for 
Search instead for 
Did you mean: 

Fluctuating values read from ADC potentiometer

JGali.3
Associate

Good Day, I'm new to STM32 Programming and my project is to read ADC value from the potentiometer. However, the problem is the value displayed at the live expression is not constant. Every time I adjust the setting, the current value retrieved will show and after a second the value changes to 2438. Here is my code below: 

JGali3_0-1720419535780.png

 

1 REPLY 1
AScha.3
Chief II

Hi,

you have to do calibration first ... from ds :

AScha3_0-1720422038699.png

+

Put a cer.cap direct at the ADC input pin, maybe 100nF to GND. (To get a "clean" DC level here.)

(And don't rely on live expressions , just check, what your ADC value is then, after conversion.)

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