Associate III
January 17, 2022
Solved
STM32G0B1: internal temperature sensor
- January 17, 2022
- 11 replies
- 5658 views
I am trying to measure/calculate the internal temperature of an STM32G0B1VE design.
The algorithm used is taken from the reference manual RM0444 Rev 5 pages 376-378:
Temperature in degreesC = ((TS_CAL2_TEMP-TS_CAL1_TEMP) / (TS_CAL2-TS_CAL1)) * (TS_DATA-TS_CAL1) + TS_CAL1_TEMP
The calibration values are taken from the data sheet, see stm32g0b1ve.pdf (DS13560 Rev 1) page 25.
TS_CAL1_TEMP = 30 (defined in data sheet)
TS_CAL2_TEMP = 130 (defined i data sheet)
TS_CAL1 = 0x3FF (speficic to my controller, retrieved from 0x1FFF75A8)
TS_CAL2 = 0x560 (specific to my controller, retrieved from 0x1FFF75CA)
measured = 0x39F
If I run the calculation, I get 3°C. Is there something I did wrong?
Attached is a minimal STM32CubeMX/STM32CubeIDE example
