12. Analog-to-digital converters (ADC)
12.1 Introduction
12.2 ADC main features
- • High-performance features
- – ADC1 is connected to 15 external channels + 3 internal channels
- – 12, 10, 8 or 6-bit configurable resolution
- – ADC conversion time:
Fast channels: 0.19 µs for 12-bit resolution (5.1 Ms/s)
Slow channels: 0.21 µs for 12-bit resolution (4.8 Ms/s) - – ADC conversion time is independent from the AHB bus clock frequency
- – Faster conversion time by lowering resolution: 0.16 µs for 10-bit resolution
- – Can manage Single-ended or differential inputs (programmable per channels)
- – AHB slave bus interface to allow fast data handling
- – Self-calibration
- – Channel-wise programmable sampling time
- – Up to four injected channels (analog inputs assignment to regular or injected channels is fully configurable)
- – Hardware assistant to prepare the context of the injected channels to allow fast context switching
- – Data alignment with in-built data coherency
- – Data can be managed by GP-DMA for regular channel conversions
- – 4 dedicated data registers for the injected channels
- • Low-power features
- – Speed adaptive low-power mode to reduce ADC consumption when operating at low frequency
- – Allows slow bus frequency application while keeping optimum ADC performance (0.19 µs conversion time for fast channels can be kept whatever the AHB bus clock frequency)
- – Provides automatic control to avoid ADC overrun in low AHB bus clock frequency application (auto-delayed mode)
- • In addition, there are three internal dedicated channels:
- – One from internal temperature sensor ( \( V_{TS} \) ), connected to ADC1
- – One from \( V_{BAT}/2 \) , connected to ADC1
- – One from the internal reference voltage ( \( V_{REFINT} \) ), connected to ADC1
- • Start-of-conversion can be initiated:
- – by software for both regular and injected conversions
- – by hardware triggers with configurable polarity (internal timers events or GPIO input events) for both regular and injected conversions
- • Conversion modes
- – Each ADC can convert a single channel or can scan a sequence of channels
- – Single mode converts selected inputs once per trigger
- – Continuous mode converts selected inputs continuously
- – Discontinuous mode
- • Interrupt generation at the end of conversion (regular or injected), end of sequence conversion (regular or injected), analog watchdog 1, 2 or 3 or overrun events
- • 3 analog watchdogs per ADC
- • ADC supply requirements: 1.80 V to 3.6 V
- • ADC input range: \( V_{REF-} \leq V_{IN} \leq V_{REF+} \)
Figure 24 shows the block diagram of one ADC.
12.3 ADC functional description
12.3.1 ADC block diagram
Figure 24 shows the ADC block diagram and Table 31 gives the ADC pin description.
Figure 24. ADC block diagram

The diagram illustrates the internal architecture and external connections of the ADC. Key components include:
- SAR ADC: The central conversion unit, receiving analog input (VIN) and control signals. It outputs converted data (RDATA[11:0], JDATA1[11:0], JDATA2[11:0], JDATA3[11:0], JDATA4[11:0]).
- Bias & Ref: Provides reference voltages and biasing for the ADC. It is connected to VREF+ (1.8 to 3.6 V) and VDDA (1.8V to 3.6 V).
- Input selection & scan control: Manages the selection of analog input channels (VINP[18:1], VINN[18:1]) and controls the scanning process. It includes controls for JAUTO, ADC_JSQRx, ADC_SQRx, and CONT (single/cont).
- Start & Stop Control: Handles start and stop triggers for the ADC conversion. It includes controls for AUTDLY (auto delayed), ADSTP (stop conv), and S/W trigger.
- EXTI mapped at product level: External Interrupts (EXTI) mapped to the ADC for triggering. It includes EXT0 through EXT15 and JEXT0 through JEXT15.
- Discontinuous mode: Controls for discontinuous conversion mode, including DISCEN, DISCNUM[0], and EXTSEL[3:0] (trigger selection).
- Injected Context Queue Mode: Controls for injected context queue mode, including JDISCEN, JDISCNUM[2:0], and JEXTSEL[3:0] (trigger selection).
- Analog watchdog 1,2,3: Analog watchdog units (AWD1, AWD2, AWD3) for monitoring input levels. They output AWD1_OUT, AWD2_OUT, and AWD3_OUT to TIMERS/ETR.
- AHB interface: Interface to the AHB bus, including registers for status and control (AREADY, EOSMP, EOC, EOS, OVR, JEOS, JQOVF, AWDx). It connects to Cortex M4 with FPU (ADC Interrupt, IRQ) and DMA (DMA request).
- Other controls: Includes ADALN (self calibration), SMPx[2:0] (sampling time), OVRMOD (overrun mode), ALIGN (left/right), RES[1:0] (12, 10, 8 bits), JOFFSETx[11:0], and JOFFSETx_CH[11:0].
MSV30260V3
12.3.2 Pins and internal signals
Table 30. ADC internal signals
| Internal signal name | Signal type | Description |
|---|---|---|
| EXT[15:0] | Inputs | Up to 16 external trigger inputs for the regular conversions (can be connected to on-chip timers). These inputs are shared between the ADC master and the ADC slave. |
| JEXT[15:0] | Inputs | Up to 16 external trigger inputs for the injected conversions (can be connected to on-chip timers). These inputs are shared between the ADC master and the ADC slave. |
| ADC1_AWDx_OUT | Output | Internal analog watchdog output signal connected to on-chip timers. (x = Analog watchdog number 1,2,3) |
| V TS | Input | Output voltage from internal temperature sensor |
| V REFINT | Input | Output voltage from internal reference voltage |
| V BAT | Input supply | External battery voltage supply |
Table 31. ADC pins
| Name | Signal type | Comments |
|---|---|---|
| V REF+ | Input, analog reference positive | The higher/positive reference voltage for the ADC, \( 1.8\text{ V} \leq V_{REF+} \leq V_{DDA} \) (1) |
| V DDA | Input, analog supply | Analog power supply equal V
DDA
: \( 1.8\text{ V} \leq V_{DDA} \leq 3.6\text{ V} \) |
| V REF- | Input, analog reference negative | The lower/negative reference voltage for the ADC, \( V_{REF-} = V_{SSA} \) |
| V SSA | Input, analog supply ground | Ground for analog power supply equal to V SS |
| V INP [18:1] | Positive input analog channels for each ADC | Connected either to external channels: ADC_INi or internal channels. |
| V INN [18:1] | Negative input analog channels for each ADC | Connected to V REF- or external channels: ADC_INi-1 |
| ADCx_IN15:1 | External analog input signals | Up to 15 analog input channels (x = ADC number = 1): – 5 fast channels – 10 slow channels |
1. In F301xx devices the V REF+ and V DDA are connected internally.
12.3.3 Clocks
Dual clock domain architecture
The dual clock-domain architecture means that each ADC clock is independent from the AHB bus clock.
The input clock of the two ADCs (master and slave) can be selected between two different clock sources (see Figure 25: ADC clock scheme ):
- The ADC clock can be a specific clock source, named “ADCxy_CK (xy=12 or 34) which is independent and asynchronous with the AHB clock”.
It can be configured in the RCC to deliver up to 72 MHz (PLL output). Refer to RCC Section for more information on generating ADC12_CK.
To select this scheme, bits CKMODE[1:0] of the ADCx_CCR register must be reset.
- The ADC clock can be derived from the AHB clock of the ADC bus interface, divided by a programmable factor (1, 2 or 4). In this mode, a programmable divider factor can be selected (/1, 2 or 4 according to bits CKMODE[1:0]).
To select this scheme, bits CKMODE[1:0] of the ADCx_CCR register must be different from “00”.
Note: Software can use option b) by writing CKMODE[1:0]=01 only if the AHB prescaler of the RCC is set to 1 (the duty cycle of the AHB clock must be 50% in this configuration).
Option a) has the advantage of reaching the maximum ADC clock frequency whatever the AHB clock scheme selected. The ADC clock can eventually be divided by the following ratio: 1, 2, 4, 6, 8, 12, 16, 32, 64, 128, 256; using the prescaler configured with bits ADCxPRES[4:0] in register RCC_CFGR2 (Refer to Section 7: Reset and clock control (RCC) ).
Option b) has the advantage of bypassing the clock domain resynchronizations. This can be useful when the ADC is triggered by a timer and if the application requires that the ADC is precisely triggered without any uncertainty (otherwise, an uncertainty of the trigger instant is added by the resynchronizations between the two clock domains).
Figure 25. ADC clock scheme
![Figure 25. ADC clock scheme diagram showing the RCC (Reset and clock controller) providing HCLK and ADC1_CK signals to the ADC1 block. The ADC1 block contains an AHB interface, a divider (/1 or /2 or /4) controlled by Bits CKMODE[1:0] of ADC12_CCR, and a multiplexer controlled by Bits CKMODE[1:0] of ADC1_CCR. The multiplexer selects between the AHB interface and the divider output to drive the Analog ADC1 (master).](/RM0366-STM32F301x6-8-318x8/55af54cd78b1a8398875e43ca2bf4c69_img.jpg)
The diagram illustrates the clocking architecture for the ADC1 block. On the left, the RCC (Reset and clock controller) provides two primary clock signals: HCLK (connected to the AHB interface) and ADC1_CK (connected to a multiplexer). The ADC1 block contains an AHB interface, a programmable divider (labeled "/1 or /2 or /4"), and a multiplexer. The divider is controlled by Bits CKMODE[1:0] of the ADC12_CCR register. The multiplexer is controlled by Bits CKMODE[1:0] of the ADC1_CCR register. The multiplexer selects between the AHB interface (input '00') and the divider output (input 'Others'). The output of the multiplexer drives the Analog ADC1 (master). The diagram is labeled MS32692V1.
- Refer to the RCC section to see how HCLK can be generated.
Clock ratio constraint between ADC clock and AHB clock
There are generally no constraints to be respected for the ratio between the ADC clock and the AHB clock except if some injected channels are programmed. In this case, it is mandatory to respect the following ratio:
- • \( F_{HCLK} \geq F_{ADC} / 4 \) if the resolution of all channels are 12-bit or 10-bit
- • \( F_{HCLK} \geq F_{ADC} / 3 \) if there are some channels with resolutions equal to 8-bit (and none with lower resolutions)
- • \( F_{HCLK} \geq F_{ADC} / 2 \) if there are some channels with resolutions equal to 6-bit
12.3.4 ADC1 connectivity
Figure 26. ADC1 connectivity

The diagram illustrates the internal connectivity of the ADC1 block within an STM32F3xx microcontroller. On the left, external pins are labeled ADC1_IN1 through ADC1_IN15, V TS , V BAT/2 , and V REFINT . These are connected to internal ADC1 pins labeled V INP [1] through V INP [18] and V INN [1] through V INN [18]. Each pair of pins is associated with a channel labeled 'fast channel' or 'slow channel'. Channels 1-5 are fast, while channels 6-18 are slow. The V INN pins are connected to a common reference voltage V REF- . The V INP pins are connected to a 'Channel Selection' multiplexer. The output of the multiplexer is connected to the V INP input of a 'SAR ADC1' block. The SAR ADC1 block also has inputs for V REF+ , V INN , and V REF- . A 'Single-ended Mode' switch is shown between the V INN and V REF- inputs. External connections include V REF+ (connected to V INP [18]), V REF- (connected to V INN [18]), V REFINT (connected to V INP [17]), V BAT/2 (connected to V INP [16]), and V TS (connected to V INP [15]). The diagram is labeled MS32691V4.
12.3.5 Slave AHB interface
The ADCs implement an AHB slave port for control/status register and data access. The features of the AHB interface are listed below:
- • Word (32-bit) accesses
- • Single cycle response
- • Response to all read/write accesses to the registers with zero wait states.
The AHB slave interface does not support split/retry requests, and never generates AHB errors.
12.3.6 ADC voltage regulator (ADVREGEN)
The sequence below is required to start ADC operations:
- 1. Enable the ADC internal voltage regulator (refer to the ADC voltage regulator enable sequence).
- 2. The software must wait for the startup time of the ADC voltage regulator ( \( T_{ADCVREG\_STUP} \) ) before launching a calibration or enabling the ADC. This temporization must be implemented by software. \( T_{ADCVREG\_STUP} \) is equal to 10 \( \mu s \) in the worst case process/temperature/power supply.
After ADC operations are complete, the ADC is disabled (ADEN=0).
It is possible to save power by disabling the ADC voltage regulator (refer to the ADC voltage regulator disable sequence).
Note: When the internal voltage regulator is disabled, the internal analog calibration is kept.
ADVREG enable sequence
To enable the ADC voltage regulator, perform the sequence below:
- 1. Change ADVREGEN[1:0] bits from '10' (disabled state, reset state) into '00'.
- 2. Change ADVREGEN[1:0] bits from '00' into '01' (enabled state).
ADVREG disable sequence
To disable the ADC voltage regulator, perform the sequence below:
- 1. Change ADVREGEN[1:0] bits from '01' (enabled state) into '00'.
- 2. Change ADVREGEN[1:0] bits from '00' into '10' (disabled state)
12.3.7 Single-ended and differential input channels
Channels can be configured to be either single-ended input or differential input by writing into bits DIFSEL[15:1] in the ADCx_DIFSEL register. This configuration must be written while the ADC is disabled (ADEN=0). Note that DIFSEL[18:16] are fixed to single ended channels (internal channels only) and are always read as 0.
In single-ended input mode, the analog voltage to be converted for channel "i" is the difference between the external voltage ADC_IN i (positive input) and \( V_{REF-} \) (negative input).
In differential input mode, the analog voltage to be converted for channel "i" is the difference between the external voltage ADC_IN i (positive input) and ADC_IN i +1 (negative input).
For a complete description of how the input channels are connected for each ADC, refer to Figure 26: ADC1 connectivity .
Caution: When configuring the channel "i" in differential input mode, its negative input voltage is connected to ADC_IN i +1. As a consequence, channel " i+1 " is no longer usable in single-ended mode or in differential mode and must never be configured to be converted.
Note: Channels 16, 17 and 18 of ADC1 are connected to internal analog channels and are internally fixed to single-ended inputs configuration (corresponding bits DIFSEL[i] is always zero). Channel 15 of ADC1 is also an internal channel and the user must configure the corresponding bit DIFSEL[15] to zero.
12.3.8 Calibration (ADCAL, ADCALDIF, ADCx_CALFACT)
Each ADC provides an automatic calibration procedure which drives all the calibration sequence including the power-on/off sequence of the ADC. During the procedure, the ADC calculates a calibration factor which is 7-bit wide and which is applied internally to the ADC until the next ADC power-off. During the calibration procedure, the application must not use the ADC and must wait until calibration is complete.
Calibration is preliminary to any ADC operation. It removes the offset error which may vary from chip to chip due to process or bandgap variation.
The calibration factor to be applied for single-ended input conversions is different from the factor to be applied for differential input conversions:
- • Write ADCALDIF=0 before launching a calibration which will be applied for single-ended input conversions.
- • Write ADCALDIF=1 before launching a calibration which will be applied for differential input conversions.
The calibration is then initiated by software by setting bit ADCAL=1. Calibration can only be initiated when the ADC is disabled (when ADEN=0). ADCAL bit stays at 1 during all the calibration sequence. It is then cleared by hardware as soon the calibration completes. At this time, the associated calibration factor is stored internally in the analog ADC and also in the bits CALFACT_S[6:0] or CALFACT_D[6:0] of ADCx_CALFACT register (depending on single-ended or differential input calibration)
The internal analog calibration is kept if the ADC is disabled (ADEN=0). However, if the ADC is disabled for extended periods, then it is recommended that a new calibration cycle is run before re-enabling the ADC.
The internal analog calibration is kept if the ADC is disabled (ADEN=0). When the ADC operating conditions change (V REF+ changes are the main contributor to ADC offset variations, V DDA and temperature change to a lesser extent), it is recommended to re-run a calibration cycle.
The internal analog calibration is lost each time the power of the ADC is removed (example, when the product enters in STANDBY or V BAT mode). In this case, to avoid spending time recalibrating the ADC, it is possible to re-write the calibration factor into the ADCx_CALFACT register without recalibrating, supposing that the software has previously saved the calibration factor delivered during the previous calibration.
The calibration factor can be written if the ADC is enabled but not converting (ADEN=1 and ADSTART=0 and JADSTART=0). Then, at the next start of conversion, the calibration factor will automatically be injected into the analog ADC. This loading is transparent and does not add any cycle latency to the start of the conversion.
Software procedure to calibrate the ADC
- 1. Ensure ADVREGEN[1:0]=01 and that ADC voltage regulator startup time has elapsed.
- 2. Ensure that ADEN=0.
- 3. Select the input mode for this calibration by setting ADCALDIF=0 (Single-ended input) or ADCALDIF=1 (Differential input).
- 4. Set ADCAL=1.
- 5. Wait until ADCAL=0.
- 6. The calibration factor can be read from ADCx_CALFACT register.
Figure 27. ADC calibration
![Timing diagram for ADC calibration showing signals ADCALDIF, ADCAL, ADC State, and CALFACT_x[6:0] over time. It indicates the sequence of events for calibration, including the calibration factor update and the time interval t_CAB.](/RM0366-STM32F301x6-8-318x8/df72bd7468eb8bd59e911d0b5cb7a810_img.jpg)
ADCALDIF \( \uparrow \) 0: Single-ended input 1: Differential input
ADCAL \( \uparrow \) \( \xleftarrow{\hspace{2cm} t_{CAB} \hspace{2cm}} \) \( \downarrow \)
ADC State: OFF | Startup | Calibrate | OFF
CALFACT_x[6:0]: 0x00 | Calibration factor
by S/W \( \uparrow \) by H/W \( \uparrow \) Indicative timings
MSV30263V2
Software procedure to re-inject a calibration factor into the ADC
- 1. Ensure ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing).
- 2. Write CALFACT_S and CALFACT_D with the new calibration factors.
- 3. When a conversion is launched, the calibration factor will be injected into the analog ADC only if the internal analog calibration factor differs from the one stored in bits CALFACT_S for single-ended input channel or bits CALFACT_D for differential input channel.
Figure 28. Updating the ADC calibration factor
![Timing diagram for updating the ADC calibration factor. It shows the ADC state transitioning from Ready to Converting channel (Single ended) and back to Ready. The internal calibration factor changes from F1 to F2. The WRITE ADC_CALFACT signal is used to update the CALFACT_S[6:0] register.](/RM0366-STM32F301x6-8-318x8/9fd6e7ee2ef576eea5eb455b7ee80ed6_img.jpg)
ADC state: Ready (not converting) | Converting channel (Single ended) | Ready | Converting channel (Single ended)
Updating calibration
Internal calibration factor[6:0]: F1 | F2
Start conversion (hardware or software) \( \uparrow \) \( \uparrow \)
WRITE ADC_CALFACT \( \uparrow \)
CALFACT_S[6:0]: F2
by s/w \( \uparrow \) by h/w \( \uparrow \)
MSV30529V2
Converting single-ended and differential analog inputs with a single ADC
If the ADC is supposed to convert both differential and single-ended inputs, two calibrations must be performed, one with ADCALDIF=0 and one with ADCALDIF=1. The procedure is the following:
- 1. Disable the ADC.
- 2. Calibrate the ADC in single-ended input mode (with ADCALDIF=0). This updates the register CALFACT_S[6:0].
- 3. Calibrate the ADC in Differential input modes (with ADCALDIF=1). This updates the register CALFACT_D[6:0].
- 4. Enable the ADC, configure the channels and launch the conversions. Each time there is a switch from a single-ended to a differential inputs channel (and vice-versa), the calibration will automatically be injected into the analog ADC.
Figure 29. Mixing single-ended and differential channels
![Timing diagram showing the sequence of ADC operations when mixing single-ended and differential channels. The diagram includes four horizontal timelines: Trigger event, ADC state, Internal calibration factor[6:0], and two calibration registers (CALFACT_S[6:0] and CALFACT_D[6:0]).](/RM0366-STM32F301x6-8-318x8/7d31539efb05e7116d0c7b279767ae8f_img.jpg)
The diagram illustrates the timing of ADC operations when mixing single-ended and differential channels. It consists of four horizontal timelines:
- Trigger event: Shows four rising edges that initiate the conversion sequence.
- ADC state: Shows the sequence of states: RDY, CONV CH 1 (Single ended inputs channel), RDY, CONV CH 2 (Differential inputs channel), RDY, CONV CH 3 (Differential inputs channel), RDY, CONV CH 4 (Single inputs channel).
- Internal calibration factor[6:0]: Shows the calibration factors used during conversion: F2 for single-ended channels, F3 for differential channels, and F2 for single-ended channels again.
- CALFACT_S[6:0]: Shows the calibration factor stored in the single-ended calibration register, which is F2.
- CALFACT_D[6:0]: Shows the calibration factor stored in the differential calibration register, which is F3.
MSV30530V2
12.3.9 ADC on-off control (ADEN, ADDIS, ADRDY)
First of all, follow the procedure explained in Section 12.3.6: ADC voltage regulator (ADVREGEN) .
Once ADVREGEN[1:0] = 01, the ADC can be enabled and the ADC needs a stabilization time of \( t_{STAB} \) before it starts converting accurately, as shown in Figure 30 . Two control bits enable or disable the ADC:
- • ADEN=1 enables the ADC. The flag ADRDY will be set once the ADC is ready for operation.
- • ADDIS=1 disables the ADC and disable the ADC. ADEN and ADDIS are then automatically cleared by hardware as soon as the analog ADC is effectively disabled.
Regular conversion can then start either by setting ADSTART=1 (refer to Section 12.3.18: Conversion on external trigger and trigger polarity (EXTSEL, EXTEN, JEXTSEL, JEXTEN) ) or when an external trigger event occurs, if triggers are enabled.
Injected conversions start by setting JADSTART=1 or when an external injected trigger event occurs, if injected triggers are enabled.
Software procedure to enable the ADC
- 1. Set ADEN=1.
- 2. Wait until ADRDY=1 (ADRDY is set after the ADC startup time). This can be done using the associated interrupt (setting ADRDYIE=1).
Note: ADEN bit cannot be set during ADCAL=1 and 4 ADC clock cycle after the ADCAL bit is cleared by hardware(end of the calibration).
Software procedure to disable the ADC
- 1. Check that both ADSTART=0 and JADSTART=0 to ensure that no conversion is ongoing. If required, stop any regular and injected conversion ongoing by setting ADSTP=1 and JADSTP=1 and then wait until ADSTP=0 and JADSTP=0.
- 2. Set ADDIS=1.
- 3. If required by the application, wait until ADEN=0, until the analog ADC is effectively disabled (ADDIS will automatically be reset once ADEN=0).
Figure 30. Enabling / Disabling the ADC

