Skip to main content
Visitor II
September 3, 2025
Question

STM32F767 ADC value significantly larger than expected

  • September 3, 2025
  • 4 replies
  • 329 views

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.

    This topic has been closed for replies.

    4 replies

    Super User
    September 3, 2025

    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 

    Graduate II
    September 3, 2025

    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.

    Super User
    September 3, 2025

    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.

    Graduate II
    September 3, 2025

    Did you calibrate the ADC by calling HAL_ADCEx_Calibration_Start?

    You should show your relevant code so we know what has been done.