Each STM32 chip has an internal reference voltage, equivalent to a standard voltage measurement point, connected to channel 17 of ADC1 inside the chip.
According to the data in the datasheet, the typical value of this reference voltage is 1.20V, with a minimum of 1.16V and a maximum of 1.24V. This voltage does not significantly change with variations in external power supply voltage.
Many people confuse this reference voltage with the reference voltage of the ADC. The reference voltage for the ADC is provided through Vref+. For models with more than 100 pins, Vref+ is brought outside the chip, with the pin name Vref+; for models with 64 pins or fewer, Vref+ is internally connected to the VCC signal line and not brought outside the chip, making the ADC reference voltage equal to the voltage on VCC.
In cases where the external reference voltage of the ADC fluctuates, or when Vref+ is internally connected to VCC and VCC changes, if the accuracy requirement for ADC measurements is not high, this internal reference voltage can be used to obtain the ADC measurement voltage value.
The specific method is to read the ADC measurement value of the reference voltage before measuring the voltage value of a certain channel, denoted as ADrefint; then read the ADC conversion value of the channel to be measured, denoted as ADchx; the voltage to be measured is:
Vchx= Vrefint* (ADchx/ADrefint)
Where Vrefint is the reference voltage = 1.20V.
The above method is particularly effective when using the built-in temperature sensor to compensate system parameters due to temperature changes. 