12.3.10 Constraints when writing the ADC control bits
The software is allowed to write the RCC control bits to configure and enable the ADC clock (refer to RCC Section), the control bits DIFSEL in the ADCx_DIFSEL register and the control bits ADCAL and ADEN in the ADCx_CR register, only if the ADC is disabled (ADEN must be equal to 0).
The software is then allowed to write the control bits ADSTART, JADSTART and ADDIS of the ADCx_CR register only if the ADC is enabled and there is no pending request to disable the ADC (ADEN must be equal to 1 and ADDIS to 0).
For all the other control bits of the ADCx_CFGR, ADCx_SMPRx, ADCx_TRx, ADCx_SQRx, ADCx_JDRy, ADCx_OFry, ADCx_OFCHR and ADCx_IER registers:
- • For control bits related to configuration of regular conversions, the software is allowed to write them only if the ADC is enabled (ADEN=1) and if there is no regular conversion ongoing (ADSTART must be equal to 0).
- • For control bits related to configuration of injected conversions, the software is allowed to write them only if the ADC is enabled (ADEN=1) and if there is no injected conversion ongoing (JADSTART must be equal to 0).
The software is allowed to write the control bits ADSTP or JADSTP of the ADCx_CR register only if the ADC is enabled and eventually converting and if there is no pending request to disable the ADC (ADSTART or JADSTART must be equal to 1 and ADDIS to 0).
The software can write the register ADCx_JSQR at any time, when the ADC is enabled (ADEN=1).
Note: There is no hardware protection to prevent these forbidden write accesses and ADC behavior may become in an unknown state. To recover from this situation, the ADC must be disabled (clear ADEN=0 as well as all the bits of ADCx_CR register).
12.3.11 Channel selection (SQRx, JSQRx)
There are up to 18 multiplexed channels per ADC:
- • 5 fast analog inputs coming from GPIO pads (ADC_IN1..5)
- • Up to 10 slow analog inputs coming from GPIO pads (ADC_IN5..15). Depending on the products, not all of them are available on GPIO pads.
- • ADC1 is connected to 3 internal analog inputs:
- – ADC1_IN16 = V TS = temperature sensor
- – ADC1_IN17 = V BAT /2 = V BAT channel
- – ADC1_IN18 = V REFINT = Internal reference voltage.
Note: To convert one of the internal analog channels, the corresponding analog sources must first be enabled by programming bits VREFEN, TSEN or VBATEN in the ADCx_CCR registers.
It is possible to organize the conversions in two groups: regular and injected. A group consists of a sequence of conversions that can be done on any channel and in any order. For instance, it is possible to implement the conversion sequence in the following order: ADC_IN3, ADC_IN8, ADC_IN2, ADC_IN2, ADC_IN0, ADC_IN2, ADC_IN2, ADC_IN15.
- • A regular group is composed of up to 16 conversions. The regular channels and their order in the conversion sequence must be selected in the ADCx_SQR registers. The total number of conversions in the regular group must be written in the L[3:0] bits in the ADCx_SQR1 register.
- • An injected group is composed of up to 4 conversions. The injected channels and their order in the conversion sequence must be selected in the ADCx_JSQR register. The total number of conversions in the injected group must be written in the L[1:0] bits in the ADCx_JSQR register.
ADCx_SQR registers must not be modified while regular conversions can occur. For this, the ADC regular conversions must be first stopped by writing ADSTP=1 (refer to Section 12.3.17: Stopping an ongoing conversion (ADSTP, JADSTP) ).
It is possible to modify the ADCx_JSQR registers on-the-fly while injected conversions are occurring. Refer to Section 12.3.21: Queue of context for injected conversions
12.3.12 Channel-wise programmable sampling time (SMPR1, SMPR2)
Before starting a conversion, the ADC must establish a direct connection between the voltage source under measurement and the embedded sampling capacitor of the ADC. This sampling time must be enough for the input voltage source to charge the embedded capacitor to the input voltage level.
Each channel can be sampled with a different sampling time which is programmable using the SMP[2:0] bits in the ADCx_SMPR1 and ADCx_SMPR2 registers. It is therefore possible to select among the following sampling time values:
- • SMP = 000: 1.5 ADC clock cycles
- • SMP = 001: 2.5 ADC clock cycles
- • SMP = 010: 4.5 ADC clock cycles
- • SMP = 011: 7.5 ADC clock cycles
- • SMP = 100: 19.5 ADC clock cycles
- • SMP = 101: 61.5 ADC clock cycles
- • SMP = 110: 181.5 ADC clock cycles
- • SMP = 111: 601.5 ADC clock cycles
The total conversion time is calculated as follows:
Example:
With \( F_{\text{ADC\_CLK}} = 72 \text{ MHz} \) and a sampling time of 1.5 ADC clock cycles:
The ADC notifies the end of the sampling phase by setting the status bit EOSMP (only for regular conversion).
Constraints on the sampling time for fast and slow channels
For each channel, SMP[2:0] bits must be programmed to respect a minimum sampling time as specified in the ADC characteristics section of the datasheets.
12.3.13 Single conversion mode (CONT=0)
In Single conversion mode, the ADC performs once all the conversions of the channels. This mode is started with the CONT bit at 0 by either:
- • Setting the ADSTART bit in the ADCx_CR register (for a regular channel)
- • Setting the JADSTART bit in the ADCx_CR register (for an injected channel)
- • External hardware trigger event (for a regular or injected channel)
Inside the regular sequence, after each conversion is complete:
- • The converted data are stored into the 16-bit ADCx_DR register
- • The EOC (end of regular conversion) flag is set
- • An interrupt is generated if the EOCIE bit is set
Inside the injected sequence, after each conversion is complete:
- • The converted data are stored into one of the four 16-bit ADCx_JDRy registers
- • The JEOC (end of injected conversion) flag is set
- • An interrupt is generated if the JEOCIE bit is set
After the regular sequence is complete:
- • The EOS (end of regular sequence) flag is set
- • An interrupt is generated if the EOSIE bit is set
After the injected sequence is complete:
- • The JEOS (end of injected sequence) flag is set
- • An interrupt is generated if the JEOSIE bit is set
Then the ADC stops until a new external regular or injected trigger occurs or until bit ADSTART or JADSTART is set again.
Note: To convert a single channel, program a sequence with a length of 1.
12.3.14 Continuous conversion mode (CONT=1)
This mode applies to regular channels only.
In continuous conversion mode, when a software or hardware regular trigger event occurs, the ADC performs once all the regular conversions of the channels and then automatically re-starts and continuously converts each conversions of the sequence. This mode is started with the CONT bit at 1 either by external trigger or by setting the ADSTART bit in the ADCx_CR register.
Inside the regular sequence, after each conversion is complete:
- • The converted data are stored into the 16-bit ADCx_DR register
- • The EOC (end of conversion) flag is set
- • An interrupt is generated if the EOCIE bit is set
After the sequence of conversions is complete:
- • The EOS (end of sequence) flag is set
- • An interrupt is generated if the EOSIE bit is set
Then, a new sequence restarts immediately and the ADC continuously repeats the conversion sequence.
Note: To convert a single channel, program a sequence with a length of 1.
It is not possible to have both discontinuous mode and continuous mode enabled: it is forbidden to set both DISCEN=1 and CONT=1.
Injected channels cannot be converted continuously. The only exception is when an injected channel is configured to be converted automatically after regular channels in continuous mode (using JAUTO bit), refer to Auto-injection mode section).
12.3.15 Starting conversions (ADSTART, JADSTART)
Software starts ADC regular conversions by setting ADSTART=1.
When ADSTART is set, the conversion starts:
- • Immediately: if EXTEN = 0x0 (software trigger)
- • At the next active edge of the selected regular hardware trigger: if EXTEN != 0x0
Software starts ADC injected conversions by setting JADSTART=1.
When JADSTART is set, the conversion starts:
- • Immediately, if JEXTEN = 0x0 (software trigger)
- • At the next active edge of the selected injected hardware trigger: if JEXTEN != 0x0
Note: In auto-injection mode (JAUTO=1), use ADSTART bit to start the regular conversions followed by the auto-injected conversions (JADSTART must be kept cleared).
ADSTART and JADSTART also provide information on whether any ADC operation is currently ongoing. It is possible to re-configure the ADC while ADSTART=0 and JADSTART=0 are both true, indicating that the ADC is idle.
ADSTART is cleared by hardware:
- • In single mode with software regular trigger (CONT=0, EXTSEL=0x0)
- – at any end of regular conversion sequence (EOS assertion) or at any end of sub-group processing if DISCEN = 1
- • In all cases (CONT=x, EXTSEL=x)
- – after execution of the ADSTP procedure asserted by the software.
Note: In continuous mode (CONT=1), ADSTART is not cleared by hardware with the assertion of EOS because the sequence is automatically relaunched.
When a hardware trigger is selected in single mode (CONT=0 and EXTSEL !=0x00), ADSTART is not cleared by hardware with the assertion of EOS to help the software which does not need to reset ADSTART again for the next hardware trigger event. This ensures that no further hardware triggers are missed.
JADSTART is cleared by hardware:
- • in single mode with software injected trigger (JEXTSEL=0x0)
- – at any end of injected conversion sequence (JEOS assertion) or at any end of sub-group processing if JDISCEN = 1
- • in all cases (JEXTSEL=x)
- – after execution of the JADSTP procedure asserted by the software.
12.3.16 Timing
The elapsed time between the start of a conversion and the end of conversion is the sum of the configured sampling time plus the successive approximation time depending on data resolution:
Figure 31. Analog-to-digital conversion time

The diagram shows the timing of an ADC conversion across several signals:
- ADC state: Starts in RDY state, then transitions to Sampling Ch(N) , then Converting Ch(N) , and finally Sampling Ch(N+1) .
- Analog channel: Shows the active channel Ch(N) during sampling and conversion, followed by Ch(N+1) during the next sampling phase.
- Internal S/H: Shows the internal sample-and-hold state: Sample AIN(N) during sampling, Hold AIN(N) during conversion, and Sample AIN(N+1) during the next sampling.
- ADSTART: Set by software (SW) to start the conversion. It is set by SW at the beginning of the sampling phase.
- EOSMP: End of Sampling. Set by hardware (HW) at the end of the sampling phase and cleared by software (SW).
- EOC: End of Conversion. Set by hardware (HW) at the end of the conversion phase and cleared by hardware/software (HW/SW).
- ADC_DR: Data register. It contains Data N-1 during the conversion of Ch(N) and updates to Data N after the conversion is complete.
Indicative timings \( t_{SMP}^{(1)} \) and \( t_{SAR}^{(2)} \) are shown between the start of sampling and the start of conversion, and between the start of conversion and the end of conversion, respectively.
MSV30532V2
- 1. \( t_{SMP} \) depends on SMP[2:0]
- 2. \( t_{SAR} \) depends on RES[2:0]
12.3.17 Stopping an ongoing conversion (ADSTP, JADSTP)
The software can decide to stop regular conversions ongoing by setting ADSTP=1 and injected conversions ongoing by setting JADSTP=1.
Stopping conversions will reset the ongoing ADC operation. Then the ADC can be reconfigured (ex: changing the channel selection or the trigger) ready for a new operation.
Note that it is possible to stop injected conversions while regular conversions are still operating and vice-versa. This allows, for instance, re-configuration of the injected conversion sequence and triggers while regular conversions are still operating (and vice-versa).
When the ADSTP bit is set by software, any ongoing regular conversion is aborted with partial result discarded (ADCx_DR register is not updated with the current conversion).
When the JADSTP bit is set by software, any ongoing injected conversion is aborted with partial result discarded (ADCx_JDRy register is not updated with the current conversion). The scan sequence is also aborted and reset (meaning that relaunching the ADC would restart a new sequence).
Once this procedure is complete, bits ADSTP/ADSTART (in case of regular conversion), or JADSTP/JADSTART (in case of injected conversion) are cleared by hardware and the software must wait until ADSTART = 0 (or JADSTART = 0) before starting a new conversion.
Note: In auto-injection mode (JAUTO=1), setting ADSTP bit aborts both regular and injected conversions (JADSTP must not be used).
Figure 32. Stopping ongoing regular conversions

ADC state: RDY | Sample Ch(N-1) | Convert Ch(N-1) | RDY | Sample Ch(N) | C | RDY
Trigger (at start of Sample Ch(N-1) and Sample Ch(N))
JADSTART: Low
ADSTART: Set by SW (start of REGULAR CONVERSIONS ongoing) | Cleared by HW (end of REGULAR CONVERSIONS ongoing)
(software is not allowed to configure regular conversions selection and triggers)
ADSTP: Set by SW | Cleared by HW
ADC_DR: Data N-2 | Data N-1
MS30533V2
Figure 33. Stopping ongoing regular and injected conversions

