Adc Interrupts; Table 48. Adc Interrupts - ST STM32F102 Series Reference Manual

Hide thumbs Also See for STM32F102 Series:
Table of Contents

Advertisement

Analog-to-digital converter (ADC)
Reading the temperature
To use the sensor:
1.
Select the ADCx_IN16 input channel.
2.
Select a sample time of 17.1 µs
3.
Set the TSVREFE bit in the
temperature sensor from power down mode.
4.
Start the ADC conversion by setting the ADON bit (or by external trigger).
5.
Read the resulting V
6.
Obtain the temperature using the following formula:
Temperature (in °C) = {(V
Where,
V
25
Avg_Slope = Average Slope for curve between Temperature vs. V
mV/° C or µV/ °C).
Refer to the 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
SENSE
the delay, the ADON and TSVREFE bits should be set at the same time.
10.11

ADC interrupts

An interrupt can be produced on end of conversion for regular and injected groups and
when the Analog Watchdog status bit is set. Separate interrupt enable bits are available for
flexibility.
Note:
ADC1 and ADC2 interrupts are mapped onto the same interrupt vector. ADC3 interrupts are
mapped onto a separate interrupt vector.
Two other flags are present in the ADC_SR register, but there is no interrupt associated with
them:
JSTRT (Start of conversion for injected group channels)
STRT (Start of conversion for regular group channels)
Table 48.
End of Conversion regular group
End of Conversion injected group
Analog Watchdog Status bit is set
168/690
SENSE
25
= V
value for 25° C and
SENSE
ADC interrupts
Interrupt event
ADC control register 2 (ADC_CR2)
data in the ADC data register
- V
) / Avg_Slope} + 25.
SENSE
to wake up the
(given in
SENSE
and
25
Event flag
Enable Control bit
EOC
EOCIE
JEOC
JEOCIE
AWD
AWDIE
RM0008

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F102 Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Stm32f101 seriesStm32f103 series

Table of Contents