cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C071 Do we need Vref for the internal temperature computation

Matthias32
Associate II

A new question moved from this thread.

In many examples they use the Vref int for the calculation of the temperature. Do I need it for the C0 also or can it be done without?

3 REPLIES 3
LCE
Principal II

I only know about some other STM32 types:

for these there's usually the info at which Vref (often VDDA) the internal temperature sensor was calibrated, so in case it's not the same it is needed.

I just see the datasheet excerpt from the other thread, there you can see the formula with VDDA in relation to 3.0
-> and the 3.0 V is probably the voltage at which the sensor was calibrated.

Matthias32
Associate II

I was checking the Cube IDE but didn't find anything which helped me.

waclawek.jan
Super User

The ADC uses VREF+ pin as its reference voltage. It means, that the number you read out from ADC has to be divided by the steps the ADC has (2^12=4096) and multiplied by that reference voltage. In many small packages, this pin is connected internally to VDDA, i.e. your analog power supply.

If you know the voltage of VREF+/VDDA and you know it's powered from a reliable and stable power source, you simply use that voltage to calculate the voltage of the temperature sensor, and from that, the temperature, given the formulas in the datasheet/reference manual.

But often VREF+/VDDA is powered from a common linear regulator, and those, while stable, are surprisingly imprecise. In that case, you want to find out that VREF+/VDDA voltage in the program - we write programs usually for a mass-produced hardware and may be unfeasible to measure VREF+/VDDA for every single product using some external multimeter or so. That's why there is a stable voltage source built into the STM32, and that's VREFINT.

I have written an article about this, maybe it will help you to understand this further.

JW