ADC state: RDY | Sample Ch(N-1) | Convert Ch(N-1) | RDY | Sample Ch(M) | C | RDY | Sample Ch(N) | C | RDY
Regular trigger (at start of Sample Ch(N-1) and Sample Ch(N))
Injected trigger (at start of Sample Ch(M))
JADSTART: Set by SW (start of INJECTED CONVERSIONS ongoing) | Cleared by HW (end of INJECTED CONVERSIONS ongoing)
(software is not allowed to configure injected conversions selection and triggers)
JADSTP: Set by SW | Cleared by HW
ADC_JDR: DATA M-1
ADSTART: Set by SW (start of REGULAR CONVERSIONS ongoing) | Cleared by HW (end of REGULAR CONVERSIONS ongoing)
(software is not allowed to configure regular conversions selection and triggers)
ADSTP: Set by SW | Cleared by HW
ADC_DR: DATA N-2 | DATA N-1
MS30534V1
12.3.18 Conversion on external trigger and trigger polarity (EXTSEL, EXTEN, JEXTSEL, JEXTEN)
A conversion or a sequence of conversions can be triggered either by software or by an external event (e.g. timer capture, input pins). If the EXTEN[1:0] control bits (for a regular conversion) or JEXTEN[1:0] bits (for an injected conversion) are different from 0b00, then external events are able to trigger a conversion with the selected polarity.
The regular trigger selection is effective once software has set bit ADSTART=1 and the injected trigger selection is effective once software has set bit JADSTART=1.
Any hardware triggers which occur while a conversion is ongoing are ignored.
- • If bit ADSTART=0, any regular hardware triggers which occur are ignored.
- • If bit JADSTART=0, any injected hardware triggers which occur are ignored.
Table 32 provides the correspondence between the EXTEN[1:0] and JEXTEN[1:0] values and the trigger polarity.
Table 32. Configuring the trigger polarity for regular external triggers
| EXTEN[1:0] | Source |
|---|---|
| 00 | Hardware Trigger detection disabled, software trigger detection enabled |
| 01 | Hardware Trigger with detection on the rising edge |
| 10 | Hardware Trigger with detection on the falling edge |
| 11 | Hardware Trigger with detection on both the rising and falling edges |
Note: The polarity of the regular trigger cannot be changed on-the-fly.
Table 33. Configuring the trigger polarity for injected external triggers
| JEXTEN[1:0] | Source |
|---|---|
| 00 | Hardware Trigger with detection on the rising edge |
| 01 | Hardware Trigger with detection on the rising edge |
| 10 | Hardware Trigger with detection on the falling edge |
| 11 | Hardware Trigger with detection on both the rising and falling edges |
Note: The polarity of the injected trigger can be anticipated and changed on-the-fly. Refer to Section 12.3.21: Queue of context for injected conversions .
The EXTSEL[3:0] and JEXTSEL[3:0] control bits select which out of 16 possible events can trigger conversion for the regular and injected groups.
A regular group conversion can be interrupted by an injected trigger.
Note: The regular trigger selection cannot be changed on-the-fly. The injected trigger selection can be anticipated and changed on-the-fly. Refer to Section 12.3.21: Queue of context for injected conversions on page 215
Each ADC master shares the same input triggers with its ADC slave as described in Figure 34 .
Figure 34. Triggers are shared between ADC master & ADC slave
![Figure 34: Triggers are shared between ADC master & ADC slave. The diagram shows two ADC blocks, 'ADC MASTER' and 'ADC SLAVE', sharing external trigger inputs. On the left, 'EXTi mapped at product level' inputs (EXT0, EXT1, ..., EXT15) are connected to the ADC MASTER's 'External regular trigger' and 'External injected trigger' multiplexers via 'EXTSEL[3:0]' and 'JEXTSEL[3:0]' selection signals. Similarly, 'JEXTi mapped at product level' inputs (JEXT0, JEXT1, ..., JEXT15) are connected to the ADC SLAVE's 'External regular trigger' and 'External injected trigger' multiplexers via their own 'EXTSEL[3:0]' and 'JEXTSEL[3:0]' selection signals. The diagram illustrates that the same external trigger sources can be used by both the master and slave ADCs.](/RM0366-STM32F301x6-8-318x8/74340c36eadb11d858e925d7b77260bf_img.jpg)
Table 34 to Table 35 give all the possible external triggers of the ADC for regular and injected conversion.
Table 34. ADC1 (master) - External triggers for regular channels
| Name | Source | Type | EXTSEL[3:0] |
|---|---|---|---|
| EXT0 | TIM1_CC1 event | Internal signal from on chip timers | 0000 |
| EXT1 | TIM1_CC2 event | Internal signal from on chip timers | 0001 |
| EXT2 | TIM1_CC3 event | Internal signal from on chip timers | 0010 |
| EXT3 | TIM2_CC2 event | Internal signal from on chip timers | 0011 |
| EXT4 | Reserved | - | 0100 |
| EXT5 | Reserved | - | 0101 |
| EXT6 | EXTI line 11 | External pin | 0110 |
| EXT7 | Reserved | - | 0111 |
| EXT8 | Reserved | - | 1000 |
| EXT9 | TIM1_TRGO event | Internal signal from on chip timers | 1001 |
| EXT10 | TIM1_TRGO2 event | Internal signal from on chip timers | 1010 |
| EXT11 | TIM2_TRGO event | Internal signal from on chip timers | 1011 |
| EXT12 | Reserved | - | 1100 |
| EXT13 | TIM6_TRGO event | Internal signal from on chip timers | 1101 |
| Name | Source | Type | EXTSEL[3:0] |
|---|---|---|---|
| EXT14 | TIM15_TRGO event | Internal signal from on chip timers | 1110 |
| EXT15 | Reserved | - | 1111 |
| Name | Source | Type | JEXTSEL[3:0] |
|---|---|---|---|
| JEXT0 | TIM1_TRGO event | Internal signal from on chip timers | 0000 |
| JEXT1 | TIM1_CC4 event | Internal signal from on chip timers | 0001 |
| JEXT2 | TIM2_TRGO event | Internal signal from on chip timers | 0010 |
| JEXT3 | TIM2_CC1 event | Internal signal from on chip timers | 0011 |
| JEXT4 | Reserved | - | 0100 |
| JEXT5 | Reserved | - | 0101 |
| JEXT6 | EXTI line 15 | External pin | 0110 |
| JEXT7 | Reserved | - | 0111 |
| JEXT8 | TIM1_TRGO2 event | Internal signal from on chip timers | 1000 |
| JEXT9 | Reserved | - | 1001 |
| JEXT10 | Reserved | - | 1010 |
| JEXT11 | Reserved | - | 1011 |
| JEXT12 | Reserved | - | 1100 |
| JEXT13 | Reserved | - | 1101 |
| JEXT14 | TIM6_TRGO event | Internal signal from on chip timers | 1110 |
| JEXT15 | TIM15_TRGO event | Internal signal from on chip timers | 1111 |
12.3.19 Injected channel management
Triggered injection mode
To use triggered injection, the JAUTO bit in the ADCx_CFGR register must be cleared.
- 1. Start the conversion of a group of regular channels either by an external trigger or by setting the ADSTART bit in the ADCx_CR register.
- 2. If an external injected trigger occurs, or if the JADSTART bit in the ADCx_CR register is set during the conversion of a regular group of channels, the current conversion is reset and the injected channel sequence switches are launched (all the injected channels are converted once).
- 3. Then, the regular conversion of the regular group of channels is resumed from the last interrupted regular conversion.
- 4. If a regular event occurs during an injected conversion, the injected conversion is not interrupted but the regular sequence is executed at the end of the injected sequence. Figure 35 shows the corresponding timing diagram.
Note: When using triggered injection, one must ensure that the interval between trigger events is longer than the injection sequence. For instance, if the sequence length is 28 ADC clock cycles (that is two conversions with a sampling time of 1.5 clock periods), the minimum interval between triggers must be 29 ADC clock cycles.
Auto-injection mode
If the JAUTO bit in the ADCx_CFGR register is set, then the channels in the injected group are automatically converted after the regular group of channels. This can be used to convert a sequence of up to 20 conversions programmed in the ADCx_SQR and ADCx_JSQR registers.
In this mode, the ADSTART bit in the ADCx_CR register must be set to start regular conversions, followed by injected conversions (JADSTART must be kept cleared). Setting the ADSTP bit aborts both regular and injected conversions (JADSTP bit must not be used).
In this mode, external trigger on injected channels must be disabled.
If the CONT bit is also set in addition to the JAUTO bit, regular channels followed by injected channels are continuously converted.
Note: It is not possible to use both the auto-injected and discontinuous modes simultaneously. When the DMA is used for exporting regular sequencer's data in JAUTO mode, it is necessary to program it in circular mode (CIRC bit set in DMA_CCRx register). If the CIRC bit is reset (single-shot mode), the JAUTO sequence will be stopped upon DMA Transfer Complete event.
Figure 35. Injected conversion latency

ai16049b
- 1. The maximum latency value can be found in the electrical characteristics of the STM32F3xx datasheets.
12.3.20 Discontinuous mode (DISCEN, DISCNUM, JDISCEN)
Regular group mode
This mode is enabled by setting the DISCEN bit in the ADC x _CFGR register.
It is used to convert a short sequence (sub-group) of n conversions ( \( n \leq 8 \) ) that is part of the sequence of conversions selected in the ADC x _SQR registers. The value of n is specified by writing to the DISCNUM[2:0] bits in the ADC x _CFGR register.
When an external trigger occurs, it starts the next n conversions selected in the ADC x _SQR registers until all the conversions in the sequence are done. The total sequence length is defined by the L[3:0] bits in the ADC x _SQR1 register.
Example:
- • DISCEN=1, n=3, channels to be converted = 1, 2, 3, 6, 7, 8, 9, 10, 11
- – 1st trigger: channels converted are 1, 2, 3 (an EOC event is generated at each conversion).
- – 2nd trigger: channels converted are 6, 7, 8 (an EOC event is generated at each conversion).
- – 3rd trigger: channels converted are 9, 10, 11 (an EOC event is generated at each conversion) and an EOS event is generated after the conversion of channel 11.
- – 4th trigger: channels converted are 1, 2, 3 (an EOC event is generated at each conversion).
- – ...
- • DISCEN=0, channels to be converted = 1, 2, 3, 6, 7, 8, 9, 10, 11
- – 1st trigger: the complete sequence is converted: channel 1, then 2, 3, 6, 7, 8, 9, 10 and 11. Each conversion generates an EOC event and the last one also generates an EOS event.
- – all the next trigger events will relaunch the complete sequence.
Note: When a regular group is converted in discontinuous mode, no rollover occurs (the last subgroup of the sequence can have less than n conversions).
When all subgroups are converted, the next trigger starts the conversion of the first subgroup. In the example above, the 4th trigger reconverts the channels 1, 2 and 3 in the 1st subgroup.
It is not possible to have both discontinuous mode and continuous mode enabled. In this case (if DISCEN=1, CONT=1), the ADC behaves as if continuous mode was disabled.
Injected group mode
This mode is enabled by setting the JDISCEN bit in the ADC x _CFGR register. It converts the sequence selected in the ADC x _JSQR register, channel by channel, after an external injected trigger event. This is equivalent to discontinuous mode for regular channels where 'n' is fixed to 1.
When an external trigger occurs, it starts the next channel conversions selected in the ADC x _JSQR registers until all the conversions in the sequence are done. The total sequence length is defined by the JL[1:0] bits in the ADC x _JSQR register.
Example:
- • JDISCEN=1, channels to be converted = 1, 2, 3
- – 1st trigger: channel 1 converted (a JEOC event is generated)
- – 2nd trigger: channel 2 converted (a JEOC event is generated)
- – 3rd trigger: channel 3 converted and a JEOC event + a JEOS event are generated
- – ...
Note: When all injected channels have been converted, the next trigger starts the conversion of the first injected channel. In the example above, the 4th trigger reconverts the 1st injected channel 1.
It is not possible to use both auto-injected mode and discontinuous mode simultaneously: the bits DISCEN and JDISCEN must be kept cleared by software when JAUTO is set.
12.3.21 Queue of context for injected conversions
A queue of context is implemented to anticipate up to 2 contexts for the next injected sequence of conversions.
This context consists of:
- • Configuration of the injected triggers (bits JEXTEN[1:0] and JEXTSEL[3:0] in ADCx_JSQR register)
- • Definition of the injected sequence (bits JSQx[4:0] and JL[1:0] in ADCx_JSQR register)
All the parameters of the context are defined into a single register ADCx_JSQR and this register implements a queue of 2 buffers, allowing the bufferization of up to 2 sets of parameters:
- • The JSQR register can be written at any moment even when injected conversions are ongoing.
- • Each data written into the JSQR register is stored into the Queue of context.
- • At the beginning, the Queue is empty and the first write access into the JSQR register immediately changes the context and the ADC is ready to receive injected triggers.
- • Once an injected sequence is complete, the Queue is consumed and the context changes according to the next JSQR parameters stored in the Queue. This new context is applied for the next injected sequence of conversions.
- • A Queue overflow occurs when writing into register JSQR while the Queue is full. This overflow is signaled by the assertion of the flag JQOVF. When an overflow occurs, the write access of JSQR register which has created the overflow is ignored and the queue of context is unchanged. An interrupt can be generated if bit JQOVFIE is set.
- • Two possible behaviors are possible when the Queue becomes empty, depending on the value of the control bit JQM of register ADCx_CFGFR:
- – If JQM=0, the Queue is empty just after enabling the ADC, but then it can never be empty during run operations: the Queue always maintains the last active context and any further valid start of injected sequence will be served according to the last active context.
- – If JQM=1, the Queue can be empty after the end of an injected sequence or if the Queue is flushed. When this occurs, there is no more context in the queue and both injected software and hardware triggers are disabled. Therefore, any further
hardware or software injected triggers are ignored until the software re-writes a new injected context into JSQR register.
- • Reading JSQR register returns the current JSQR context which is active at that moment. When the JSQR context is empty, JSQR is read as 0x0000.
- • The Queue is flushed when stopping injected conversions by setting JADSTP=1 or when disabling the ADC by setting ADDIS=1:
- – If JQM=0, the Queue is maintained with the last active context.
- – If JQM=1, the Queue becomes empty and triggers are ignored.
Note: When configured in discontinuous mode (bit JDISCEN=1), only the last trigger of the injected sequence changes the context and consumes the Queue. The 1 st trigger only consumes the queue but others are still valid triggers as shown by the discontinuous mode example below (length = 3 for both contexts):
- • 1 st trigger, discontinuous. Sequence 1: context 1 consumed, 1 st conversion carried out
- • 2 nd trigger, disc. Sequence 1: 2 nd conversion.
- • 3 rd trigger, discontinuous. Sequence 1: 3 rd conversion.
- • 4 th trigger, discontinuous. Sequence 2: context 2 consumed, 1 st conversion carried out.
- • 5 th trigger, discontinuous. Sequence 2: 2 nd conversion.
- • 6 th trigger, discontinuous. Sequence 2: 3 rd conversion.
Behavior when changing the trigger or sequence context
The Figure 36 and Figure 37 show the behavior of the context Queue when changing the sequence or the triggers.
Figure 36. Example of JSQR queue of context (sequence change)

The diagram shows five horizontal signal lines over time:
1.
Write JSQR
: Shows three pulses labeled P1, P2, and P3. P1 and P2 occur sequentially at the start, while P3 occurs after the first set of conversions.
2.
JSQR queue
:
- Starts as EMPTY.
- Becomes P1 after the P1 write pulse.
- Becomes P1,P2 after the P2 write pulse.
- Transitions to P2 after the first trigger consumes P1.
- Becomes P2,P3 after the P3 write pulse.
- Becomes P3 after the second trigger consumes P2.
3.
Trigger 1
: Shows two trigger pulses. The first pulse initiates the P1 sequence. The second pulse initiates the P2 sequence.
4.
ADC J context (returned by reading JSQR)
:
- Starts as EMPTY.
- Becomes P1 upon the first trigger pulse.
- Becomes P2 upon the second trigger pulse.
- Becomes P3 after the P2 conversion completes.
5.
ADC state
:
- Starts in RDY.
- After the first trigger, it performs Conversion1, Conversion2, and Conversion3 (Sequence P1), then returns to RDY.
- After the second trigger, it performs Conversion1 (Sequence P2), then returns to RDY.
- 1. Parameters:
P1: sequence of 3 conversions, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 4 conversions, hardware trigger 1
Figure 37. Example of JSQR queue of context (trigger change)

The diagram illustrates the state of the JSQR queue and ADC context when triggers change.
-
Write JSQR:
Shows three write operations for sequences P1, P2, and P3.
-
JSQR queue:
Starts as
EMPTY
. After writing P1, it contains
P1
. After writing P2, it contains
P1,P2
. When P3 is written, the queue overflows and is
Ignored
, remaining
P1,P2
. After P1 is removed, it contains
P2
. After P2 is removed, it contains
P2,P3
. Finally, it contains
P3
.
-
Trigger 1:
Hardware trigger for sequences P1 and P3. It is active when the queue contains P1 or P3.
-
Trigger 2:
Hardware trigger for sequence P2. It is ignored when the queue contains P1 or P3.
-
ADC J context (returned by reading JSQR):
Shows the context actually being converted. It starts
EMPTY
, then contains
P1
(triggered by Trigger 1), then
P2
(triggered by Trigger 2), and finally
P3
(triggered by Trigger 1).
-
ADC state:
Shows the state of the ADC. It is
RDY
when the queue is empty or a new sequence is being loaded. It performs
Conversion1
and
Conversion2
when the queue contains P1 or P3.
MS30537V3
- 1. Parameters:
P1: sequence of 2 conversions, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 2
P3: sequence of 4 conversions, hardware trigger 1
Queue of context: Behavior when a queue overflow occurs
The Figure 38 and Figure 39 show the behavior of the context Queue if an overflow occurs before or during a conversion.
Figure 38. Example of JSQR queue of context with overflow before conversion

The diagram illustrates the behavior of the JSQR queue when an overflow occurs.
-
Write JSQR:
Shows write operations for sequences P1, P2, P3, and P4.
-
JSQR queue:
Starts as
EMPTY
. It contains
P1
, then
P1,P2
. When P3 is written, it overflows (
=> Overflow, ignored
) and remains
P1,P2
. After P1 is removed, it contains
P2
. When P4 is written, it contains
P2,P4
.
-
JQOVF:
Flag that goes high when the queue overflows (at the P3 write) and is
Cleared by SW
(software).
-
Trigger 1:
Hardware trigger for sequences P1 and P3. It is active when the queue contains P1 or P3.
-
Trigger 2:
Hardware trigger for sequence P2.
-
ADC J context (returned by reading JSQR):
Shows the context being converted. It starts
EMPTY
, then contains
P1
(triggered by Trigger 1), then
P2
(triggered by Trigger 2).
-
ADC state:
Shows the state of the ADC. It is
RDY
when the queue is empty or a new sequence is being loaded. It performs
Conversion1
and
Conversion2
when the queue contains P1 or P3.
-
JEOS:
End of sequence flag that goes high when the current conversion sequence is complete.
MS30538V3
- 1. Parameters:
P1: sequence of 2 conversions, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 2
P3: sequence of 3 conversions, hardware trigger 1
P4: sequence of 4 conversions, hardware trigger 1
Figure 39. Example of JSQR queue of context with overflow during conversion

- 1. Parameters:
P1: sequence of 2 conversions, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 2
P3: sequence of 3 conversions, hardware trigger 1
P4: sequence of 4 conversions, hardware trigger 1
It is recommended to manage the queue overflows as described below:
- • After each P context write into JSQR register, flag JQOVF shows if the write has been ignored or not (an interrupt can be generated).
- • Avoid Queue overflows by writing the third context (P3) only once the flag JEOS of the previous context P2 has been set. This ensures that the previous context has been consumed and that the queue is not full.
Queue of context: Behavior when the queue becomes empty
Figure 40 and Figure 41 show the behavior of the context Queue when the Queue becomes empty in both cases JQM=0 or 1.
Figure 40. Example of JSQR queue of context with empty queue (case JQM=0)

- 1. Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Note: When writing P3, the context changes immediately. However, because of internal resynchronization, there is a latency and if a trigger occurs just after or before writing P3, it can happen that the conversion is launched considering the context P2. To avoid this situation, the user must ensure that there is no ADC trigger happening when writing a new context that applies immediately.
Figure 41. Example of JSQR queue of context with empty queue (case JQM=1)

