2025-05-02 8:33 AM
Dear,
We are using the ADC2 in 16-bit resolution at 100 kHz, operating in differential mode.
The internal voltage reference (Vref) is set to 2.5 V.
A 1 kHz sine wave with a peak-to-peak voltage of 2.5 V (ranging from 0 V to 2.5 V) is applied to the ADC inputs.
Based on this setup, we expect the ADC output to vary between 0 and 65,535 after conversion.
However, our actual measurements show values ranging approximately from 16,787 to 50,000.
This suggests we are missing about 16384 counts on the lower and upper end.
When we rescale the measured values to the full 0–65,535 range, it appears as though the ADC is working with a 3.3 V range instead of 2.5 V.
Is this expected behaviour, or is there something we might be doing wrong?
See attached files for the configuration.
Our VREF of 1.25 (2.5V / 2) is connected to PC2
2025-05-02 8:52 AM
Hi,
> it appears as though the ADC is working with a 3.3 V range instead of 2.5 V.
So whats at pins Vref+ and Vref- ? (this range it will convert)
+
>The internal voltage reference (Vref) is set to 2.5 V.
Ok, and you connected to vref+ ? --->
+
You did diff.calibration ?
2025-05-02 11:27 AM - edited 2025-05-02 11:45 AM
Dear,
The vref + is connected to the Vrefbuf.
This is internally connected with the VREF+, mode ENVR = 1 and HiZ = 0
Now it is a 100 pin version of the STM32H7B0 and this MCU has no Vref+ and Vref- inputs
I do the diff. calibration with:
if (HAL_ADCEx_Calibration_Start(pHdlr->pHdlr_adc,
LL_ADC_CALIB_OFFSET_LINEARITY,
ADC_DIFFERENTIAL_ENDED) != HAL_OK) {
return(eERR_failed);
}
ps: R401 isn't assembled
What else can we check to identify the cause of this issue?
2025-05-02 11:39 AM
Your VREF+ is connected to VDDA, which is 3.3V. If you want to use VREFBUF, you will need to disconnect this pin from VDDA and add a 1uF capacitor. Looks like you have the caps, just need to disconnect R401.
You cannot use VREFBUF when VREF+ is provided externally.
2025-05-02 11:47 AM
Hi,
first check with DMM : whats on Tp 400 + 401 ? (when program running)
+
>Now it is a 100 pin version of the STM32H7B0
So :
+
to see the real actual input range, just do normal (not diff.) conversion , with dc at input 0...3V ,
to see, what the ADC really has as its vref+ .
2025-05-02 12:05 PM
Dear,
R401 is disconnected (not assembed)
2025-05-02 12:07 PM - edited 2025-05-02 12:11 PM
Dear,
On test point TP401 we have 2.506V
On test point TP400 we have 3.301V
When we use the ADC in non diff mode and we inject 2.5 on the ADC pin we become an ADC value of 49580.
This value is only correct when Vref is 3.3V and not 2.5V
2025-05-02 12:14 PM
> However, our actual measurements show values ranging approximately from 16,787 to 50,000.
Oh, there's just no issue here. These are the expected results.
To get an output of 0, you will need the positive input at 0 V and the negative input at VREF+. Since your negative input is fixed at VREF+/2, you will never see the full 0-65535 value range.
2025-05-02 12:41 PM - edited 2025-05-02 12:42 PM
Dear,
There is an issue.
We had the ADC configurated as in single end input.
So now the full ADC range of 0..65535 should be from 0 to 2.5V.
I have inject the follow voltages on the ADC input.
1.25V give 24801 on the ADC output ==> must be ~32767
2.5V give 49632 on the ADC output. ==> must be ~65535
These values are only correct when Vref was 3.3V and not 2.5V
2025-05-02 12:49 PM
So now we see: its running on Vref+ 3.3V .
Check your settings....and from rm for your 100pin (!!!) : can vref+ be switched to vref pin.
(I am too tired now...to look in rm.)