2019-07-05 09:31 AM
Using STM32F0308C on a custom board. When I read the temperature sensor I am getting 1765 and the TS_CAL value is 1778.
Supply voltage is 3.3V, VREF_INT is 1524 and I am reading 1525 on the internal reference. So I assume I must apply a 1524/1525 correction to the temperature reading which gives me 1777. This must correspond approximately to 29.4°C if I did the math right.
However it is very cold today (less than 20°C in the room) so my question is if the internal temperature sensor is always this higher. Processor is running at 8MHz.
Summarizing:
VDD/VDDA: 3.3V
VREF_INT: 1524
TS_CAL: 1775
Vref reading: 1525
Temp reading: 1778
Temp reading corrected: 1777
Temperature: 29.4°C
Same firmware running on a STM32F0308 discovery board gives:
VDD/VDDA: 3.0V
VREF_INT: 1531
TS_CAL: 1768
Vref reading: 1704
Temp reading: 1989
Temp reading corrected: 1787
Temperature: 26.4°C
So the question is is the temperature I get makes sense, why there is this 3°C discrepancy and if it makes sense it being several °C above the ambient temperature when the microcontroller has just been powered on.
EDIT: before anybody asks, using ADC 14MHz with the highest sampling time (~17us).
2019-07-05 11:59 AM
Well, I would use VRef to calculate back Vdda, then translate the ADC Temp value to what it would be at 3.0V and compare it with the calibrated 2 temperature points of 30 and 110 or 125 degrees (chip dependent, read the datasheet).
Now this is the localized silicon temperature within the package, which has some self heating.
I do beleive the existing ADC Temp/Vref examples are not going to this extend, hence so many questions like this on the forum....