The diagram shows the following signals and states over time:
- Write JSQR: Shows three pulses corresponding to writing contexts P1, P2, and P3.
- JSQR queue: Shows the queue state: EMPTY → P1 → P1,P2 → P2 → EMPTY → P3 → EMPTY.
- Trigger 1: Shows hardware trigger pulses. The first two triggers occur while the queue contains P1 and P2 respectively. The third trigger occurs after P3 is written but before the context has fully updated. The last trigger occurs when the queue is empty and is ignored.
- ADC J context (returned by reading JSQR): Shows the context currently being used: EMPTY → P1 → P2 → EMPTY (0x0000) → P3 → EMPTY.
- ADC state: Shows the state of the ADC: RDY → Conversion → RDY → Conversion → RDY → Conversion → RDY.
A note indicates: "Queue becomes empty and triggers are ignored because JQM=1". A callout points to the transition from P2 to EMPTY. Another callout points to the ignored trigger when the queue is empty. The diagram is labeled MS30541V2.
- Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Flushing the queue of context
The figures below show the behavior of the context Queue in various situations when the queue is flushed.
Figure 42. Flushing JSQR queue of context by setting JADSTP=1 (JQM=0). Case when JADSTP occurs during an ongoing conversion.

The diagram shows the following signals and states over time:
- Write JSQR: Shows three pulses corresponding to writing contexts P1, P2, and P3.
- JSQR queue: Shows the queue state: EMPTY → P1 → P1,P2 → P1 → P3. A note indicates: "Queue is flushed and maintains the last active context (P2 is lost)".
- JADSTP: Shows a software-set pulse that occurs during an ongoing conversion. A callout points to the queue state after this pulse, showing it contains P1.
- JADSTART: Shows the start of a conversion. A callout points to the signal being reset by hardware.
- Trigger 1: Shows hardware trigger pulses. The first two triggers occur while the queue contains P1 and P2 respectively. The third trigger occurs after P3 is written.
- ADC J context (returned by reading JSQR): Shows the context currently being used: EMPTY → P1 → P3.
- ADC state: Shows the state of the ADC: RDY → STP → RDY → Conversion → RDY.
Labels include "Set by S/W" for JADSTP, "Reset by H/W" for JADSTART, and "Set by S/W" for the start of the final conversion. The diagram is labeled MS30544V2.
- Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Figure 43. Flushing JSQR queue of context by setting JADSTP=1 (JQM=0).
Case when JADSTP occurs during an ongoing conversion and a new trigger occurs.

The diagram illustrates the following sequence of events:
- Write JSQR: Sequences P1 and P2 are written to the JSQR.
- JSQR queue: Initially EMPTY, then contains P1, then P1 and P2. When P3 is written, the queue contains P1, P2, and P3.
- JADSTP: Set by software (S/W) while the ADC is in the CONVERSION1 state for P2.
- JADSTART: Reset by hardware (H/W) when JADSTP is set, then set by software (S/W) when Trigger 1 occurs.
- Trigger 1: Occurs while the ADC is still in the CONVERSION1 state for P2.
- ADC J context: Returned by reading JSQR. It shows EMPTY, then P1, then P1 (as P2 is lost), and finally P3.
- ADC state: Starts at RDY, goes to CONVERSION1 (Aborted) for P1, then STP. When Trigger 1 occurs, it goes to CONVERSION1 for P3, then RDY, then CONVERSION1 for P3 again, and finally RDY.
Text annotation: "Queue is flushed and maintains the last active context (P2 is lost)".
Reference: MS30543V1
- Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Figure 44. Flushing JSQR queue of context by setting JADSTP=1 (JQM=0).
Case when JADSTP occurs outside an ongoing conversion

The diagram illustrates the following sequence of events:
- Write JSQR: Sequences P1 and P2 are written to the JSQR.
- JSQR queue: Initially EMPTY, then contains P1, then P1 and P2. When P3 is written, the queue contains P1, P2, and P3.
- JADSTP: Set by software (S/W) while the ADC is in the STOP state.
- JADSTART: Reset by hardware (H/W) when JADSTP is set, then set by software (S/W) when Trigger 1 occurs.
- Trigger 1: Occurs while the ADC is still in the STOP state.
- ADC J context: Returned by reading JSQR. It shows EMPTY, then P1, then P1 (as P2 is lost), and finally P3.
- ADC state: Starts at RDY, goes to STOP. When Trigger 1 occurs, it goes to CONVERSION1 for P3, then RDY, then CONVERSION1 for P3 again, and finally RDY.
Text annotation: "the last active context (P2 is lost)".
Reference: MS30544V1
- Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Figure 45. Flushing JSQR queue of context by setting JADSTP=1 (JQM=1)

The diagram illustrates the state of the ADC's JSQR queue and context when JADSTP=1 (JQM=1).
1.
Write JSQR
: Contexts P1 and P2 are written. Later, after the queue is flushed, P3 is written.
2.
JSQR queue
: Initially EMPTY. After writing P1, it contains P1. After writing P2, it contains P1, P2. When JADSTP is set by software, the queue is flushed and becomes EMPTY (P2 is lost). After writing P3, it contains P3, and then becomes EMPTY again.
3.
JADSTP
: Set by software (S/W) and reset by hardware (H/W).
4.
JADSTART
: Reset by hardware (H/W) and set by software (S/W).
5.
Trigger 1
: Hardware trigger that initiates a conversion.
6.
ADC J context (returned by reading JSQR)
: Initially EMPTY. After P1 is written, it contains P1. When the queue is flushed, it becomes EMPTY (0x0000). After P3 is written, it contains P3, and then becomes EMPTY again.
7.
ADC state
: Starts at RDY. After P1 is written and Trigger 1 is asserted, it goes to Conv1 (Aborted) and then STP. When the queue is flushed, it returns to RDY. After P3 is written and Trigger 1 is asserted, it goes to Conversion1 and then RDY.
Reference: MS30545V1
- 1. Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Figure 46. Flushing JSQR queue of context by setting ADDIS=1 (JQM=0)

The diagram illustrates the state of the ADC's JSQR queue and context when ADDIS=1 (JQM=0).
1.
JSQR queue
: Initially contains P1, P2. When ADDIS is set by software, the queue is flushed but maintains the last active context, which is P1.
2.
ADDIS
: Set by software (S/W) and reset by hardware (H/W).
3.
ADC J context (returned by reading JSQR)
: Initially contains P1. When ADDIS is set, it remains P1.
4.
ADC state
: Starts at RDY. When ADDIS is set, it goes to REQ-OFF and then OFF.
Reference: MS30546V1
- 1. Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Figure 47. Flushing JSQR queue of context by setting ADDIS=1 (JQM=1)

Figure 47 is a timing diagram illustrating the flushing of the JSQR queue. The diagram shows four signal lines over time:
- JSQR queue: Initially contains sequences P1, P2. When the ADDIS bit is set, the queue becomes EMPTY.
- ADDIS: A control bit that is set by S/W and reset by H/W.
- ADC J context (returned by reading JSQR): Initially contains P1. When the queue is flushed, it becomes EMPTY (0x0000).
- ADC state: Transitions from RDY to REQ-OFF when ADDIS is set, and then to OFF when ADDIS is reset.
A note indicates: "Queue is flushed and becomes empty (JSQR is read as 0x0000)". The diagram is labeled MSV30547V3.
- 1. Parameters:
P1: sequence of 1 conversion, hardware trigger 1
P2: sequence of 1 conversion, hardware trigger 1
P3: sequence of 1 conversion, hardware trigger 1
Changing context from hardware to software (or software to hardware) injected trigger
When changing the context from hardware trigger to software injected trigger, it is necessary to stop the injected conversions by setting JADSTP=1 after the last hardware triggered conversions. This is necessary to re-enable the software trigger (a rising edge on JADSTART is necessary to start a software injected conversion). Refer to Figure 48.
When changing the context from software trigger to hardware injected trigger, after the last software trigger, it is necessary to set JADSTART=1 to enable the hardware triggers. Refer to Figure 48.
Figure 48. Example of JSQR queue of context when changing SW and HW triggers

Figure 48 is a timing diagram illustrating the JSQR queue and ADC state when changing between software (S/W) and hardware (H/W) triggers. The diagram shows seven signal lines over time:
- Write JSQR: Shows the writing of sequences P1, P2, P3, and P4 into the JSQR queue.
- JSQR queue: Shows the queue contents: EMPTY, P1, P1, P2, P2, P2, P3, P3, P3, P4, P4, P4.
- H/W trigger: Shows hardware trigger pulses. One pulse is labeled "Ignored" when JADSTP is set.
- ADC J context (returned by reading JSQR): Shows the context returned: EMPTY, P1, P2, P3, P4.
- ADC state: Shows the state transitions: RDY, Conversion1 (triggered by H/W), RDY, Conversion1 (triggered by H/W), RDY, Conversion1 (triggered by S/W), RDY, Conversion1 (triggered by H/W).
- JADSTART: A control bit that is set by S/W and reset by H/W.
- JADSTP: A control bit that is set by S/W and reset by H/W.
The diagram is labeled MSV30548V1.
- 1. Parameters:
P1: sequence of 1 conversion, hardware trigger (JEXTEN /= 0x0)
P2: sequence of 1 conversion, hardware trigger (JEXTEN != 0x0)
P3: sequence of 1 conversion, software trigger (JEXTEN = 0x0)
P4: sequence of 1 conversion, hardware trigger (JEXTEN != 0x0)
Queue of context: Starting the ADC with an empty queue
The following procedure must be followed to start ADC operation with an empty queue, in case the first context is not known at the time the ADC is initialized. This procedure is only applicable when JQM bit is reset:
- 5. Write a dummy JSQR with JEXTEN not equal to 0 (otherwise triggering a software conversion)
- 6. Set JADSTART
- 7. Set JADSTP
- 8. Wait until JADSTART is reset
- 9. Set JADSTART.
12.3.22 Programmable resolution (RES) - fast conversion mode
It is possible to perform faster conversion by reducing the ADC resolution.
The resolution can be configured to be either 12, 10, 8, or 6 bits by programming the control bits RES[1:0]. Figure 53 , Figure 54 , Figure 55 and Figure 56 show the conversion result format with respect to the resolution as well as to the data alignment.
Lower resolution allows faster conversion time for applications where high-data precision is not required. It reduces the conversion time spent by the successive approximation steps according to Table 36 .
Table 36. \( T_{SAR} \) timings depending on resolution
| RES (bits) | \( T_{SAR} \) (ADC clock cycles) | \( T_{SAR} \) (ns) at \( F_{ADC}=72 \) MHz | \( T_{ADC} \) (ADC clock cycles) (with Sampling Time= 1.5 ADC clock cycles) | \( T_{ADC} \) (ns) at \( F_{ADC}=72 \) MHz |
|---|---|---|---|---|
| 12 | 12.5 ADC clock cycles | 173.6 ns | 14 ADC clock cycles | 194.4 ns |
| 10 | 10.5 ADC clock cycles | 145.8 ns | 12 ADC clock cycles | 166.7 ns |
| 8 | 8.5 ADC clock cycles | 118.0 ns | 10 ADC clock cycles | 138.9 ns |
| 6 | 6.5 ADC clock cycles | 90.3 ns | 8 ADC clock cycles | 111.1 ns |
12.3.23 End of conversion, end of sampling phase (EOC, JEOC, EOSMP)
The ADC notifies the application for each end of regular conversion (EOC) event and each injected conversion (JEOC) event.
The ADC sets the EOC flag as soon as a new regular conversion data is available in the ADCx_DR register. An interrupt can be generated if bit EOCIE is set. EOC flag is cleared by the software either by writing 1 to it or by reading ADCx_DR.
The ADC sets the JEOC flag as soon as a new injected conversion data is available in one of the ADCx_JDRy register. An interrupt can be generated if bit JEOCIE is set. JEOC flag is cleared by the software either by writing 1 to it or by reading the corresponding ADCx_JDRy register.
The ADC also notifies the end of Sampling phase by setting the status bit EOSMP (for regular conversions only). EOSMP flag is cleared by software by writing 1 to it. An interrupt can be generated if bit EOSMPIE is set.
12.3.24 End of conversion sequence (EOS, JEOS)
The ADC notifies the application for each end of regular sequence (EOS) and for each end of injected sequence (JEOS) event.
The ADC sets the EOS flag as soon as the last data of the regular conversion sequence is available in the ADCx_DR register. An interrupt can be generated if bit EOSIE is set. EOS flag is cleared by the software either by writing 1 to it.
The ADC sets the JEOS flag as soon as the last data of the injected conversion sequence is complete. An interrupt can be generated if bit JEOSIE is set. JEOS flag is cleared by the software either by writing 1 to it.
12.3.25 Timing diagrams example (single/continuous modes, hardware/software triggers)
Figure 49. Single conversions of a sequence, software trigger

MS30549V1
- 1. EXTEN=0x0, CONT=0
- 2. Channels selected = 1,9, 10, 17; AUTDLY=0.
Figure 50. Continuous conversion of a sequence, software trigger

ADCSTART (1)
EOC
EOS
ADSTP
ADC state (2) READY | CH1 | CH9 | CH10 | CH17 | CH1 | CH9 | CH10 | STP | READY | CH1 | CH9
ADC_DR | D1 | D9 | D10 | D17 | D1 | D9 | D1
by SW ↑ by HW ↑ Indicative timings
MS30550V1
- 1. EXTEN=0x0, CONT=1
- 2. Channels selected = 1, 9, 10, 17; AUTDLY=0.
Figure 51. Single conversions of a sequence, hardware trigger

ADSTART
EOC
EOS
TRGX (1)
ADC state (2) RDY | CH1 | CH2 | CH3 | CH4 | RDY | CH1 | CH2 | CH3 | CH4 | RDY
ADC_DR | D1 | D2 | D3 | D4 | D1 | D2 | D3 | D4
by s/w ↑ by h/w ↑ triggered ↑ ignored ∗ Indicative timings
MS31013V2
- 1. TRGX (over-frequency) is selected as trigger source, EXTEN = 01, CONT = 0
- 2. Channels selected = 1, 2, 3, 4; AUTDLY=0.
Figure 52. Continuous conversions of a sequence, hardware trigger

ADSTART
EOC
EOS
ADSTP
TRGX (1)
ADC (2) RDY | CH1 | CH2 | CH3 | CH4 | CH1 | CH2 | CH3 | CH4 | CH1 | STOP | RDY
ADC_DR | D1 | D2 | D3 | D4 | D1 | D2 | D3 | D4
by s/w ↑ by h/w ↑ triggered ↑ ignored ∗ Not in scale timings
MS31014V2
- 1. TRGX is selected as trigger source, EXTEN = 10, CONT = 1
- 2. Channels selected = 1, 2, 3, 4; AUTDLY=0.
12.3.26 Data management
Data register, data alignment and offset (ADCx_DR, OFFSETy, OFFSETy_CH, ALIGN)
Data and alignment
At the end of each regular conversion channel (when EOC event occurs), the result of the converted data is stored into the ADCx_DR data register which is 16 bits wide.
At the end of each injected conversion channel (when JEOC event occurs), the result of the converted data is stored into the corresponding ADCx_JDRy data register which is 16 bits wide.
The ALIGN bit in the ADCx_CFGR register selects the alignment of the data stored after conversion. Data can be right- or left-aligned as shown in Figure 53 , Figure 54 , Figure 55 and Figure 56 .
Special case: when left-aligned, the data are aligned on a half-word basis except when the resolution is set to 6-bit. In that case, the data are aligned on a byte basis as shown in Figure 55 and Figure 56 .
Offset
An offset y (y=1,2,3,4) can be applied to a channel by setting the bit OFFSETy_EN=1 into ADCx_OF Ry register. The channel to which the offset will be applied is programmed into the bits OFFSETy_CH[4:0] of ADCx_OF Ry register. In this case, the converted value is decreased by the user-defined offset written in the bits OFFSETy[11:0]. The result may be a negative value so the read data is signed and the SEXT bit represents the extended sign value.
Table 39 describes how the comparison is performed for all the possible resolutions for analog watchdog 1.
Table 37. Offset computation versus data resolution
| Resolution (bits RES[1:0]) | Substraction between raw converted data and offset | Result | Comments | |
|---|---|---|---|---|
| Raw converted data, left aligned | Offset | |||
| 00: 12-bit | DATA[11:0] | OFFSET[11:0] | Signed 12-bit data | - |
| 01: 10-bit | DATA[11:2],00 | OFFSET[11:0] | Signed 10-bit data | The user must configure OFFSET[1:0] to “00” |
| 10: 8-bit | DATA[11:4],0000 | OFFSET[11:0] | Signed 8-bit data | The user must configure OFFSET[3:0] to “0000” |
| 11: 6-bit | DATA[11:6],000000 | OFFSET[11:0] | Signed 6-bit data | The user must configure OFFSET[5:0] to “000000” |
When reading data from ADCx_DR (regular channel) or from ADCx_JDRy (injected channel, y=1,2,3,4) corresponding to the channel “i”:
- • If one of the offsets is enabled (bit OFFSETy_EN=1) for the corresponding channel, the read data is signed.
- • If none of the four offsets is enabled for this channel, the read data is not signed.
Figure 53, Figure 54, Figure 55 and Figure 56 show alignments for signed and unsigned data.
Figure 53. Right alignment (offset disabled, unsigned value)

| 12-bit data | |||||||||||||||
| bit15 | bit7 | bit0 | |||||||||||||
| 0 | 0 | 0 | 0 | D11 | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
| 10-bit data | |||||||||||||||
| bit15 | bit7 | bit0 | |||||||||||||
| 0 | 0 | 0 | 0 | 0 | 0 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
| 8-bit data | |||||||||||||||
| bit15 | bit7 | bit0 | |||||||||||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
| 6-bit data | |||||||||||||||
| bit15 | bit7 | bit0 | |||||||||||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | D5 | D4 | D3 | D2 | D1 | D0 |
MS31015V1
Figure 54. Right alignment (offset enabled, signed value)

12-bit data
bit15 bit7 bit0
| SEXT | SEXT | SEXT | SEXT | D11 | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
10-bit data
bit15 bit7 bit0
| SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
8-bit data
bit15 bit7 bit0
| SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
6-bit data
bit15 bit7 bit0
| SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | D5 | D4 | D3 | D2 | D1 | D0 |
MS31016V1
Figure 55. Left alignment (offset disabled, unsigned value)

12-bit data
bit15 bit7 bit0
| D11 | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 | 0 | 0 |
10-bit data
bit15 bit7 bit0
| D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 | 0 | 0 | 0 | 0 |
8-bit data
bit15 bit7 bit0
| D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6-bit data
bit15 bit7 bit0
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 |
MS31017V1
Figure 56. Left alignment (offset enabled, signed value)

