The device has an integrated temperature sensor which is part of the Supply Controller (SUPC). The analog signal of that sensor can be converted into a digital value by the ADC. The digital value can be converted into a temperature in °C by following the steps in this section.

In order to conduct temperature measurements, configure the device according to these
steps.

- 1.Configure the clocks and device frequencies according to the Electrical Characteristics chapters.
- 2.Configure the Voltage References System of the Supply Controller (SUPC):
- a.Enable the temperature sensor by writing a '1' to the Temperature Sensor Enable bit in the VREF Control register (SUPC.VREF.TSEN).
- b.Select the required voltage for the internal voltage reference INTREF by writing to the Voltage Reference Selection bits (SUPC.VREF.SEL). The required value can be found in the Electrical Characteristics chapters.
- c.Enable routing INTREF to the ADC by writing a '1' to the Voltage Reference Output Enable bit (SUPC.VREF.VREFOE).

- 3.Configure the ADC:
- a.Select the internal voltage reference INTREF as ADC reference voltage by writing to the Reference Control register (ADC.REFCTRL.REFSEL).
- b.Select the temperature sensor vs. internal GND as input by writing TEMP and GND to the positive and negative MUX Input Selection bit fields (ADC.INPUTCTRL.MUXNEG and .MUXPOS, respectively).
- c.Configure the remaining ADC parameters according to the Electrical Characteristics chapters.
- d.Enable the ADC and
acquire a value, ADC
_{m}.

The temperature sensor behavior is linear, but it is sensitive to several parameters such as the internal voltage reference - which itself depends on the temperature. To take this into account, each device contains a Temperature Log row with individual calibration data measured and written during the production tests. These calibration values are read by software to infer the most accurate temperature readings possible.

The Temperature Log Row basically contains the following parameter set for two
different temperatures ("ROOM" and "HOT"):

- Calibration temperatures in
°C. One at room temperature
*temp*_{R}, one at a higher temperature*temp*_{H}:- ROOM_TEMP_VAL_INT and ROOM_TEMP_VAL_DEC contain the measured
temperature at room insertion,
*temp*_{R}, in °C, separated in integer and decimal value.Example: For ROOM_TEMP_VAL_INT=0x19=25 and ROOM_TEMP_VAL_DEC=2, the measured temperature at room insertion is 25.2°C.

- HOT_TEMP_VAL_INT and HOT_TEMP_VAL_DEC contain the measured
temperature at hot insertion,
*temp*_{H}, in °C. The integer and decimal value are also separated.

- ROOM_TEMP_VAL_INT and ROOM_TEMP_VAL_DEC contain the measured
temperature at room insertion,
- For each temperature, the
corresponding sensor value at the ADC in 12-bit, ADC
_{R}and ADC_{H}:- ROOM_ADC_VAL contains the 12-bit ADC value, ADC
_{R}, corresponding to*temp*_{R}. Its conversion to Volt is denoted V_{ADCR}. - HOT_ADC_VAL contains the 12-bit ADC value, ADC
_{H}, corresponding to*temp*_{H}. Its conversion to Volt is denoted V_{ADCH}.

- ROOM_ADC_VAL contains the 12-bit ADC value, ADC
- Actual reference voltages at
each calibration temperature in Volt, INT1V
_{R}and INT1V_{H}, respectively:- ROOM_INT1V_VAL is the 2’s complement of the internal 1V reference
value at
*temp*_{R}: INT1V_{R}. - HOT_INT1V_VAL is the 2’s complement of the internal 1V reference
value at
*temp*_{H}: INT1V_{H}. - Both ROOM_INT1V_VAL and HOT_INT1V_VAL values are centered around 1V with a 0.001V step. In other words, the range of values [0,127] corresponds to [1V, 0.873V] and the range of values [-1, -127] corresponds to [1.001V, 1.127V]. INT1V == 1 - (VAL/1000) is valid for both ranges.

- ROOM_INT1V_VAL is the 2’s complement of the internal 1V reference
value at

Using the data pairs (*temp*_{R}, *V _{ADCR}*) and (

The voltages *V _{x}* are acquired as
12-bit ADC values

For the measured value of the temperature sensor,
*ADC _{m}*, the reference voltage is assumed to be perfect,
i.e., INT1V

Or, after eliminating the 12-bit scaling factor
(2^{12}-1):

**[Equation 3]**

Equations 3 is a coarse value, because we assumed
that INT1V_{c}=1V. To achieve a more accurate result, we replace
INT1V_{c} with an interpolated value INT1V_{m}. We
use the two data pairs (*temp*_{R},
INT1V_{R}) and (*temp*_{H}, INT1V_{H}) and yield:

Using the coarse temperature value
*temp _{c}*, we can infer a more precise INT1V

Back to Equation 3, we replace the simple
INT1V_{c}=1V by the more precise INT1V_{m} of Equation 4, and
find a more accurate temperature value *temp*_{f}:

**[Equation
5]**