CMS32L051 User Manual |Chapter 25 Temperature Sensor
www.mcu.com.cn 685 / 703
25.3.2 How to use the temperature sensor
Method 1: In this product, the TSN25 register stores the voltage conversion value (CAL25) of the
temperature sensor measured under the conditions of Ta=Tj=25°C and AVCC0=3.0v. The TSN85 register
stores the voltage conversion values of the temperature sensor measured at Ta=Tj=125°C and AVCC0=3.0v
(CAL125). Using these two sets of values, the temperature slope can be calculated:
slope = (V2 V1) / (125 - 25).
V1 = 3.0 × CAL25 / 256 [V]
V2 = 3. 0 × CAL125 / 256 [V]
Using the above results, the temperature can be calculated according to the following formula:
T = (Vs V1) / slope + 25 [°C]
T: Measured temperature (°C)
Vs: Output voltage of the temperature sensor obtained using an A/D converter at T temperature (V)
Method 2: If you use the temperature slope given in Electrical Characteristics, you can directly calculate
the measured temperature using the following formula:
T = (Vs V1) / slope + 25 [°C]
Note: This method produces a temperature that is less accurate than Method 1 measurements.