12-bit data
| bit15 bit7 bit0 | |||||||||||||||
| SEXT | D11 | D10 | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 | 0 |
10-bit data
| bit15 bit7 bit0 | |||||||||||||||
| SEXT | D9 | D8 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 | 0 | 0 | 0 |
8-bit data
| bit15 bit7 bit0 | |||||||||||||||
| SEXT | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6-bit data
| bit15 bit7 bit0 | |||||||||||||||
| SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | SEXT | D5 | D4 | D3 | D2 | D1 | D0 | 0 |
MS31018V1
ADC overrun (OVR, OVRMOD)
The overrun flag (OVR) notifies of a buffer overrun event, when the regular converted data was not read (by the CPU or the DMA) before new converted data became available.
The OVR flag is set if the EOC flag is still 1 at the time when a new conversion completes. An interrupt can be generated if bit OVRIE=1.
When an overrun condition occurs, the ADC is still operating and can continue to convert unless the software decides to stop and reset the sequence by setting bit ADSTP=1.
OVR flag is cleared by software by writing 1 to it.
It is possible to configure if data is preserved or overwritten when an overrun event occurs by programming the control bit OVRMOD:
- • OVRMOD=0: The overrun event preserves the data register from being overrun: the old data is maintained and the new conversion is discarded and lost. If OVR remains at 1, any further conversions will occur but the result data will be also discarded.
- • OVRMOD=1: The data register is overwritten with the last conversion result and the previous unread data is lost. If OVR remains at 1, any further conversions will operate normally and the ADCx_DR register will always contain the latest converted data.
Figure 57. Example of overrun (OVR)

The diagram illustrates the timing of an ADC overrun. The top section shows signal transitions for ADSTART (1) , EOC, EOS, OVR, ADSTP, and TRGx (1) . Below this, the ADC state is shown as a sequence of RDY, CH1, CH2, CH3, CH4, CH5, CH6, CH7, STOP, and RDY. An 'Overrun' is indicated between CH4 and CH5. The bottom section shows the ADC_DR register content for two cases: OVRMOD=0 (D1, D2, D3, D4) and OVRMOD=1 (D1, D2, D3, D4, D5, D6). A legend at the bottom indicates that rising edges are 'by s/w', 'by h/w', or 'triggered'. The diagram is labeled 'Indicative timings' and 'MS31019V1'.
Note: There is no overrun detection on the injected channels since there is a dedicated data register for each of the four injected channels.
Managing a sequence of conversion without using the DMA
If the conversions are slow enough, the conversion sequence can be handled by the software. In this case the software must use the EOC flag and its associated interrupt to handle each data. Each time a conversion is complete, EOC is set and the ADCx_DR register can be read. OVRMOD should be configured to 0 to manage overrun events as an error.
Managing conversions without using the DMA and without overrun
It may be useful to let the ADC convert one or more channels without reading the data each time (if there is an analog watchdog for instance). In this case, the OVRMOD bit must be configured to 1 and OVR flag should be ignored by the software. An overrun event will not prevent the ADC from continuing to convert and the ADCx_DR register will always contain the latest conversion.
Managing conversions using the DMA
Since converted channel values are stored into a unique data register, it is useful to use DMA for conversion of more than one channel. This avoids the loss of the data already stored in the ADCx_DR register.
When the DMA mode is enabled (DMAEN bit set to 1 in the ADCx_CFGR register), a DMA request is generated after each conversion of a channel. This allows the transfer of the converted data from the ADCx_DR register to the destination location selected by the software.
Despite this, if an overrun occurs (OVR=1) because the DMA could not serve the DMA transfer request in time, the ADC stops generating DMA requests and the data
corresponding to the new conversion is not transferred by the DMA. Which means that all the data transferred to the RAM can be considered as valid.
Depending on the configuration of OVRMOD bit, the data is either preserved or overwritten (refer to Section : ADC overrun (OVR, OVRMOD) ).
The DMA transfer requests are blocked until the software clears the OVR bit.
Two different DMA modes are proposed depending on the application use and are configured with bit DMACFG of the ADCx_CFGR register in single ADC mode:
- • DMA one shot mode (DMACFG=0).
This mode is suitable when the DMA is programmed to transfer a fixed number of data. - • DMA circular mode (DMACFG=1)
This mode is suitable when programming the DMA in circular mode.
DMA one shot mode (DMACFG=0)
In this mode, the ADC generates a DMA transfer request each time a new conversion data is available and stops generating DMA requests once the DMA has reached the last DMA transfer (when a transfer complete interrupt occurs - refer to DMA section) even if a conversion has been started again.
When the DMA transfer is complete (all the transfers configured in the DMA controller have been done):
- • The content of the ADC data register is frozen.
- • Any ongoing conversion is aborted with partial result discarded.
- • No new DMA request is issued to the DMA controller. This avoids generating an overrun error if there are still conversions which are started.
- • Scan sequence is stopped and reset.
- • The DMA is stopped.
DMA circular mode (DMACFG=1)
In this mode, the ADC generates a DMA transfer request each time a new conversion data is available in the data register, even if the DMA has reached the last DMA transfer. This allows configuring the DMA in circular mode to handle a continuous analog input data stream.
12.3.27 Dynamic low-power features
Auto-delayed conversion mode (AUTDLY)
The ADC implements an auto-delayed conversion mode controlled by the AUTDLY configuration bit. Auto-delayed conversions are useful to simplify the software as well as to optimize performance of an application clocked at low frequency where there would be risk of encountering an ADC overrun.
When AUTDLY=1, a new conversion can start only if all the previous data of the same group has been treated:
- • For a regular conversion: once the ADCx_DR register has been read or if the EOC bit has been cleared (see Figure 58 ).
- • For an injected conversion: when the JEOS bit has been cleared (see Figure 59 ).
This is a way to automatically adapt the speed of the ADC to the speed of the system which will read the data.
The delay is inserted after each regular conversion (whatever DISCEN=0 or 1) and after each sequence of injected conversions (whatever JDISCEN=0 or 1).
Note: There is no delay inserted between each conversions of the injected sequence, except after the last one.
During a conversion, a hardware trigger event (for the same group of conversions) occurring during this delay is ignored.
Note: This is not true for software triggers where it remains possible during this delay to set the bits ADSTART or JADSTART to re-start a conversion: it is up to the software to read the data before launching a new conversion.
No delay is inserted between conversions of different groups (a regular conversion followed by an injected conversion or conversely):
- • If an injected trigger occurs during the automatic delay of a regular conversion, the injected conversion starts immediately (see Figure 59 ).
- • Once the injected sequence is complete, the ADC waits for the delay (if not ended) of the previous regular conversion before launching a new regular conversion (see Figure 61 ).
The behavior is slightly different in auto-injected mode (JAUTO=1) where a new regular conversion can start only when the automatic delay of the previous injected sequence of conversion has ended (when JEOS has been cleared). This is to ensure that the software can read all the data of a given sequence before starting a new sequence (see Figure 62 ).
To stop a conversion in continuous auto-injection mode combined with autodelay mode (JAUTO=1, CONT=1 and AUTDLY=1), follow the following procedure:
- 1. Wait until JEOS=1 (no more conversions are restarted)
- 2. Clear JEOS,
- 3. Set ADSTP=1
- 4. Read the regular data.
If this procedure is not respected, a new regular sequence can re-start if JEOS is cleared after ADSTP has been set.
In AUTDLY mode, a hardware regular trigger event is ignored if it occurs during an already ongoing regular sequence or during the delay that follows the last regular conversion of the sequence. It is however considered pending if it occurs after this delay, even if it occurs during an injected sequence or the delay that follows it. The conversion then starts at the end of the delay of the injected sequence.
In AUTDLY mode, a hardware injected trigger event is ignored if it occurs during an already ongoing injected sequence or during the delay that follows the last injected conversion of the sequence.
Figure 58. AUTODLY=1, regular conversion in continuous mode, software trigger

- 1. AUTODLY=1
- 2. Regular configuration: EXTEN=0x0 (SW trigger), CONT=1, CHANNELS = 1,2,3
- 3. Injected configuration DISABLED
Figure 59. AUTODLY=1, regular HW conversions interrupted by injected conversions (DISCEN=0; JDISCEN=0)

- 1. AUTODLY=1
- 2. Regular configuration: EXTEN=0x1 (HW trigger), CONT=0, DISCEN=0, CHANNELS = 1, 2, 3
- 3. Injected configuration: JEXTEN=0x1 (HW Trigger), JDISCEN=0, CHANNELS = 5,6
Figure 60. AUTODLY=1, regular HW conversions interrupted by injected conversions (DISCEN=1, JDISCEN=1)

MS31022V1
- 1. AUTODLY=1
- 2. Regular configuration: EXTEN=0x1 (HW trigger), CONT=0, DISCEN=1, DISCNUM=1, CHANNELS = 1, 2, 3.
- 3. Injected configuration: JEXTEN=0x1 (HW Trigger), JDISCEN=1, CHANNELS = 5,6
Figure 61. AUTODLY=1, regular continuous conversions interrupted by injected conversions

This timing diagram illustrates the ADC operation with AUTODLY=1. The sequence starts with ADSTART (1) (software trigger) and the ADC state transitioning from RDY to CH1 (regular). The regular conversion sequence consists of CH1, DLY (CH1), CH2, DLY (CH2), CH3, and DLY (CH3). Injected conversions CH5 and CH6 are triggered by a hardware trigger. The diagram shows that the injected conversions interrupt the regular sequence. The ADC_DR register is updated with conversion results D1, D2, and D3 for the regular sequence. The injected conversions result in D5 and D6 being stored in the ADC_JDR1 and ADC_JDR2 registers, respectively. The 'Ignored' label indicates that the injected trigger is ignored during the regular conversion sequence. The diagram also shows the EOC (End of Conversion) and EOS (End of Sequence) signals, and the ADC_DR read access. The legend indicates that 'by s/w' refers to software triggers and 'by h/w' refers to hardware triggers. The diagram is labeled 'Indicative timings' and MS31023V2.
- 1. AUTODLY=1
- 2. Regular configuration: EXTEN=0x0 (SW trigger), CONT=1, DISCEN=0, CHANNELS = 1, 2, 3
- 3. Injected configuration: JEXTEN=0x1 (HW Trigger), JDISCEN=0, CHANNELS = 5,6
Figure 62. AUTODLY=1 in auto- injected mode (JAUTO=1)

This timing diagram illustrates the ADC operation with AUTODLY=1 and JAUTO=1. The sequence starts with ADSTART (1) (software trigger) and the ADC state transitioning from RDY to CH1 (regular). The regular conversion sequence consists of CH1, DLY (CH1), CH2, DLY (CH2), CH3, and DLY (CH3). Injected conversions CH5 and CH6 are triggered by a hardware trigger. The diagram shows that the injected conversions are automatically inserted into the regular sequence. The ADC_DR register is updated with conversion results D1, D2, and D3 for the regular sequence. The injected conversions result in D5 and D6 being stored in the ADC_JDR1 and ADC_JDR2 registers, respectively. The 'No delay' label indicates that there is no delay between the regular and injected conversions. The diagram also shows the EOC (End of Conversion) and EOS (End of Sequence) signals, and the ADC_DR read access. The legend indicates that 'by s/w' refers to software triggers and 'by h/w' refers to hardware triggers. The diagram is labeled 'Indicative timings' and MS31024V2.
- 1. AUTODLY=1
- 2. Regular configuration: EXTEN=0x0 (SW trigger), CONT=1, DISCEN=0, CHANNELS = 1, 2
- 3. Injected configuration: JAUTO=1, CHANNELS = 5,6
12.3.28 Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTx, AWD_LTx, AWDx)
The three AWD analog watchdogs monitor whether some channels remain within a configured voltage range (window).
Figure 63. Analog watchdog's guarded area

The diagram illustrates the 'Guarded area' for an analog watchdog. It features a vertical axis labeled 'Analog voltage'. Two horizontal lines represent the 'Higher threshold' (HTR) and the 'Lower threshold' (LTR). The region between these two thresholds is shaded gray and labeled 'Guarded area'. The identifier 'ai16048' is located in the bottom right corner of the diagram.
AWDx flag and interrupt
An interrupt can be enabled for each of the 3 analog watchdogs by setting AWDxIE in the ADCx_IER register (x=1,2,3).
AWDx (x=1,2,3) flag is cleared by software by writing 1 to it.
The ADC conversion result is compared to the lower and higher thresholds before alignment.
Description of analog watchdog 1
The AWD analog watchdog 1 is enabled by setting the AWD1EN bit in the ADCx_CFGFR register. This watchdog monitors whether either one selected channel or all enabled channels (1) remain within a configured voltage range (window).
Table 38 shows how the ADCx_CFGFR registers should be configured to enable the analog watchdog on one or more channels.
Table 38. Analog watchdog channel selection
| Channels guarded by the analog watchdog | AWD1SGL bit | AWD1EN bit | JAWD1EN bit |
|---|---|---|---|
| None | x | 0 | 0 |
| All injected channels | 0 | 0 | 1 |
| All regular channels | 0 | 1 | 0 |
| All regular and injected channels | 0 | 1 | 1 |
| Single (1) injected channel | 1 | 0 | 1 |
| Single (1) regular channel | 1 | 1 | 0 |
| Single (1) regular or injected channel | 1 | 1 | 1 |
1. Selected by the AWD1CH[4:0] bits. The channels must also be programmed to be converted in the appropriate regular or injected sequence.
The AWD1 analog watchdog status bit is set if the analog voltage converted by the ADC is below a lower threshold or above a higher threshold.
These thresholds are programmed in bits HT1[11:0] and LT1[11:0] of the ADCx_TR1 register for the analog watchdog 1. When converting data with a resolution of less than 12 bits (according to bits RES[1:0]), the LSB of the programmed thresholds must be kept cleared because the internal comparison is always performed on the full 12-bit raw converted data (left aligned).
Table 39 describes how the comparison is performed for all the possible resolutions for analog watchdog 1.
Table 39. Analog watchdog 1 comparison
| Resolution (bit RES[1:0]) | Analog watchdog comparison between: | Comments | |
|---|---|---|---|
| Raw converted data, left aligned (1) | Thresholds | ||
| 00: 12-bit | DATA[11:0] | LT1[11:0] and HT1[11:0] | - |
| 01: 10-bit | DATA[11:2],00 | LT1[11:0] and HT1[11:0] | User must configure LT1[1:0] and HT1[1:0] to 00 |
| 10: 8-bit | DATA[11:4],0000 | LT1[11:0] and HT1[11:0] | User must configure LT1[3:0] and HT1[3:0] to 0000 |
| 11: 6-bit | DATA[11:6],000000 | LT1[11:0] and HT1[11:0] | User must configure LT1[5:0] and HT1[5:0] to 000000 |
- 1. The watchdog comparison is performed on the raw converted data before any alignment calculation and before applying any offsets (the data which is compared is not signed).
Description of analog watchdog 2 and 3
The second and third analog watchdogs are more flexible and can guard several selected channels by programming the corresponding bits in AWDxCH[18:1] (x=2,3).
The corresponding watchdog is enabled when any bit of AWDxCH[18:0] (x=2,3) is set.
They are limited to a resolution of 8 bits and only the 8 MSBs of the thresholds can be programmed into HTx[7:0] and LTx[7:0]. Table 40 describes how the comparison is performed for all the possible resolutions.
Table 40. Analog watchdog 2 and 3 comparison
| Resolution (bits RES[1:0]) | Analog watchdog comparison between: | Comments | |
|---|---|---|---|
| Raw converted data, left aligned (1) | Thresholds | ||
| 00: 12-bit | DATA[11:4] | LTx[7:0] and HTx[7:0] | DATA[3:0] are not relevant for the comparison |
| 01: 10-bit | DATA[11:4] | LTx[7:0] and HTx[7:0] | DATA[3:2] are not relevant for the comparison |
| 10: 8-bit | DATA[11:4] | LTx[7:0] and HTx[7:0] | - |
| 11: 6-bit | DATA[11:6],00 | LTx[7:0] and HTx[7:0] | User must configure LTx[1:0] and HTx[1:0] to 00 |
- 1. The watchdog comparison is performed on the raw converted data before any alignment calculation and before applying any offsets (the data which is compared is not signed).
ADCy_AWDx_OUT signal output generation
Each analog watchdog is associated to an internal hardware signal ADCy_AWDx_OUT (y=ADC number, x=watchdog number) which is directly connected to the ETR input (external trigger) of some on-chip timers. Refer to the on-chip timers section to understand how to select the ADCy_AWDx_OUT signal as ETR.
ADCy_AWDx_OUT is activated when the associated analog watchdog is enabled:
- • ADCy_AWDx_OUT is set when a guarded conversion is outside the programmed thresholds.
- • ADCy_AWDx_OUT is reset after the end of the next guarded conversion which is inside the programmed thresholds (It remains at 1 if the next guarded conversions are still outside the programmed thresholds).
- • ADCy_AWDx_OUT is also reset when disabling the ADC (when setting ADDIS=1). Note that stopping regular or injected conversions (setting ADSTP=1 or JADSTP=1) has no influence on the generation of ADCy_AWDx_OUT.
Note: AWDx flag is set by hardware and reset by software: AWDx flag has no influence on the generation of ADCy_AWDx_OUT (ex: ADCy_AWDx_OUT can toggle while AWDx flag remains at 1 if the software did not clear the flag).
Figure 64. ADCy_AWDx_OUT signal generation (on all regular channels)

The timing diagram illustrates the relationship between the ADC state, End of Conversion (EOC) flags, Watchdog (WD) flags, and the AWDx_OUT signal across seven regular conversions. The ADC starts in the 'RDY' state. Conversions 1 through 7 are performed sequentially. Conversions 1, 3, and 7 are 'inside' the programmed thresholds, while conversions 2, 4, 5, and 6 are 'outside'. The EOC FLAG pulses at the end of each conversion. The AWDx FLAG is set by hardware when a conversion is outside the thresholds and is cleared by software (S/W). The ADCy_AWDx_OUT signal is set (goes high) when a conversion is outside the thresholds and is reset (goes low) when a conversion is inside the thresholds. Since conversions 2, 4, 5, and 6 are outside, the AWDx_OUT signal remains high throughout the sequence. A legend indicates that regular channels 1, 2, 3, 4, 5, 6, and 7 are all guarded.
| ADC STATE | Conversion1 | Conversion2 | Conversion3 | Conversion4 | Conversion5 | Conversion6 | Conversion7 |
|---|---|---|---|---|---|---|---|
| RDY | inside | outside | inside | outside | outside | outside | inside |
- Converting regular channels 1,2,3,4,5,6,7
- Regular channels 1,2,3,4,5,6,7 are all guarded
MS31025V1

- Regular channels 1,2,3,4,5,6,7 are all guarded
MS31026V1

- Only channel 1 is guarded
MS31027V1

- All injected channels 1, 2, 3, 4 are guarded
MS31028V1
12.3.29 Temperature sensor
The temperature sensor can be used to measure the junction temperature ( \( T_J \) ) of the device. The temperature sensor is internally connected to the input channels which are used to convert the sensor output voltage to a digital value. When not in use, the sensor can be put in power down mode.
Figure 68 shows the block diagram of connections between the temperature sensor and the ADC.
The temperature sensor output voltage changes linearly with temperature. The offset of this line varies from chip to chip due to process variation (up to 45 °C from one chip to another).
The uncalibrated internal temperature sensor is more suited for applications that detect temperature variations instead of absolute temperatures. To improve the accuracy of the temperature sensor measurement, calibration values are stored in system memory for each device by ST during production.
During the manufacturing process, the calibration data of the temperature sensor and the internal voltage reference are stored in the system memory area. The user application can then read them and use them to improve the accuracy of the temperature sensor or the internal reference. Refer to the STM32F3xx datasheet for additional information.
Main features
- • Supported temperature range: -40 to 125 °C
- • Precision: \( \pm 2 \) °C
The temperature sensor is internally connected to the ADC1_IN16 input channel which is used to convert the sensor's output voltage to a digital value. Refer to the electrical characteristics section of STM32F3xx datasheet for the sampling time value to be applied when converting the internal temperature sensor.
When not in use, the sensor can be put in power-down mode.
Figure 68 shows the block diagram of the temperature sensor.
Figure 68. Temperature sensor channel block diagram

