EasyManuals Logo

ST STM32F412 User Manual

ST STM32F412
1163 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #331 background imageLoading...
Page #331 background image
RM0402 Rev 6 331/1163
RM0402 Analog-to-digital converter (ADC)
347
Reading the temperature
To use the sensor:
3. Select ADC1_IN18 input channel.
4. Select a sampling time greater than the minimum sampling time specified in the
datasheet.
5. Set the TSVREFE bit in the ADC_CCR register to wake up the temperature sensor
from power down mode
6. Start the ADC conversion by setting the SWSTART bit (or by external trigger)
7. Read the resulting V
SENSE
data in the ADC data register
8. Calculate the temperature using the following formula:
Temperature (in °C) = {(V
SENSE
– V
25
) / Avg_Slope} + 25
Where:
–V
25
= V
SENSE
value for 25° C
Avg_Slope = average slope of the temperature vs. V
SENSE
curve (given in mV/°C
or µV/°C)
Refer to the datasheet electrical characteristics section for the actual values of V
25
and
Avg_Slope.
Note: The sensor has a startup time after waking from power down mode before it can output
V
SENSE
at the correct level. The ADC also has a startup time after power-on, so to minimize
the delay, the ADON and TSVREFE bits should be set at the same time.
The temperature sensor output voltage changes linearly with temperature. The offset of this
linear function depends on each chip due to process variation (up to 45
°C from one chip to
another).
The internal temperature sensor is more suited for applications that detect temperature
variations instead of absolute temperatures. If accurate temperature reading is required, an
external temperature sensor should be used.
13.10 Battery charge monitoring
The VBATE bit in the ADC_CCR register is used to switch to the battery voltage. As the
V
BAT
voltage could be higher than V
DDA
, to ensure the correct operation of the ADC, the
V
BAT
pin is internally connected to a bridge divider.
When the VBATE is set, the bridge is automatically enabled to connect:
VBAT/4 to the ADC1_IN18 input channel
Note: The VBAT and temperature sensor are connected to the same ADC internal channel
(ADC1_IN18). Only one conversion, either temperature sensor or VBAT, must be selected
at a time. When both conversion are enabled simultaneously, only the VBAT conversion is
performed.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F412 and is the answer not in the manual?

ST STM32F412 Specifications

General IconGeneral
BrandST
ModelSTM32F412
CategoryMicrocontrollers
LanguageEnglish

Related product manuals