cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7B0 has incorrect ADC scale

OGhis
Senior

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.

OGhis_1-1746199734945.png

 

OGhis_0-1746199662145.png

Our VREF of 1.25 (2.5V / 2) is connected to PC2

OGhis_2-1746199793804.png

 

 






10 REPLIES 10
AScha.3
Chief III

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)

AScha3_0-1746200941320.png

+

>The internal voltage reference (Vref) is set to 2.5 V.

Ok, and you connected to vref+ ?  --->

AScha3_1-1746201087983.png

+

You did diff.calibration ?

 

 

 

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

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); 
}

 

OGhis_2-1746211518522.png

 

 

OGhis_1-1746210536001.png

ps: R401 isn't assembled


What else can we check to identify the cause of this issue?

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.

TDK_0-1746211054469.png

 

You cannot use VREFBUF when VREF+ is provided externally.

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

Hi,

first check with DMM : whats on Tp 400 + 401 ? (when program running)

+

>Now it is a 100 pin version of the STM32H7B0

So :

AScha3_0-1746211353719.png

+

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+ .

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

Dear,

R401 is disconnected (not assembed)

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

TDK
Guru

> 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.

  • At -1.25 V (differential), expected output is 16787.
  • At +1.25 V (differential), expected output is 49152.

 

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.

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

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

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.)

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