graph LR; TS[Temperature sensor] -- V_TS --> Mux; TSEN[TSEN control bit] --> Mux; Mux --> ADCx[ADCx]; ADCx -- converted data --> Bus[Address/data bus];
Note: The TSEN bit must be set to enable the conversion of the temperature sensor voltage \( V_{TS} \) .
Reading the temperature
To use the sensor:
- 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 STM32F3xx 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_{TS} \) data in the ADC data register.
- 6. Calculate the actual temperature using the following formula:
Where:
- – \( V_{25} = V_{TS} \) value for \( 25^\circ\text{C} \)
- – Avg_Slope = average slope of the temperature vs. \( V_{TS} \) curve (given in \( \text{mV}/^\circ\text{C} \) or \( \mu\text{V}/^\circ\text{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_{TS} \) 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.
12.3.30 \( V_{BAT} \) supply monitoring
The VBATEN bit in the ADC12_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 by 2. This bridge is automatically enabled when VBATEN is set, to connect \( V_{BAT}/2 \) to the ADC1_IN17 input channel. As a consequence, the converted digital value is half the \( V_{BAT} \) voltage. To prevent any unwanted 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 STM32F3xx datasheet for the sampling time value to be applied when converting the \( V_{BAT}/2 \) voltage.
Figure 69 shows the block diagram of the \( V_{BAT} \) sensing feature.
Figure 69. \( V_{BAT} \) channel block diagram

graph LR
subgraph InternalPowerBlock [Internal Power block]
VREFINT[VREFINT]
end
VREFEN[VREFEN control bit]
MUX{ }
ADC1[ADC1]
IN18[ADC1_IN18]
Bus[Address/data bus]
VREFINT --> MUX
VREFEN --> MUX
MUX --> IN18
IN18 --> ADC1
ADC1 --> Bus
Note: The VBATEN bit must be set to enable the conversion of internal channel ADC1_IN17 (V BATEN ).
12.3.3.1 Monitoring the internal voltage reference
It is possible to monitor the internal voltage reference (V REFINT ) to have a reference point for evaluating the ADC V REF+ voltage level.
The internal voltage reference is internally connected to the input channel 18 of the two ADCs (ADCx_IN18).
Refer to the electrical characteristics section of the STM32F3xx datasheet for the sampling time value to be applied when converting the internal voltage reference voltage.
Figure 69 shows the block diagram of the V REFINT sensing feature.
Calculating the actual V DDA voltage using the internal reference voltage
The V DDA power supply voltage applied to the microcontroller may be subject to variation or not precisely known. The embedded internal voltage reference (V REFINT ) and its calibration data acquired by the ADC during the manufacturing process at V DDA = 3.3 V can be used to evaluate the actual V DDA voltage level.
The following formula gives the actual V DDA voltage supplying the device:
Where:
- • VREFINT_CAL is the VREFINT calibration value
- • VREFINT_DATA is the actual VREFINT output value converted by ADC
Converting a supply-relative ADC measurement to an absolute voltage value
The ADC is designed to deliver a digital value corresponding to the ratio between the analog power supply and the voltage applied on the converted channel. For most application use cases, it is necessary to convert this ratio into a voltage independent of V DDA . For applications where V DDA is known and ADC converted values are right-aligned user can use the following formula to get this absolute value:
For applications where V DDA value is not known, user must use the internal voltage reference and V DDA can be replaced by the expression provided in the section Calculating the actual V DDA voltage using the internal reference voltage , resulting in the following formula:
Where:
- • VREFINT_CAL is the VREFINT calibration value
- • ADCx_DATA is the value measured by the ADC on channel x (right-aligned)
- • VREFINT_DATA is the actual VREFINT output value converted by the ADC
- • FULL_SCALE is the maximum digital value of the ADC output. For example with 12-bit resolution, it will be \( 2^{12} - 1 = 4095 \) or with 8-bit resolution, \( 2^8 - 1 = 255 \) .
Note: If ADC measurements are done using an output format other than 12 bit right-aligned, all the parameters must first be converted to a compatible format before the calculation is done.
12.4 ADC interrupts
For each ADC, an interrupt can be generated:
- • After ADC power-up, when the ADC is ready (flag ADRDY)
- • On the end of any conversion for regular groups (flag EOC)
- • On the end of a sequence of conversion for regular groups (flag EOS)
- • On the end of any conversion for injected groups (flag JEOC)
- • On the end of a sequence of conversion for injected groups (flag JEOS)
- • When an analog watchdog detection occurs (flag AWD1, AWD2 and AWD3)
- • When the end of sampling phase occurs (flag EOSMP)
- • When the data overrun occurs (flag OVR)
- • When the injected sequence context queue overflows (flag JQOVF)
Separate interrupt enable bits are available for flexibility.
Table 41. ADC interrupts per each ADC
| Interrupt event | Event flag | Enable control bit |
|---|---|---|
| ADC ready | ADRDY | ADRDYIE |
| End of conversion of a regular group | EOC | EOCIE |
| End of sequence of conversions of a regular group | EOS | EOSIE |
| End of conversion of a injected group | JEOC | JEOCIE |
| End of sequence of conversions of an injected group | JEOS | JEOSIE |
| Analog watchdog 1 status bit is set | AWD1 | AWD1IE |
| Analog watchdog 2 status bit is set | AWD2 | AWD2IE |
| Analog watchdog 3 status bit is set | AWD3 | AWD3IE |
| End of sampling phase | EOSMP | EOSMPIE |
| Overrun | OVR | OVRIE |
| Injected context queue overflows | JQOVF | JQOVFIE |
12.5 ADC registers (for each ADC)
Refer to Section 1.2 on page 36 for a list of abbreviations used in register descriptions.
12.5.1 ADC interrupt and status register (ADCx_ISR, x=1)
Address offset: 0x00
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | JQOVF | AWD3 | AWD2 | AWD1 | JEOS | JEOC | OVR | EOS | EOC | EOSMP | ADRDY |
| rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 | rc_w1 |
Bits 31:11 Reserved, must be kept at reset value.
Bit 10 JQOVF : Injected context queue overflow
This bit is set by hardware when an Overflow of the Injected Queue of Context occurs. It is cleared by software writing 1 to it. Refer to Section 12.3.21: Queue of context for injected conversions for more information.
0: No injected context queue overflow occurred (or the flag event was already acknowledged and cleared by software)
1: Injected context queue overflow has occurred
Bit 9 AWD3 : Analog watchdog 3 flag
This bit is set by hardware when the converted voltage crosses the values programmed in the fields LT3[7:0] and HT3[7:0] of ADCx_TR3 register. It is cleared by software writing 1 to it.
0: No analog watchdog 3 event occurred (or the flag event was already acknowledged and cleared by software)
1: Analog watchdog 3 event occurred
Bit 8 AWD2 : Analog watchdog 2 flag
This bit is set by hardware when the converted voltage crosses the values programmed in the fields LT2[7:0] and HT2[7:0] of ADCx_TR2 register. It is cleared by software writing 1 to it.
0: No analog watchdog 2 event occurred (or the flag event was already acknowledged and cleared by software)
1: Analog watchdog 2 event occurred
Bit 7 AWD1 : Analog watchdog 1 flag
This bit is set by hardware when the converted voltage crosses the values programmed in the fields LT1[11:0] and HT1[11:0] of ADCx_TR1 register. It is cleared by software writing 1 to it.
0: No analog watchdog 1 event occurred (or the flag event was already acknowledged and cleared by software)
1: Analog watchdog 1 event occurred
Bit 6 JEOS : Injected channel end of sequence flag
This bit is set by hardware at the end of the conversions of all injected channels in the group. It is cleared by software writing 1 to it.
0: Injected conversion sequence not complete (or the flag event was already acknowledged and cleared by software)
1: Injected conversions complete
Bit 5 JEOC: Injected channel end of conversion flagThis bit is set by hardware at the end of each injected conversion of a channel when a new data is available in the corresponding ADCx_JDRy register. It is cleared by software writing 1 to it or by reading the corresponding ADCx_JDRy register
- 0: Injected channel conversion not complete (or the flag event was already acknowledged and cleared by software)
- 1: Injected channel conversion complete
This bit is set by hardware when an overrun occurs on a regular channel, meaning that a new conversion has completed while the EOC flag was already set. It is cleared by software writing 1 to it.
- 0: No overrun occurred (or the flag event was already acknowledged and cleared by software)
- 1: Overrun has occurred
This bit is set by hardware at the end of the conversions of a regular sequence of channels. It is cleared by software writing 1 to it.
- 0: Regular Conversions sequence not complete (or the flag event was already acknowledged and cleared by software)
- 1: Regular Conversions sequence complete
This bit is set by hardware at the end of each regular conversion of a channel when a new data is available in the ADCx_DR register. It is cleared by software writing 1 to it or by reading the ADCx_DR register
- 0: Regular channel conversion not complete (or the flag event was already acknowledged and cleared by software)
- 1: Regular channel conversion complete
This bit is set by hardware during the conversion of any channel (only for regular channels), at the end of the sampling phase.
- 0: not at the end of the sampling phase (or the flag event was already acknowledged and cleared by software)
- 1: End of sampling phase reached
This bit is set by hardware after the ADC has been enabled (bit ADEN=1) and when the ADC reaches a state where it is ready to accept conversion requests.
It is cleared by software writing 1 to it.
- 0: ADC not yet ready to start conversion (or the flag event was already acknowledged and cleared by software)
- 1: ADC is ready to start conversion
12.5.2 ADC interrupt enable register (ADCx_IER, x=1)
Address offset: 0x04
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | JQ OVFIE | AWD3 IE | AWD2 IE | AWD1 IE | JEOSIE | JEOCIE | OVR IE | EOSIE | EOCIE | EOSMP IE | ADRDY IE |
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:11 Reserved, must be kept at reset value.
Bit 10 JQOVFIE: Injected context queue overflow interrupt enable
This bit is set and cleared by software to enable/disable the Injected Context Queue Overflow interrupt.
0: Injected Context Queue Overflow interrupt disabled
1: Injected Context Queue Overflow interrupt enabled. An interrupt is generated when the JQOVF bit is set.
Note: Software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).
Bit 9 AWD3IE: Analog watchdog 3 interrupt enable
This bit is set and cleared by software to enable/disable the analog watchdog 2 interrupt.
0: Analog watchdog 3 interrupt disabled
1: Analog watchdog 3 interrupt enabled
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 8 AWD2IE: Analog watchdog 2 interrupt enable
This bit is set and cleared by software to enable/disable the analog watchdog 2 interrupt.
0: Analog watchdog 2 interrupt disabled
1: Analog watchdog 2 interrupt enabled
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 7 AWD1IE: Analog watchdog 1 interrupt enable
This bit is set and cleared by software to enable/disable the analog watchdog 1 interrupt.
0: Analog watchdog 1 interrupt disabled
1: Analog watchdog 1 interrupt enabled
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 6 JEOSIE: End of injected sequence of conversions interrupt enable
This bit is set and cleared by software to enable/disable the end of injected sequence of conversions interrupt.
0: JEOS interrupt disabled
1: JEOS interrupt enabled. An interrupt is generated when the JEOS bit is set.
Note: Software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).
Bit 5 JEOCIE: End of injected conversion interrupt enableThis bit is set and cleared by software to enable/disable the end of an injected conversion interrupt.
0: JEOC interrupt disabled.
1: JEOC interrupt enabled. An interrupt is generated when the JEOC bit is set.
Note: Software is allowed to write this bit only when JADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 4 OVRIE: Overrun interrupt enableThis bit is set and cleared by software to enable/disable the Overrun interrupt of a regular conversion.
0: Overrun interrupt disabled
1: Overrun interrupt enabled. An interrupt is generated when the OVR bit is set.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 3 EOSIE: End of regular sequence of conversions interrupt enableThis bit is set and cleared by software to enable/disable the end of regular sequence of conversions interrupt.
0: EOS interrupt disabled
1: EOS interrupt enabled. An interrupt is generated when the EOS bit is set.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 2 EOCIE: End of regular conversion interrupt enableThis bit is set and cleared by software to enable/disable the end of a regular conversion interrupt.
0: EOC interrupt disabled.
1: EOC interrupt enabled. An interrupt is generated when the EOC bit is set.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 1 EOSMPIE: End of sampling flag interrupt enable for regular conversionsThis bit is set and cleared by software to enable/disable the end of the sampling phase interrupt for regular conversions.
0: EOSMP interrupt disabled.
1: EOSMP interrupt enabled. An interrupt is generated when the EOSMP bit is set.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 0 ADRDYIE: ADC ready interrupt enableThis bit is set and cleared by software to enable/disable the ADC Ready interrupt.
0: ADRDY interrupt disabled
1: ADRDY interrupt enabled. An interrupt is generated when the ADRDY bit is set.
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
12.5.3 ADC control register (ADCx_CR, x=1)
Address offset: 0x08
Reset value: 0x2000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AD CAL | ADCA LDIF | ADVREGEN[1:0] | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | |
| rs | rW | rW | rW | ||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | JAD STP | AD STP | JAD START | AD START | AD DIS | AD EN |
| rs | rs | rs | rs | rs | rs |
Bit 31 ADCAL: ADC calibration
This bit is set by software to start the calibration of the ADC. Program first the bit ADCALDIF to determine if this calibration applies for single-ended or differential inputs mode.
It is cleared by hardware after calibration is complete.
0: Calibration complete
1: Write 1 to calibrate the ADC. Read at 1 means that a calibration in progress.
Note: Software is allowed to launch a calibration by setting ADCAL only when ADEN=0.
Note: Software is allowed to update the calibration factor by writing ADCx_CALFACT only when ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing)
Bit 30 ADCALDIF: Differential mode for calibration
This bit is set and cleared by software to configure the single-ended or differential inputs mode for the calibration.
0: Writing ADCAL will launch a calibration in Single-ended inputs Mode.
1: Writing ADCAL will launch a calibration in Differential inputs Mode.
Note: Software is allowed to write this bit only when the ADC is disabled and is not calibrating (ADCAL=0, JADSTART=0, JADSTP=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Bits 29:28 ADVREGEN[1:0]: ADC voltage regulator enable
These bits are set by software to enable the ADC voltage regulator.
Before performing any operation such as launching a calibration or enabling the ADC, the ADC voltage regulator must first be enabled and the software must wait for the regulator start-up time.
00: Intermediate state required when moving the ADC voltage regulator from the enabled to the disabled state or from the disabled to the enabled state.
01: ADC Voltage regulator enabled.
10: ADC Voltage regulator disabled (Reset state)
11: reserved
For more details about the ADC voltage regulator enable and disable sequences, refer to Section 12.3.6: ADC voltage regulator (ADVREGEN) .
Note: The software can program this bit field only when the ADC is disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Bits 27:6 Reserved, must be kept at reset value.
Bit 5 JADSTP: ADC stop of injected conversion commandThis bit is set by software to stop and discard an ongoing injected conversion (JADSTP Command). It is cleared by hardware when the conversion is effectively discarded and the ADC injected sequence and triggers can be re-configured. The ADC is then ready to accept a new start of injected conversions (JADSTART command).
0: No ADC stop injected conversion command ongoing
1: Write 1 to stop injected conversions ongoing. Read 1 means that an ADSTP command is in progress.
Note: Software is allowed to set JADSTP only when JADSTART=1 and ADDIS=0 (ADC is enabled and eventually converting an injected conversion and there is no pending request to disable the ADC)
Note: In auto-injection mode (JAUTO=1), setting ADSTP bit aborts both regular and injected conversions (do not use JADSTP)
Bit 4 ADSTP: ADC stop of regular conversion commandThis bit is set by software to stop and discard an ongoing regular conversion (ADSTP Command). It is cleared by hardware when the conversion is effectively discarded and the ADC regular sequence and triggers can be re-configured. The ADC is then ready to accept a new start of regular conversions (ADSTART command).
0: No ADC stop regular conversion command ongoing
1: Write 1 to stop regular conversions ongoing. Read 1 means that an ADSTP command is in progress.
Note: Software is allowed to set ADSTP only when ADSTART=1 and ADDIS=0 (ADC is enabled and eventually converting a regular conversion and there is no pending request to disable the ADC)
Note: In auto-injection mode (JAUTO=1), setting ADSTP bit aborts both regular and injected conversions (do not use JADSTP)
Bit 3 JADSTART: ADC start of injected conversionThis bit is set by software to start ADC conversion of injected channels. Depending on the configuration bits JEXTEN, a conversion will start immediately (software trigger configuration) or once an injected hardware trigger event occurs (hardware trigger configuration).
It is cleared by hardware:
– in single conversion mode when software trigger is selected (JEXTSEL=0x0): at the assertion of the End of Injected Conversion Sequence (JEOS) flag.
– in all cases: after the execution of the JADSTP command, at the same time that JADSTP is cleared by hardware.
0: No ADC injected conversion is ongoing.
1: Write 1 to start injected conversions. Read 1 means that the ADC is operating and eventually converting an injected channel.
Note: Software is allowed to set JADSTART only when ADEN=1 and ADDIS=0 (ADC is enabled and there is no pending request to disable the ADC)
Note: In auto-injection mode (JAUTO=1), regular and auto-injected conversions are started by setting bit ADSTART (JADSTART must be kept cleared)
Bit 2 ADSTART: ADC start of regular conversionThis bit is set by software to start ADC conversion of regular channels. Depending on the configuration bits EXTEN, a conversion will start immediately (software trigger configuration) or once a regular hardware trigger event occurs (hardware trigger configuration).
It is cleared by hardware:
- – in single conversion mode when software trigger is selected (EXTSEL=0x0): at the assertion of the End of Regular Conversion Sequence (EOS) flag.
- – in all cases: after the execution of the ADSTP command, at the same time that ADSTP is cleared by hardware.
0: No ADC regular conversion is ongoing.
1: Write 1 to start regular conversions. Read 1 means that the ADC is operating and eventually converting a regular channel.
Note: Software is allowed to set ADSTART only when ADEN=1 and ADDIS=0 (ADC is enabled and there is no pending request to disable the ADC)
Note: In auto-injection mode (JAUTO=1), regular and auto-injected conversions are started by setting bit ADSTART (JADSTART must be kept cleared)
Bit 1 ADDIS: ADC disable commandThis bit is set by software to disable the ADC (ADDIS command) and put it into power-down state (OFF state).
It is cleared by hardware once the ADC is effectively disabled (ADEN is also cleared by hardware at this time).
0: no ADDIS command ongoing
1: Write 1 to disable the ADC. Read 1 means that an ADDIS command is in progress.
Note: Software is allowed to set ADDIS only when ADEN=1 and both ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing)
Bit 0 ADEN: ADC enable controlThis bit is set by software to enable the ADC. The ADC will be effectively ready to operate once the flag ADRDY has been set.
It is cleared by hardware when the ADC is disabled, after the execution of the ADDIS command.
0: ADC is disabled (OFF state)
1: Write 1 to enable the ADC.
Note: Software is allowed to set ADEN only when all bits of ADCx_CR registers are 0 (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0) except for bit ADVREGEN which must be 1 (and the software must have wait for the startup time of the voltage regulator)
12.5.4 ADC configuration register (ADCx_CFGR, x=1)
Address offset: 0x0C
Reset value: 0x0000 00000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | AWD1CH[4:0] | JAUTO | JAWD1EN | AWD1EN | AWD1SGL | JQM | JDISCEN | DISCNUM[2:0] | DISCEN | ||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | AUT DLY | CONT | OVR MOD | EXTEN[1:0] | EXTSEL[3:0] | ALIGN | RES[1:0] | Res. | DMA CFG | DMA EN | |||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||
Bit 31 Reserved, must be kept at reset value.
Bits 30:26 AWD1CH[4:0] : Analog watchdog 1 channel selection
These bits are set and cleared by software. They select the input channel to be guarded by the analog watchdog.
00000: reserved (analog input channel 0 is not mapped)
00001: ADC analog input channel-1 monitored by AWD1
.....
10010: ADC analog input channel-18 monitored by AWD1
others: reserved, must not be used
Note: The channel selected by AWD1CH must be also selected into the SQRi or JSQRi registers.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 25 JAUTO : Automatic injected group conversion
This bit is set and cleared by software to enable/disable automatic injected group conversion after regular group conversion.
0: Automatic injected group conversion disabled
1: Automatic injected group conversion enabled
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no regular nor injected conversion is ongoing).
Bit 24 JAWD1EN : Analog watchdog 1 enable on injected channels
This bit is set and cleared by software
0: Analog watchdog 1 disabled on injected channels
1: Analog watchdog 1 enabled on injected channels
Note: Software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).
Bit 23 AWD1EN : Analog watchdog 1 enable on regular channels
This bit is set and cleared by software
0: Analog watchdog 1 disabled on regular channels
1: Analog watchdog 1 enabled on regular channels
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 22 AWD1SGL : Enable the watchdog 1 on a single channel or on all channels
This bit is set and cleared by software to enable the analog watchdog on the channel identified by the AWD1CH[4:0] bits or on all the channels
0: Analog watchdog 1 enabled on all channels
1: Analog watchdog 1 enabled on a single channel
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 21 JQM : JSQR queue mode
This bit is set and cleared by software.
It defines how an empty Queue is managed.
0: JSQR Mode 0: The Queue is never empty and maintains the last written configuration into JSQR.
1: JSQR Mode 1: The Queue can be empty and when this occurs, the software and hardware triggers of the injected sequence are both internally disabled just after the completion of the last valid injected sequence.
Refer to Section 12.3.21: Queue of context for injected conversions for more information.
Note: Software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).
Bit 20 JDISCEN : Discontinuous mode on injected channels
This bit is set and cleared by software to enable/disable discontinuous mode on the injected channels of a group.
0: Discontinuous mode on injected channels disabled
1: Discontinuous mode on injected channels enabled
Note: Software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).
Note: It is not possible to use both auto-injected mode and discontinuous mode simultaneously: the bits DISCEN and JDISCEN must be kept cleared by software when JAUTO is set.
Bits 19:17 DISCNUM[2:0] : Discontinuous mode channel count
These bits are written by software to define the number of regular channels to be converted in discontinuous mode, after receiving an external trigger.
000: 1 channel
001: 2 channels
...
111: 8 channels
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 16 DISCEN : Discontinuous mode for regular channels
This bit is set and cleared by software to enable/disable Discontinuous mode for regular channels.
0: Discontinuous mode for regular channels disabled
1: Discontinuous mode for regular channels enabled
Note: It is not possible to have both discontinuous mode and continuous mode enabled: it is forbidden to set both DISCEN=1 and CONT=1.
Note: It is not possible to use both auto-injected mode and discontinuous mode simultaneously: the bits DISCEN and JDISCEN must be kept cleared by software when JAUTO is set.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 15 Reserved, must be kept at reset value.
Bit 14 AUTDLY: Delayed conversion modeThis bit is set and cleared by software to enable/disable the Auto Delayed Conversion mode.
0: Auto-delayed conversion mode off
1: Auto-delayed conversion mode on
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 13 CONT: Single / continuous conversion mode for regular conversionsThis bit is set and cleared by software. If it is set, regular conversion takes place continuously until it is cleared.
0: Single conversion mode
1: Continuous conversion mode
Note: It is not possible to have both discontinuous mode and continuous mode enabled: it is forbidden to set both DISCEN=1 and CONT=1.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 12 OVRMOD: Overrun ModeThis bit is set and cleared by software and configure the way data overrun is managed.
0: ADCx_DR register is preserved with the old data when an overrun is detected.
1: ADCx_DR register is overwritten with the last conversion result when an overrun is detected.
Note: Software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bits 11:10 EXTEN[1:0]: External trigger enable and polarity selection for regular channelsThese bits are set and cleared by software to select the external trigger polarity and enable the trigger of a regular group.
00: Hardware trigger detection disabled (conversions can be launched by software)
01: Hardware trigger detection on the rising edge
10: Hardware trigger detection on the falling edge
11: Hardware trigger detection on both the rising and falling edges
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bits 9:6 EXTSEL[3:0]: External trigger selection for regular groupThese bits select the external event used to trigger the start of conversion of a regular group:
0000: Event 0
0001: Event 1
0010: Event 2
0011: Event 3
0100: Event 4
0101: Event 5
0110: Event 6
0111: Event 7
...
1111: Event 15
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Bit 5 ALIGN : Data alignment
This bit is set and cleared by software to select right or left alignment. Refer to Figure : Data register, data alignment and offset (ADCx_DR, OFFSETy, OFFSETy_CH, ALIGN)
- 0: Right alignment
- 1: Left alignment
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bits 4:3 RES[1:0] : Data resolution
These bits are written by software to select the resolution of the conversion.
- 00: 12-bit
- 01: 10-bit
- 10: 8-bit
- 11: 6-bit
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 2 Reserved, must be kept at reset value.
Bit 1 DMACFG : Direct memory access configuration
This bit is set and cleared by software to select between two DMA modes of operation and is effective only when DMAEN=1.
- 0: DMA One Shot Mode selected
- 1: DMA Circular Mode selected
For more details, refer to Section : Managing conversions using the DMA
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 0 DMAEN : Direct memory access enable
This bit is set and cleared by software to enable the generation of DMA requests. This allows to use the GP-DMA to manage automatically the converted data. For more details, refer to Section : Managing conversions using the DMA .
- 0: DMA disabled
- 1: DMA enabled
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
12.5.5 ADC sample time register 1 (ADCx_SMPR1, x=1)
Address offset: 0x14
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | SMP9[2:0] | SMP8[2:0] | SMP7[2:0] | SMP6[2:0] | SMP5[2:1] | |||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SMP5_0 | SMP4[2:0] | SMP3[2:0] | SMP2[2:0] | SMP1[2:0] | Res. | Res. | Res. | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||
Bits 31:30 Reserved, must be kept at reset value.
Bits 29:3 SMPx[2:0] : Channel x sampling time selection
These bits are written by software to select the sampling time individually for each channel. During sample cycles, the channel selection bits must remain unchanged.
- 000: 1.5 ADC clock cycles
- 001: 2.5 ADC clock cycles
- 010: 4.5 ADC clock cycles
- 011: 7.5 ADC clock cycles
- 100: 19.5 ADC clock cycles
- 101: 61.5 ADC clock cycles
- 110: 181.5 ADC clock cycles
- 111: 601.5 ADC clock cycles
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bits 2:0 Reserved
12.5.6 ADC sample time register 2 (ADCx_SMPR2, x=1)
Address offset: 0x18
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | SMP18[2:0] | SMP17[2:0] | SMP16[2:0] | SMP15[2:1] | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SMP15_0 | SMP14[2:0] | SMP13[2:0] | SMP12[2:0] | SMP11[2:0] | SMP10[2:0] | ||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw |
Bits 31:27 Reserved, must be kept at reset value.
Bits 26:0 SMPx[2:0] : Channel x sampling time selection
These bits are written by software to select the sampling time individually for each channel. During sampling cycles, the channel selection bits must remain unchanged.
- 000: 1.5 ADC clock cycles
- 001: 2.5 ADC clock cycles
- 010: 4.5 ADC clock cycles
- 011: 7.5 ADC clock cycles
- 100: 19.5 ADC clock cycles
- 101: 61.5 ADC clock cycles
- 110: 181.5 ADC clock cycles
- 111: 601.5 ADC clock cycles
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
12.5.7 ADC watchdog threshold register 1 (ADCx_TR1, x=1)
Address offset: 0x20
Reset value: 0x0FFF 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | HT1[11:0] | |||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | LT1[11:0] | |||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||||
Bits 31:28 Reserved, must be kept at reset value.
Bits 27:16 HT1[11:0] : Analog watchdog 1 higher threshold
These bits are written by software to define the higher threshold for the analog watchdog 1.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bits 15:12 Reserved, must be kept at reset value.
Bits 11:0 LT1[11:0] : Analog watchdog 1 lower threshold
These bits are written by software to define the lower threshold for the analog watchdog 1.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
12.5.8 ADC watchdog threshold register 2 (ADCx_TR2, x = 1)
Address offset: 0x24
Reset value: 0x00FF 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | HT2[7:0] | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | ||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LT2[7:0] | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | ||||||||
Bits 31:24 Reserved, must be kept at reset value.
Bits 23:16 HT2[7:0] : Analog watchdog 2 higher threshold
These bits are written by software to define the higher threshold for the analog watchdog 2.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bits 15:8 Reserved, must be kept at reset value.
Bits 7:0 LT2[7:0] : Analog watchdog 2 lower threshold
These bits are written by software to define the lower threshold for the analog watchdog 2.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
12.5.9 ADC watchdog threshold register 3 (ADCx_TR3, x=1)
Address offset: 0x28
Reset value: 0x00FF 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | HT3[7:0] | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | ||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LT3[7:0] | |||||||
| rw | rw | rw | rw | rw | rw | rw | rw | ||||||||
Bits 31:24 Reserved, must be kept at reset value.
Bits 23:16 HT3[7:0] : Analog watchdog 3 higher threshold
These bits are written by software to define the higher threshold for the analog watchdog 3.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bits 15:8 Reserved, must be kept at reset value.
Bits 7:0 LT3[7:0] : Analog watchdog 3 lower threshold
These bits are written by software to define the lower threshold for the analog watchdog 3.
This watchdog compares the 8-bit of LT3 with the 8 MSB of the converted data.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
12.5.10 ADC regular sequence register 1 (ADCx_SQR1, x=1)
Address offset: 0x30
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | SQ4[4:0] | Res. | SQ3[4:0] | Res. | SQ2[4] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SQ2[3:0] | Res. | SQ1[4:0] | Res. | Res. | L[3:0] | ||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||
Bits 31:29 Reserved, must be kept at reset value.
Bits 28:24 SQ4[4:0] : 4th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 4th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 23 Reserved, must be kept at reset value.
Bits 22:18 SQ3[4:0] : 3rd conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 3rd in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 17 Reserved, must be kept at reset value.
Bits 16:12 SQ2[4:0] : 2nd conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 2nd in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 11 Reserved, must be kept at reset value.
Bits 10:6 SQ1[4:0] : 1st conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 1st in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bits 5:4 Reserved, must be kept at reset value.
Bits 3:0 L[3:0] : Regular channel sequence length
These bits are written by software to define the total number of conversions in the regular channel conversion sequence.
0000: 1 conversion
0001: 2 conversions
...
1111: 16 conversions
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
12.5.11 ADC regular sequence register 2 (ADCx_SQR2, x=1)
Address offset: 0x34
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | SQ9[4:0] | Res. | SQ8[4:0] | Res. | SQ7[4] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SQ7[3:0] | Res. | SQ6[4:0] | Res. | SQ5[4:0] | |||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
Bits 31:29 Reserved, must be kept at reset value.
Bits 28:24 SQ9[4:0] : 9th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 9th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bit 23 Reserved, must be kept at reset value.
Bits 22:18 SQ8[4:0] : 8th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 8th in the regular conversion sequence
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bit 17 Reserved, must be kept at reset value.
Bits 16:12 SQ7[4:0] : 7th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 7th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 11 Reserved, must be kept at reset value.
Bits 10:6 SQ6[4:0] : 6th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 6th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 5 Reserved, must be kept at reset value.
Bits 4:0 SQ5[4:0] : 5th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 5th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
12.5.12 ADC regular sequence register 3 (ADCx_SQR3, x=1)
Address offset: 0x38
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | SQ14[4:0] | Res. | SQ13[4:0] | Res. | SQ12[4] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| SQ12[3:0] | Res. | SQ11[4:0] | Res. | SQ10[4:0] | |||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||
Bits 31:29 Reserved, must be kept at reset value.
Bits 28:24 SQ14[4:0] : 14th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 14th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bit 23 Reserved, must be kept at reset value.
Bits 22:18 SQ13[4:0] : 13th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 13th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bit 17 Reserved, must be kept at reset value.
Bits 16:12 SQ12[4:0] : 12th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 12th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bit 11 Reserved, must be kept at reset value.
Bits 10:6 SQ11[4:0] : 11th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 11th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bit 5 Reserved, must be kept at reset value.
Bits 4:0 SQ10[4:0] : 10th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 10th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
12.5.13 ADC regular sequence register 4 (ADCx_SQR4, x=1)
Address offset: 0x3C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | SQ16[4:0] | Res. | SQ15[4:0] | ||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||||||
Bits 31:11 Reserved, must be kept at reset value.
Bits 10:6 SQ16[4:0] : 16th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 16th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 5 Reserved, must be kept at reset value.
Bits 4:0 SQ15[4:0] : 15th conversion in regular sequence
These bits are written by software with the channel number (1..18) assigned as the 15th in the regular conversion sequence.
Note: Software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
12.5.14 ADC regular Data Register (ADCx_DR, x=1)
Address offset: 0x40
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| RDATA[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 RDATA[15:0] : Regular Data converted
These bits are read-only. They contain the conversion result from the last converted regular channel. The data are left- or right-aligned as described in Section 12.3.26: Data management .
12.5.15 ADC injected sequence register (ADCx_JSQR, x=1)
Address offset: 0x4C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | JSQ4[4:0] | Res. | JSQ3[4:0] | Res. | JSQ2[4:2] | ||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| JSQ2[1:0] | Res. | JSQ1[4:0] | JEXTEN[1:0] | JEXTSEL[3:0] | JL[1:0] | ||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
Bit 31 Reserved, must be kept at reset value.
Bits 30:26 JSQ4[4:0] : 4th conversion in the injected sequence
These bits are written by software with the channel number (1..18) assigned as the 4th in the injected conversion sequence.
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 25 Reserved, must be kept at reset value.
Bits 24:20 JSQ3[4:0] : 3rd conversion in the injected sequence
These bits are written by software with the channel number (1..18) assigned as the 3rd in the injected conversion sequence.
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 19 Reserved, must be kept at reset value.
Bits 18:14 JSQ2[4:0] : 2nd conversion in the injected sequence
These bits are written by software with the channel number (1..18) assigned as the 2nd in the injected conversion sequence.
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bit 13 Reserved, must be kept at reset value.
Bits 12:8 JSQ1[4:0] : 1st conversion in the injected sequence
These bits are written by software with the channel number (1..18) assigned as the 1st in the injected conversion sequence.
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
Note: Analog input channel 0 is not mapped: value "00000" should not be used
Bits 7:6 JEXTEN[1:0]: External Trigger Enable and Polarity Selection for injected channelsThese bits are set and cleared by software to select the external trigger polarity and enable the trigger of an injected group.
- 00: Hardware trigger detection disabled (conversions can be launched by software)
- 01: Hardware trigger detection on the rising edge
- 10: Hardware trigger detection on the falling edge
- 11: Hardware trigger detection on both the rising and falling edges
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
Note: If JQM=1 and if the Queue of Context becomes empty, the software and hardware triggers of the injected sequence are both internally disabled (refer to Section 12.3.21: Queue of context for injected conversions )
Bits 5:2 JEXTSEL[3:0]: External Trigger Selection for injected groupThese bits select the external event used to trigger the start of conversion of an injected group:
- 0000: Event 0
- 0001: Event 1
- 0010: Event 2
- 0011: Event 3
- 0100: Event 4
- 0101: Event 5
- 0110: Event 6
- 0111: Event 7
- ...
- 1111: Event 15
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
Bits 1:0 JL[1:0]: Injected channel sequence lengthThese bits are written by software to define the total number of conversions in the injected channel conversion sequence.
- 00: 1 conversion
- 01: 2 conversions
- 10: 3 conversions
- 11: 4 conversions
Note: Software is allowed to write these bits at any time, once the ADC is enabled (ADEN=1).
12.5.16 ADC offset register (ADCx_OF Ry, x=1) (y=1..4)
Address offset: 0x60, 0x64, 0x68, 0x6C
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OFFSETy_EN | OFFSETy_CH[4:0] | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | |||||
| rw | rw | rw | rw | rw | rw | ||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | OFFSETy[11:0] | |||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | ||||
Bit 31 OFFSETy_EN: Offset y Enable
This bit is written by software to enable or disable the offset programmed into bits OFFSETy[11:0].
Note: Software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bits 30:26 OFFSETy_CH[4:0]: Channel selection for the Data offset y
These bits are written by software to define the channel to which the offset programmed into bits OFFSETy[11:0] will apply.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Note: Analog input channel 0 is not mapped: value “00000” should not be used
Bits 25:12 Reserved, must be kept at reset value.
Bits 11:0 OFFSETy[11:0]: Data offset y for the channel programmed into bits OFFSETy_CH[4:0]
These bits are written by software to define the offset y to be subtracted from the raw converted data when converting a channel (can be regular or injected). The channel to which applies the data offset y must be programmed in the bits OFFSETy_CH[4:0]. The conversion result can be read from in the ADCx_DR (regular conversion) or from in the ADCx_JDRyi registers (injected conversion).
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Note: If several offset (OFFSETy) point to the same channel, only the offset with the lowest x value is considered for the subtraction.
Ex: if OFFSET1_CH[4:0]=4 and OFFSET2_CH[4:0]=4, this is OFFSET1[11:0] which is subtracted when converting channel 4.
12.5.17 ADC injected data register (ADCx_JDRy, x=1, y= 1..4)
Address offset: 0x80 - 0x8C
Reset value: 0x0000 0000

| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| JDATA[15:0] | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | r | r | r | r | r |
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0 JDATA[15:0] : Injected data
These bits are read-only. They contain the conversion result from injected channel y. The data are left -or right-aligned as described in Section 12.3.26: Data management .
12.5.18 ADC Analog Watchdog 2 Configuration Register (ADCx_AWD2CR, x=1)
Address offset: 0xA0
Reset value: 0x0000 0000

| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | AWD2CH[18:16] | ||
| rw | rw | rw | |||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| AWD2CH[15:1] | Res. | ||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
Bits 31:19 Reserved, must be kept at reset value.
Bits 18:1 AWD2CH[18:1] : Analog watchdog 2 channel selection
These bits are set and cleared by software. They enable and select the input channels to be guarded by the analog watchdog 2.
AWD2CH[i] = 0: ADC analog input channel-i is not monitored by AWD2
AWD2CH[i] = 1: ADC analog input channel-i is monitored by AWD2
When AWD2CH[18:1] = 000..0, the analog Watchdog 2 is disabled
Note: The channels selected by AWD2CH must be also selected into the SQRi or JSQRi registers.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 0 Reserved, must be kept at reset value.
12.5.19 ADC Analog Watchdog 3 Configuration Register (ADCx_AWD3CR, x=1)
Address offset: 0xA4
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | AWD3CH[18:16] | ||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| AWD3CH[15:1] | Res. | ||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
Bits 31:19 Reserved, must be kept at reset value.
Bits 18:1 AWD3CH[18:1] : Analog watchdog 3 channel selection
These bits are set and cleared by software. They enable and select the input channels to be guarded by the analog watchdog 3.
- AWD3CH[i] = 0: ADC analog input channel-i is not monitored by AWD3
- AWD3CH[i] = 1: ADC analog input channel-i is monitored by AWD3
When AWD3CH[18:1] = 000..0, the analog Watchdog 3 is disabled
Note: The channels selected by AWD3CH must be also selected into the SQRi or JSQRi registers.
Note: Software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).
Bit 0 Reserved, must be kept at reset value.
12.5.20 ADC Differential Mode Selection Register (ADCx_DIFSEL, x=1)
Address offset: 0xB0
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | DIFSEL[18:16] | ||
| r | r | r | |||||||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| DIFSEL[15:1] | Res. | ||||||||||||||
| rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | rw | |
Bits 31:19 Reserved, must be kept at reset value.
Bits 18:16 DIFSEL[18:16] : Differential mode for channels 18 to 16.
These bits are read only. These channels are forced to single-ended input mode (either connected to a single-ended I/O port or to an internal channel).
Bits 15:1 DIFSEL[15:1] : Differential mode for channels 15 to 1
These bits are set and cleared by software. They allow to select if a channel is configured as single ended or differential mode.
DIFSEL[i] = 0: ADC analog input channel-i is configured in single ended mode
DIFSEL[i] = 1: ADC analog input channel-i is configured in differential mode
Note: Software is allowed to write these bits only when the ADC is disabled (ADCAL=0, JADSTART=0, JADSTP=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Note: It is mandatory to keep cleared ADC1_DIFSEL[15] (connected to an internal single ended channel)
Bit 0 Reserved, must be kept at reset value.
12.5.21 ADC Calibration Factors (ADCx_CALFACT, x=1)
Address offset: 0xB4
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CALFACT_D[6:0] | ||||||
| rw | rw | rw | rw | rw | rw | rw | |||||||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | CALFACT_S[6:0] | ||||||
| rw | rw | rw | rw | rw | rw | rw | |||||||||
Bits 31:23 Reserved, must be kept at reset value.
Bits 22:16 CALFACT_D[6:0] : Calibration Factors in differential mode
These bits are written by hardware or by software.
Once a differential inputs calibration is complete, they are updated by hardware with the calibration factors.
Software can write these bits with a new calibration factor. If the new calibration factor is different from the current one stored into the analog ADC, it will then be applied once a new differential calibration is launched.
Note: Software is allowed to write these bits only when ADEN=1, ADSTART=0 and JADSTART=0 (ADC is enabled and no calibration is ongoing and no conversion is ongoing).
Bits 15:7 Reserved, must be kept at reset value.
Bits 6:0 CALFACT_S[6:0] : Calibration Factors In Single-Ended mode
These bits are written by hardware or by software.
Once a single-ended inputs calibration is complete, they are updated by hardware with the calibration factors.
Software can write these bits with a new calibration factor. If the new calibration factor is different from the current one stored into the analog ADC, it will then be applied once a new single-ended calibration is launched.
Note: Software is allowed to write these bits only when ADEN=1, ADSTART=0 and JADSTART=0 (ADC is enabled and no calibration is ongoing and no conversion is ongoing).
12.6 ADC common registers
These registers define the control and status registers common to master and slave ADCs:
- • One set of registers is related to ADC1 (master)
12.6.1 ADC Common status register (ADCx_CSR, x=1)
Address offset: 0x00 (this offset address is relative to the master ADC base address + 0x300)
Reset value: 0x0000 0000
This register provides an image of the status bits of the different ADCs. Nevertheless it is read-only and does not allow to clear the different status bits. Instead each status bit must be cleared by writing 0 to it in the corresponding ADCx_SR register.
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | JQOVF_ SLV | AWD3_ SLV | AWD2_ SLV | AWD1_ SLV | JEOS_ SLV | JEOC_ SLV | OVR_ SLV | EOS_ SLV | EOC_ SLV | EOSMP_ SLV | ADRDY_ SLV |
| Slave ADC | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | |||||
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Res. | Res. | Res. | Res. | Res. | JQOVF_ MST | AWD3_ MST | AWD2_ MST | AWD1_ MST | JEOS_ MST | JEOC_ MST | OVR_ MST | EOS_ MST | EOC_ MST | EOSMP_ MST | ADRDY_ MST |
| Master ADC | |||||||||||||||
| r | r | r | r | r | r | r | r | r | r | r | |||||
Bits 31:27 Reserved, must be kept at reset value.
Bit 26
JQOVF_
SLV
: Injected Context Queue Overflow flag of the slave ADC
This bit is a copy of the JQOVF bit in the corresponding ADCx_ISR register.
Bit 25
AWD3_
SLV
: Analog watchdog 3 flag of the slave ADC
This bit is a copy of the AWD3 bit in the corresponding ADCx_ISR register.
Bit 24
AWD2_
SLV
: Analog watchdog 2 flag of the slave ADC
This bit is a copy of the AWD2 bit in the corresponding ADCx_ISR register.
Bit 23
AWD1_
SLV
: Analog watchdog 1 flag of the slave ADC
This bit is a copy of the AWD1 bit in the corresponding ADCx_ISR register.
Bit 22
JEOS_
SLV
: End of injected sequence flag of the slave ADC
This bit is a copy of the JEOS bit in the corresponding ADCx_ISR register.
Bit 21
JEOC_
SLV
: End of injected conversion flag of the slave ADC
This bit is a copy of the JEOC bit in the corresponding ADCx_ISR register.
Bit 20
OVR_
SLV
: Overrun flag of the slave ADC
This bit is a copy of the OVR bit in the corresponding ADCx_ISR register.
Bit 19
EOS_
SLV
: End of regular sequence flag of the slave ADC
This bit is a copy of the EOS bit in the corresponding ADCx_ISR register.
Bit 18
EOC_
SLV
: End of regular conversion of the slave ADC
This bit is a copy of the EOC bit in the corresponding ADCx_ISR register.
- Bit 17
EOSMP_SLV
: End of Sampling phase flag of the slave ADC
This bit is a copy of the EOSMP2 bit in the corresponding ADCx_ISR register. - Bit 16
ADRDY_SLV
: Slave ADC ready
This bit is a copy of the ADRDY bit in the corresponding ADCx_ISR register. - Bits 15:11 Reserved, must be kept at reset value.
- Bit 10
JQOVF_MST
: Injected Context Queue Overflow flag of the master ADC
This bit is a copy of the JQOVF bit in the corresponding ADCx_ISR register. - Bit 9
AWD3_MST
: Analog watchdog 3 flag of the master ADC
This bit is a copy of the AWD3 bit in the corresponding ADCx_ISR register. - Bit 8
AWD2_MST
: Analog watchdog 2 flag of the master ADC
This bit is a copy of the AWD2 bit in the corresponding ADCx_ISR register. - Bit 7
AWD1_MST
: Analog watchdog 1 flag of the master ADC
This bit is a copy of the AWD1 bit in the corresponding ADCx_ISR register. - Bit 6
JEOS_MST
: End of injected sequence flag of the master ADC
This bit is a copy of the JEOS bit in the corresponding ADCx_ISR register. - Bit 5
JEOC_MST
: End of injected conversion flag of the master ADC
This bit is a copy of the JEOC bit in the corresponding ADCx_ISR register. - Bit 4
OVR_MST
: Overrun flag of the master ADC
This bit is a copy of the OVR bit in the corresponding ADCx_ISR register. - Bit 3
EOS_MST
: End of regular sequence flag of the master ADC
This bit is a copy of the EOS bit in the corresponding ADCx_ISR register. - Bit 2
EOC_MST
: End of regular conversion of the master ADC
This bit is a copy of the EOC bit in the corresponding ADCx_ISR register. - Bit 1
EOSMP_MST
: End of Sampling phase flag of the master ADC
This bit is a copy of the EOSMP bit in the corresponding ADCx_ISR register. - Bit 0
ADRDY_MST
: Master ADC ready
This bit is a copy of the ADRDY bit in the corresponding ADCx_ISR register.
12.6.2 ADC common control register (ADCx_CCR, x=1)
Address offset: 0x08 (this offset address is relative to the master ADC base address + 0x300)
Reset value: 0x0000 0000
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | VBAT EN | TS EN | VREF EN | Res. | Res. | Res. | Res. | CKMODE[1:0] | |
| rw | rw | rw | rw | rw |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. |
Bits 31:25 Reserved, must be kept at reset value.
Bit 24 VBATEN : V BAT enable
This bit is set and cleared by software to enable/disable the V BAT channel.
0: V BAT channel disabled
1: V BAT channel enabled
Note: Software is allowed to write this bit only when the ADCs are disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Bit 23 TSEN : Temperature sensor enable
This bit is set and cleared by software to enable/disable the temperature sensor channel.
0: Temperature sensor channel disabled
1: Temperature sensor channel enabled
Note: Software is allowed to write this bit only when the ADCs are disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Bit 22 VREFEN : V REFINT enable
This bit is set and cleared by software to enable/disable the V REFINT channel.
0: V REFINT channel disabled
1: V REFINT channel enabled
Note: Software is allowed to write this bit only when the ADCs are disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Bits 21:18 Reserved, must be kept at reset value.
Bits 17:16 CKMODE[1:0] : ADC clock mode
These bits are set and cleared by software to define the ADC clock scheme (which is common to both master and slave ADCs):
00: CK_ADCx (x=123) (Asynchronous clock mode), generated at product level (refer to Section 7: Reset and clock control (RCC) )
01: HCLK/1 (Synchronous clock mode). This configuration must be enabled only if the AHB clock prescaler is set to 1 (HPRE[3:0] = 0xxx in RCC_CFGR register) and if the system clock has a 50% duty cycle.
10: HCLK/2 (Synchronous clock mode)
11: HCLK/4 (Synchronous clock mode)
In all synchronous clock modes, there is no jitter in the delay from a timer trigger to the start of a conversion.
Note: Software is allowed to write these bits only when the ADCs are disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).
Bits 15:0 Reserved, must be kept at reset value.
12.7 ADC register map
The following table summarizes the ADC registers.
Table 42. ADC global register map (1)
| Offset | Register |
|---|---|
| 0x000 - 0x04C | Master ADC1 |
| 0x050 - 0x0FC | Reserved |
| 0x100 - 0x14C | Reserved |
| 0x118 - 0x1FC | Reserved |
| 0x200 - 0x24C | Reserved |
| 0x250 - 0x2FC | Reserved |
| 0x300 - 0x308 | Master and slave ADCs common registers (ADC1) |
1. The gray color is used for reserved memory addresses.
Table 43. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC, x=1)
| Offset | Register name reset value | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | ADCx_ISR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | JQOVF | AWD3 | AWD2 | AWD1 | JEOS | JEOC | OVR | EOS | EOC | EOSMP | ADRDY |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||||||
| 0x04 | ADCx_IER | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | JQOVFIE | AWD3IE | AWD2IE | AWD1IE | JEOSIE | JEOCIE | OVRIE | EOSIE | EOCIE | EOSMPIE | ADRDYIE |
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Table 43. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC, x=1) (continued)
| Offset | Register name reset value | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x08 | ADCx_CR | ADCAL | ADCALDIF | ADVREGEN[1:0] | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | JADSTP | ADSTP | JADSTART | ADSTART | ADDIS | ADEN | |
| Reset value | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||||||
| 0x0C | ADCx_CFGR | Res. | AWD1CH[4:0] | JAUTO | JAWD1EN | AWD1EN | AWD1SGL | JQM | JDISCEN | DISCNUM [2:0] | DISCEN | Res. | AUTDLY | CONT | OVRMOD | EXTEN[1:0] | EXTSEL [3:0] | ALIGN | RES [1:0] | Res. | DMACFG | DMAEN | |||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||
| 0x10 | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x14 | ADCx_SMPR1 | Res. | Res. | SMP9 [2:0] | SMP8 [2:0] | SMP7 [2:0] | SMP6 [2:0] | SMP5 [2:0] | SMP4 [2:0] | SMP3 [2:0] | SMP2 [2:0] | SMP1 [2:0] | Res. | Res. | |||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
| 0x18 | ADCx_SMPR2 | Res. | Res. | Res. | Res. | SMP18 [2:0] | SMP17 [2:0] | SMP16 [2:0] | SMP15 [2:0] | SMP14 [2:0] | SMP13 [2:0] | SMP12 [2:0] | SMP11 [2:0] | SMP10 [2:0] | |||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
| 0x1C | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x20 | ADCx_TR1 | Res. | Res. | Res. | Res. | HT1[11:0] | Res. | Res. | Res. | Res. | LT1[11:0] | ||||||||||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||
| 0x24 | ADCx_TR2 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | HT2[7:0] | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LT2[7:0] | ||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x28 | ADCx_TR3 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | HT3[7:0] | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | LT3[7:0] | ||||||||||||||
| Reset value | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x2C | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x30 | ADCx_SQR1 | Res. | Res. | Res. | SQ4[4:0] | Res. | SQ3[4:0] | Res. | SQ2[4:0] | Res. | SQ1[4:0] | Res. | L[3:0] | ||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||
| 0x34 | ADCx_SQR2 | Res. | Res. | Res. | SQ9[4:0] | Res. | SQ8[4:0] | Res. | SQ7[4:0] | Res. | SQ6[4:0] | Res. | SQ5[4:0] | ||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||
| 0x38 | ADCx_SQR3 | Res. | Res. | Res. | SQ14[4:0] | Res. | SQ13[4:0] | Res. | SQ12[4:0] | Res. | SQ11[4:0] | Res. | SQ10[4:0] | ||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||
| 0x3C | ADCx_SQR4 | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | SQ16[4:0] | Res. | SQ15[4:0] | Res. | Res. | ||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||||||
| 0x40 | ADCx_DR | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | regular RDATA[15:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x44-0x48 | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x4C | ADCx_JSQR | Res. | JSQ4[4:0] | Res. | JSQ3[4:0] | Res. | JSQ2[4:0] | Res. | JSQ1[4:0] | JEXTEN[1:0] | JEXTSEL [3:0] | JL[1:0] | |||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||
| 0x50-0x5C | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x60 | ADCx_OFR1 | OFFSET1_EN | OFFSET1_CH[4:0] | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | Res. | OFFSET1[11:0] | |||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
Table 43. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC, x=1) (continued)
| Offset | Register name reset value | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x64 | ADCx_OFR2 | OFFSET2_EN | OFFSET2_CH[4:0] | Res. | OFFSET2[11:0] | ||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
| 0x68 | ADCx_OFR3 | OFFSET3_EN | OFFSET3_CH[4:0] | Res. | OFFSET3[11:0] | ||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
| 0x6C | ADCx_OFR4 | OFFSET4_EN | OFFSET4_CH[4:0] | Res. | OFFSET4[11:0] | ||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
| 0x70-0x7C | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x80 | ADCx_JDR1 | Res. | JDATA1[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x84 | ADCx_JDR2 | Res. | JDATA2[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x88 | ADCx_JDR3 | Res. | JDATA3[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x8C | ADCx_JDR4 | Res. | JDATA4[15:0] | ||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
| 0x8C-0x9C | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0xA0 | ADCx_AWD2CR | Res. | AWD2CH[18:1] | Res. | |||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
| 0xA4 | ADCx_AWD3CR | Res. | AWD3CH[18:1] | Res. | |||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
| 0xA8-0xAC | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0xB0 | ADCx_DIFSEL | Res. | DIFSEL[18:1] | Res. | |||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||
| 0xB4 | ADCx_CALFACT | Res. | CALFACT_D[6:0] | Res. | CALFACT_S[6:0] | ||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||
Table 44. ADC register map and reset values (master and slave ADC common registers) offset =0x300, x=1
| Offset | Register name reset value | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | ADCx_CSR | Res. | JQOVF_SLV | AWD3_SLV | Res. | JQOVF_MST | AWD3_MST | AWD2_MST | AWD1_MST | JEOS_MST | JEOC_MST | OVR_MST | EOS_MST | EOC_MST | EOSMP_MST | ADRDY_MST | |||||||||||||||||
| Reset value | 0 | 0 | 0 | master ADC1 | |||||||||||||||||||||||||||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||||||||
Table 44. ADC register map and reset values (master and slave ADC common registers) offset =0x300, x=1) (continued)
| Offset | Register name reset value | 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x04 | Reserved | Res. | |||||||||||||||||||||||||||||||
| 0x08 | ADCx_CCR | Res. | |||||||||||||||||||||||||||||||
| Reset value | Res. | Res. | Res. | Res. | Res. | Res. | Res. | VBATEN | TSEN | VREFEN | Res. | Res. | Res. | Res. | CKMODE[1:0] | MDMA[1:0] | DMACFG | Res. | DELAY[3:0] | Res. | Res. | Res. | Res. | ||||||||||
| 0x0C | ADCx_CDR | RDATA_SLV[15:0] | |||||||||||||||||||||||||||||||
| Reset value | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Refer to Section 2.2 on page 40 for the register boundary addresses.