Analog-to-digital converter (ADC)
Main features
•
Supported temperature range: –40 to 125 °C
•
Linearity: ±2 °C max., precision depending on calibration
Reading the temperature
1.
Select the ADC V
2.
Select an appropriate sampling time specified in the device datasheet (T
3.
Set the TSEN bit in the ADC_CCR register to wake up the temperature sensor from
power down mode and wait for its stabilization time (t
4.
Start the ADC conversion by setting the ADSTART bit in the ADC_CR register (or by
external trigger)
5.
Read the resulting V
6.
Calculate the temperature using the following formula
Temperature in °C
Where:
•
TS_CAL2 is the temperature sensor calibration value acquired at TS_CAL2_TEMP
(refer to the datasheet for TS_CAL2 value)
•
TS_CAL1 is the temperature sensor calibration value acquired at TS_CAL1_TEMP
(refer to the datasheet for TS_CAL1 value)
•
TS_DATA is the actual temperature sensor output value converted by ADC
Refer to the specific device datasheet for more information about TS_CAL1 and
TS_CAL2 calibration points.
Note:
The sensor has a startup time after waking from power down mode before it can output V
at the correct level. The ADC also has a startup time after power-on, so to minimize the
delay, the ADEN and TSEN bits should be set at the same time.
566/1461
Figure 84. Temperature sensor and V
TSEN control bit
Temperature
sensor
VREFEN control bit
Internal power
block
[12] input channel
IN
data in the ADC_DR register
TS
TS_CAL2_TEMP TS_CAL1_TEMP
--------------------------------------------------------------------------------------------------- -
(
)
=
TS_CAL2 TS_CAL1
REFINT
V
+
TS
ADC V
-
V
+
REFINT
ADC V
-
–
×
–
RM0453 Rev 1
channel block diagram
[12]
IN
converted data
ADC
[13]
IN
).
START
(
TS_DATA TS_CAL1
–
)
+
TS_CAL1_TEMP
RM0453
MSv45366V2
).
S_temp
TS
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?
Questions and answers