
Analog-to-digital converter (ADC)
RM0008
210/1096
Doc ID 13902 Rev 12
Once the conversion of the selected channel is complete:
●
If a regular channel was converted:
–
The converted data is stored in the 16-bit ADC_DR register
–
The EOC (End Of Conversion) flag is set
–
and an interrupt is generated if the EOCIE is set.
●
If an injected channel was converted:
–
The converted data is stored in the 16-bit ADC_DRJ1 register
–
The JEOC (End Of Conversion Injected) flag is set
–
and an interrupt is generated if the JEOCIE bit is set.
The ADC is then stopped.
11.3.5
Continuous conversion mode
In continuous conversion mode ADC starts another conversion as soon as it finishes one.
This mode is started either by external trigger or by setting the ADON bit in the ADC_CR2
register, while the CONT bit is 1.
After each conversion:
●
If a regular channel was converted:
–
The converted data is stored in the 16-bit ADC_DR register
–
The EOC (End Of Conversion) flag is set
–
An interrupt is generated if the EOCIE is set.
●
If an injected channel was converted:
–
The converted data is stored in the 16-bit ADC_DRJ1 register
–
The JEOC (End Of Conversion Injected) flag is set
–
An interrupt is generated if the JEOCIE bit is set.
11.3.6 Timing
diagram
As shown in
, the ADC needs a stabilization time of t
STAB
before it starts
converting accurately. After the start of ADC conversion and after 14 clock cycles, the EOC
flag is set and the 16-bit ADC Data register contains the result of the conversion.
Figure 23.
Timing diagram
ADC_CLK
EOC
Next ADC Conversion
ADC Conversion
Conversion Time
t
STAB
ADC
Software resets EOC bit
SET ADON
ADC power on
(total conv time)
Start 1st conversion
Start next conversion