RM0365
1.
Select the ADC1_IN16 input channel (with the appropriate sampling time).
2.
Program with the appropriate sampling time (refer to electrical characteristics section of
the STM32F302xx datasheet).
3.
Set the TSEN bit in the ADC1_CCR register to wake up the temperature sensor from
power-down mode.
4.
Start the ADC conversion.
5.
Read the resulting V
6.
Calculate the actual temperature using the following formula:
Where:
–
–
Refer to the datasheet electrical characteristics section for the actual values of V
Avg_Slope.
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.
15.3.31
V
supply monitoring
BAT
The VBATEN bit in the ADC12_CCR register is used to switch to the battery voltage. As the
V
voltage could be higher than V
BAT
V
pin is internally connected to a bridge divider by 2. This bridge is automatically enabled
BAT
when VBATEN is set, to connect V
consequence, the converted digital value is half the V
consumption on the battery, it is recommended to enable the bridge divider only when
needed, for ADC conversion.
Refer to the electrical characteristics of the STM32F302xx datasheet for the sampling time
value to be applied when converting the V
Figure 109
data in the ADC data register.
TS
Temperature (in °C) = {(V
V
= V
value for 25° C
25
TS
Avg_Slope = average slope of the temperature vs. V
µV/°C)
shows the block diagram of the V
DocID025202 Rev 7
Analog-to-digital converters (ADC)
– V
) / Avg_Slope} + 25
25
TS
, to ensure the correct operation of the ADC, the
DDA
/2 to the ADC1_IN17 input channel. As a
BAT
BAT
/2 voltage.
BAT
sensing feature.
BAT
curve (given in mV/°C or
TS
voltage. To prevent any unwanted
and
25
TS
352/1080
392
Need help?
Do you have a question about the RM0365 and is the answer not in the manual?