
RM0008
Analog-to-digital converter (ADC)
Doc ID 13902 Rev 12
209/1096
11.3.1 ADC
on-off
control
The ADC can be powered-on by setting the ADON bit in the ADC_CR2 register. When the
ADON bit is set for the first time, it wakes up the ADC from Power Down mode.
Conversion starts when ADON bit is set for a second time by software after ADC power-up
time (t
STAB
).
You can stop conversion and put the ADC in power down mode by resetting the ADON bit. In
this mode the ADC consumes almost no power (only a few µA).
11.3.2 ADC
clock
The ADCCLK clock provided by the Clock Controller is synchronous with the PCLK2 (APB2
clock). The RCC controller has a dedicated programmable prescaler for the ADC clock (refer
to
Low-, medium-, high- and XL-density reset and clock control (RCC) on page 87
for more
details.
11.3.3 Channel
selection
There are 16 multiplexed channels. It is possible to organize the conversions in two groups:
regular and injected. A group consists of a sequence of conversions which can be done on
any channel and in any order. For instance, it is possible to do the conversion in the
following order: Ch3, Ch8, Ch2, Ch2, Ch0, Ch2, Ch2, Ch15.
●
The
regular group
is composed of up to 16 conversions. The regular channels and
their order in the conversion sequence must be selected in the ADC_SQRx registers.
The total number of conversions in the regular group must be written in the L[3:0] bits in
the ADC_SQR1 register.
●
The
injected group
is composed of up to 4 conversions. The injected channels and
their order in the conversion sequence must be selected in the ADC_JSQR register.
The total number of conversions in the injected group must be written in the L[1:0] bits
in the ADC_JSQR register.
If the ADC_SQRx or ADC_JSQR registers are modified during a conversion, the current
conversion is reset and a new start pulse is sent to the ADC to convert the new chosen
group.
Temperature sensor/V
REFINT
internal channels
The Temperature sensor is connected to channel ADCx_IN16 and the internal reference
voltage V
REFINT
is connected to ADCx_IN17. These two internal channels can be selected
and converted as injected or regular channels.
Note:
The sensor and V
REFINT
are only available on the master ADC1 peripheral.
11.3.4
Single conversion mode
In Single conversion mode the ADC does one conversion. This mode is started either by
setting the ADON bit in the ADC_CR2 register (for a regular channel only) or by external
trigger (for a regular or injected channel), while the CONT bit is 0.