cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767 ADC value significantly larger than expected

Seyoung
Associate II

We're using the ADC function built into the STM32F767.

The problem is that when the analog signal input to the ADC is around 200mV, the digital value output from the ADC appears to be around 240-260. We're trying to obtain a stable value by collecting 60 of these digital values ​​and calculating a moving average.

However, quite often, out of the 60 data points, 20-30 values ​​exceed 3000. Therefore, even when averaging the data, the readings are completely different from the actual analog value.

When I measured the input analog signal with an oscilloscope, it was around 200mV +/- 40mV, so I don't think it's due to input signal noise.

I suspect there's something wrong with the MCU's ADC settings or program. Please advise on what I suspect.

3 REPLIES 3
Andrew Neil
Super User

where is the input signal coming from?

Are you sure that the input signal is actually clean & steady?

Please show your schematic & code:

 How to write your question to maximize your chances to find a solution 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
bramble
Senior

Hi @Seyoung ,

You probably know this already, just a reminder that the 12 bit ADC value returned is an unsigned value, so zero volts in should give you noise fluctuations around 2048. You need to invert the msb (of those 12 bits) in order to convert to a signed integer. Also, worth double checking how you have configured the result to be aligned in the (presumably) 16 bit sample result words: i.e. left or right aligned.

I always do a sanity check that +3.3v and 0v at ADC input are swinging the sample result over the expected full range.

TDK
Super User

What board is this? Ensure VREF+ is steady and appropriately decoupled.

If 30-50% of the values exceed 3000 when they should be ~250, there is something very wrong here. Perhaps show your calculations.

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