25. Analog-to-digital converters (ADC)

25.1 Introduction

This section describes the ADC implementation:

Each ADC consists of a 16-bit successive approximation analog-to-digital converter.

Each ADC has up to 20 multiplexed channels. A/D conversion of the various channels can be performed in single, continuous, scan or discontinuous mode. The result of the ADC is stored in a left-aligned or right-aligned 32-bit data register.

The ADCs are mapped on the AHB bus to allow fast data handling.

The analog watchdog features allow the application to detect if the input voltage goes outside the user-defined high or low thresholds.

A built-in hardware oversampler allows to improve analog performances while off-loading the related computational burden from the CPU.

An efficient low-power mode is implemented to allow very low consumption at low frequency.

25.2 ADC main features

Figure 135 shows the block diagram of one ADC.

25.3 ADC implementation

Table 204. ADC features

ADC modes/featuresADC1ADC2ADC3
Dual modeX (coupled together)-
DFSDM interfaceXXX
Extended sample time option (SMPPLUS control)---
LDO voltage regulator statusX (1)X (1)X (1)

1. Available only on devices revision V.

25.4 ADC functional description

25.4.1 ADC block diagram

Figure 135 shows the ADC block diagram and Table 205 gives the ADC pin description.

Figure 135. ADC block diagram

Figure 135. ADC block diagram. This is a detailed functional block diagram of the ADC. At the top, the 'Bias & Ref' block receives 'Analog supply (VDDA)' and 'VREF+' inputs. Below it, the 'SAR ADC' block receives 'V_IN' and 'CONVERTED DATA' feedback. The 'Input selection & scan control' block connects to 'ADCx_INPy' and 'ADCx_INNy' pins and provides 'V_INPy' and 'V_INNy' to the SAR ADC. The 'Start & Stop Control' block includes 'S/W trigger' and 'h/w trigger' (with 'EXTEN[1:0]' and 'EXTSEL[4:0]') inputs. The 'Oversampler' block is connected to the SAR ADC and has various configuration registers. The 'AHB interface' block connects to 'ADRDY-EOSMP', 'EOC', 'EOS', 'OVR', 'JEOC', 'JEOS', 'JQOVF', and 'AWDx' signals, and provides 'adc_it', 'adc_dma', and 'adc_dat[15:0]' outputs. The 'Analog watchdog 1,2,3' block includes 'AWD1', 'AWD2', and 'AWD3' comparators and associated registers. The diagram also shows various internal signals like 'BOOST', 'DEEPPWD', 'ADVREGEN', 'REG.', 'ADEN/ADDIS', 'ADCAL', 'ADCALDIF', 'SMPx[2:0]', 'JL[1:0]', 'JSQx', 'L[3:0]', 'SQx', 'CONT', 'DIFSEL[19:0]', 'ADCTLY', 'ADSTART', 'ADSTP', 'JADSTART', 'JADSTP', 'JDISCEN', 'JDISCNUM[2:0]', 'JQDIS', 'JQM', 'AWD1EN', 'JAWD1EN', 'AWD1SGL', 'AWD1CH[4:0]', 'LTR1[25:0]', 'HTR1[25:0]', 'AWD2CH[19:0]', 'LTR2[25:0]', 'HTR2[25:0]', 'AWD3CH[19:0]', 'LTR3[25:0]', 'HTR3[25:0]', 'OVRRMOD', 'ALIGN', 'RES[2:0]', 'OFFSETy[25:0]', 'OFFSETy_CH[4:0]', 'SSATE', 'ROVSM', 'TROVS', 'OVSS[3:0]', 'OSVR[9:0]', 'JOVSE', 'ROVSE', 'RSHIFT4.1', 'LSHIFT[3:0]', 'DMNGT[1:0]', 'DAMDF[1:0]', 'adc_ker_ck', 'adc_hclk', and 'adc_sclk'. The diagram is labeled 'MSv62479V2' at the bottom right.
Figure 135. ADC block diagram. This is a detailed functional block diagram of the ADC. At the top, the 'Bias & Ref' block receives 'Analog supply (VDDA)' and 'VREF+' inputs. Below it, the 'SAR ADC' block receives 'V_IN' and 'CONVERTED DATA' feedback. The 'Input selection & scan control' block connects to 'ADCx_INPy' and 'ADCx_INNy' pins and provides 'V_INPy' and 'V_INNy' to the SAR ADC. The 'Start & Stop Control' block includes 'S/W trigger' and 'h/w trigger' (with 'EXTEN[1:0]' and 'EXTSEL[4:0]') inputs. The 'Oversampler' block is connected to the SAR ADC and has various configuration registers. The 'AHB interface' block connects to 'ADRDY-EOSMP', 'EOC', 'EOS', 'OVR', 'JEOC', 'JEOS', 'JQOVF', and 'AWDx' signals, and provides 'adc_it', 'adc_dma', and 'adc_dat[15:0]' outputs. The 'Analog watchdog 1,2,3' block includes 'AWD1', 'AWD2', and 'AWD3' comparators and associated registers. The diagram also shows various internal signals like 'BOOST', 'DEEPPWD', 'ADVREGEN', 'REG.', 'ADEN/ADDIS', 'ADCAL', 'ADCALDIF', 'SMPx[2:0]', 'JL[1:0]', 'JSQx', 'L[3:0]', 'SQx', 'CONT', 'DIFSEL[19:0]', 'ADCTLY', 'ADSTART', 'ADSTP', 'JADSTART', 'JADSTP', 'JDISCEN', 'JDISCNUM[2:0]', 'JQDIS', 'JQM', 'AWD1EN', 'JAWD1EN', 'AWD1SGL', 'AWD1CH[4:0]', 'LTR1[25:0]', 'HTR1[25:0]', 'AWD2CH[19:0]', 'LTR2[25:0]', 'HTR2[25:0]', 'AWD3CH[19:0]', 'LTR3[25:0]', 'HTR3[25:0]', 'OVRRMOD', 'ALIGN', 'RES[2:0]', 'OFFSETy[25:0]', 'OFFSETy_CH[4:0]', 'SSATE', 'ROVSM', 'TROVS', 'OVSS[3:0]', 'OSVR[9:0]', 'JOVSE', 'ROVSE', 'RSHIFT4.1', 'LSHIFT[3:0]', 'DMNGT[1:0]', 'DAMDF[1:0]', 'adc_ker_ck', 'adc_hclk', and 'adc_sclk'. The diagram is labeled 'MSv62479V2' at the bottom right.
  1. 1. adc_sclk is available only on devices revision V.

25.4.2 ADC pins and internal signals

Table 205. ADC input/output pins

NameSignal typeDescription
VREF+Input, analog reference positiveThe higher/positive reference voltage for the ADC.
VDDAInput, analog supplyAnalog power supply equal V DDA
VREF-Input, analog reference negativeThe lower/negative reference voltage for the ADC.
VSSAInput, analog supply groundGround for analog power supply equal to V SS
ADCx_INPyExternal analog inputsUp to 20 analog input channels (x = ADC number= 1 to 3):
– ADCx_INP[0:5] fast channels
– ADCx_INP[6:19] slow channels
ADCx_INNyUp to 20 analog input channels (x = ADC number= 1 to 3):
– ADCx_INN[0:5] fast channels
– ADCx_INN[6:19] slow channels

Table 206. ADC internal input/output signals

Internal signal nameSignal typeDescription
V INP [y]Analog inputsPositive input analog channels for each ADC, connected either to ADCx_INPi external channels or to internal channels.
V INN [y]Analog inputsNegative input analog channels for each ADC, connected either to V REF- or to ADCx_INNi external channels
adc_ext_trgyInputsUp to 21 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.
adc_jext_trgyInputsUp to 21 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.
adc_awd1
adc_awd2
adc_awd3
OutputsInternal analog watchdog output signal connected to on-chip timers. (x = Analog watchdog number 1,2,3)
adc_itOutputADC interrupt
adc_hclkInputAHB clock
adc_sclkInputADC synchronous clock input from RCC
adc_ker_ck_inputInputADC kernel clock input from RCC
adc_dmaOutputADC DMA requests
adc_dat[15:0]OutputsADC data outputs

Table 207. ADC interconnection

Signal nameSource/destination
ADC3 V INP [18]V SENSE (output voltage from internal temperature sensor)
ADC3 V INP [19]V REFINT (output voltage from internal reference voltage)
ADC3 V INP [17]V BAT /4 (external battery voltage supply voltage)
ADC2 V INP [16]dac1_out1
ADC2 V INP [17]dac1_out2
adc_dat[15:0]dfsdm_dat_adc[15:0]

25.4.3 ADC clocks

Dual clock domain architecture (revision V devices)

The dual clock-domain architecture means that the ADC clock is independent from the AHB bus clock.

The input clock is the same for all ADCs and can be selected between two different clock sources (see Figure 136: ADC Clock scheme ):

  1. 1. The ADC clock can be a specific clock source, named adc_ker_ck_input which is independent and asynchronous with the AHB clock.

It can be configured in the RCC (refer to RCC Section for more information on how to generate the ADC clock ( adc_ker_ck_input ) dedicated clock).

To select this scheme, CKMODE[1:0] bits of the ADCx_CCR register must be reset.

  1. 2. The ADC clock can be derived from the system clock or system clock divided by two ( adc_sclk ). In this mode, a programmable divider factor can be selected (/1, 2 or 4 according to bits CKMODE[1:0]).

To select this scheme, CKMODE[1:0] bits of the ADCx_CCR register must be different from “00”. adc_sclk is equal to sys_ck when HPRE is set to 0, otherwise it corresponds to sys_ck/2 .

In both case, the clock divider factor of 2 is applied to the clock provided to the ADC analog block ( f adc_ker_ck ).

Option 1) 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, 10, 12, 16, 32, 64, 128, 256; using the prescaler configured with bits PRESC[3:0] in the ADCx_CCR register.

Option 2) has the advantage of using the system without additional PLL. In addition, when adc_sclk is twice faster than the adc_hclk clock, the latency between the trigger and the start of conversion is fixed. 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).

The clock configured through CKMODE[1:0] bits must be compliant with the analog ADC operating frequency specified in the product datasheet.

Note: adc_sclk is the system clock or system clock divided by two: when the AHB prescaler is set to 1 (HPRE[3:0] = 0XXX in RCC_CFGR register), adc_sclk is equal to sys_ck, otherwise adc_sclk corresponds to sys_ck/2.

Figure 136. ADC Clock scheme

Figure 136. ADC Clock scheme diagram showing the clock sources and prescalers for ADC1, ADC2, and ADC3. The diagram shows the RCC (Reset and clock controller) providing ad_hclk and ad_sclk to the ADCs. The ad_sclk is derived from the ad_hclk through a prescaler (/1 or /2 or /4) controlled by CKMODE[1:0] bits of the ADCx_CCR register. The ad_hclk is also derived from the ad_hclk through a prescaler (/1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256) controlled by PREC[3:0] bits of the ADCx_CCR register. The ad_sclk is then divided by 2 to provide the ad_hclk to the Analog ADC1 or ADC3 (master) and Analog ADC2 (slave).

The diagram illustrates the clock architecture for ADC1, ADC2, and ADC3. On the left, the RCC (Reset and clock controller) provides two primary clock signals: ad_hclk and ad_sclk . The ad_hclk signal enters the ADC block and is distributed to the AHB interface and a prescaler block. The ad_sclk signal is derived from the ad_hclk through a prescaler block labeled /1 or /2 or /4 , which is controlled by Bits CKMODE[1:0] of ADCx_CCR . The ad_hclk signal also enters a prescaler block labeled /1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256 , controlled by Bits PREC[3:0] of ADCx_CCR . The outputs of these two prescalers are combined in a block labeled Others , which is controlled by Bits CKMODE[1:0] of ADCx_CCR . The output of the Others block is then divided by 2 (labeled /2 ) to produce the final clock signals: F adc_hclk x 2 for Analog ADC1 or ADC3 (master) and F adc_hclk for Analog ADC2 (slave) . The diagram is labeled with the code MSV62429V3 in the bottom right corner.

Figure 136. ADC Clock scheme diagram showing the clock sources and prescalers for ADC1, ADC2, and ADC3. The diagram shows the RCC (Reset and clock controller) providing ad_hclk and ad_sclk to the ADCs. The ad_sclk is derived from the ad_hclk through a prescaler (/1 or /2 or /4) controlled by CKMODE[1:0] bits of the ADCx_CCR register. The ad_hclk is also derived from the ad_hclk through a prescaler (/1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256) controlled by PREC[3:0] bits of the ADCx_CCR register. The ad_sclk is then divided by 2 to provide the ad_hclk to the Analog ADC1 or ADC3 (master) and Analog ADC2 (slave).
  1. 1. Refer to the RCC section to see how ad_hclk and ad_hclk_input can be generated.

Dual clock domain architecture (revision Y devices)

The dual clock-domain architecture means that the ADC clock is independent from the AHB bus clock.

The input clock is the same for all the ADCs and can be selected between two different clock sources (see Figure 137: ADC clock scheme ):

  1. 1. The ADC clock can be a specific clock source, named ad_hclk_input which is independent and asynchronous with the AHB clock.
    It can be configured in the RCC (refer to RCC Section for more information on how to generate the ADC clock ( ad_hclk_input ) dedicated clock).
    To select this scheme, CKMODE[1:0] bits of the ADCx_CCR register must be reset.
  2. 2. 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, CKMODE[1:0] bits of the ADCx_CCR register must be different from “00”.

Note: For option 2), a prescaling factor of 1 (CKMODE[1:0]=01) can be used only if the AHB prescaler is set to 1 (HPRE[3:0] = 0XXX in RCC_CFGR register, corresponding to a clock duty cycle of 50 %).

Option 1) 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, 10, 12, 16, 32, 64, 128, 256; using the prescaler configured with bits PRESC[3:0] in the ADCx_CCR register.

Option 2) 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).

The clock configured through CKMODE[1:0] bits must be compliant with the operating frequency specified in the product datasheet.

Figure 137. ADC clock scheme

Figure 137. ADC clock scheme diagram showing the internal clock architecture of the ADC. The RCC (Reset and clock controller) provides adc_hclk and adc_ker_ck_input. The ADC1, ADC2 or ADC3 block contains an AHB interface, Bits CKMODE[1:0] of ADCx_CCR, a prescaler (/1 or /2 or /4), and a multiplexer. The prescaler is controlled by Bits PREC[3:0] of ADCx_CCR. The multiplexer selects between the prescaler output and 'Others' (00). The output of the multiplexer is F_adc_ker_ck, which is connected to Analog ADC1 or ADC3 (master) and Analog ADC2 (slave).

The diagram illustrates the internal clock architecture of the ADC. On the left, the RCC (Reset and clock controller) provides two clock inputs: adc_hclk and adc_ker_ck_input . The adc_hclk is connected to the AHB interface within the ADC1, ADC2 or ADC3 block. The adc_ker_ck_input is connected to a prescaler block. The prescaler has two sets of inputs: Bits CKMODE[1:0] of ADCx_CCR and Bits PREC[3:0] of ADCx_CCR . The first set of inputs selects between /1 or /2 or /4 , and the second set selects between /1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256 . The output of the prescaler is connected to a multiplexer. The multiplexer also receives inputs from Others (00) and Bits CKMODE[1:0] of ADCx_CCR . The output of the multiplexer is F_adc_ker_ck , which is then connected to the Analog ADC1 or ADC3 (master) and Analog ADC2 (slave).

Figure 137. ADC clock scheme diagram showing the internal clock architecture of the ADC. The RCC (Reset and clock controller) provides adc_hclk and adc_ker_ck_input. The ADC1, ADC2 or ADC3 block contains an AHB interface, Bits CKMODE[1:0] of ADCx_CCR, a prescaler (/1 or /2 or /4), and a multiplexer. The prescaler is controlled by Bits PREC[3:0] of ADCx_CCR. The multiplexer selects between the prescaler output and 'Others' (00). The output of the multiplexer is F_adc_ker_ck, which is connected to Analog ADC1 or ADC3 (master) and Analog ADC2 (slave).
  1. 1. Refer to the RCC section to see how adc_hclk and adc_ker_ck_input 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:

Constraints between ADC clocks

When several ADC interfaces are used simultaneously, it is mandatory to use the same clock source from the RCC block without prescaler ratio, for all ADC interfaces.

BOOST control

The ADC Boost mode can be controlled through the BOOST bit in the ADC_CR register.

This bit must be set according to the ADC clock setting. Refer to the ADC_CR register description.

25.4.4 ADC1/2/3 connectivity

ADC1 and ADC2 are tightly coupled and share some external channels as described in the following figures.

ADC3 is instantiated separately, but some inputs are shared with ADC1 and ADC2.

Figure 138. ADC1 connectivity

Schematic diagram of ADC1 connectivity showing 20 differential input channels (INP0 to INP19) connected to a SAR ADC1 block. The diagram includes internal VSSA pins, channel selection logic, and reference voltage inputs (VREF+, VREF-).

The diagram illustrates the internal connectivity of the ADC1 block. On the left, 20 differential input pairs are shown, labeled from ADC12_INP0/ADC12_INN1 to ADC12_INP19/ADC12_INN18. These inputs are connected to a central column of pins. The pins are organized into two groups: V_INP[0] through V_INP[19] and V_INN[0] through V_INN[19]. Pins V_INN[0] through V_INN[5] are labeled as 'Fast channel', while V_INN[6] through V_INN[19] are labeled as 'Slow channel'. Several VSSA pins are present between the input pins. On the right, a 'Channel selection' block connects the input pins to a 'SAR ADC1' block. The SAR ADC1 block has inputs for V_INP, V_INN, V_REF+, and V_REF-. The diagram is identified by the code MSv41018V3 in the bottom right corner.

Schematic diagram of ADC1 connectivity showing 20 differential input channels (INP0 to INP19) connected to a SAR ADC1 block. The diagram includes internal VSSA pins, channel selection logic, and reference voltage inputs (VREF+, VREF-).

1. ADCx_INNy signal can only be used when the corresponding ADC input channel is configured as differential mode.

Figure 139. ADC2 connectivity

Schematic diagram of ADC2 connectivity showing 20 channels (0-19) with their respective input pins (INP and INN) connected to a SAR ADC2 block. The diagram includes labels for VSSA, VREF+, VREF-, and channel types (Fast channel, Slow channel).

The diagram illustrates the internal connectivity of the ADC2 block. It features 20 input channels, each consisting of a positive input (INP) and a negative input (INN). The channels are categorized as follows:

External pins are connected to the internal INP and INN pins as follows:

Reference and supply pins are connected as follows:

The SAR ADC2 block performs the conversion based on the differential voltage between V_INP and V_INN for each selected channel. A 'Channel selection' input is used to select the active channel.

Schematic diagram of ADC2 connectivity showing 20 channels (0-19) with their respective input pins (INP and INN) connected to a SAR ADC2 block. The diagram includes labels for VSSA, VREF+, VREF-, and channel types (Fast channel, Slow channel).

MSV41019V4

  1. 1. ADCx_INNy signal can only be used when the corresponding ADC input channel is configured as differential mode.

Figure 140. ADC3 connectivity

Schematic diagram of ADC3 connectivity showing 20 channels (0-19) with their respective V_INP and V_INN pins, channel types (Fast or Slow), and external connections to a SAR ADC3 block. The diagram includes various voltage sources like VSSA, VBAT/4, VSENSE, and VREFINT connected to the V_INN pins.

The diagram illustrates the internal connectivity of the ADC3 module. It features 20 channels, each with a positive input (V_INP) and a negative input (V_INN). The channels are categorized as 'Fast channel' or 'Slow channel'. The V_INP pins are connected to various external pins (e.g., ADC3_INP0 through ADC3_INP19), while the V_INN pins are connected to internal voltage references or VSSA. The V_INP and V_INN pins are then connected to a SAR ADC3 block, which also receives V_REF+ and V_REF- inputs. A 'Channel selection' block is shown at the top right, indicating the selection of channels for conversion.

ChannelV_INP PinV_INN PinChannel Type
0ADC3_INP0V_INN[0]Fast channel
1ADC3_INP1V_INN[1]Fast channel
2ADC3_INP2V_INN[2]Fast channel
3ADC3_INP3V_INN[3]Fast channel
4ADC3_INP4V_INN[4]Fast channel
5ADC3_INP5V_INN[5]Fast channel
6ADC3_INP6V_INN[6]Slow channel
7ADC3_INP7V_INN[7]Slow channel
8ADC3_INP8V_INN[8]Slow channel
9ADC3_INP9V_INN[9]Slow channel
10ADC123_INP10V_INN[10]Slow channel
11ADC123_INP11V_INN[11]Slow channel
12ADC123_INP12V_INN[12]Slow channel
13ADC3_INP13V_INN[13]Slow channel
14ADC3_INP14V_INN[14]Slow channel
15ADC3_INP15V_INN[15]Slow channel
16ADC3_INP16V_INN[16]Slow channel
17V_INN[17]Slow channel
18V_INN[18]Slow channel
19V_INN[19]Slow channel

MSv41020V4

Schematic diagram of ADC3 connectivity showing 20 channels (0-19) with their respective V_INP and V_INN pins, channel types (Fast or Slow), and external connections to a SAR ADC3 block. The diagram includes various voltage sources like VSSA, VBAT/4, VSENSE, and VREFINT connected to the V_INN pins.
  1. 1. ADCx_INNy signal can only be used when the corresponding ADC input channel is configured as differential mode.

25.4.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:

The AHB slave interface does not support split/retry requests, and never generates AHB errors.

25.4.6 ADC deep-power-down mode (DEEPPWD) and ADC voltage regulator (ADVREGEN)

By default, the ADC is in deep-power-down mode where its supply is internally switched off to reduce the leakage currents (the reset state of bit DEEPPWD is 1 in the ADC_CR register).

To start ADC operations, it is first needed to exit deep-power-down mode by clearing bit DEEPPWD=0.

Then, it is mandatory to enable the ADC internal voltage regulator by setting the bit ADVREGEN=1 into ADC_CR register. 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 delay must be implemented by software.

The LDO status can be verified by checking the LDORDY bit in ADC_ISR register (refer to Section 25.3: ADC implementation for the availability of the LDO regulator status).

For the startup time of the ADC voltage regulator, refer to device datasheet for T ADCVREG_STUP parameter.

After ADC operations are complete, the ADC can be disabled (ADEN=0). It is possible to save power by also disabling the ADC voltage regulator. This is done by writing bit ADVREGEN=0.

Then, to save more power by reducing the leakage currents, it is also possible to re-enter in ADC deep-power-down mode by setting bit DEEPPWD=1 into ADC_CR register. This is particularly interesting before entering Stop mode.

Note: Writing DEEPPWD=1 automatically disables the ADC voltage regulator and bit ADVREGEN is automatically cleared.

Note: When the internal voltage regulator is disabled (ADVREGEN=0), the internal analog calibration is kept.

In ADC deep-power-down mode (DEEPPWD=1), the internal analog calibration is lost and it is necessary to either relaunch a calibration or apply again the calibration factor which was previously saved (refer to Section 25.4.8: Calibration (ADCAL, ADCALDIF, ADCALLIN, ADC_CALFACT) ).

25.4.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[19:0] in the ADC_DIFSEL register. This configuration must be written while the ADC is disabled (ADEN=0).

In single-ended input mode, the analog voltage to be converted for channel “i” is the difference between the external voltage \( V_{INP[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 \( V_{INP[i]} \) (positive input) and \( V_{INN[i]} \) (negative input).

The output data for the differential mode is an unsigned data. When \( V_{INP[i]} \) equals \( V_{REF+} \) , \( V_{INN[i]} \) equals \( V_{REF-} \) and the output data is 0x0000 (16-bit resolution mode). When \( V_{INP[i]} \) equals \( V_{REF+} \) , \( V_{INN[i]} \) equals \( V_{REF-} \) and the output data is 0xFFFF.

\[ \text{Converted value} = \frac{\text{ADC\_Full\_Scale}}{2} \times \left[ 1 + \frac{V_{INP} - V_{INN}}{V_{REF+}} \right] \]

When ADC is configured as differential mode, both input should be biased at \( V_{REF+} / 2 \) voltage.

The input signal are supposed to be differential (common mode voltage should be fixed).

For a complete description of how the input channels are connected for each ADC, refer to Section 25.4.4: ADC1/2/3 connectivity .

Caution: When configuring the channel “i” in differential input mode, its negative input voltage is connected to \( V_{INN[i]} \) . As a consequence, channel “i+n”, which is connected to \( V_{INN[i]} \) , should not be converted at same time by different ADCs. Some channels are shared between ADC1/ADC2: this can make the channel on the other ADC unusable.

25.4.8 Calibration (ADCAL, ADCALDIF, ADCALLIN, ADC_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 11-bits of offset or 160-bits of linearity 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.

The calibration is preliminary to any ADC operation. It removes the systematic errors which may vary from chip to chip and allows to compensate offset and linearity deviation.

The calibration factor for the offset to be applied for single-ended input conversions is different from the factor to be applied for differential input conversions:

The linearity correction must be done once only, regardless of single / differential configuration.

The calibration is then initiated by software by setting bit ADCAL=1. It can be initiated only 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[10:0] or CALFACT_D[10:0] of ADC_CALFACT register (depending on single-ended or differential input calibration). The 160-bit linearity calibration factor can be accessed using the ADC_CALFACT2 register with ADEN set to 1.

The internal analog calibration is kept if the ADC is disabled (ADEN=0). However, if the ADC is disabled for extended periods, it is recommended that a new offset calibration cycle is run before enabling again the ADC.

The internal analog calibration is lost each time the power of the ADC is removed (example, when the product enters in STANDBY or VBAT mode). In this case, to avoid spending time recalibrating the ADC, it is possible to re-write the calibration factor into the ADC_CALFACT and ADC_CALFACT2 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. It is recommended to recalibrate when V REF+ voltage changed more than 10%.

Refer to the datasheets for the clock cycle requirement for both linear and offset calibration.

Software procedure to calibrate the ADC

  1. 1. Ensure DEEPPWD=0, ADVREGEN=1 and verify that the ADC voltage regulator startup time has elapsed by checking the LDORDY bit in ADC_ISR (refer to Section 25.3: ADC implementation for the availability of the LDO regulator status).
  2. 2. Ensure that ADEN=0.
  3. 3. Select the input mode for this calibration by setting ADCALDIF=0 (Single-ended input) or ADCALDIF=1 (Differential input). Select if Linearity calibration enable or not by ADCALLIN=1(enabled) or ADCALLIN=0(disabled).
  4. 4. Set ADCAL=1.
  5. 5. Wait until ADCAL=0.
  6. 6. The offset calibration factor can be read from ADC_CALFACT register.
  7. 7. The linearity calibration factor can be read from ADC_CALFACT2 register, following the procedure described in Section : Linearity calibration reading procedure (ADEN must be set to 1 prior to accessing ADC_CALFACT2 register).

Figure 141. ADC calibration

Timing diagram for ADC calibration showing signal transitions and state changes for ADCALDIF, ADCALLIN, ADCAL, ADC State, CALFACT_x[10:0], and LINCALFACT [159:0]. Software rising edge symbol Hardware falling edge symbol

The diagram illustrates the timing for ADC calibration. It shows the following signals and states over time:

Legend:
by S/W
by H/W
Indicative timings \( t_{CAB} \)

MSv41021V1

Timing diagram for ADC calibration showing signal transitions and state changes for ADCALDIF, ADCALLIN, ADCAL, ADC State, CALFACT_x[10:0], and LINCALFACT [159:0]. Software rising edge symbol Hardware falling edge symbol

Software procedure to re-inject a calibration factor into the ADC

  1. 1. Ensure ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing).
  2. 2. Write CALFACT_S and CALFACT_D with the new offset calibration factors.
  3. 3. Write LINCALFACT bits with the new linearity calibration factors, following the procedure described in Section : Linearity calibration writing procedure .
  4. 4. 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 142. Updating the ADC offset calibration factor

Timing diagram for updating the ADC offset calibration factor showing the sequence of events: Ready state, Converting channel, and the update of internal calibration factor F1 to F2. Software rising edge symbol Hardware falling edge symbol

The diagram illustrates the timing for updating the ADC offset calibration factor. It shows the following signals and states over time:

Legend:
by s/w
by h/w

MSv41022V1

Timing diagram for updating the ADC offset calibration factor showing the sequence of events: Ready state, Converting channel, and the update of internal calibration factor F1 to F2. Software rising edge symbol Hardware falling edge symbol

Calibrating 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. 1. Disable the ADC.
  2. 2. Calibrate the ADC in single-ended input mode (with ADCALDIF=0) and Linearity calibration enable (with ADCALLIN=1). This updates the registers CALFACT_S[10:0] and LINCALFACT[159:0].
  3. 3. Calibrate the ADC in Differential input modes (with ADCALDIF=1) and Linearity calibration disable (with ADCALLIN=0). This updates the register CALFACT_D[10:0].
  4. 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 143. Mixing single-ended and differential channels

Timing diagram showing the mixing of single-ended and differential channels. The diagram illustrates the sequence of trigger events, ADC states (RDY, CONV), and the corresponding internal calibration factors (F2, F3) and register updates (CALFACT_S, CALFACT_D).

The diagram illustrates the timing and state transitions for mixing single-ended and differential channels. It consists of five horizontal timelines:

The diagram demonstrates that the internal calibration factor automatically switches between F2 (for single-ended channels) and F3 (for differential channels) based on the channel type being converted. The external calibration registers CALFACT_S and CALFACT_D store the respective calibration factors for single-ended and differential inputs.

MSv41023V1

Timing diagram showing the mixing of single-ended and differential channels. The diagram illustrates the sequence of trigger events, ADC states (RDY, CONV), and the corresponding internal calibration factors (F2, F3) and register updates (CALFACT_S, CALFACT_D).

Linearity calibration reading procedure

Once the calibration is done (ADCAL bit cleared by hardware) with ADCALLIN=1, the 160-bit linearity correction factor can be read using the ADC_CALFACT2 30-bit registers (6 read accesses are necessary).

The six LINCALRDYW1..6 control/status bits in ADC_CR are set when the calibration is complete. When ADEN is set to 1, clearing one of these bits launches the transfer of part of the linearity factor into the LINCALFACT[29:0] of the ADC_CALFACT2 register. The bit will be reset by hardware when the ADC_CALFACT2 register can be read (software must poll the bit until it is cleared). The complete procedure is as following:

  1. 1. Ensure DEEPPWD=0, ADVREGEN=1 and that the ADC voltage regulator startup time has elapsed by checking the LDORDY bit in ADC_ISR (refer to Section 25.3: ADC implementation for the availability of the LDO regulator status).
  2. 2. Set ADEN = 1 and wait until ADRDY=1.
  3. 3. Clear LINCALRDYW6 bit (Linearity calibration ready Word 6).
  4. 4. Poll LINCALRDYW6 bit until returned value is zero, indicating linearity correction bits[159:150] are available in ADC_CALFACT2[29:0].
  5. 5. Read ADC_CALFACT2[29:0].
  6. 6. Clear LINCALRDYW5 bit.
  7. 7. Poll LINCALRDYW5 bit until returned value is zero, indicating linearity correction bits[149:120] are available in ADC_CALFACT2[29:0].
  8. 8. Read ADC_CALFACT2[29:0].
  9. 9. Clear LINCALRDYW4 bit.
  10. 10. Poll LINCALRDYW4 bit until returned value is zero, indicating linearity correction bits[119:90] are available in ADC_CALFACT2[29:0].
  11. 11. Read ADC_CALFACT2[29:0].
  12. 12. Clear LINCALRDYW3 bit.
  13. 13. Poll LINCALRDYW3 bit until returned value is zero, indicating linearity correction bits[89:60] are available in ADC_CALFACT2[29:0].
  14. 14. Read ADC_CALFACT2[29:0].
  15. 15. Clear LINCALRDYW2 bit.
  16. 16. Poll LINCALRDYW2 bit until returned value is zero, indicating linearity correction bits[59:30] are available in ADC_CALFACT2[29:0].
  17. 17. Read ADC_CALFACT2[29:0].
  18. 18. Clear LINCALRDYW1 bit.
  19. 19. Poll LINCALRDYW1 bit until returned value is zero, indicating linearity correction bits[29:0] are available in ADC_CALFACT2[29:0].
  20. 20. Read ADC_CALFACT2[29:0].

Note: The software is allowed to toggle a single LINCALRDYWx bit at once (other bits left unchanged), otherwise causing unexpected behavior.

The software can access the linearity calibration factor by writing LINCALRDYW1..6 bits only when ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing).

Linearity calibration writing procedure

The six LINCALRDYW1..6 control/status bits in ADC_CR are reset when the calibration has not yet been done or a new linearity calibration factor have been rewritten. It is possible to force directly a linearity calibration factor or re-inject it using the following procedure:

  1. 1. Ensure DEEPPWD=0, ADVREGEN=1 and that ADC voltage regulator startup time has elapsed by checking the LDORDY bit in ADC_ISR (refer to Section 25.3: ADC implementation for the availability of the LDO regulator status).
  2. 2. Set ADEN = 1 and wait until ADRDY=1.
  3. 3. Write ADC_CALFACT2[9:0] with previously saved linearity correction factor bits[159:150].
  4. 4. Set LINCALRDYW6 bit.
  5. 5. Poll LINCALRDYW6 bit until returned value is one, indicating linearity correction bits[159:150] have been effectively written.
  6. 6. Write ADC_CALFACT2[29:0] with previously saved linearity correction factor bits[149:120].
  7. 7. Set LINCALRDYW5 bit.
  8. 8. Poll LINCALRDYW5 bit until returned value is one, indicating linearity correction bits[149:120] have been effectively written.
  9. 9. Write ADC_CALFACT2[29:0] with previously saved linearity correction factor bits[119:90].
  10. 10. Set LINCALRDYW4 bit.
  11. 11. Poll LINCALRDYW4 bit until returned value is one, indicating linearity correction bits[119:90] have been effectively written.
  12. 12. Write ADC_CALFACT2[29:0] with previously saved linearity correction factor bits[89:60].
  13. 13. Set LINCALRDYW3 bit.
  14. 14. Poll LINCALRDYW3 bit until returned value is one, indicating linearity correction bits[89:60] have been effectively written.
  15. 15. Write ADC_CALFACT2[29:0] with previously saved linearity correction factor bits[59:30].
  16. 16. Set LINCALRDYW2 bit.
  17. 17. Poll LINCALRDYW2 bit until returned value is one, indicating linearity correction bits[59:30] have been effectively written.
  18. 18. Write ADC_CALFACT2[29:0] with previously saved linearity correction factor bits[29:0].
  19. 19. Set LINCALRDYW1 bit.
  20. 20. Poll LINCALRDYW1 bit until returned value is one, indicating linearity correction bits[29:0] have been effectively written.

Note: The software is allowed to toggle a single LINCALRDYWx bit at once (other bits left unchanged), otherwise causing unexpected behavior.

The software is allowed to update the linearity calibration factor by writing LINCALRDYW1..6 bits only when ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing).

25.4.9 ADC on-off control (ADEN, ADDIS, ADRDY)

First of all, follow the procedure explained in Section 25.4.6: ADC deep-power-down mode (DEEPPWD) and ADC voltage regulator (ADVREGEN) .

Once DEEPPWD = 0 and ADVREGEN = 1, the ADC can be enabled and the ADC needs a stabilization time of \( t_{STAB} \) before it starts converting accurately, as shown in Figure 144 . Two control bits enable or disable the ADC:

Regular conversion can then start either by setting ADSTART=1 (refer to Section 25.4.19: 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. 1. Clear the ADRDY bit in the ADC_ISR register by writing '1'.
  2. 2. Set ADEN=1.
  3. 3. Wait until ADRDY=1 (ADRDY is set after the ADC startup time). This can be done using the associated interrupt (setting ADRDYIE=1).
  4. 4. Clear the ADRDY bit in the ADC_ISR register by writing '1' (optional).

Software procedure to disable the ADC

  1. 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. 2. Set ADDIS=1.
  3. 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 144. Enabling / Disabling the ADC

Timing diagram showing the sequence of events for enabling and disabling the ADC. The diagram plots four signals over time: ADEN, ADRDY, ADDIS, and ADC state. 1. Initial state: ADEN is low, ADRDY is low, ADDIS is low, and ADC state is OFF. 2. Enabling: ADEN is set high (by S/W). ADRDY goes high after a stabilization time t_STAB. ADC state transitions from OFF to Startup, then to RDY. 3. Conversions: ADSTART or JADSTART would be set here (not explicitly shown). ADC state transitions from RDY to Converting CH, then back to RDY. 4. Disabling: ADDIS is set high (by S/W). ADEN is automatically cleared low (by H/W). ADRDY goes low. ADC state transitions from RDY to REQ-OFF, then back to OFF. A legend at the bottom indicates that rising edges are 'by S/W' and falling edges are 'by H/W'.
Timing diagram showing the sequence of events for enabling and disabling the ADC. The diagram plots four signals over time: ADEN, ADRDY, ADDIS, and ADC state. 1. Initial state: ADEN is low, ADRDY is low, ADDIS is low, and ADC state is OFF. 2. Enabling: ADEN is set high (by S/W). ADRDY goes high after a stabilization time t_STAB. ADC state transitions from OFF to Startup, then to RDY. 3. Conversions: ADSTART or JADSTART would be set here (not explicitly shown). ADC state transitions from RDY to Converting CH, then back to RDY. 4. Disabling: ADDIS is set high (by S/W). ADEN is automatically cleared low (by H/W). ADRDY goes low. ADC state transitions from RDY to REQ-OFF, then back to OFF. A legend at the bottom indicates that rising edges are 'by S/W' and falling edges are 'by H/W'.

MSv30264V2

25.4.10 Constraints when writing the ADC control bits

The software can write the RCC control bits to configure and enable the ADC clock (refer to RCC Section), the control bits DIFSEL in the ADC_DIFSEL register, ADCx_CCR register and the control bits ADCAL and ADEN in the ADC_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 ADC_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 ADC_CFGR, ADC_SMPRy, ADC_TRy, ADC_SQRY, ADC_JDRy, ADC_OFRy and ADC_IER registers:

The software can write ADSTP or JADSTP control bits in the ADC_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 ADC_JSQR at any time, when the ADC is enabled (ADEN=1).

The software is allowed to write the ADC_JSQR register only when JADSTART is cleared to 0 (no injected conversion is ongoing) unless the context queue is enabled (JQDIS=0 in ADC_CFGR register).

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 ADC_CR register).

25.4.11 Channel selection (SQRx, JSQRx)

There are up to 20 multiplexed channels per ADC:

Refer to Table ADC interconnection in Section 25.4.2: ADC pins and internal signals for the connection of the above internal analog inputs to external ADC pins or internal signals.

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:

ADCx_INP/INN3, ADCx_INP/INN8, ADCx_INP/INN2, ADCx_INP/INN2, ADCx_INP/INN0, ADCx_INP/INN2, ADCx_INP/INN2, ADCx_INP/INN15.

ADC_SQRy 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 25.4.18: Stopping an ongoing conversion (ADSTP, JADSTP) ).

The software is allowed to modify on-the-fly the ADC_JSQR register when JADSTART is set to 1 only when the context queue is enabled (JQDIS=0 in ADC_CFGR register).

Temperature sensor, V REFINT and V BAT internal channels

The internal reference voltage (V REFINT ), the temperature sensor (V SENSE ), and the V BAT channel are connected to ADC internal channels. Refer to Table ADC interconnection in Section 25.4.2: ADC pins and internal signals for details.

Note: To convert one of the internal analog channels, enable the corresponding analog sources by programming VREFEN, TSEN and VBATEN bits in the ADCx_CCR registers.

25.4.12 Channel preselection register (ADC_PCSEL)

For each channel selected through SQRx or JSQRx, the corresponding ADC_PCSEL bit must be previously configured.

This ADC_PCSEL bit controls the analog switch integrated in the I/O level. The ADC input MUX selects the ADC input according to the SQRx and JSQRx with very high speed, the analog switch integrated in the IO cannot react as fast as ADC mux does. To avoid the delay on analog switch control on IO, it is necessary to pre select the input channels which will be selected in the SQRx, JSQRx.

The selection is based on the V INP[ij] of each ADC input. If ADC1 converts the ADC123_INP2(V INP[2] ) as differential mode, ADC123_INP6(V INP[6] ) also needs to be selected in ADC_PCSEL.

Some I/Os are connected to several V INP[ij] of the ADCx. The control inputs of the analog switch are ORed with the corresponding ADC_PCSEL register bits.

25.4.13 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 ADC_SMPR1 and ADC_SMPR2 registers. It is therefore possible to select among the following sampling time values:

The total conversion time is calculated as follows:

\[ T_{\text{CONV}} = \text{Sampling time} + 7.5 \text{ ADC clock cycles} \]

Example:

With \( F_{\text{adc\_ker\_ck}} = 24 \text{ MHz} \) and a sampling time of 1.5 ADC clock cycles (14-bit mode):

\[ T_{\text{CONV}} = (1.5 + 7.5) \text{ ADC clock cycles} = 9 \text{ ADC clock cycles} = 0.375 \text{ } \mu\text{s} \text{ (14 bit mode for fast channels)} \]

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.

I/O analog switch voltage booster

The resistance of the I/O analog switches increases when the \( V_{\text{DDA}} \) voltage is too low. The sampling time must consequently be adapted accordingly (refer to the device datasheet for the corresponding electrical characteristics). This resistance can be minimized at low \( V_{\text{DDA}} \) voltage by enabling an internal voltage booster through the BOOSTE bit of the SYSCFG_PMCR register.

25.4.14 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 ADC_CR register (for a regular channel, with software trigger selected)
    • • Setting the JADSTART bit in the ADC_CR register (for an injected channel, with software trigger selected)
    • • External hardware trigger event (for a regular or injected channel)
  1. ADSTART bit or JADSTART bit must be set before triggering an external event.

Inside the regular sequence, after each conversion is complete:

Inside the injected sequence, after each conversion is complete:

After the regular sequence is complete:

After the injected sequence is complete:

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.

25.4.15 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 ADC_CR register.

Inside the regular sequence, after each conversion is complete:

After the sequence of conversions is complete:

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).

25.4.16 Starting conversions (ADSTART, JADSTART)

Software starts ADC regular conversions by setting ADSTART=1.

When ADSTART is set, the conversion starts:

Software starts ADC injected conversions by setting JADSTART=1.

When JADSTART is set, the conversion starts:

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:

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 EXTEN !=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:

Note: When the software trigger is selected, ADSTART bit should not be set if the EOC flag is still high.

25.4.17 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:

\[ T_{CONV} = T_{SMPL} + T_{SAR} = [1.5 \text{ } |_{min} + 7.5 \text{ } |_{14bit}] \times T_{adc\_ker\_ck} \]
\[ T_{CONV} = T_{SMPL} + T_{SAR} = 62.5 \text{ ns } |_{min} + 312.5 \text{ ns } |_{14bit} = 375.0 \text{ ns (for } F_{adc\_ker\_ck} = 24 \text{ MHz)} \]

Figure 145. Analog to digital conversion time

Timing diagram for analog to digital conversion. It shows the relationship between ADC state, Analog channel, Internal S/H, ADSTART, EOSMP, EOC, and ADC_DR signals over time. The diagram is divided into four phases: RDY, Sampling Ch(N), Converting Ch(N), and Sampling Ch(N+1). Key timing parameters t_SMPL(1) and t_SAR(2) are indicated. The ADSTART signal is set by software at the beginning of the sampling phase. The EOSMP signal is set by software at the start of the conversion phase and cleared by software at the start of the next sampling phase. The EOC signal is set by software at the start of the conversion phase and cleared by software at the start of the next sampling phase. The ADC_DR register contains Data N-1 during the conversion phase and Data N during the next sampling phase.
Timing diagram for analog to digital conversion. It shows the relationship between ADC state, Analog channel, Internal S/H, ADSTART, EOSMP, EOC, and ADC_DR signals over time. The diagram is divided into four phases: RDY, Sampling Ch(N), Converting Ch(N), and Sampling Ch(N+1). Key timing parameters t_SMPL(1) and t_SAR(2) are indicated. The ADSTART signal is set by software at the beginning of the sampling phase. The EOSMP signal is set by software at the start of the conversion phase and cleared by software at the start of the next sampling phase. The EOC signal is set by software at the start of the conversion phase and cleared by software at the start of the next sampling phase. The ADC_DR register contains Data N-1 during the conversion phase and Data N during the next sampling phase.

1. \( T_{SMPL} \) depends on SMP[2:0]

2. \( T_{SAR} \) depends on RES[2:0]

25.4.18 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 (ADC_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 (ADC_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 poll ADSTART (or JADSTART) until the bit is reset before assuming the ADC is completely stopped.

Note: In auto-injection mode (JAUTO=1), setting ADSTP bit aborts both regular and injected conversions (JADSTP must not be used).

Figure 146. Stopping ongoing regular conversions

Timing diagram for stopping ongoing regular conversions. The diagram shows the ADC state, JADSTART, ADSTART, ADSTP, and ADC_DR signals over time. The ADC state starts in RDY, then becomes Sample Ch(N-1) and Convert Ch(N-1) upon a Trigger. After conversion, it returns to RDY. A second Trigger starts Sample Ch(N) and C. The ADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_DR signal contains Data N-2 and Data N-1.

The diagram illustrates the timing for stopping ongoing regular conversions. The ADC state transitions from RDY to Sample Ch(N-1) and Convert Ch(N-1) upon a Trigger. After conversion, it returns to RDY. A second Trigger starts Sample Ch(N) and C. The ADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_DR signal contains Data N-2 and Data N-1. A note indicates that software is not allowed to configure regular conversions selection and triggers.

MS30533V1

Timing diagram for stopping ongoing regular conversions. The diagram shows the ADC state, JADSTART, ADSTART, ADSTP, and ADC_DR signals over time. The ADC state starts in RDY, then becomes Sample Ch(N-1) and Convert Ch(N-1) upon a Trigger. After conversion, it returns to RDY. A second Trigger starts Sample Ch(N) and C. The ADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_DR signal contains Data N-2 and Data N-1.

Figure 147. Stopping ongoing regular and injected conversions

Timing diagram for stopping ongoing regular and injected conversions. The diagram shows the ADC state, JADSTART, JADSTP, ADC_JDR, ADSTART, ADSTP, and ADC_DR signals over time. The ADC state transitions from RDY to Sample Ch(N-1) and Convert Ch(N-1) upon a Regular trigger. After conversion, it returns to RDY. An Injected trigger starts Sample Ch(M) and C. The JADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The JADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_JDR signal contains DATA M-1. The ADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_DR signal contains DATA N-2 and DATA N-1. Notes indicate that software is not allowed to configure injected conversions selection and triggers, and software is not allowed to configure regular conversions selection and triggers.

The diagram illustrates the timing for stopping ongoing regular and injected conversions. The ADC state transitions from RDY to Sample Ch(N-1) and Convert Ch(N-1) upon a Regular trigger. After conversion, it returns to RDY. An Injected trigger starts Sample Ch(M) and C. The JADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The JADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_JDR signal contains DATA M-1. The ADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_DR signal contains DATA N-2 and DATA N-1. Notes indicate that software is not allowed to configure injected conversions selection and triggers, and software is not allowed to configure regular conversions selection and triggers.

MS30534V1

Timing diagram for stopping ongoing regular and injected conversions. The diagram shows the ADC state, JADSTART, JADSTP, ADC_JDR, ADSTART, ADSTP, and ADC_DR signals over time. The ADC state transitions from RDY to Sample Ch(N-1) and Convert Ch(N-1) upon a Regular trigger. After conversion, it returns to RDY. An Injected trigger starts Sample Ch(M) and C. The JADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The JADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_JDR signal contains DATA M-1. The ADSTART signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADSTP signal is set by software (SW) and cleared by hardware (HW) when the conversion is complete. The ADC_DR signal contains DATA N-2 and DATA N-1. Notes indicate that software is not allowed to configure injected conversions selection and triggers, and software is not allowed to configure regular conversions selection and triggers.

25.4.19 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.

When the Injected Queue is enabled (bit JQDIS=0), injected software triggers are not possible.

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.

Table 208 provides the correspondence between the EXTEN[1:0] and JEXTEN[1:0] values and the trigger polarity.

Table 208. Configuring the trigger polarity for regular external triggers

EXTEN[1:0]Source
00Hardware Trigger detection disabled, software trigger detection enabled
01Hardware Trigger with detection on the rising edge
10Hardware Trigger with detection on the falling edge
11Hardware Trigger with detection on both the rising and falling edges

Note: The polarity of the regular trigger cannot be changed on-the-fly.

Table 209. Configuring the trigger polarity for injected external triggers

JEXTEN[1:0]Source
00
  • – If JQDIS=1 (Queue disabled): Hardware trigger detection disabled, software trigger detection enabled
  • – If JQDIS=0 (Queue enabled), Hardware and software trigger detection disabled
01Hardware Trigger with detection on the rising edge
10Hardware Trigger with detection on the falling edge
11Hardware 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 when the queue is enabled (JQDIS=0). Refer to Section 25.4.22: Queue of context for injected conversions .

The EXTSEL[4:0] and JEXTSEL[4:0] control bits select which out of 21 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 25.4.22: Queue of context for injected conversions on page 944

Each ADC master shares the same input triggers with its ADC slave as described in Figure 148 .

Figure 148. Triggers are shared between ADC master and ADC slave

Figure 148: Triggers are shared between ADC master and ADC slave. The diagram shows two ADC blocks, 'ADC MASTER' and 'ADC SLAVE', sharing common external trigger inputs. On the left, there are two groups of trigger inputs: 'adc_ext0_trg', 'adc_ext1_trg', and 'adc_ext31_trg' (labeled 'EXTi mapped at product level'); and 'adc_jext0_trg', 'adc_jext1_trg', and 'adc_jext31_trg' (labeled 'JEXTi mapped at product level'). These inputs are connected to multiplexers within each ADC block. The 'ADC MASTER' has two multiplexers: 'EXTSEL[4:0]' for regular triggers and 'JEXTSEL[4:0]' for injected triggers. The 'ADC SLAVE' also has two multiplexers: 'EXTSEL[4:0]' for regular triggers and 'JEXTSEL[4:0]' for injected triggers. The diagram illustrates that the master and slave share the same external trigger sources for both regular and injected conversions. A small text 'MSv41035V2' is visible in the bottom right corner of the diagram area.
Figure 148: Triggers are shared between ADC master and ADC slave. The diagram shows two ADC blocks, 'ADC MASTER' and 'ADC SLAVE', sharing common external trigger inputs. On the left, there are two groups of trigger inputs: 'adc_ext0_trg', 'adc_ext1_trg', and 'adc_ext31_trg' (labeled 'EXTi mapped at product level'); and 'adc_jext0_trg', 'adc_jext1_trg', and 'adc_jext31_trg' (labeled 'JEXTi mapped at product level'). These inputs are connected to multiplexers within each ADC block. The 'ADC MASTER' has two multiplexers: 'EXTSEL[4:0]' for regular triggers and 'JEXTSEL[4:0]' for injected triggers. The 'ADC SLAVE' also has two multiplexers: 'EXTSEL[4:0]' for regular triggers and 'JEXTSEL[4:0]' for injected triggers. The diagram illustrates that the master and slave share the same external trigger sources for both regular and injected conversions. A small text 'MSv41035V2' is visible in the bottom right corner of the diagram area.

Table 210 and Table 211 give all the possible external triggers of the three ADCs for regular and injected conversion.

Table 210. ADC1, ADC2 and ADC3 - External triggers for regular channels

NameSourceTypeEXTSEL[4:0]
adc_ext_trg0tim1_oc1Internal signal from on-chip timers00000
adc_ext_trg1tim1_oc2Internal signal from on-chip timers00001
adc_ext_trg2tim1_oc3Internal signal from on-chip timers00010
adc_ext_trg3tim2_oc2Internal signal from on-chip timers00011
adc_ext_trg4tim3_trgoInternal signal from on-chip timers00100
adc_ext_trg5tim4_oc4Internal signal from on-chip timers00101
adc_ext_trg6exti11External pin00110
adc_ext_trg7tim8_trgoInternal signal from on-chip timers00111
adc_ext_trg8tim8_trgo2Internal signal from on-chip timers01000
adc_ext_trg9tim1_trgoInternal signal from on-chip timers01001
Table 210. ADC1, ADC2 and ADC3 - External triggers for regular channels (continued)
NameSourceTypeEXTSEL[4:0]
adc_ext_trg10tim1_trgo2Internal signal from on-chip timers01010
adc_ext_trg11tim2_trgoInternal signal from on-chip timers01011
adc_ext_trg12tim4_trgoInternal signal from on-chip timers01100
adc_ext_trg13tim6_trgoInternal signal from on-chip timers01101
adc_ext_trg14tim15_trgoInternal signal from on-chip timers01110
adc_ext_trg15tim3_oc4Internal signal from on-chip timers01111
adc_ext_trg16hrtim1_adctrig1Internal signal from on-chip timers10000
adc_ext_trg17hrtim1_adctrig3Internal signal from on-chip timers10001
adc_ext_trg18lptim1_outInternal signal from on-chip timers10010
adc_ext_trg19lptim2_outInternal signal from on-chip timers10011
adc_ext_trg20lptim3_outInternal signal from on-chip timers10100
adc_ext_trg21Reserved-10101
adc_ext_trg22Reserved-10110
adc_ext_trg23Reserved-10111
adc_ext_trg24Reserved-11000
adc_ext_trg25Reserved-11001
adc_ext_trg26Reserved-11010
adc_ext_trg27Reserved-11011
adc_ext_trg28Reserved-11100
adc_ext_trg29Reserved-11101
adc_ext_trg30Reserved-11110
adc_ext_trg31Reserved-11111
Table 211. ADC1, ADC2 and ADC3 - External triggers for injected channels
NameSourceTypeJEXTSEL[4:0]
adc_jext_trg0tim1_trgoInternal signal from on-chip timers00000
adc_jext_trg1tim1_oc4Internal signal from on-chip timers00001
adc_jext_trg2tim2_trgoInternal signal from on-chip timers00010
adc_jext_trg3tim2_oc1Internal signal from on-chip timers00011
adc_jext_trg4tim3_oc4Internal signal from on-chip timers00100
adc_jext_trg5tim4_trgoInternal signal from on-chip timers00101
adc_jext_trg6exti15External pin00110
adc_jext_trg7tim8_oc4Internal signal from on-chip timers00111
adc_jext_trg8tim1_trgo2Internal signal from on-chip timers01000
adc_jext_trg9tim8_trgoInternal signal from on-chip timers01001

Table 211. ADC1, ADC2 and ADC3 - External triggers for injected channels (continued)

NameSourceTypeJEXTSEL[4:0]
adc_jext_trg10tim8_trgo2Internal signal from on-chip timers01010
adc_jext_trg11tim3_oc3Internal signal from on-chip timers01011
adc_jext_trg12tim3_trgoInternal signal from on-chip timers01100
adc_jext_trg13tim3_oc1Internal signal from on-chip timers01101
adc_jext_trg14tim6_trgoInternal signal from on-chip timers01110
adc_jext_trg15tim15_trgoInternal signal from on-chip timers01111
adc_jext_trg16hrtim1_adctrig2Internal signal from on-chip timers10000
adc_jext_trg17hrtim1_adctrig4Internal signal from on-chip timers10001
adc_jext_trg18lptim1_outInternal signal from on-chip timers10010
adc_jext_trg19lptim2_outInternal signal from on-chip timers10011
adc_jext_trg20lptim3_outInternal signal from on-chip timers10100
adc_jext_trg21Reserved-10101
adc_jext_trg22Reserved-10110
adc_jext_trg23Reserved-10111
adc_jext_trg24Reserved-11000
adc_jext_trg25Reserved-11001
adc_jext_trg26Reserved-11010
adc_jext_trg27Reserved-11011
adc_jext_trg28Reserved-11100
adc_jext_trg29Reserved-11101
adc_jext_trg30Reserved-11110
adc_jext_trg31Reserved-11111

25.4.20 Injected channel management

Triggered injection mode

To use triggered injection, the JAUTO bit in the ADC_CFGR register must be cleared.

  1. 1. Start the conversion of a group of regular channels either by an external trigger or by setting the ADSTART bit in the ADC_CR register.
  2. 2. If an external injected trigger occurs, or if the JADSTART bit in the ADC_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. 3. Then, the regular conversion of the regular group of channels is resumed from the last interrupted regular conversion.
  4. 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 149 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 20 ADC clock cycles (that is two conversions with a sampling time of 1.5 clock periods), the minimum interval between triggers must be 21 ADC clock cycles.

Auto-injection mode

If the JAUTO bit in the ADC_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 ADC_SQRy and ADC_JSQR registers.

In this mode, the ADSTART bit in the ADC_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 149. Injected conversion latency

Timing diagram showing injected conversion latency. The diagram plots four signals over time: adc_ker_ck (ADC kernel clock), Injection event, Reset ADC, and SOC (Start of Conversion). The adc_ker_ck signal is a periodic square wave. The Injection event signal is a pulse that triggers the conversion. The Reset ADC signal is a pulse that resets the ADC. The SOC signal is a pulse that indicates the start of the conversion. The maximum latency (1) is the time interval between the rising edge of the Injection event and the rising edge of the SOC signal. The diagram also shows the Reset ADC signal occurring after the Injection event and before the SOC signal. The MSV43771V1 identifier is present in the bottom right corner of the diagram area.
Timing diagram showing injected conversion latency. The diagram plots four signals over time: adc_ker_ck (ADC kernel clock), Injection event, Reset ADC, and SOC (Start of Conversion). The adc_ker_ck signal is a periodic square wave. The Injection event signal is a pulse that triggers the conversion. The Reset ADC signal is a pulse that resets the ADC. The SOC signal is a pulse that indicates the start of the conversion. The maximum latency (1) is the time interval between the rising edge of the Injection event and the rising edge of the SOC signal. The diagram also shows the Reset ADC signal occurring after the Injection event and before the SOC signal. The MSV43771V1 identifier is present in the bottom right corner of the diagram area.
  1. 1. The maximum latency value can be found in the electrical characteristics of the device datasheet.

25.4.21 Discontinuous mode (DISCEN, DISCNUM, JDISCEN)

Regular group mode

This mode is enabled by setting the DISCEN bit in the ADC_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_SQRy registers. The value of n is specified by writing to the DISCNUM[2:0] bits in the ADC_CFGR register.

When an external trigger occurs, it starts the next n conversions selected in the ADC_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_SQR1 register.

Example:

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_CFGR register. It converts the sequence selected in the ADC_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_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_JSQR register.

Example:

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.

25.4.22 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. JQDIS bit of ADC_CFGR register must be reset to enable this feature. Only hardware-triggered conversions are possible when the context queue is enabled.

This context consists of:

All the parameters of the context are defined into a single register ADC_JSQR and this register implements a queue of 2 buffers, allowing the bufferization of up to 2 sets of parameters:

hardware triggers are disabled. Therefore, any further hardware injected triggers are ignored until the software re-writes a new injected context into JSQR register.

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):

Note: When queue of context enabled (bit JQDIS=0), only hardware trigger can be used.

Behavior when changing the trigger or sequence context

The Figure 150 and Figure 151 show the behavior of the context Queue when changing the sequence or the triggers.

Figure 150. Example of JSQR queue of context (sequence change)

Timing diagram showing the behavior of the JSQR queue when changing the trigger or sequence context. The diagram illustrates the relationship between Write JSQR, JSQR queue, Trigger 1, ADC J context, and ADC state over time.

The diagram shows the following signals and states over time:

MS30536V2

Timing diagram showing the behavior of the JSQR queue when changing the trigger or sequence context. The diagram illustrates the relationship between Write JSQR, JSQR queue, Trigger 1, ADC J context, and ADC state over time.
  1. 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 151. Example of JSQR queue of context (trigger change)

Timing diagram for Figure 151 showing the JSQR queue behavior with trigger changes. It includes signals for Write JSQR (P1, P2, P3), JSQR queue (EMPTY, P1, P1,P2, P2, P2,P3, P3), Trigger 1, Trigger 2, ADC J context, and ADC state (RDY, Conversion1, Conversion2).

The diagram illustrates the state of the JSQR queue and ADC context over time.
- Write JSQR: Shows three pulses: P1, P2, and P3.
- JSQR queue: Starts as EMPTY. After P1, it contains P1. After P2, it contains P1,P2. After P3, it contains P2. When P3 is written while P1,P2 are present, P3 is ignored. Later, after another P3 pulse, it contains P2,P3. When P3 is written while P2,P3 are present, P3 is ignored again. Finally, it contains P3.
- Trigger 1: Hardware trigger for sequences P1 and P3.
- Trigger 2: Hardware trigger for sequence P2. One pulse occurs while P1 is in the queue and is ignored. Another pulse occurs when the queue is empty and is ignored.
- ADC J context: Returned by reading JQSR. It mirrors the current state of the JSQR queue: EMPTY, P1, P2, P3.
- ADC state: Shows RDY, Conversion1, Conversion2 states corresponding to the execution of the sequences in the queue.

Timing diagram for Figure 151 showing the JSQR queue behavior with trigger changes. It includes signals for Write JSQR (P1, P2, P3), JSQR queue (EMPTY, P1, P1,P2, P2, P2,P3, P3), Trigger 1, Trigger 2, ADC J context, and ADC state (RDY, Conversion1, Conversion2).
  1. 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 152 and Figure 153 show the behavior of the context Queue if an overflow occurs before or during a conversion.

Figure 152. Example of JSQR queue of context with overflow before conversion

Timing diagram for Figure 152 showing JSQR queue overflow. It includes signals for Write JSQR (P1, P2, P3 -> Overflow, P4), JSQR queue, JQOVF, Trigger 1, Trigger 2, ADC J context, ADC state, and JEOS.

The diagram shows a queue overflow scenario.
- Write JSQR: Pulses P1, P2, and P3 occur in quick succession. P3 results in an overflow because the queue already contains P1 and P2. P3 is ignored. Later, pulse P4 occurs.
- JSQR queue: Starts as EMPTY. After P1, it contains P1. After P2, it contains P1, P2. When P3 is written, it overflows and is ignored. After P4, it contains P2, P4.
- JQOVF: An overflow flag is set when P3 is ignored and is later cleared by software (SW).
- Trigger 1: Hardware trigger for sequences P1 and P3.
- Trigger 2: Hardware trigger for sequence P2.
- ADC J context: Returned by reading JQSR. It shows EMPTY, P1, and P2.
- ADC state: Shows RDY, Conversion1, Conversion2 states.
- JEOS: End of conversion signal.

Timing diagram for Figure 152 showing JSQR queue overflow. It includes signals for Write JSQR (P1, P2, P3 -> Overflow, P4), JSQR queue, JQOVF, Trigger 1, Trigger 2, ADC J context, ADC state, and JEOS.
  1. 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 153. Example of JSQR queue of context with overflow during conversion

Timing diagram for Figure 153 showing JSQR queue overflow. The diagram tracks several signals: Write JSQR, JSQR queue, JQOVF, Trigger 1, Trigger 2, ADC J context, ADC state, and JEOS. It shows P1 and P2 being written to the queue. A third write P3 occurs while the queue is full, causing JQOVF to set and P3 to be ignored. After P1 and P2 conversions, the queue is cleared by SW, and P4 is written and subsequently converted.

The diagram shows the following sequence of events:

Timing diagram for Figure 153 showing JSQR queue overflow. The diagram tracks several signals: Write JSQR, JSQR queue, JQOVF, Trigger 1, Trigger 2, ADC J context, ADC state, and JEOS. It shows P1 and P2 being written to the queue. A third write P3 occurs while the queue is full, causing JQOVF to set and P3 to be ignored. After P1 and P2 conversions, the queue is cleared by SW, and P4 is written and subsequently converted.
  1. 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:

Queue of context: Behavior when the queue becomes empty

Figure 154 and Figure 155 show the behavior of the context Queue when the Queue becomes empty in both cases JQM=0 or 1.

Figure 154. Example of JSQR queue of context with empty queue (case JQM=0)

Timing diagram for Figure 154 showing JSQR queue behavior with JQM=0. Signals include Write JSQR, JSQR queue, Trigger 1, ADC J context, and ADC state. It illustrates that when JQM=0, the queue maintains the last context (P2) even after conversion until a new context (P3) is written.

The diagram shows the following sequence of events:

Timing diagram for Figure 154 showing JSQR queue behavior with JQM=0. Signals include Write JSQR, JSQR queue, Trigger 1, ADC J context, and ADC state. It illustrates that when JQM=0, the queue maintains the last context (P2) even after conversion until a new context (P3) is written.
  1. 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 155. Example of JSQR queue of context with empty queue (case JQM=1)

Timing diagram for Figure 155 showing the JSQR queue and ADC state when JQM=1. The diagram includes signals for Write JSQR, JSQR queue, Trigger 1, ADC J context, and ADC state. It shows how the queue becomes empty and how subsequent triggers are ignored when the queue is empty and JQM=1.

The diagram illustrates the behavior of the JSQR queue and ADC state when JQM=1. The 'Write JSQR' signal shows three pulses for contexts P1, P2, and P3. The 'JSQR queue' starts as 'EMPTY', becomes 'P1', then 'P1,P2', then 'P2', then 'EMPTY', then 'P3', and finally 'EMPTY'. The 'Trigger 1' signal shows two pulses. The first pulse occurs while the queue contains 'P1,P2' and 'P2', resulting in a 'Conversion1'. The second pulse occurs while the queue is 'EMPTY' and 'P3' is being written. Because the queue is empty and JQM=1, this trigger is 'Ignored'. The 'ADC J context (returned by reading JQSR)' shows 'EMPTY', 'P1', 'P2', 'EMPTY (0x0000)', 'P3', and 'EMPTY'. The 'ADC state' shows 'RDY', 'Conversion1', 'RDY', 'Conversion1', 'RDY', 'Conversion1', and 'RDY'.

Timing diagram for Figure 155 showing the JSQR queue and ADC state when JQM=1. The diagram includes signals for Write JSQR, JSQR queue, Trigger 1, ADC J context, and ADC state. It shows how the queue becomes empty and how subsequent triggers are ignored when the queue is empty and JQM=1.
  1. 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

Flushing the queue of context

The figures below show the behavior of the context Queue in various situations when the queue is flushed.

Figure 156. Flushing JSQR queue of context by setting JADSTP=1 (JQM=0). Case when JADSTP occurs during an ongoing conversion.

Timing diagram for Figure 156 showing the JSQR queue and ADC state when JADSTP=1 (JQM=0). The diagram includes signals for Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state. It shows how setting JADSTP=1 flushes the queue, maintaining only the last active context (P2 is lost).

The diagram illustrates the behavior of the JSQR queue and ADC state when JADSTP=1 (JQM=0). The 'Write JSQR' signal shows three pulses for contexts P1, P2, and P3. The 'JSQR queue' starts as 'EMPTY', becomes 'P1', then 'P1, P2', then 'P1' (after JADSTP is set), and finally 'P3'. The 'JADSTP' signal is set by software (S/W) and reset by hardware (H/W). The 'JADSTART' signal is reset by hardware (H/W) and set by software (S/W). The 'Trigger 1' signal shows one pulse. The 'ADC J context (returned by reading JSQR)' shows 'EMPTY', 'P1', and 'P3'. The 'ADC state' shows 'RDY', 'STP', 'RDY', 'Conversion1', and 'RDY'.

Timing diagram for Figure 156 showing the JSQR queue and ADC state when JADSTP=1 (JQM=0). The diagram includes signals for Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state. It shows how setting JADSTP=1 flushes the queue, maintaining only the last active context (P2 is lost).
  1. 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 157. Flushing JSQR queue of context by setting JADSTP=1 (JQM=0).
Case when JADSTP occurs during an ongoing conversion and a new trigger occurs.

Timing diagram for Figure 157 showing the flushing of the JSQR queue during an ongoing conversion. The diagram tracks the state of the Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state over time. It shows that when JADSTP is set during an ongoing conversion (P1), and a new trigger occurs, the queue is flushed and maintains the last active context (P3), with P2 being lost.

Timing diagram for Figure 157. The diagram shows the following signals and states over time:

MS30543V1

Timing diagram for Figure 157 showing the flushing of the JSQR queue during an ongoing conversion. The diagram tracks the state of the Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state over time. It shows that when JADSTP is set during an ongoing conversion (P1), and a new trigger occurs, the queue is flushed and maintains the last active context (P3), with P2 being lost.
  1. 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 158. Flushing JSQR queue of context by setting JADSTP=1 (JQM=0).
Case when JADSTP occurs outside an ongoing conversion

Timing diagram for Figure 158 showing the flushing of the JSQR queue outside an ongoing conversion. The diagram tracks the state of the Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state over time. It shows that when JADSTP is set while the ADC is in the STOP state, and a new trigger occurs, the queue is flushed and maintains the last active context (P3), with P2 being lost.

Timing diagram for Figure 158. The diagram shows the following signals and states over time:

MS30544V1

Timing diagram for Figure 158 showing the flushing of the JSQR queue outside an ongoing conversion. The diagram tracks the state of the Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state over time. It shows that when JADSTP is set while the ADC is in the STOP state, and a new trigger occurs, the queue is flushed and maintains the last active context (P3), with P2 being lost.
  1. 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 159. Flushing JSQR queue of context by setting JADSTP=1 (JQM=1)

Timing diagram for Figure 159 showing the effect of setting JADSTP=1 on the JSQR queue. It tracks signals like Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state over time. When JADSTP is set, the queue is flushed and becomes empty, losing context P2.

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, JADSTP is set by software (S/W). When JADSTP is set, an annotation indicates 'Queue is flushed and becomes empty (P2 is lost)'. Later, context P3 is written.
2. JSQR queue: Starts as EMPTY, contains P1, then P1 and P2. After JADSTP is set, it becomes EMPTY. When P3 is written, it contains P3, then becomes EMPTY again.
3. JADSTP: Set by S/W, then Reset by H/W.
4. JADSTART: Reset by H/W, then Set by S/W.
5. Trigger 1: Hardware trigger pulses.
6. ADC J context (returned by reading JSQR): Starts as EMPTY, contains P1. After the queue is flushed, it contains EMPTY (0x0000). When P3 is processed, it contains P3, then becomes EMPTY.
7. ADC state: Starts as RDY. After the first trigger (while P2 was in the queue but lost), it goes to Conv1 (Aborted), then STP. After JADSTP is reset, it goes to RDY. A subsequent trigger is 'Ignored'. After P3 is processed, it goes to Conversion1, then RDY.

Timing diagram for Figure 159 showing the effect of setting JADSTP=1 on the JSQR queue. It tracks signals like Write JSQR, JSQR queue, JADSTP, JADSTART, Trigger 1, ADC J context, and ADC state over time. When JADSTP is set, the queue is flushed and becomes empty, losing context P2.
  1. 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 160. Flushing JSQR queue of context by setting ADDIS=1 (JQM=0)

Timing diagram for Figure 160 showing the effect of setting ADDIS=1 on the JSQR queue. It tracks signals like JSQR queue, ADDIS, ADC J context, and ADC state. When ADDIS is set, the queue is flushed but maintains the last active context (P1), while P2 is lost.

The diagram illustrates the state of the ADC's JSQR queue and context when ADDIS=1 (JQM=0).
1. JSQR queue: Initially contains P1 and P2. When ADDIS is set by software (S/W), an annotation indicates 'Queue is flushed and maintains the last active context (P2 which was not consumed is lost)'. The queue then contains only P1.
2. ADDIS: Set by S/W, then Reset by H/W.
3. ADC J context (returned by reading JSQR): Contains P1.
4. ADC state: Starts as RDY. When ADDIS is set, it goes to REQ-OFF, then OFF.

Timing diagram for Figure 160 showing the effect of setting ADDIS=1 on the JSQR queue. It tracks signals like JSQR queue, ADDIS, ADC J context, and ADC state. When ADDIS is set, the queue is flushed but maintains the last active context (P1), while P2 is lost.
  1. 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 161. Flushing JSQR queue of context by setting ADDIS=1 (JQM=1)

Timing diagram showing the flushing of the JSQR queue. The diagram illustrates four signals over time: JSQR queue, ADDIS, ADC J context, and ADC state. The JSQR queue starts with P1 and P2. When ADDIS is set by software, the queue becomes EMPTY. The ADC J context is returned by reading the JSQR and becomes EMPTY (0x0000). The ADC state changes from RDY to REQ-OFF and then to OFF. The diagram is labeled MS30547V1.

Queue is flushed and becomes empty (JSQR is read as 0x0000)

JSQR queueP1, P2EMPTY
ADDISSet by S/WReset by H/W
ADC J context
(returned by reading JSQR)
P1EMPTY (0x0000)
ADC stateRDYREQ-OFF OFF

MS30547V1

Timing diagram showing the flushing of the JSQR queue. The diagram illustrates four signals over time: JSQR queue, ADDIS, ADC J context, and ADC state. The JSQR queue starts with P1 and P2. When ADDIS is set by software, the queue becomes EMPTY. The ADC J context is returned by reading the JSQR and becomes EMPTY (0x0000). The ADC state changes from RDY to REQ-OFF and then to OFF. The diagram is labeled MS30547V1.
  1. 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

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:

  1. 5. Write a dummy JSQR with JEXTEN not equal to 0 (otherwise triggering a software conversion)
  2. 6. Set JADSTART
  3. 7. Set JADSTP
  4. 8. Wait until JADSTART is reset
  5. 9. Set JADSTART.

Disabling the queue

It is possible to disable the queue by setting bit JQDIS=1 into the ADC_CFGR register.

Queue of context: Programming of the register ADC_JSQR

When the injected conversion queue of context is enabled (JQDIS=0), the ADC_JSQR must be programmed at one register write access. As JL[1:0] register define the number of the injected sequence, corresponding JSQ1 to JSQ4 must be written at same time. If ADC_JSQR is reprogrammed before the injected conversion start, reprogrammed data is put on the queue. When queue of context is empty, ADC_JSQR read back as 0x0000. Register access should not use the 'read modify write' sequence.

When ADC_JSQR is programmed when already 2 contexts are queued, it will raise JQOVF flag and generate the interrupt.

25.4.23 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 16, 14, 12, 10, 8 bits by programming the control bits RES[1:0]. Figure 166 , Figure 167 , Figure 168 and Figure 169 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 212 .

Table 212. T SAR timings depending on resolution

RES [2:0]T SAR
(ADC clock cycles)
T SAR (ns) at
F adc_ker_ck =24
MHz
T adc_ker_ck (ADC clock
cycles)
(with Sampling Time=
1.5 ADC clock cycles)
T adc_ker_ck (ns)
at
F adc_ker_ck =24
MHz
16 bits8.5 ADC clock cycles354.210 ADC clock cycles416.7
14 bits7.5 ADC clock cycles312.59 ADC clock cycles375
12 bits6.5 ADC clock cycles270.88 ADC clock cycles333.3
10 bits5.5 ADC clock cycles229.27 ADC clock cycles291.7
8 bits4.5 ADC clock cycles187.56 ADC clock cycles250.0

25.4.24 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 ADC_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 ADC_DR.

The ADC sets the JEOC flag as soon as a new injected conversion data is available in one of the ADC_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 ADC_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.

25.4.25 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 ADC_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.

25.4.26 Timing diagrams example (single/continuous modes, hardware/software triggers)

Figure 162. Single conversions of a sequence, software trigger

Timing diagram for single conversions of a sequence with software trigger. It shows four signal lines: ADSTART(1), EOC, EOS, and ADC state(2). ADSTART is a software trigger (by SW) that starts the conversion sequence. EOC (End of Conversion) pulses for each channel conversion. EOS (End of Sequence) goes high after the last channel (CH17) is converted. ADC state shows the sequence: RDY, CH1, CH9, CH10, CH17, RDY, CH1, CH9, CH10, CH17, RDY. ADC_DR shows the digital values: D1, D9, D10, D17, D1, D9, D10, D17. A legend indicates 'by SW' for ADSTART and 'by HW' for EOC. A box labeled 'Indicative timings' is present. MS30549V1 is noted in the bottom right.
Timing diagram for single conversions of a sequence with software trigger. It shows four signal lines: ADSTART(1), EOC, EOS, and ADC state(2). ADSTART is a software trigger (by SW) that starts the conversion sequence. EOC (End of Conversion) pulses for each channel conversion. EOS (End of Sequence) goes high after the last channel (CH17) is converted. ADC state shows the sequence: RDY, CH1, CH9, CH10, CH17, RDY, CH1, CH9, CH10, CH17, RDY. ADC_DR shows the digital values: D1, D9, D10, D17, D1, D9, D10, D17. A legend indicates 'by SW' for ADSTART and 'by HW' for EOC. A box labeled 'Indicative timings' is present. MS30549V1 is noted in the bottom right.
  1. 1. EXTEN=0x0, CONT=0
  2. 2. Channels selected = 1,9, 10, 17; AUTDLY=0.

Figure 163. Continuous conversion of a sequence, software trigger

Timing diagram for continuous conversion of a sequence with software trigger. It shows five signal lines: ADCSTART(1), EOC, EOS, ADSTP, and ADC state(2). ADCSTART is a software trigger (by SW) that starts the continuous conversion. EOC pulses for each channel conversion. EOS goes high after the last channel (CH17) is converted. ADSTP (Auto-stop) goes high after the second sequence of conversions. ADC state shows the sequence: READY, CH1, CH9, CH10, CH17, CH1, CH9, CH10, STP, READY, CH1, CH9. ADC_DR shows the digital values: D1, D9, D10, D17, D1, D9, D1. A legend indicates 'by SW' for ADCSTART and 'by HW' for EOC. A box labeled 'Indicative timings' is present. MS30550V1 is noted in the bottom right.
Timing diagram for continuous conversion of a sequence with software trigger. It shows five signal lines: ADCSTART(1), EOC, EOS, ADSTP, and ADC state(2). ADCSTART is a software trigger (by SW) that starts the continuous conversion. EOC pulses for each channel conversion. EOS goes high after the last channel (CH17) is converted. ADSTP (Auto-stop) goes high after the second sequence of conversions. ADC state shows the sequence: READY, CH1, CH9, CH10, CH17, CH1, CH9, CH10, STP, READY, CH1, CH9. ADC_DR shows the digital values: D1, D9, D10, D17, D1, D9, D1. A legend indicates 'by SW' for ADCSTART and 'by HW' for EOC. A box labeled 'Indicative timings' is present. MS30550V1 is noted in the bottom right.
  1. 1. EXTEN=0x0, CONT=1
  2. 2. Channels selected = 1,9, 10, 17; AUTDLY=0.

Figure 164. Single conversions of a sequence, hardware trigger

Timing diagram for single conversions of a sequence with hardware trigger. It shows the relationship between ADSTART, EOC, EOS, TRGX, ADC state, and ADC_DR signals over time. The diagram illustrates the flow from a hardware trigger to the conversion of four channels (CH1, CH2, CH3, CH4) and the resulting data (D1, D2, D3, D4) being stored in the ADC_DR register. The ADC state transitions from RDY to CH1, CH2, CH3, CH4, READ, and back to RDY. The legend indicates that TRGX is triggered by a software write (s/w) and hardware (h/w), and that the timing is indicative.
Timing diagram for single conversions of a sequence with hardware trigger. It shows the relationship between ADSTART, EOC, EOS, TRGX, ADC state, and ADC_DR signals over time. The diagram illustrates the flow from a hardware trigger to the conversion of four channels (CH1, CH2, CH3, CH4) and the resulting data (D1, D2, D3, D4) being stored in the ADC_DR register. The ADC state transitions from RDY to CH1, CH2, CH3, CH4, READ, and back to RDY. The legend indicates that TRGX is triggered by a software write (s/w) and hardware (h/w), and that the timing is indicative.
  1. 1. TRGX (1) (over-frequency) is selected as trigger source, EXTEN = 01, CONT = 0
  2. 2. Channels selected = 1, 2, 3, 4; AUTDLY=0.

Figure 165. Continuous conversions of a sequence, hardware trigger

Timing diagram for continuous conversions of a sequence with hardware trigger. It shows the relationship between ADSTART, EOC, EOS, ADSTP, TRGX, ADC state, and ADC_DR signals. The diagram illustrates continuous conversion of four channels (CH1, CH2, CH3, CH4) with data (D1, D2, D3, D4) being stored in the ADC_DR register. The ADC state transitions from RDY to CH1, CH2, CH3, CH4, CH1, CH2, CH3, CH4, CH1, STOP, and back to RDY. The legend indicates that TRGX is triggered by a software write (s/w) and hardware (h/w), and that the timing is not in scale.
Timing diagram for continuous conversions of a sequence with hardware trigger. It shows the relationship between ADSTART, EOC, EOS, ADSTP, TRGX, ADC state, and ADC_DR signals. The diagram illustrates continuous conversion of four channels (CH1, CH2, CH3, CH4) with data (D1, D2, D3, D4) being stored in the ADC_DR register. The ADC state transitions from RDY to CH1, CH2, CH3, CH4, CH1, CH2, CH3, CH4, CH1, STOP, and back to RDY. The legend indicates that TRGX is triggered by a software write (s/w) and hardware (h/w), and that the timing is not in scale.
  1. 1. TRGX is selected as trigger source, EXTEN = 10, CONT = 1
  2. 2. Channels selected = 1, 2, 3, 4; AUTDLY=0.

25.4.27 Data management

Data register, data alignment and offset (ADC_DR, ADC_JDRy, OFFSETy, OFFSETy_CH, OVSS, LSHIFT, RSHIFT, SSATE)

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 ADC_DR data register which is 32 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 ADC_JDRy data register which is 32 bits wide.

The OVSS[3:0] and LSHIFT[3:0] bitfields in the ADC_CFGR2 register selects the alignment of the data stored after conversion. Data can be right- or left-aligned as shown in Figure 166 , Figure 167 , Figure 168 and Figure 169 .

Note: The data can be re-aligned in normal and in oversampling mode.

Offset

An offset y (y=1, 2, 3, 4) can be applied to a channel by programming a value different from 0 in OFFSETy[25:0] bitfield into ADC_OFRy register. The channel to which the offset will be applied is programmed into the bits OFFSETy_CH[4:0] of ADC_OFRy register. In this case, the converted value is decreased by the user-defined offset written in the bits OFFSETy[25:0]. The result may be a negative value so the read data is signed and the SEXT bit represents the extended sign value.

The offset value should be lower than the max conversion value (ex. 16bit mode, offset value max is 0xFFFF).

The offset correction is also supported in oversampling mode. For the oversampling mode, offset is subtracted before OVSS right shift applied.

Table 213 describes how the comparison is performed for all the possible resolutions for analog watchdog 1, 2, 3.

Table 213. Offset computation versus data resolution

Resolution
(bits
RES[2:0])
Subtraction between raw
converted data and offset:
ResultComments
Raw
converted
Data, left
aligned
Offset
16 bitsDATA[15:0]OFFSET[25:0]signed 27-bit
data
-
14 bitsDATA[15:2],00OFFSET[25:0]signed 27-bit
data
The user must configure OFFSET[1:0]
to 00
12 bitsDATA[15:4],00
00
OFFSET[25:0]signed 27-bit
data
The user must configure OFFSET[3:0]
to 0000
10 bitsDATA[15:6],00
0000
OFFSET[25:0]signed 27-bit
data
The user must configure OFFSET[5:0]
to 000000
8 bitsDATA[15:8],00
0000
OFFSET[25:0]signed 27-bit
data
The user must configure OFFSET[7:0]
to 00000000

When reading data from ADC_DR (regular channel) or from ADC_JDRy (injected channel, y=1,2,3,4), the offset compensation is disabled when ADC_OFRy [25:0] bitfield is reset. Otherwise, the offset for ADC_OFRy[30:26] channel is enabled.

Figure 166 , Figure 167 , Figure 168 and Figure 169 show alignments for signed and unsigned data together with corresponding OVSS and LSHIFT values.

Figure 166. Right alignment (offset disabled, unsigned value)

Diagram showing right alignment for unsigned values with various bit widths (16-bit, 12-bit, 8-bit) and oversampling settings (OSR=1024).

Figure 166 illustrates the right alignment of ADC data when offset is disabled and values are unsigned. The diagram shows five examples of data alignment within a 32-bit register, with bit positions 31, 23, 15, 7, and 0 marked at the top.

MSv41024V1

Diagram showing right alignment for unsigned values with various bit widths (16-bit, 12-bit, 8-bit) and oversampling settings (OSR=1024).

Figure 167. Right alignment (offset enabled, signed value)

Diagram showing right alignment for signed values with various bit widths and settings (SSATE, RSHIFT1..4).

Figure 167 illustrates the right alignment of ADC data when offset is enabled and values are signed. The diagram shows six examples of data alignment within a 32-bit register, with bit positions 31, 23, 15, 7, and 0 marked at the top. A vertical dashed line at bit 15 separates the upper and lower 16-bit halves of the register.

MSv41025V1

Diagram showing right alignment for signed values with various bit widths and settings (SSATE, RSHIFT1..4).

Figure 168. Left alignment (offset disabled, unsigned value)

Figure 168: Left alignment (offset disabled, unsigned value). Diagram showing four data formats: 16-bit data (LSHIFT=0), 12-bit data (LSHIFT=4), 8-bit data (LSHIFT=0), and 16-bit data with OSR=1024 (LSHIFT=6). Each format shows the mapping of data bits (D15..D0, D11..D0, D7..D0, D25..D0) into a 32-bit register, with leading zeros and trailing zeros as appropriate.

Figure 168 illustrates the left alignment of unsigned values in a 32-bit register. The register bits are numbered 31, 23, 15, 7, and 0. The data is aligned to the left, with zeros filling the remaining bits.

MSV41026V1

Figure 168: Left alignment (offset disabled, unsigned value). Diagram showing four data formats: 16-bit data (LSHIFT=0), 12-bit data (LSHIFT=4), 8-bit data (LSHIFT=0), and 16-bit data with OSR=1024 (LSHIFT=6). Each format shows the mapping of data bits (D15..D0, D11..D0, D7..D0, D25..D0) into a 32-bit register, with leading zeros and trailing zeros as appropriate.

Figure 169. Left alignment (offset enabled, signed value)

Figure 169: Left alignment (offset enabled, signed value). Diagram showing six data formats: 16-bit data (Signed 32-bit format, LSHIFT=15), 16-bit data (Signed 16-bit format, SATEN=1), 12-bit data (Signed 16-bit format, LSHIFT=3), 8-bit data (Signed 16-bit format, LSHIFT=7), 8-bit data (Signed 8-bit format, SSATE=1 or RSHIFT1..4=1), and 16-bit data with OSR=1024 (Signed 32-bit format, LSHIFT=5). Each format shows the mapping of data bits (D15..D0, D14..D0, D11..D0, D7..D0, D6..D0, D25..D0) into a 32-bit register, with sign extension (SEXT) or a sign bit (S) as appropriate.

Figure 169 illustrates the left alignment of signed values in a 32-bit register. The register bits are numbered 31, 23, 15, 7, and 0. The data is aligned to the left, with sign extension (SEXT) or a sign bit (S) as appropriate.

MSV41027V2

Figure 169: Left alignment (offset enabled, signed value). Diagram showing six data formats: 16-bit data (Signed 32-bit format, LSHIFT=15), 16-bit data (Signed 16-bit format, SATEN=1), 12-bit data (Signed 16-bit format, LSHIFT=3), 8-bit data (Signed 16-bit format, LSHIFT=7), 8-bit data (Signed 8-bit format, SSATE=1 or RSHIFT1..4=1), and 16-bit data with OSR=1024 (Signed 32-bit format, LSHIFT=5). Each format shows the mapping of data bits (D15..D0, D14..D0, D11..D0, D7..D0, D6..D0, D25..D0) into a 32-bit register, with sign extension (SEXT) or a sign bit (S) as appropriate.

16-bit and 8-bit signed format management: RSHIFTx,SSATE

The offset correction sign-extends the data format, resulting in an unsigned 16-bit conversion being extended to 17-bit signed format, for instance.

Three options are offered for formatting 8-bit and 16-bit conversion results.

For each offset correction channel 1 to 4, a RSHIFT1..4 bit in the ADC_CFGR2 register allows to have the result right-shifted 1-bit and have it fitting a standard 8 or 16-bit format.

Another option is to have the result saturated to the 16-bit and 8-bit signed formats, for the following cases only: RES[2:0] = 000 (16-bit format) and RES[2:0] = 111 (8-bit format).

This mode is enabled with the SSATE bit in the ADC_OFRy register.

The table below summarizes the 3 available use case for 16-bit format.

Table 214. 16-bit data formats

SSATERSHIFTxFormatData range
(offset = 0x8000)
00Sign-extended 17-bit significant data
SEXT[31:16] DATA[15:0]
0x00007FFF - 0x FFFF8000
01Sign-extended right-shifted 16-bit significant data
SEXT[31:15] DATA[14:0]
0x3FFF - 0xC000
10Sign-extended saturated 16-bit significant data
SEXT[31:15] DATA[14:0]
7FFF - 0x8000
11Reserved-

Numerical examples are given in Table 215 with 3 different offset values.

Table 215. Numerical examples for 16-bit format (bold indicates saturation)

Raw conversion resultOffset valueResult
SSATE = 0
RSHIFT = 0
Result
SSATE = 0
RSHIFT = 1
Result
SSATE = 1
RSHIFT = 0
0xFFFF0x80000x0000 7FFF3FFF7FFF
0x80000x0000 000000
0x00000xFFFF 8000C0008000
0xFFFF0x80200x0000 7FDF3FEF7FDF
0x80000xFFFF FFE0FFF0FFE0
0x00000xFFFF 7FE0BFF08000
0xFFFF0x7FF00x0000 800F40077FFF
0x80000x0000 001080010
0x00000xFFFF 8010C0088010

When oversampling mode is active, the SSATE and RSHIFT1..4 bits are not supported.

ADC overrun (OVR, OVRMOD)

The overrun flag (OVR) notifies of a buffer overrun event when the regular converted data has not been read (by the CPU or the DMA) before ADC_DR FIFO (eight stages) is overflowed.

The OVR flag is set when a new conversion completes while ADC_CR register FIFO was full. An interrupt is generated if OVRRIE bit is set to 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 ADSTP to 1.

OVR flag is cleared by software by writing 1 to it.

Data can be configured to be preserved or overwritten when an overrun event occurs by programming the OVRMOD control bit of the ADC_CFGR register:

The overrun event preserves the data register from being overwritten: the old data is maintained up to ADC_DR FIFO depth (8 data) and the new conversion is discarded and lost. If OVR remains at 1, any further conversion is performed but the resulting data is also discarded.

The data register is overwritten with the last conversion result and the previous unread data is lost. In this mode, ADC_DR FIFO is disabled. If OVR remains at 1, any further conversion is performed normally and the ADC_DR register always contains the latest converted data.

Figure 170. Example of overrun (OVRMOD = 0)

Timing diagram for Figure 170 showing an overrun condition when OVRMOD = 0. The diagram illustrates the relationship between ADSTART, EOC, OVR, ADSTP, TRGx, ADC state, ADC_DR read access, and ADC_DR (FIFO_DATA) signals. It shows that when a new conversion result is ready before the previous one is read, the data is lost in the FIFO.

This timing diagram illustrates an overrun condition in an ADC when OVRMOD = 0. The signals shown are:

Key timing points are indicated by arrows:

The overrun occurs when a new conversion result (D4) is ready before the previous one (D3) is read, causing D3 to be lost. The OVR flag is set. The FIFO contains D4, D5, D9, D10, D10, na, D12.

MSv69549V1

Timing diagram for Figure 170 showing an overrun condition when OVRMOD = 0. The diagram illustrates the relationship between ADSTART, EOC, OVR, ADSTP, TRGx, ADC state, ADC_DR read access, and ADC_DR (FIFO_DATA) signals. It shows that when a new conversion result is ready before the previous one is read, the data is lost in the FIFO.

Figure 171. Example of overrun (OVRMOD = 1)

Timing diagram for Figure 171 showing an overrun condition when OVRMOD = 1. The diagram illustrates the relationship between ADSTART, EOC, OVR, ADSTP, TRGx, ADC state, ADC_DR read access, and ADC_DR (OVRMOD = 1) signals. It shows that when a new conversion result is ready before the previous one is read, the data is overwritten in the register.

This timing diagram illustrates an overrun condition in an ADC when OVRMOD = 1. The signals shown are:

Key timing points are indicated by arrows:

The overrun occurs when a new conversion result (D5) is ready before the previous one (D4) is read, causing D4 to be overwritten. The OVR flag is set. The ADC_DR register contains D1, D2, D3, D4, D5, D6.

MSv65301V1

Timing diagram for Figure 171 showing an overrun condition when OVRMOD = 1. The diagram illustrates the relationship between ADSTART, EOC, OVR, ADSTP, TRGx, ADC state, ADC_DR read access, and ADC_DR (OVRMOD = 1) signals. It shows that when a new conversion result is ready before the previous one is read, the data is overwritten in the register.

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 ADC_DR register can be read. OVRMOD should be configured to 0 to manage overrun events or FIFO overflows as errors.

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 ADC_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 ADC_DR register.

When the DMA mode is enabled (DMNGT bit = 01 or 11 in the ADC_CFGR register in single ADC mode or MDMA different from 0b00 in dual ADC mode), a DMA request is generated after each conversion of a channel. This allows the transfer of the converted data from the ADC_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 DMNGT of the ADC_CFGR register in single ADC mode, or with bit DAMDF of the ADCx_CCR register in dual ADC mode:

DMA one shot mode (DMNGT=01)

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):

DMA circular mode (DMNGT=11)

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.

DMA with FIFO

The output data register has eight-stage FIFO. Two different DMA requests are generated parallel. When a data is available, "SREQ single request" generated, when 4 data are available, "BREQ burst request" generated. DMA2 can be programmed either single transfer mode or incremental burst mode(4 beats), according to this mode, correct request line is selected by the DMA2. Please refer to the DMA2 chapter for further information.

25.4.28 Managing conversions using the DFSDM

The ADC conversion results can be transferred directly to the Digital Filter for Sigma Delta Modulators (DFSDM).

In this case, the DMNGT[1:0] bits must be set to 10.

The ADC transfers 16 least significant bits of the regular data register data to the DFSDM, which in turns will reset the EOC flag once the transfer is effective.

The data format must be 16-bit signed:

ADC_DR[31:16] = don't care

ADC_DR[15] = sign

ADC_DR[14:0] = data

Any value above 16-bit signed format will be truncated.

25.4.29 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:

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):

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 176 ).

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. 1. Wait until JEOS=1 (no more conversions are restarted)
  2. 2. Clear JEOS,
  3. 3. Set ADSTP=1
  4. 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 of 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 172. AUTDLY=1, regular conversion in continuous mode, software trigger

Timing diagram for Figure 172 showing ADC state transitions (RDY, CH1, DLY, CH2, DLY, CH3, DLY, CH1, DLY, STOP, RDY) and data output (D1, D2, D3, D1) over time. It includes signal lines for ADSTART(1), EOC, EOS, ADSTP, and ADC_DR read access. A legend indicates 'by SW' for rising edges and 'by HW' for falling edges. A box labeled 'Indicative timings' is present.
Timing diagram for Figure 172 showing ADC state transitions (RDY, CH1, DLY, CH2, DLY, CH3, DLY, CH1, DLY, STOP, RDY) and data output (D1, D2, D3, D1) over time. It includes signal lines for ADSTART(1), EOC, EOS, ADSTP, and ADC_DR read access. A legend indicates 'by SW' for rising edges and 'by HW' for falling edges. A box labeled 'Indicative timings' is present.

MS31020V1

  1. 1. AUTDLY=1
  2. 2. Regular configuration: EXTEN=0x0 (SW trigger), CONT=1, CHANNELS = 1,2,3
  3. 3. Injected configuration DISABLED

Figure 173. AUTDLY=1, regular HW conversions interrupted by injected conversions (DISCEN=0; JDISCEN=0)

Timing diagram for Figure 173 showing regular and injected conversion sequences. Regular triggers are ignored during the injected sequence. The diagram shows ADC state transitions for regular channels (CH1, CH2, CH3) and injected channels (CH5, CH6). Data outputs include D1, D2, D3, D5, and D6. Signal lines include Regular trigger, ADC state, EOC, EOS, ADC_DR read access, Injected trigger, JEOS, ADC_JDR1, and ADC_JDR2. A legend indicates 'by s/w' for rising edges and 'by h/w' for falling edges. A box labeled 'Indicative timings' is present.
Timing diagram for Figure 173 showing regular and injected conversion sequences. Regular triggers are ignored during the injected sequence. The diagram shows ADC state transitions for regular channels (CH1, CH2, CH3) and injected channels (CH5, CH6). Data outputs include D1, D2, D3, D5, and D6. Signal lines include Regular trigger, ADC state, EOC, EOS, ADC_DR read access, Injected trigger, JEOS, ADC_JDR1, and ADC_JDR2. A legend indicates 'by s/w' for rising edges and 'by h/w' for falling edges. A box labeled 'Indicative timings' is present.

MS31021V2

  1. 1. AUTDLY=1
  2. 2. Regular configuration: EXTEN=0x1 (HW trigger), CONT=0, DISCEN=0, CHANNELS = 1, 2, 3
  3. 3. Injected configuration: JEXTEN=0x1 (HW Trigger), JDISCEN=0, CHANNELS = 5,6

Figure 174. AUTDLY=1, regular HW conversions interrupted by injected conversions (DISCEN=1, JDISCEN=1)

Timing diagram showing regular and injected ADC conversions with delays and triggers. The diagram illustrates the sequence of events when regular conversions are interrupted by injected ones. It includes signals for Regular trigger, ADC state (RDY, CH1, DLY, CH2, CH5, CH6, CH3), EOC, EOS, ADC_DR, read access, Injected trigger, JEOS, ADC_JDR1, and ADC_JDR2. Data points D1 through D6 are shown. Delays DLY(CH1), DLY(CH2), DLY(CH3), and DLY(inj) are indicated. Some triggers are labeled 'Ignored' or 'Not ignored (occurs during injected sequence)'.

The timing diagram illustrates the interaction between regular and injected ADC conversions. The 'Regular trigger' line shows a sequence of rising edges. The first edge starts a regular sequence (CH1, DLY, CH2, DLY, CH3). Subsequent regular triggers occurring while the regular sequence is still active (e.g., during the DLY phase of CH2) are 'Ignored'. An injected trigger occurs during the regular sequence, causing the regular sequence to be suspended. The injected sequence (CH5, CH6) is executed. After the injected sequence, the regular sequence resumes from where it was suspended. The 'ADC state' line shows the current conversion: CH1 (regular), DLY, CH2 (regular), DLY, CH5 (injected), DLY, CH6 (injected), CH3 (regular), DLY, CH1 (regular), DLY, CH2 (regular). The 'EOC' (End of Conversion) signal is shown for regular and injected sequences. The 'ADC_DR' (Data Register) is updated with the conversion results: D1, D2, D3, D1. The 'Injected trigger' line shows the start of the injected sequence. The 'JEOS' (End of Injected Sequence) signal is shown. The 'ADC_JDR1' and 'ADC_JDR2' registers are updated with the injected conversion results: D5, D6. The diagram also indicates 'read access' to the data registers. A legend at the bottom shows 'by SW' (software trigger) and 'by HW' (hardware trigger) symbols. The text 'Indicative timings' is present in the bottom right of the diagram area.

Timing diagram showing regular and injected ADC conversions with delays and triggers. The diagram illustrates the sequence of events when regular conversions are interrupted by injected ones. It includes signals for Regular trigger, ADC state (RDY, CH1, DLY, CH2, CH5, CH6, CH3), EOC, EOS, ADC_DR, read access, Injected trigger, JEOS, ADC_JDR1, and ADC_JDR2. Data points D1 through D6 are shown. Delays DLY(CH1), DLY(CH2), DLY(CH3), and DLY(inj) are indicated. Some triggers are labeled 'Ignored' or 'Not ignored (occurs during injected sequence)'.

MS31022V1

  1. 1. AUTDLY=1
  2. 2. Regular configuration: EXTEN=0x1 (HW trigger), CONT=0, DISCEN=1, DISCNUM=1, CHANNELS = 1, 2, 3.
  3. 3. Injected configuration: JEXTEN=0x1 (HW Trigger), JDISCEN=1, CHANNELS = 5,6

Figure 175. AUTDLY=1, regular continuous conversions interrupted by injected conversions

Timing diagram for Figure 175 showing regular continuous conversions interrupted by injected conversions with AUTDLY=1. The diagram illustrates the sequence of channels (CH1, CH2, CH5, CH6, CH3, CH1), delays (DLY), and data outputs (D1, D2, D3, D5, D6).

The diagram shows the timing of an ADC sequence. The ADSTART signal is triggered by a software (s/w) or hardware (h/w) source. The ADC state transitions from RDY to CH1 (regular), then DLY (CH1), then CH2 (regular), then DLY (CH2), then CH5 (injected), CH6 (injected), then DLY, then CH3 (regular), then DLY (CH3), and finally CH1 (regular). The EOC signal pulses at the end of each regular conversion (CH1, CH2, CH3). The EOS signal pulses at the end of the injected conversion sequence (CH5, CH6). The ADC_DR read access is shown for data outputs D1, D2, D3, D5, and D6. The injected trigger is shown as a pulse. The JEOS signal pulses at the end of the injected conversion sequence. The ADC_JDR1 and ADC_JDR2 registers are shown for data outputs D5 and D6. The legend indicates that 'by s/w' means software trigger and 'by h/w' means hardware trigger. The text 'Indicative timings' is present.

Timing diagram for Figure 175 showing regular continuous conversions interrupted by injected conversions with AUTDLY=1. The diagram illustrates the sequence of channels (CH1, CH2, CH5, CH6, CH3, CH1), delays (DLY), and data outputs (D1, D2, D3, D5, D6).

MS31023V3

  1. 1. AUTDLY=1
  2. 2. Regular configuration: EXTEN=0x0 (SW trigger), CONT=1, DISCEN=0, CHANNELS = 1, 2, 3
  3. 3. Injected configuration: JEXTEN=0x1 (HW Trigger), JDISCEN=0, CHANNELS = 5,6

Figure 176. AUTDLY=1 in auto- injected mode (JAUTO=1)

Timing diagram for Figure 176 showing AUTDLY=1 in auto-injected mode (JAUTO=1). The diagram illustrates the sequence of channels (CH1, CH2, CH5, CH6, CH3, CH1), delays (DLY), and data outputs (D1, D2, D3, D5, D6).

The diagram shows the timing of an ADC sequence in auto-injected mode. The ADSTART signal is triggered by a software (s/w) or hardware (h/w) source. The ADC state transitions from RDY to CH1 (regular), then DLY (CH1), then CH2 (regular), then CH5 (injected), CH6 (injected), then DLY (inj), then CH3 (regular), then DLY, and finally CH1 (regular). The EOC signal pulses at the end of each regular conversion (CH1, CH2, CH3). The EOS signal pulses at the end of the injected conversion sequence (CH5, CH6). The ADC_DR read access is shown for data outputs D1, D2, D3, D5, and D6. The JEOS signal pulses at the end of the injected conversion sequence. The ADC_JDR1 and ADC_JDR2 registers are shown for data outputs D5 and D6. The legend indicates that 'by s/w' means software trigger and 'by h/w' means hardware trigger. The text 'Indicative timings' is present. A 'No delay' label is present between ADSTART and the first regular conversion.

Timing diagram for Figure 176 showing AUTDLY=1 in auto-injected mode (JAUTO=1). The diagram illustrates the sequence of channels (CH1, CH2, CH5, CH6, CH3, CH1), delays (DLY), and data outputs (D1, D2, D3, D5, D6).

MS31024V4

  1. 1. AUTDLY=1
  2. 2. Regular configuration: EXTEN=0x0 (SW trigger), CONT=1, DISCEN=0, CHANNELS = 1, 2
  3. 3. Injected configuration: JAUTO=1, CHANNELS = 5,6

25.4.30 Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy)

The three AWD analog watchdogs monitor whether some channels remain within a configured voltage range (window).

Figure 177. Analog watchdog guarded area

Figure 177. Analog watchdog guarded area. A diagram showing a vertical axis for 'Analog voltage' with two horizontal lines representing the 'Higher threshold' (HTR) and 'Lower threshold' (LTR). The region between these thresholds is shaded and labeled 'Guarded area'. The diagram is labeled ai16048.
Figure 177. Analog watchdog guarded area. A diagram showing a vertical axis for 'Analog voltage' with two horizontal lines representing the 'Higher threshold' (HTR) and 'Lower threshold' (LTR). The region between these thresholds is shaded and labeled 'Guarded area'. The diagram is labeled ai16048.

AWDx flag and interrupt

An interrupt can be enabled for each of the 3 analog watchdogs by setting AWDyIE in the ADC_IER register (x=1,2,3).

AWDy (y=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 ADC_CFGR register. This watchdog monitors whether either one selected channel or all enabled channels (1) remain within a configured voltage range (window).

Table 216 shows how the ADC_CFGRy registers should be configured to enable the analog watchdog on one or more channels.

Table 216. Analog watchdog channel selection

Channels guarded by the analog watchdogAWD1SGL bitAWD1EN bitJAWD1EN bit
Nonex00
All injected channels001
All regular channels010
All regular and injected channels011
Single (1) injected channel101
Single (1) regular channel110
Single (1) regular or injected channel111

1. Selected by the AWDyCH[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 HTR1[25:0] of the ADC_HTR1 register and LTR1[25:0] of the ADC_LTR1 register for the analog watchdog 1.

The threshold can be up to 26-bits (16-bit resolution with oversampling, OSVR[9:0]=1024).

When converting data with a resolution of less than 16 bits (according to bits RES[2:0]), the LSBs of the programmed thresholds must be kept cleared, the internal comparison being performed on the full 16-bit converted data (left aligned to the half-word boundary).

Table 217 describes how the comparison is performed for all the possible resolutions for analog watchdog 1,2,3.

Table 217. Analog watchdog 1,2,3 comparison

Resolution
(bit
RES[2:0])
Analog watchdog comparison
between:
Comments
Raw converted
data, left
aligned (1)
Thresholds
16 bitsDATA[15:0]LTR1[25:0] and
HTR1[25:0]
-
14 bitsDATA[15:2],00LTR1[25:0] and
HTR1[25:0]
User must configure LTR1[1:0] and
HTR1[1:0] to 00
12 bitsDATA[15:4],0000LTR1[25:0] and
HTR1[25:0]
User must configure LTR1[3:0] and
HTR1[3:0] to 0000
10 bitsDATA[15:6],00000
0
LTR1[25:0] and
HTR1[25:0]
User must configure LTR1[5:0] and
HTR1[5:0] to 000000
8 bitsDATA[15:8],00000
000
LTR1[25:0] and
HTR1[25:0]
User must configure LTR1[7:0] and
HTR1[7:0] to 00000000
  1. 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 AWDCHy[19:0] (y=2,3).

The corresponding watchdog is enabled when any bit of AWDCHy[19:0] (y=2,3) is set.

The threshold can be up to 26-bits (16-bit resolution with oversampling, OSVR[9:0]=1024) and are programmed with the ADC_HTR2, ADC_LTR2, ADC_LTR3, and ADC_HTR3 registers.

When converting data with a resolution of less than 16 bits (according to bits RES[2:0]), the LSBs of the programmed thresholds must be kept cleared, the internal comparison being performed on the full 16-bit converted data (left aligned to the half-word boundary).

ADCx_AWDy_OUT signal output generation

Each analog watchdog is associated to an internal hardware signal ADCx_AWDy_OUT (x=ADC number, y=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 ADCx_AWDy_OUT signal as ETR.

ADCx_AWDy_OUT is activated when the associated analog watchdog is enabled:

Note: AWDx flag is set by hardware and reset by software: AWDy flag has no influence on the generation of ADCx_AWDy_OUT (ex: ADCy_AWDy_OUT can toggle while AWDx flag remains at 1 if the software did not clear the flag).

Figure 178. ADCy_AWDx_OUT signal generation (on all regular channels)

Timing diagram for Figure 178 showing ADC STATE, EOC FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals over seven conversions. The AWDx FLAG is cleared by software after each 'outside' conversion, causing the ADCy_AWDx_OUT signal to toggle.

The diagram illustrates the signal generation for ADCy_AWDx_OUT when the AWDx flag is cleared by software. The ADC STATE shows a sequence of conversions: Conversion1 (inside), Conversion2 (outside), Conversion3 (inside), Conversion4 (outside), Conversion5 (outside), Conversion6 (outside), and Conversion7 (inside). The EOC FLAG pulses at the end of each conversion. The AWDx FLAG is set by hardware when a conversion is 'outside' and is manually cleared by software (S/W) after each such conversion. Consequently, the ADCy_AWDx_OUT signal toggles: it is high during Conversion2, low during Conversion3, high again during Conversions 4 and 5, and low again during Conversion6 and 7.

Legend:

MS31025V1

Timing diagram for Figure 178 showing ADC STATE, EOC FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals over seven conversions. The AWDx FLAG is cleared by software after each 'outside' conversion, causing the ADCy_AWDx_OUT signal to toggle.

Figure 179. ADCy_AWDx_OUT signal generation (AWDx flag not cleared by SW)

Timing diagram for Figure 179 showing ADC STATE, EOC FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals over seven conversions. The AWDx FLAG is not cleared by software, remaining high after the first 'outside' conversion, which keeps the ADCy_AWDx_OUT signal high throughout the sequence.

The diagram illustrates the signal generation for ADCy_AWDx_OUT when the AWDx flag is not cleared by software. The ADC STATE and EOC FLAG signals are identical to Figure 178. However, the AWDx FLAG, once set by hardware during Conversion2 ('outside'), is not cleared by software. It remains high for the remainder of the sequence. As a result, the ADCy_AWDx_OUT signal goes high at Conversion2 and remains high through Conversion7, despite Conversion3 being 'inside' and Conversions 6 and 7 also being 'inside'.

Legend:

MS31026V1

Timing diagram for Figure 179 showing ADC STATE, EOC FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals over seven conversions. The AWDx FLAG is not cleared by software, remaining high after the first 'outside' conversion, which keeps the ADCy_AWDx_OUT signal high throughout the sequence.

Figure 180. ADC y _AWD x _OUT signal generation (on a single regular channel)

Timing diagram for Figure 180 showing ADC STATE, EOC FLAG, EOS FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals for regular channels 1 and 2, with only channel 1 guarded.

The diagram shows the relationship between ADC state, flags, and the AWD output signal for regular channels. The ADC STATE is divided into segments for Conversion1 and Conversion2. Conversion1 is labeled 'outside', 'inside', 'outside', 'outside'. Conversion2 is not explicitly labeled but follows Conversion1. The EOC FLAG pulses at the end of each conversion. The EOS FLAG pulses at the end of the sequence. The AWDx FLAG is high when Conversion1 is 'inside' and is cleared by software (S/W). The ADCy_AWDx_OUT signal is high when Conversion1 is 'inside'.

MS31027V1

Timing diagram for Figure 180 showing ADC STATE, EOC FLAG, EOS FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals for regular channels 1 and 2, with only channel 1 guarded.

Figure 181. ADC y _AWD x _OUT signal generation (on all injected channels)

Timing diagram for Figure 181 showing ADC STATE, JEOS FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals for injected channels 1, 2, 3, and 4, all of which are guarded.

The diagram shows the relationship between ADC state, flags, and the AWD output signal for injected channels. The ADC STATE starts with RDY and then shows segments for Conversion1 (inside), Conversion2 (outside), Conversion3 (inside), Conversion4 (outside), Conversion (outside), Conversion (outside), and Conversion (inside). The JEOS FLAG pulses at the end of the sequence. The AWDx FLAG is high when any of the guarded channels (1, 2, 3, 4) is 'inside' and is cleared by software (S/W). The ADCy_AWDx_OUT signal is high when any of the guarded channels is 'inside'.

MS31028V1

Timing diagram for Figure 181 showing ADC STATE, JEOS FLAG, AWDx FLAG, and ADCy_AWDx_OUT signals for injected channels 1, 2, 3, and 4, all of which are guarded.

25.4.31 Oversampler

The oversampling unit performs data preprocessing to offload the CPU. It is able to handle multiple conversions and average them into a single data with increased data width, up to 26-bit (16-bit values and OSVR[9:0] = 1024).

It provides a result with the following form, where N and M can be adjusted:

\[ \text{Result} = \frac{1}{M} \times \sum_{n=0}^{n=N-1} \text{Conversion}(t_n) \]

It allows to perform by hardware the following functions: averaging, data rate reduction, SNR improvement, basic filtering.

The oversampling ratio N is defined using the OSVR[9:0] bits in the ADC_CFGR2 register, and can range from 2x to 1024x. The division coefficient M consists of a right bit shift up to 10 bits, and is defined using the OVSS[3:0] bits in the ADC_CFGR2 register.

The summation unit can yield a result up to 26 bits (1024 x 16-bit results), which can be left or right shifted. When right shifting is selected, it is rounded to the nearest value using the least significant bits left apart by the shifting, before being transferred into the ADC_DR data register.

The Table 182 gives a numerical example of the processing, from a raw 26-bit accumulated data to the final 16-bit result.

Figure 182. 16-bit result oversampling with 10-bits right shift and rouding

Diagram showing 16-bit result oversampling with 10-bits right shift and rounding examples.
31231570
16-bit data
OSVR=1024
0D25..D0OVSS[3:0]=0
➠ Right shifting and rounding
16-bit data
OSVR=1024
0D15..D0OVSS[3:0]=1010
31231570
16-bit data
OSVR=1024
00x3FFE258OVSS[3:0]=0
➠ Right shifting and rounding
16-bit data
OSVR=1024
00xFFF9OVSS[3:0]=1010

MSv41028V2

Diagram showing 16-bit result oversampling with 10-bits right shift and rounding examples.

There are no changes for conversion timings in oversampled mode: the sample time is maintained equal during the whole oversampling sequence. A new data is provided every N conversions, with an equivalent delay equal to \( N \times T_{\text{CONV}} = N \times (t_{\text{SMPL}} + t_{\text{SAR}}) \) . The flags are set as follow:

Single ADC operating modes support when oversampling

In oversampling mode, most of the ADC operating modes are maintained:

Note: The alignment mode is not available when working with oversampled data. The data are always provided right-aligned.

Analog watchdog

The analog watchdog functionality is maintained (AWDSGL and AWDEN bits), with the following difference:

Note: Care must be taken when using high shifting values, this will reduce the comparison range. For instance, if the oversampled result is shifted by 4 bits, thus yielding a 12-bit data right-aligned, the effective analog watchdog comparison can only be performed on 8 bits. The comparison is done between ADC_DR[11:4] and HT[0:7] / LT[0:7], and HT[11:8] / LT[11:8] must be kept reset.

Triggered mode

The averager can also be used for basic filtering purpose. Although not a very powerful filter (slow roll-off and limited stop band attenuation), it can be used as a notch filter to reject constant parasitic frequencies (typically coming from the mains or from a switched mode power supply). For this purpose, a specific discontinuous mode can be enabled with TROVS bit in ADC_CFGR2, to be able to have an oversampling frequency defined by a user and independent from the conversion time itself.

The Figure 183 below shows how conversions are started in response to triggers during discontinuous mode.

If the TROVS bit is set, the content of the DISCEN bit is ignored and considered as 1.

Figure 183. Triggered regular oversampling mode (TROVS bit = 1)

Figure 183: Triggered regular oversampling mode (TROVS bit = 1). The diagram illustrates two scenarios for regular oversampling. The top scenario shows a sequence of four channels (Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3) being converted upon a trigger. The bottom scenario shows a sequence of seven channels (Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(N)0, Ch(N)1, Ch(N)2) being converted upon a trigger. Both scenarios show the EOC flag set after the sequence of conversions. The top scenario is labeled with CONT=0, DISCEN = 1, TROVS = 0. The bottom scenario is labeled with CONT=0, DISCEN = 1, TROVS = 1. The diagram is labeled MS34455V2.

The diagram illustrates two scenarios for regular oversampling mode (TROVS bit = 1). In the top scenario, the ADC is configured with CONT=0, DISCEN = 1, and TROVS = 0. A trigger initiates a sequence of four channel conversions: Ch(N)0, Ch(N)1, Ch(N)2, and Ch(N)3. The EOC flag is set after the last conversion. In the bottom scenario, the ADC is configured with CONT=0, DISCEN = 1, and TROVS = 1. A trigger initiates a sequence of seven channel conversions: Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(N)0, Ch(N)1, and Ch(N)2. The EOC flag is set after the last conversion. The diagram is labeled MS34455V2.

Figure 183: Triggered regular oversampling mode (TROVS bit = 1). The diagram illustrates two scenarios for regular oversampling. The top scenario shows a sequence of four channels (Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3) being converted upon a trigger. The bottom scenario shows a sequence of seven channels (Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(N)0, Ch(N)1, Ch(N)2) being converted upon a trigger. Both scenarios show the EOC flag set after the sequence of conversions. The top scenario is labeled with CONT=0, DISCEN = 1, TROVS = 0. The bottom scenario is labeled with CONT=0, DISCEN = 1, TROVS = 1. The diagram is labeled MS34455V2.

Injected and regular sequencer management when oversampling

In oversampling mode, it is possible to have differentiated behavior for injected and regular sequencers. The oversampling can be enabled for both sequencers with some limitations if they have to be used simultaneously (this is related to a unique accumulation unit).

Oversampling regular channels only

The regular oversampling mode bit ROVSM defines how the regular oversampling sequence is resumed if it is interrupted by injected conversion:

The Figure 184 gives examples for a 4x oversampling ratio.

Figure 184. Regular oversampling modes (4x ratio)

Figure 184: Regular oversampling modes (4x ratio). The diagram is split into two horizontal sections. The top section, 'Continued mode', shows a sequence of regular channels: Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(M)0, Ch(M)1. A trigger occurs at Ch(M)0, and oversampling is stopped at Ch(M)1. An 'Abort' signal is shown. The sequence resumes with Ch(M)1, Ch(M)2, Ch(M)3, Ch(O)0, with oversampling continued. The bottom section, 'Resumed mode', shows the same initial sequence. A trigger occurs at Ch(M)0, and oversampling is aborted at Ch(M)1. An 'Abort' signal is shown. The sequence resumes with Ch(M)0, Ch(M)1, Ch(M)2, Ch(M)3, with oversampling resumed. Both sections show injected channels Ch(J) and Ch(K) being converted after the regular channels, leading to JEOC. Configuration bits are: Continued mode: ROVSE = 1, JOVSE = 0, ROVSM = 0, TROVS = X; Resumed mode: ROVSE = 1, JOVSE = 0, ROVSM = 1, TROVS = X. MS34456V1 is noted in the bottom right.
Figure 184: Regular oversampling modes (4x ratio). The diagram is split into two horizontal sections. The top section, 'Continued mode', shows a sequence of regular channels: Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(M)0, Ch(M)1. A trigger occurs at Ch(M)0, and oversampling is stopped at Ch(M)1. An 'Abort' signal is shown. The sequence resumes with Ch(M)1, Ch(M)2, Ch(M)3, Ch(O)0, with oversampling continued. The bottom section, 'Resumed mode', shows the same initial sequence. A trigger occurs at Ch(M)0, and oversampling is aborted at Ch(M)1. An 'Abort' signal is shown. The sequence resumes with Ch(M)0, Ch(M)1, Ch(M)2, Ch(M)3, with oversampling resumed. Both sections show injected channels Ch(J) and Ch(K) being converted after the regular channels, leading to JEOC. Configuration bits are: Continued mode: ROVSE = 1, JOVSE = 0, ROVSM = 0, TROVS = X; Resumed mode: ROVSE = 1, JOVSE = 0, ROVSM = 1, TROVS = X. MS34456V1 is noted in the bottom right.

Oversampling Injected channels only

The Injected oversampling mode bit JOVSE enables oversampling solely for conversions in the injected sequencer.

Oversampling regular and Injected channels

It is possible to have both ROVSE and JOVSE bits set. In this case, the regular oversampling mode is forced to resumed mode (ROVSM bit ignored), as represented on Figure 185 below.

Figure 185. Regular and injected oversampling modes used simultaneously

Figure 185: Regular and injected oversampling modes used simultaneously. The diagram shows a sequence of regular channels: Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(M)0, Ch(M)1. A trigger occurs at Ch(M)0, and oversampling is aborted at Ch(M)1. An 'Abort' signal is shown. The sequence resumes with Ch(M)0, Ch(M)1. Below the regular channels, injected channels Ch(J)0, Ch(J)1, Ch(J)2, Ch(J)3 are shown, with oversampling resumed for them. The sequence ends with JEOC. Configuration bits are: ROVSE = 1, JOVSE = 1, ROVSM = 1, TROVS = 0. MS34457V2 is noted in the bottom right.
Figure 185: Regular and injected oversampling modes used simultaneously. The diagram shows a sequence of regular channels: Ch(N)0, Ch(N)1, Ch(N)2, Ch(N)3, Ch(M)0, Ch(M)1. A trigger occurs at Ch(M)0, and oversampling is aborted at Ch(M)1. An 'Abort' signal is shown. The sequence resumes with Ch(M)0, Ch(M)1. Below the regular channels, injected channels Ch(J)0, Ch(J)1, Ch(J)2, Ch(J)3 are shown, with oversampling resumed for them. The sequence ends with JEOC. Configuration bits are: ROVSE = 1, JOVSE = 1, ROVSM = 1, TROVS = 0. MS34457V2 is noted in the bottom right.

Triggered regular oversampling with injected conversions

It is possible to have triggered regular mode with injected conversions. In this case, the injected mode oversampling mode must be disabled, and the ROVSM bit is ignored (resumed mode is forced). The JOVSE bit must be reset. The behavior is represented on Figure 186 below.

Figure 186. Triggered regular oversampling with injection

Timing diagram for triggered regular oversampling with injection. It shows a sequence of regular channels (Ch(N)0, Ch(N)1, Ch(N)2) and injected channels (Ch(J), Ch(K)). Triggers are shown for the regular channels. The injected channels are triggered by the regular channel Ch(N)2. The diagram indicates that the injected mode oversampling is disabled (ROVSE=1, JOVSE=0, ROVSM=1, TROVS=1). The regular channel sequence is resumed after the injected channels. The text 'Oversampling resumed' is shown above the resumed regular channels. The text 'Abort' is shown between the regular and injected channels. The text 'Resumed' is shown below the resumed regular channels. The text 'MS34458V4' is shown in the bottom right corner.

ROVSE = 1, JOVSE = 0, ROVSM = 1, TROVS = 1

MS34458V4

Timing diagram for triggered regular oversampling with injection. It shows a sequence of regular channels (Ch(N)0, Ch(N)1, Ch(N)2) and injected channels (Ch(J), Ch(K)). Triggers are shown for the regular channels. The injected channels are triggered by the regular channel Ch(N)2. The diagram indicates that the injected mode oversampling is disabled (ROVSE=1, JOVSE=0, ROVSM=1, TROVS=1). The regular channel sequence is resumed after the injected channels. The text 'Oversampling resumed' is shown above the resumed regular channels. The text 'Abort' is shown between the regular and injected channels. The text 'Resumed' is shown below the resumed regular channels. The text 'MS34458V4' is shown in the bottom right corner.

Auto-injected mode

It is possible to oversample auto-injected sequences and have all conversions results stored in registers to save a DMA resource. This mode is available only with both regular and injected oversampling active: JAUTO = 1, ROVSE = 1 and JOVSE = 1, other combinations are not supported. The ROVSM bit is ignored in auto-injected mode. The Figure 187 below shows how the conversions are sequenced.

Figure 187. Oversampling in auto-injected mode

Timing diagram for oversampling in auto-injected mode. It shows a sequence of regular channels (N0, N1, N2, N3) and injected channels (I0, I1, I2, I3, J0, J1, J2, J3, K0, K1, K2, K3, L0, L1, L2, L3). The injected channels are triggered by the regular channels. The diagram indicates that the injected mode oversampling is active (JAUTO=1, ROVSE=1, JOVSE=1, ROVSM=X, TROVS=0). The regular channel sequence is resumed after the injected channels. The text 'MS34459V1' is shown in the bottom right corner.

JAUTO = 1, ROVSE = 1, JOVSE = 1, ROVSM = X, TROVS = 0

MS34459V1

Timing diagram for oversampling in auto-injected mode. It shows a sequence of regular channels (N0, N1, N2, N3) and injected channels (I0, I1, I2, I3, J0, J1, J2, J3, K0, K1, K2, K3, L0, L1, L2, L3). The injected channels are triggered by the regular channels. The diagram indicates that the injected mode oversampling is active (JAUTO=1, ROVSE=1, JOVSE=1, ROVSM=X, TROVS=0). The regular channel sequence is resumed after the injected channels. The text 'MS34459V1' is shown in the bottom right corner.

It is possible to have also the triggered mode enabled, using the TROVS bit. In this case, the ADC must be configured as following: JAUTO=1, DISCEN=0, JDISCEN=0, ROVSE=1, JOVSE=1 and TROVSE=1.

Dual ADC modes support when oversampling

It is possible to have oversampling enabled when working in dual ADC configuration, for the injected simultaneous mode and regular simultaneous mode. In this case, the two ADCs must be programmed with the very same settings (including oversampling).

All other dual ADC modes are not supported when either regular or injected oversampling is enabled (ROVSE = 1 or JOVSE = 1).

Combined modes summary

The Table 218 below summarizes all combinations, including modes not supported.

Table 218. Oversampler operating modes summary

Regular Over-
sampling
ROVSE
Injected Over-
sampling
JOVSE
Oversampler
mode
ROVSM
0 = continued
1 = resumed
Triggered
Regular mode
TROVS
Comment
1000Regular continued mode
1001Not supported
1010Regular resumed mode
1011Triggered regular resumed mode
110XNot supported
1110Injected and regular resumed mode
1111Not supported
01XXInjected oversampling

25.4.32 Dual ADC modes

In devices with two ADCs or more, dual ADC modes can be used (see Figure 188 ):

In dual ADC mode the start of conversion is triggered alternately or simultaneously by the ADCx master to the ADC slave, depending on the mode selected by the bits DUAL[4:0] in the ADCx_CCR register.

Four possible modes are implemented:

It is also possible to use these modes combined in the following ways:

In dual ADC mode (when bits DUAL[4:0] in ADCx_CCR register are not equal to zero), the bits CONT, AUTDLY, DISCEN, DISCNUM[2:0], JDISCEN, JQM, JAUTO of the ADC_CFGR register are shared between the master and slave ADC: the bits in the slave ADC are always equal to the corresponding bits of the master ADC.

To start a conversion in dual mode, the user must program the bits EXTEN, EXTSEL, JEXTEN, JEXTSEL of the master ADC only, to configure a software or hardware trigger,

and a regular or injected trigger. (the bits EXTEN[1:0] and JEXTEN[1:0] of the slave ADC are don't care).

In regular simultaneous or interleaved modes: once the user sets bit ADSTART or bit ADSTP of the master ADC, the corresponding bit of the slave ADC is also automatically set. However, bit ADSTART or bit ADSTP of the slave ADC is not necessary cleared at the same time as the master ADC bit.

In injected simultaneous or alternate trigger modes: once the user sets bit JADSTART or bit JADSTP of the master ADC, the corresponding bit of the slave ADC is also automatically set. However, bit JADSTART or bit JADSTP of the slave ADC is not necessary cleared at the same time as the master ADC bit.

In dual ADC mode, the converted data of the master and slave ADC can be read in parallel, by reading the ADC common data register (ADCx_CDR). The status bits can be also read in parallel by reading the dual-mode status register (ADCx_CSR).

Figure 188. Dual ADC block diagram (1)

Dual ADC block diagram showing Master ADC and Slave ADC components, including channels, registers, and triggers.

The diagram illustrates the internal architecture of a Dual ADC system. It consists of two main ADC blocks: a Slave ADC at the top and a Master ADC at the bottom. Both ADCs have their own Regular channels and Injected channels . The Slave ADC's regular channels output to a Regular data register (32-bits) , while its injected channels output to Injected data registers (4 x32-bits) . The Master ADC follows a similar pattern with its own regular and injected data registers. All four data registers are connected to a common Address/data bus on the right. Input signals include Internal analog inputs and GPIO ports (labeled with ADCx_INP0, ADCx_INN0, ADCx_INP2, ADCx_INN2, ..., ADCx_INP19, ADCx_INN19). These inputs are multiplexed before entering the ADC channels. Triggering is managed by Internal triggers , Start trigger mux. (regular group) , and Start trigger mux. (injected group) . A Dual mode control block is also shown, connected to the Master ADC's triggers.

Dual ADC block diagram showing Master ADC and Slave ADC components, including channels, registers, and triggers.

MSV41029V2

Injected simultaneous mode

This mode is selected by programming bits DUAL[4:0]=00101

This mode converts an injected group of channels. The external trigger source comes from the injected group multiplexer of the master ADC (selected by the JEXTSEL[4:0] bits in the ADC_JSQR register).

Note: Do not convert the same channel on the two ADCs (no overlapping sampling times for the two ADCs when converting the same channel).

In simultaneous mode, one must convert sequences with the same length and inside a sequence, the N-th conversion in master and slave must be configured with the same sampling time.

Regular conversions can be performed on one or all ADCs. In that case, they are independent of each other and are interrupted when an injected event occurs. They are resumed at the end of the injected conversion group.

Figure 189. Injected simultaneous mode on 4 channels: dual ADC mode

Timing diagram for Injected simultaneous mode on 4 channels: dual ADC mode. The diagram shows two horizontal timelines for MASTER ADC and SLAVE ADC. The MASTER ADC timeline has four boxes labeled CH1, CH2, CH3, and CH4. The SLAVE ADC timeline has four boxes labeled CH15, CH14, CH13, and CH12. A 'Trigger' arrow points to the start of the MASTER ADC sequence. Below the triggers, a legend shows a small square for 'Sampling' and a larger rectangle for 'Conversion'. Arrows point from the end of the MASTER ADC sequence and the SLAVE ADC sequence to a label 'End of injected sequence on MASTER and SLAVE ADC'. The diagram is labeled MS31900V1 in the bottom right corner.
Timing diagram for Injected simultaneous mode on 4 channels: dual ADC mode. The diagram shows two horizontal timelines for MASTER ADC and SLAVE ADC. The MASTER ADC timeline has four boxes labeled CH1, CH2, CH3, and CH4. The SLAVE ADC timeline has four boxes labeled CH15, CH14, CH13, and CH12. A 'Trigger' arrow points to the start of the MASTER ADC sequence. Below the triggers, a legend shows a small square for 'Sampling' and a larger rectangle for 'Conversion'. Arrows point from the end of the MASTER ADC sequence and the SLAVE ADC sequence to a label 'End of injected sequence on MASTER and SLAVE ADC'. The diagram is labeled MS31900V1 in the bottom right corner.

If JDISCEN=1, each simultaneous conversion of the injected sequence requires an injected trigger event to occur.

This mode can be combined with AUTDLY mode:

Regular simultaneous mode with independent injected

This mode is selected by programming bits DUAL[4:0] = 00110.

This mode is performed on a regular group of channels. The external trigger source comes from the regular group multiplexer of the master ADC (selected by the EXTSEL[4:0] bits in the ADC_CFGR register). A simultaneous trigger is provided to the slave ADC.

In this mode, independent injected conversions are supported. An injection request (either on master or on the slave) will abort the current simultaneous conversions, which are re-started once the injected conversion is completed.

Note: Do not convert the same channel on the two ADCs (no overlapping sampling times for the two ADCs when converting the same channel).

In regular simultaneous mode, one must convert sequences with the same length and inside a sequence, the N-th conversion in master and slave must be configured with the same sampling time.

Software is notified by interrupts when it can read the data:

It is also possible to read the regular data using the DMA. Two methods are possible:

Note: When DAMDF[1:0]=0b10 or 0b11, the user must program the same number of conversions in the master's sequence as in the slave's sequence. Otherwise, the remaining conversions will not generate a DMA request.

Figure 190. Regular simultaneous mode on 16 channels: dual ADC mode

Diagram illustrating regular simultaneous mode on 16 channels for dual ADC mode. It shows two parallel sequences of 16 channels (CH1 to CH16) for MASTER ADC and SLAVE ADC. The MASTER ADC sequence starts with CH1, CH2, CH3, CH4, ..., CH16. The SLAVE ADC sequence starts with CH16, CH14, CH13, CH12, ..., CH1. A 'Trigger' arrow points to the start of the sequences. A legend indicates that a small square represents 'Sampling' and a larger rectangle represents 'Conversion'. An arrow points to the end of the sequences with the text 'End of regular sequence on MASTER and SLAVE ADC'. The diagram is labeled 'ai16054b'.
Diagram illustrating regular simultaneous mode on 16 channels for dual ADC mode. It shows two parallel sequences of 16 channels (CH1 to CH16) for MASTER ADC and SLAVE ADC. The MASTER ADC sequence starts with CH1, CH2, CH3, CH4, ..., CH16. The SLAVE ADC sequence starts with CH16, CH14, CH13, CH12, ..., CH1. A 'Trigger' arrow points to the start of the sequences. A legend indicates that a small square represents 'Sampling' and a larger rectangle represents 'Conversion'. An arrow points to the end of the sequences with the text 'End of regular sequence on MASTER and SLAVE ADC'. The diagram is labeled 'ai16054b'.

If DISCEN=1 then each “n” simultaneous conversions of the regular sequence require a regular trigger event to occur (“n” is defined by DISCNUM).

This mode can be combined with AUTDLY mode:

It is possible to use the DMA to handle data in regular simultaneous mode combined with AUTDLY mode, assuming that multi-DMA mode is used: bits DAMDF must be set to 0b10 or 0b11.

When regular simultaneous mode is combined with AUTDLY mode, it is mandatory for the user to ensure that:

Note: This combination of regular simultaneous mode and AUTDLY mode is restricted to the use case when only regular channels are programmed: it is forbidden to program injected channels in this combined mode.

Interleaved mode with independent injected

This mode is selected by programming bits DUAL[4:0] = 00111.

This mode can be started only on a regular group (usually one channel). The external trigger source comes from the regular channel multiplexer of the master ADC.

After an external trigger occurs:

The minimum delay which separates 2 conversions in interleaved mode is configured in the DELAY bits in the ADCx_CCR register. This delay starts to count after the end of the sampling phase of the master conversion. This way, an ADC cannot start a conversion if the

complementary ADC is still sampling its input (only one ADC can sample the input signal at a given time).

If the CONT bit is set on both master and slave ADCs, the selected regular channels of both ADCs are continuously converted.

The software is notified by interrupts when it can read the data at the end of each conversion event (EOC) on the slave ADC. A slave and master EOC interrupts are generated (if EOCIE is enabled) and the software can read the ADC_DR of the slave/master ADC.

Note: It is possible to enable only the EOC interrupt of the slave and read the common data register (ADCx_CDR). But in this case, the user must ensure that the duration of the conversions are compatible to ensure that inside the sequence, a master conversion is always followed by a slave conversion before a new master conversion restarts. It is recommended to use the MDMA mode.

It is also possible to have the regular data transferred by DMA. In this case, individual DMA requests on each ADC cannot be used and it is mandatory to use the MDMA mode, as following:

Figure 191. Interleaved mode on 1 channel in continuous conversion mode: dual ADC mode

Timing diagram for dual ADC interleaved mode. It shows two horizontal timelines for MASTER ADC and SLAVE ADC. The MASTER ADC starts with a 'Sampling' phase (grey box) followed by a 'Conversion' phase (white box labeled CH1). The SLAVE ADC is triggered by the MASTER ADC's conversion and follows with its own 'Sampling' and 'Conversion' phases (also labeled CH1). Vertical dashed lines indicate timing intervals of 3.5 ADCCLK cycles between the start of the master's conversion and the start of the slave's conversion, and between the start of the slave's conversion and the end of the master's conversion. The diagram ends with an arrow pointing to the completion of both conversions, labeled 'End of conversion on master and slave ADC'. A legend at the bottom left shows a grey box for 'Sampling' and a white box for 'Conversion'. The diagram is labeled MSv41030V2 in the bottom right corner.
Timing diagram for dual ADC interleaved mode. It shows two horizontal timelines for MASTER ADC and SLAVE ADC. The MASTER ADC starts with a 'Sampling' phase (grey box) followed by a 'Conversion' phase (white box labeled CH1). The SLAVE ADC is triggered by the MASTER ADC's conversion and follows with its own 'Sampling' and 'Conversion' phases (also labeled CH1). Vertical dashed lines indicate timing intervals of 3.5 ADCCLK cycles between the start of the master's conversion and the start of the slave's conversion, and between the start of the slave's conversion and the end of the master's conversion. The diagram ends with an arrow pointing to the completion of both conversions, labeled 'End of conversion on master and slave ADC'. A legend at the bottom left shows a grey box for 'Sampling' and a white box for 'Conversion'. The diagram is labeled MSv41030V2 in the bottom right corner.

Figure 192. Interleaved mode on 1 channel in single conversion mode: dual ADC mode

Timing diagram for Figure 192 showing interleaved mode on 1 channel in single conversion mode for dual ADC. The diagram illustrates two conversion cycles. In the first cycle, the Master ADC starts sampling CH1, and the Slave ADC is triggered. After 3.5 ADCCLK cycles, the conversion ends on both the master and slave ADC. The second cycle follows the same pattern. A legend indicates that gray boxes represent sampling and white boxes represent conversion.

Timing diagram for Figure 192. The diagram shows two conversion cycles. In the first cycle, the Master ADC starts sampling CH1, and the Slave ADC is triggered. After 3.5 ADCCLK cycles, the conversion ends on both the master and slave ADC. The second cycle follows the same pattern. A legend indicates that gray boxes represent sampling and white boxes represent conversion.

Timing diagram for Figure 192 showing interleaved mode on 1 channel in single conversion mode for dual ADC. The diagram illustrates two conversion cycles. In the first cycle, the Master ADC starts sampling CH1, and the Slave ADC is triggered. After 3.5 ADCCLK cycles, the conversion ends on both the master and slave ADC. The second cycle follows the same pattern. A legend indicates that gray boxes represent sampling and white boxes represent conversion.

If DISCEN=1, each “n” simultaneous conversions (“n” is defined by DISCNUM) of the regular sequence require a regular trigger event to occur.

In this mode, injected conversions are supported. When injection is done (either on master or on slave), both the master and the slave regular conversions are aborted and the sequence is re-started from the master (see Figure 193 below).

Figure 193. Interleaved conversion with injection

Timing diagram for Figure 193 showing interleaved conversion with injection. The diagram shows a sequence of regular conversions on ADC1 (master) and ADC2 (slave). An injected trigger occurs, causing the regular conversions to be aborted. The injected conversion (CH11) is performed on the master ADC. After the injection, the regular conversions resume on the master ADC. A legend indicates that gray boxes represent sampling and white boxes represent conversion.

Timing diagram for Figure 193. The diagram shows a sequence of regular conversions on ADC1 (master) and ADC2 (slave). An injected trigger occurs, causing the regular conversions to be aborted. The injected conversion (CH11) is performed on the master ADC. After the injection, the regular conversions resume on the master ADC. A legend indicates that gray boxes represent sampling and white boxes represent conversion.

Timing diagram for Figure 193 showing interleaved conversion with injection. The diagram shows a sequence of regular conversions on ADC1 (master) and ADC2 (slave). An injected trigger occurs, causing the regular conversions to be aborted. The injected conversion (CH11) is performed on the master ADC. After the injection, the regular conversions resume on the master ADC. A legend indicates that gray boxes represent sampling and white boxes represent conversion.

Alternate trigger mode

This mode is selected by programming bits DUAL[4:0] = 01001.

This mode can be started only on an injected group. The source of external trigger comes from the injected group multiplexer of the master ADC.

This mode is only possible when selecting hardware triggers: JEXTEN must not be 0x0.

Injected discontinuous mode disabled (JDISCEN=0 for both ADC)

  1. 1. When the 1st trigger occurs, all injected master ADC channels in the group are converted.
  2. 2. When the 2nd trigger occurs, all injected slave ADC channels in the group are converted.
  3. 3. And so on.

A JEOS interrupt, if enabled, is generated after all injected channels of the master ADC in the group have been converted.

A JEOS interrupt, if enabled, is generated after all injected channels of the slave ADC in the group have been converted.

JEOC interrupts, if enabled, can also be generated after each injected conversion.

If another external trigger occurs after all injected channels in the group have been converted then the alternate trigger process restarts by converting the injected channels of the master ADC in the group.

Figure 194. Alternate trigger: injected group of each ADC

Timing diagram showing the sequence of Master and Slave ADC conversions triggered by four external events. The diagram illustrates sampling and conversion phases for injected groups. Interrupts JEOC and JEOS are shown occurring at various points in the sequence for both Master and Slave ADCs.

The diagram illustrates the timing of injected group conversions for a Master ADC and a Slave ADC across four trigger events. Each ADC has a sequence of three injected channels. Each channel consists of a sampling phase (grey) followed by a conversion phase (white). The sequence of events is as follows:

Legend: Grey box = Sampling, White box = Conversion. Source: ai16059-m.

Timing diagram showing the sequence of Master and Slave ADC conversions triggered by four external events. The diagram illustrates sampling and conversion phases for injected groups. Interrupts JEOC and JEOS are shown occurring at various points in the sequence for both Master and Slave ADCs.

Note: Regular conversions can be enabled on one or all ADCs. In this case the regular conversions are independent of each other. A regular conversion is interrupted when the ADC has to perform an injected conversion. It is resumed when the injected conversion is finished.

The time interval between 2 trigger events must be greater than or equal to 1 ADC clock period. The minimum time interval between 2 trigger events that start conversions on the same ADC is the same as in the single ADC mode.

Injected discontinuous mode enabled (JDISCEN=1 for both ADC)

If the injected discontinuous mode is enabled for both master and slave ADCs:

A JEOS interrupt, if enabled, is generated after all injected channels of the master ADC in the group have been converted.

A JEOS interrupt, if enabled, is generated after all injected channels of the slave ADC in the group have been converted.

JEOC interrupts, if enabled, can also be generated after each injected conversions.

If another external trigger occurs after all injected channels in the group have been converted then the alternate trigger process restarts.

Figure 195. Alternate trigger: 4 injected channels (each ADC) in discontinuous mode

Timing diagram for alternate trigger mode with 4 injected channels per ADC. It shows two rows: MASTER ADC and SLAVE ADC. Eight triggers are shown sequentially. Triggers 1, 3, 5, and 7 initiate sampling (grey box) and conversion (white box) on the Master ADC. Triggers 2, 4, 6, and 8 initiate sampling and conversion on the Slave ADC. Arrows indicate JEOC (End of Conversion) interrupts after each conversion. For the Master ADC, JEOC occurs after triggers 1, 3, 5, and 7. For the Slave ADC, JEOC occurs after triggers 2, 4, and 6. After the 7th trigger conversion, JEOC and JEOS (End of Sequence) are flagged for the Master ADC. After the 8th trigger conversion, JEOC and JEOS are flagged for the Slave ADC.

Legend: Sampling Conversion

Timing diagram for alternate trigger mode with 4 injected channels per ADC. It shows two rows: MASTER ADC and SLAVE ADC. Eight triggers are shown sequentially. Triggers 1, 3, 5, and 7 initiate sampling (grey box) and conversion (white box) on the Master ADC. Triggers 2, 4, 6, and 8 initiate sampling and conversion on the Slave ADC. Arrows indicate JEOC (End of Conversion) interrupts after each conversion. For the Master ADC, JEOC occurs after triggers 1, 3, 5, and 7. For the Slave ADC, JEOC occurs after triggers 2, 4, and 6. After the 7th trigger conversion, JEOC and JEOS (End of Sequence) are flagged for the Master ADC. After the 8th trigger conversion, JEOC and JEOS are flagged for the Slave ADC.

Combined regular/injected simultaneous mode

This mode is selected by programming bits DUAL[4:0] = 00001.

It is possible to interrupt the simultaneous conversion of a regular group to start the simultaneous conversion of an injected group.

Note: The sequences must be converted with the same length, the N-th conversion in master and slave mode must be configured with the same sampling time inside a given sequence, or the interval between triggers has to be longer than the long conversion time of the 2 sequences. If the above conditions are not respected, the ADC with the shortest sequence may restart while the ADC with the longest sequence is completing the previous conversions.

Combined regular simultaneous + alternate trigger mode

This mode is selected by programming bits DUAL[4:0]=00010.

It is possible to interrupt the simultaneous conversion of a regular group to start the alternate trigger conversion of an injected group. Figure 196 shows the behavior of an alternate trigger interrupting a simultaneous regular conversion.

The injected alternate conversion is immediately started after the injected event. If a regular conversion is already running, in order to ensure synchronization after the injected

conversion, the regular conversion of all (master/slave) ADCs is stopped and resumed synchronously at the end of the injected conversion.

Note: The sequences must be converted with the same length, the N-th conversion in master and slave mode must be configured with the same sampling time inside a given sequence, or the interval between triggers has to be longer than the long conversion time of the 2 sequences. If the above conditions are not respected, the ADC with the shortest sequence may restart while the ADC with the longest sequence is completing the previous conversions.

Figure 196. Alternate + regular simultaneous

Timing diagram for alternate + regular simultaneous conversion. It shows four horizontal timelines: ADC MASTER reg, ADC MASTER inj, ADC SLAVE reg, and ADC SLAVE inj. The regular sequences consist of CH1-CH2-CH3, CH3-CH4, and CH4-CH5 for the master, and CH4-CH6-CH7, CH7-CH8, and CH8-CH9 for the slave. Injected sequences consist of CH1 for the master and CH1 for the slave. A '1st trigger' arrow points to the start of the first regular sequence. A '2nd trigger' arrow points to the start of the second injected sequence. A note 'synchronization not lost' is present near the slave injected sequence. The diagram is labeled ai16062V2-m.
Timing diagram for alternate + regular simultaneous conversion. It shows four horizontal timelines: ADC MASTER reg, ADC MASTER inj, ADC SLAVE reg, and ADC SLAVE inj. The regular sequences consist of CH1-CH2-CH3, CH3-CH4, and CH4-CH5 for the master, and CH4-CH6-CH7, CH7-CH8, and CH8-CH9 for the slave. Injected sequences consist of CH1 for the master and CH1 for the slave. A '1st trigger' arrow points to the start of the first regular sequence. A '2nd trigger' arrow points to the start of the second injected sequence. A note 'synchronization not lost' is present near the slave injected sequence. The diagram is labeled ai16062V2-m.

If a trigger occurs during an injected conversion that has interrupted a regular conversion, the alternate trigger is served. Figure 197 shows the behavior in this case (note that the 6th trigger is ignored because the associated alternate conversion is not complete).

Figure 197. Case of trigger occurring during injected conversion

Timing diagram showing a case where a trigger occurs during an injected conversion. It shows four horizontal timelines: ADC MASTER reg, ADC MASTER inj, ADC SLAVE reg, and ADC SLAVE inj. The regular sequences consist of CH1-CH2-CH3, CH3-CH4, CH4-CH5, and CH5-CH6 for the master, and CH7-CH8-CH9, CH9-CH10, CH10-CH11, and CH11-CH12 for the slave. Injected sequences consist of CH14 for the master and CH15 for the slave. Triggers are labeled: 1st trigger (start of regular), 2nd trigger (start of injected), 3rd trigger (start of regular), 4th trigger (start of injected), 5th trigger (start of regular), and 6th trigger (ignored because injected conversion is not complete). The diagram is labeled ai16063V2.
Timing diagram showing a case where a trigger occurs during an injected conversion. It shows four horizontal timelines: ADC MASTER reg, ADC MASTER inj, ADC SLAVE reg, and ADC SLAVE inj. The regular sequences consist of CH1-CH2-CH3, CH3-CH4, CH4-CH5, and CH5-CH6 for the master, and CH7-CH8-CH9, CH9-CH10, CH10-CH11, and CH11-CH12 for the slave. Injected sequences consist of CH14 for the master and CH15 for the slave. Triggers are labeled: 1st trigger (start of regular), 2nd trigger (start of injected), 3rd trigger (start of regular), 4th trigger (start of injected), 5th trigger (start of regular), and 6th trigger (ignored because injected conversion is not complete). The diagram is labeled ai16063V2.

Combined injected simultaneous plus interleaved

This mode is selected by programming bits DUAL[4:0]=00011.

It is possible to interrupt an interleaved conversion with a simultaneous injected event.

In this case the interleaved conversion is interrupted immediately and the simultaneous injected conversion starts. At the end of the injected sequence the interleaved conversion is resumed. When the interleaved regular conversion resumes, the first regular conversion which is performed is always the master's one. Figure 198, Figure 199 and Figure 200 show the behavior using an example.

Caution: In this mode, it is mandatory to use the Common Data Register to read the regular data with a single read access. On the contrary, master-slave data coherency is not guaranteed.

Figure 198. Interleaved single channel CH0 with injected sequence CH11, CH12

Timing diagram for Figure 198 showing interleaved single channel CH0 with injected sequence CH11, CH12. It illustrates the interaction between ADC1 (master) and ADC2 (slave) over time, showing sampling and conversion phases. An injected trigger interrupts the master's conversion of CH0, causing it to be aborted. The slave then completes its injected sequence of CH11 and CH12. After the injection, the master resumes its conversion of CH0. A legend indicates that light gray represents sampling and dark gray represents conversion.

ADC1 (master) [CH0] [CH0] [CH0] ... Conversions aborted ... [CH0] [CH0] [CH0]

ADC2 (slave) [CH0] [CH0] [CH0] ... [CH11] [CH11] ... [CH12] [CH12] ... [CH0] [CH0] [CH0]

read CDR, read CDR, read CDR, read CDR

Legend: Sampling (light gray), Conversion (dark gray)

Injected trigger

Resume (always restart with the master)

MS34461V1

Timing diagram for Figure 198 showing interleaved single channel CH0 with injected sequence CH11, CH12. It illustrates the interaction between ADC1 (master) and ADC2 (slave) over time, showing sampling and conversion phases. An injected trigger interrupts the master's conversion of CH0, causing it to be aborted. The slave then completes its injected sequence of CH11 and CH12. After the injection, the master resumes its conversion of CH0. A legend indicates that light gray represents sampling and dark gray represents conversion.

Figure 199. Two Interleaved channels (CH1, CH2) with injected sequence CH11, CH12 - case 1: Master interrupted first

Timing diagram for Figure 199, case 1: Master interrupted first. It shows ADC1 (master) and ADC2 (slave) interleaving channels CH1 and CH2. When ADC1 starts converting CH1, ADC2 is already converting CH2. An injected trigger occurs while ADC1 is still converting CH1, causing its conversion to be aborted. ADC2 completes its CH2 conversion, then the injected sequence CH11 and CH12 is performed. After the injection, ADC1 resumes its conversion of CH1, and ADC2 resumes its conversion of CH2. A legend indicates that light gray represents sampling and dark gray represents conversion.

ADC1 (master) [CH1] [CH1] [CH1] ... Conversions aborted ... [CH1] [CH1] [CH1]

ADC2 (slave) [CH2] [CH2] [CH2] ... [CH11] [CH11] ... [CH12] [CH12] ... [CH2] [CH2] [CH2]

read CDR, read CDR, read CDR, read CDR

Legend: Sampling (light gray), Conversion (dark gray)

Injected trigger

Resume (always restart with the master)

MS34462V1

Timing diagram for Figure 199, case 1: Master interrupted first. It shows ADC1 (master) and ADC2 (slave) interleaving channels CH1 and CH2. When ADC1 starts converting CH1, ADC2 is already converting CH2. An injected trigger occurs while ADC1 is still converting CH1, causing its conversion to be aborted. ADC2 completes its CH2 conversion, then the injected sequence CH11 and CH12 is performed. After the injection, ADC1 resumes its conversion of CH1, and ADC2 resumes its conversion of CH2. A legend indicates that light gray represents sampling and dark gray represents conversion.

Figure 200. Two Interleaved channels (CH1, CH2) with injected sequence CH11, CH12 - case 2: Slave interrupted first

Timing diagram for Figure 200, case 2: Slave interrupted first. It shows ADC1 (master) and ADC2 (slave) interleaving channels CH1 and CH2. When ADC2 starts converting CH2, ADC1 is already converting CH1. An injected trigger occurs while ADC2 is still converting CH2, causing its conversion to be aborted. ADC1 completes its CH1 conversion, then the injected sequence CH11 and CH12 is performed. After the injection, ADC1 resumes its conversion of CH1, and ADC2 resumes its conversion of CH2. A legend indicates that light gray represents sampling and dark gray represents conversion.

ADC1 (master) [CH1] [CH1] [CH1] ... Conversions aborted ... [CH1] [CH1] [CH1]

ADC2 (slave) [CH2] [CH2] [CH2] ... [CH11] [CH11] ... [CH12] [CH12] ... [CH2] [CH2] [CH2]

read CDR, read CDR, read CDR, read CDR

Legend: Sampling (light gray), Conversion (dark gray)

Injected trigger

Resume (always restart with the master)

MS34463V2

Timing diagram for Figure 200, case 2: Slave interrupted first. It shows ADC1 (master) and ADC2 (slave) interleaving channels CH1 and CH2. When ADC2 starts converting CH2, ADC1 is already converting CH1. An injected trigger occurs while ADC2 is still converting CH2, causing its conversion to be aborted. ADC1 completes its CH1 conversion, then the injected sequence CH11 and CH12 is performed. After the injection, ADC1 resumes its conversion of CH1, and ADC2 resumes its conversion of CH2. A legend indicates that light gray represents sampling and dark gray represents conversion.

DMA requests in dual ADC mode

In all dual ADC modes, it is possible to use two DMA channels (one for the master, one for the slave) to transfer the data, like in single mode (refer to Figure 201: DMA Requests in regular simultaneous mode when DAMDF=0b00 ).

Figure 201. DMA Requests in regular simultaneous mode when DAMDF=0b00

Timing diagram showing DMA requests in regular simultaneous mode when DAMDF=0b00. The diagram illustrates the sequence of events for two ADCs (Master and Slave) triggered by a common 'Trigger' signal. The Master ADC (CH1) and Slave ADC (CH2) both start their conversion sequences. The Master EOC (End of Conversion) and Slave EOC signals are shown. DMA requests are generated from both ADCs. The Master DMA request is followed by 'DMA reads Master ADC_DR', and the Slave DMA request is followed by 'DMA reads Slave ADC_DR'. The diagram indicates that each sequence contains only one conversion.

Configuration where each sequence contains only one conversion

MSv31032V2

Timing diagram showing DMA requests in regular simultaneous mode when DAMDF=0b00. The diagram illustrates the sequence of events for two ADCs (Master and Slave) triggered by a common 'Trigger' signal. The Master ADC (CH1) and Slave ADC (CH2) both start their conversion sequences. The Master EOC (End of Conversion) and Slave EOC signals are shown. DMA requests are generated from both ADCs. The Master DMA request is followed by 'DMA reads Master ADC_DR', and the Slave DMA request is followed by 'DMA reads Slave ADC_DR'. The diagram indicates that each sequence contains only one conversion.

In simultaneous regular and interleaved modes, it is also possible to save one DMA channel and transfer both data using a single DMA channel. For this DAMDF bits must be configured in the ADCx_CCR register:

Example:

Interleaved dual mode: a DMA request is generated each time a new 32-bit data is available:

1st DMA request: \( ADCx\_CDR2[31:0] = MST\_ADC\_DR[31:0] \)

2nd DMA request: \( ADCx\_CDR2[31:0] = SLV\_ADC\_DR[31:0] \)

converted data items. The slave ADC data take the upper half-word and the master ADC data take the lower half-word.

This mode is used in interleaved mode and in regular simultaneous mode when resolution is ranging from 10 to 16-bit. Any value above 16-bit in the master or the slave converter will be truncated to the least 16 significant bits.

Example:

Interleaved dual mode: a DMA request is generated each time 2 data items are available:

1st DMA request: \( ADCx\_CDR[31:0] = SLV\_ADC\_DR[15:0] | MST\_ADC\_DR[15:0] \)

2nd DMA request: \( ADCx\_CDR[31:0] = SLV\_ADC\_DR[15:0] | MST\_ADC\_DR[15:0] \)

Figure 202. DMA requests in regular simultaneous mode when DAMDF=0b10

Timing diagram for regular simultaneous mode. It shows two sequences of ADC conversions. In each sequence, a 'Trigger' signal initiates a conversion on 'ADC Master regular' (CH1) and 'ADC Slave regular' (CH2) simultaneously. The 'ADC Master EOC' (End of Conversion) signal goes high when CH1 conversion is complete, and the 'ADC Slave EOC' signal goes high when CH2 conversion is complete. A 'DMA request from ADC Master' is generated when the Master EOC signal goes high. The 'DMA request from ADC Slave' signal remains low throughout. The caption indicates this configuration has one conversion per sequence.

Configuration where each sequence contains only one conversion

MSV31033V3

Timing diagram for regular simultaneous mode. It shows two sequences of ADC conversions. In each sequence, a 'Trigger' signal initiates a conversion on 'ADC Master regular' (CH1) and 'ADC Slave regular' (CH2) simultaneously. The 'ADC Master EOC' (End of Conversion) signal goes high when CH1 conversion is complete, and the 'ADC Slave EOC' signal goes high when CH2 conversion is complete. A 'DMA request from ADC Master' is generated when the Master EOC signal goes high. The 'DMA request from ADC Slave' signal remains low throughout. The caption indicates this configuration has one conversion per sequence.

Figure 203. DMA requests in interleaved mode when DAMDF=0b10

Timing diagram for interleaved mode. It shows two sequences. The left sequence has three triggers. Each trigger starts a CH1 conversion on the master ADC. After a 'Delay', a CH2 conversion is started on the slave ADC. The 'ADC Master EOC' signal goes high after each CH1 conversion, and the 'ADC Slave EOC' signal goes high after each CH2 conversion. A 'DMA request from ADC Master' is generated when the Master EOC signal goes high. The 'DMA request from ADC Slave' signal remains low. The right sequence shows two triggers, each starting a CH1 conversion on the master ADC, followed by a delay and then a CH2 conversion on the slave ADC. The caption indicates this configuration has one conversion per sequence.

Configuration where each sequence contains only one conversion

MSV31034V2

Timing diagram for interleaved mode. It shows two sequences. The left sequence has three triggers. Each trigger starts a CH1 conversion on the master ADC. After a 'Delay', a CH2 conversion is started on the slave ADC. The 'ADC Master EOC' signal goes high after each CH1 conversion, and the 'ADC Slave EOC' signal goes high after each CH2 conversion. A 'DMA request from ADC Master' is generated when the Master EOC signal goes high. The 'DMA request from ADC Slave' signal remains low. The right sequence shows two triggers, each starting a CH1 conversion on the master ADC, followed by a delay and then a CH2 conversion on the slave ADC. The caption indicates this configuration has one conversion per sequence.

Note: When using Multiple-ADC mode, the user must take care to configure properly the duration of the master and slave conversions so that a DMA request is generated and served for reading both data (master + slave) before a new conversion is available.

This mode is used in interleaved and regular simultaneous mode when the result is 8-bit. A new DMA request is issued when 4 new 8-bit values are available.

Example:

Interleaved dual mode: a DMA request is generated each time 4 data items are available (t0, t1,... are corresponding to the consecutive sampling instants)

1st DMA request:

ADCx_CDR[7:0] = MST_ADC_DR[7:0] t0

ADCx_CDR[15:8] = SLV_ADC_DR[7:0] t0

ADCx_CDR[23:16] = MST_ADC_DR[7:0] t1

ADCx_CDR[31:24] = SLV_ADC_DR[7:0] t1

2nd DMA request:

ADCx_CDR[7:0] = MST_ADC_DR[7:0] t2

ADCx_CDR[15:8] = SLV_ADC_DR[7:0] t2

ADCx_CDR[23:16] = MST_ADC_DR[7:0] t3

ADCx_CDR[31:24] = SLV_ADC_DR[7:0] t3

Overrun detection

In dual ADC mode (when DUAL[4:0] is not equal to b00000), if an overrun is detected on one of the ADCs, the DMA requests are no longer issued to ensure that all the data transferred to the RAM are valid (this behavior occurs whatever the DAMDF configuration). It may happen that the EOC bit corresponding to one ADC remains set because the data register of this ADC contains valid data.

DMA one shot mode/ DMA circular mode when Multiple-ADC mode is selected

When DAMDF mode is selected (0b10 or 0b11), bit DMNGT[1:0]=0b10 in the master ADC's ADCx_CCR register must also be configured to select between DMA one shot mode and circular mode, as explained in section Section : Managing conversions using the DMA .

Stopping the conversions in dual ADC modes

The user must set the control bits ADSTP/JADSTP of the master ADC to stop the conversions of both ADC in dual ADC mode. The other ADSTP control bit of the slave ADC has no effect in dual ADC mode.

Once both ADC are effectively stopped, the bits ADSTART/JADSTART of the master and slave ADCs are both cleared by hardware.

DFSDM mode in dual ADC mode interleaved mode

In dual ADC interleaved modes, the ADC conversion results can be transferred directly to the Digital Filter for Sigma Delta Modulators (DFSDM).

This mode is enabled by setting the bits \( DMNGT[1:0] = 0b10 \) in the master ADC's ADC_CFGR register.

The ADC transfers alternatively the 16 least significant bits of the regular data register from the master and the slave converter to a single channel of the DFSDM.

The data format must be 16-bit signed:

ADC_DR[31:16] = 0x0000
ADC_DR[15] = sign
ADC_DR[14:0] = data

Any value above 16-bit signed format in any converter will be truncated.

DFSDM mode in dual ADC simultaneous mode

The dual mode is not required to use DFSDM in dual ADC simultaneous mode since conversion data will be treated by each individual channel. Single mode with same trigger source results in simultaneous conversion with DFSDM interface.

25.4.33 Temperature sensor

The temperature sensor can measure the junction temperature ( \( T_J \) ) of the device in the \( -40 \) to \( 125^\circ\text{C} \) temperature range.

The temperature sensor is internally connected to an ADC internal channel which is used to convert the sensor's output voltage to a digital value (refer to Table ADC interconnection in Section 25.4.2: ADC pins and internal signals ). The sampling time for the temperature sensor's analog pin must be greater than the stabilization time specified in the product datasheet.

When not in use, the sensor can be put in power-down mode.

Figure 204 shows the block diagram of the temperature sensor.

Figure 204. Temperature sensor channel block diagram

Temperature sensor channel block diagram showing the signal path from the sensor through a multiplexer controlled by TSEN to the ADCx and finally the address/data bus.
graph LR
    TS[Temperature sensor] -- V_SENSE --> MUX{Multiplexer}
    TSEN[TSEN control bit] --> MUX
    MUX -- ADC input --> ADC[ADCx]
    ADC -- converted data --> BUS[Address/data bus]

MSv41034V6

Temperature sensor channel block diagram showing the signal path from the sensor through a multiplexer controlled by TSEN to the ADCx and finally the address/data bus.

Note: The TSEN bit must be set to enable the conversion of the corresponding ADC internal channel (temperature sensor, \( V_{\text{SENSE}} \) ).

Reading the temperature

To use the sensor:

  1. 1. Select the ADC input channels (with the appropriate sampling time).
  2. 2. Program with the appropriate sampling time (refer to electrical characteristics section of the device datasheet).
  3. 3. Set the TSEN bit in the ADCx_CCR register to wake up the temperature sensor from power-down mode.
  4. 4. Start the ADC conversion.
  5. 5. Read the resulting \( V_{SENSE} \) data in the ADC data register.
  6. 6. Calculate the actual temperature using the following formula:

\[ \text{temperature (in } ^\circ\text{C)} = \frac{\text{TS\_CAL2\_TEMP} - \text{TS\_CAL1\_TEMP}}{\text{TS\_CAL2} - \text{TS\_CAL1}} \times (\text{TS\_DATA} - \text{TS\_CAL1}) + \text{TS\_CAL1\_TEMP} \]

Where:

    • • TS_CAL2 is the temperature sensor calibration value acquired at TS_CAL2_TEMP
    • • TS_CAL1 is the temperature sensor calibration value acquired at TS_CAL1_TEMP
    • • TS_DATA is the actual temperature sensor output value converted by ADC
  1. Refer to the device datasheet for more information about TS_CAL1 and TS_CAL2 calibration points.

Note: The sensor has a startup time after waking from power-down mode before it can output \( V_{SENSE} \) at the correct level. The ADC also has a startup time after power-on, so to minimize the delay, the ADEN and SENSEEN bits should be set at the same time.

25.4.34 \( V_{BAT} \) supply monitoring

The VBATEN bit of the ADCx_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 4. This bridge is automatically enabled when VBATEN is set, to connect \( V_{BAT}/4 \) to an ADC input channel (refer to Table ADC interconnection in Section 25.4.2: ADC pins and internal signals ).

As a consequence, the converted digital value is one fourth of 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 device datasheet for the sampling time value to be applied when converting the \( V_{BAT}/4 \) voltage.

Figure 205 shows the block diagram of the \( V_{BAT} \) sensing feature.

Figure 205.\( V_{BAT} \) channel block diagram Figure 205. VBAT channel block diagram

The diagram shows the internal circuitry for the \( V_{BAT} \) channel. A switch controlled by the \( V_{BATEN} \) control bit connects the \( V_{BAT} \) pin to a voltage divider consisting of two resistors. The midpoint of the divider provides a voltage of \( V_{BAT}/4 \) . This voltage is selected by a multiplexer and sent to the \( ADCx \) block as an \( ADC\ input \) . The \( ADCx \) block is connected to an \( Address/data\ bus \) . The bottom of the voltage divider is connected to ground. The diagram is labeled MSv41032V4.

Figure 205. VBAT channel block diagram

Note: The \( V_{BATEN} \) bit in \( ADCx\_CCR \) must be configured to enable the conversion of the corresponding ADC internal channel.

25.4.35 Monitoring the internal voltage reference

The internal voltage reference can be monitored to have a reference point for evaluating the ADC \( V_{REF+} \) voltage level.

The internal voltage reference is internally connected to an ADC input channel (refer to Table ADC interconnection in Section 25.4.2: ADC pins and internal signals ).

The sampling time for this channel must be greater than the stabilization time specified in the product datasheet.

Figure 205 shows the block diagram of the \( V_{REFINT} \) sensing feature.

Figure 206.\( V_{REFINT} \) channel block diagram Figure 206. VREFINT channel block diagram

The diagram shows the internal circuitry for the \( V_{REFINT} \) channel. An \( Internal\ power\ block \) generates the \( V_{REFINT} \) voltage. This voltage is selected by a multiplexer controlled by the \( VREFEN \) control bit and sent to the \( ADCx \) block as an \( ADC\ input \) . The diagram is labeled MSv41033V5.

Figure 206. VREFINT channel block diagram

Note: The \( VREFEN \) bit of the \( ADCx\_CCR \) register must be configured to enable the conversion of the corresponding ADC internal channel ( \( V_{REFINT} \) ).

Calculating the actual \( V_{DDA} \) voltage using the internal reference voltage

The power supply voltage applied to the device may be subject to variations or not precisely known. When \( V_{DDA} \) is connected to \( V_{REF+} \) , it is possible to compute the actual \( V_{DDA} \) voltage using the embedded internal reference voltage ( \( V_{REFINT} \) ). \( V_{REFINT} \) and its calibration data acquired by the ADC during the manufacturing process at \( V_{DDA} = 3.3\text{ V} \) can be used to evaluate the actual \( V_{DDA} \) voltage level.

The following formula gives the actual \( V_{DDA} \) voltage supplying the device:

\[ V_{REF+} = 3.3\text{ V} \times VREFINT\_CAL / VREFINT\_DATA \]

Where:

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 \( V_{REF+} \) and the voltage applied on the converted channel.

For most applications \( V_{DDA} \) value is unknown and ADC converted values are right-aligned. In this case, it is necessary to convert this ratio into a voltage independent from \( V_{DDA} \) :

\[ V_{CHANNELx} = \frac{V_{REF+}}{FULL\_SCALE} \times ADC\_DATA \]

By replacing \( V_{REF+} \) by the formula provided above, the absolute voltage value is given by the following formula

\[ V_{CHANNELx} = \frac{3.3\text{ V} \times VREFINT\_CAL \times ADC\_DATA}{VREFINT\_DATA \times FULL\_SCALE} \]

For applications where \( V_{DDA} \) is known and ADC converted values are right-aligned, the absolute voltage value can be obtained by using the following formula:

\[ V_{CHANNELx} = \frac{V_{DDA}}{FULL\_SCALE} \times ADC\_DATA \]

Where:

Note: If ADC measurements are done using an output format other than 16-bit right-aligned, all the parameters must first be converted to a compatible format before the calculation is done.

25.5 ADC interrupts

For each ADC, an interrupt can be generated:

Separate interrupt enable bits are available for flexibility.

Table 219. ADC interrupts per each ADC

Interrupt eventEvent flagEnable control bit
ADC readyADRDYADRDYIE
End of conversion of a regular groupEOCEOCIE
End of sequence of conversions of a regular groupEOSEOSIE
End of conversion of a injected groupJEOCJEOCIE
End of sequence of conversions of an injected groupJEOSJEOSIE
Analog watchdog 1 status bit is setAWD1AWD1IE
Analog watchdog 2 status bit is setAWD2AWD2IE
Analog watchdog 3 status bit is setAWD3AWD3IE
End of sampling phaseEOSMPEOSMPIE
OverrunOVROVRIE
Injected context queue overflowsJQOVFJQOVFIE

25.6 ADC registers (for each ADC)

Refer to Section 1.2 on page 101 for a list of abbreviations used in register descriptions.

25.6.1 ADC interrupt and status register (ADC_ISR)

Address offset: 0x00

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.LDOR
DY
Res.JQOVFAWD3AWD2AWD1JEOSJEOCOVREOSEOCEOSMPADRDY
rrc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1

Bits 31:13 Reserved, must be kept at reset value.

Bit 12 LDORDY: ADC LDO output voltage ready bit

This bit is set and cleared by hardware. It indicates that the ADC internal LDO output is ready and that the ADC can be enabled or calibrated.

0: ADC LDO voltage regulator disabled

1: ADC LDO voltage regulator enabled

Note: Refer to Section 25.3: ADC implementation for the availability of the LDO regulator.

Bit 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 25.4.22: 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 ADC_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 ADC_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 ADC_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 flag

This bit is set by hardware at the end of each injected conversion of a channel when a new data is available in the corresponding ADC_JDRy register. It is cleared by software writing 1 to it or by reading the corresponding ADC_JDRy register

0: Injected channel conversion not complete (or the flag event was already acknowledged and cleared by software)

1: Injected channel conversion complete

Bit 4 OVR: ADC overrun

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

Bit 3 EOS: End of regular sequence flag

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

Bit 2 EOC: End of conversion flag

This bit is set by hardware at the end of each regular conversion of a channel when a new data is available in the ADC_DR register. It is cleared by software writing 1 to it or by reading the ADC_DR register

0: Regular channel conversion not complete (or the flag event was already acknowledged and cleared by software)

1: Regular channel conversion complete

Bit 1 EOSMP: End of sampling flag

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

Bit 0 ADRDY: ADC ready

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

25.6.2 ADC interrupt enable register (ADC_IER)

Address offset: 0x04

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.JQOVF
IE
AWD3
IE
AWD2
IE
AWD1
IE
JEOSIEJEOCIEOVR IEEOSIEEOCIEEOSMP
IE
ADRDY
IE
rwrwrwrwrwrwrwrwrwrwrw

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: The 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: The 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: The 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: The 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: The 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 enable

This 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: The software is allowed to write this bit only when JADSTART is cleared to 0 (no injected conversion is ongoing).

Bit 4 OVRRIE: Overrun interrupt enable

This 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: The 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 enable

This 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: The 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 enable

This 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: The 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 conversions

This 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: The 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 enable

This 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: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.3 ADC control register (ADC_CR)

Address offset: 0x08

Reset value: 0x2000 0000

Devices revision Y

31302928272625242322212019181716
ADCAL
L
ADCA
LDIF
DEEP
PWD
ADVREG
EN
LINCA
LRDY
W6
LINCA
LRDY
W5
LINCA
LRDY
W4
LINCAL
RDYW3
LINCAL
RDYW2
LINCAL
RDYW1
Res.Res.Res.Res.Res.ADCAL
LIN
rsrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.BOOSTRes.Res.JADSTPADSTPJADST
ART
ADSTA
RT
ADDISADEN
rwrsrsrsrsrsrs

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: The software is allowed to launch a calibration by setting ADCAL only when ADEN=0.

The software is allowed to update the calibration factor by writing ADC_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: The 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).

Bit 29 DEEPPWD: Deep-power-down enable

This bit is set and cleared by software to put the ADC in deep-power-down mode.

0: ADC not in deep-power down

1: ADC in deep-power-down (default reset state)

Note: The software is allowed to write this bit only when the ADC is disabled (ADCAL=0, JADSTART=0, JADSTP=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).

Bit 28 ADVREGEN: ADC voltage regulator enable

This bit is 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.

0: ADC Voltage regulator disabled

1: ADC Voltage regulator enabled.

For more details about the ADC voltage regulator enable and disable sequences, refer to Section 25.4.6: ADC deep-power-down mode (DEEPPWD) and ADC voltage regulator (ADVREGEN) .

The software can program this bitfield only when the ADC is disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).

Bit 27 LINCALRDYW6: Linearity calibration ready Word 6

This control / status bit allows to read/write the 6th linearity calibration factor.

When the linearity calibration is complete, this bit is set. A bit clear will launch the transfer of the linearity factor 6 into the LINCALFACT[29:0] of the ADC_CALFACT2 register. The bit will be reset by hardware when the ADC_CALFACT2 register can be read (software must poll the bit until it is cleared).

When the LINCALRDYW6 bit is reset, a new linearity factor 6 value can be written into the LINCALFACT[29:0] of the ADC_CALFACT2 register. A bit set will launch the linearity factor 6 update and the bit will be effectively set by hardware once the update will be done (software must poll the bit until it is set to indicate the write is effective).

Note: ADC_CALFACT2[29:10] contains 0. ADC_CALFACT2[9:0] corresponds linearity correction factor bits[159:150].

The software is allowed to toggle this bit only if the LINCALRDYW5, LINCALRDYW4, LINCALRDYW3, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged, see chapter 25.4.8: Calibration (ADCAL, ADCALDIF, ADCALLIN, ADC_CALFACT) for details.

The software is allowed to update the linearity calibration factor by writing LINCALRDYWx only when ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing)

Bit 26 LINCALRDYW5: Linearity calibration ready Word 5

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[149:120].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW3, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged.

Bit 25 LINCALRDYW4: Linearity calibration ready Word 4

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] correspond linearity correction factor bits[119:90].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW3, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged.

Bit 24 LINCALRDYW3: Linearity calibration ready Word 3

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[89:60].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW4, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged.

Bit 23 LINCALRDYW2: Linearity calibration ready Word 2

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[59:30].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW4, LINCALRDYW3 and LINCALRDYW1 bits are left unchanged.

Bit 22 LINCALRDYW1: Linearity calibration ready Word 1

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[29:0].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW4, LINCALRDYW3 and LINCALRDYW2 bits are left unchanged.

Bits 21:17 Reserved, must be kept at reset value.

Bit 16 ADCALLIN: Linearity calibration

This bit is set and cleared by software to enable the Linearity calibration.

0: Writing ADCAL will launch a calibration without the Linearity calibration.

1: Writing ADCAL will launch a calibration with the Linearity calibration.

Note: The 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 15:9 Reserved, must be kept at reset value.

Bit 8 BOOST: Boost mode control

This bit is set and cleared by software to enable/disable the Boost mode.

0: Boost mode off. Used when ADC clock < 20 MHz to save power at lower clock frequency.

1: Boost mode on. Must be used when ADC clock > 20 MHz.

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

When dual mode is enabled (bits DAMDF of ADCx_CCR register are not equal to zero), the bit BOOST of the slave ADC is no more writable and its content must be equal to the master ADC BOOST bit.

Bits 7:6 Reserved, must be kept at reset value.

Bit 5 JADSTP: ADC stop of injected conversion command

This 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: The 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).

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 command

This 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: The 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).

In auto-injection mode (JAUTO=1), setting ADSTP bit aborts both regular and injected conversions (do not use JADSTP).

In dual ADC regular simultaneous mode and interleaved mode, the bit ADSTP of the master ADC must be used to stop regular conversions. The other ADSTP bit is inactive.

Bit 3 JADSTART: ADC start of injected conversion

This 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:

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: The 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).

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 conversion

This 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:

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: The 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)

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 command

This 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: The 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 control

This 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: The software is allowed to set ADEN only when all bits of ADC_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)

Devices revision V
31302928272625242322212019181716
ADCAL LADCAL LDIFDEEP PWDADVREG ENLINCA LRDY W6LINCA LRDY W5LINCA LRDY W4LINCA LRDYW3LINCA LRDYW2LINCA LRDYW1Res.Res.Res.Res.Res.ADCAL LIN
rsrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.BOOST[1:0]Res.Res.JADSTPADSTPJADST ARTADSTA RTADDISADEN
rwrwrsrsrsrsrsrs
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: The software is allowed to launch a calibration by setting ADCAL only when ADEN=0.

The software is allowed to update the calibration factor by writing ADC_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: The 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).

Bit 29 DEEPPWD : Deep-power-down enable

This bit is set and cleared by software to put the ADC in deep-power-down mode.

0: ADC not in deep-power down

1: ADC in deep-power-down (default reset state)

Note: The software is allowed to write this bit only when the ADC is disabled (ADCAL=0, JADSTART=0, JADSTP=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).

Bit 28 ADVREGEN : ADC voltage regulator enable

This bit is 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.

0: ADC Voltage regulator disabled

1: ADC Voltage regulator enabled.

For more details about the ADC voltage regulator enable and disable sequences, refer to Section 25.4.6: ADC deep-power-down mode (DEEPPWD) and ADC voltage regulator (ADVREGEN) .

The software can program this bitfield only when the ADC is disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0).

Bit 27 LINCALRDYW6 : Linearity calibration ready Word 6

This control / status bit allows to read/write the 6th linearity calibration factor.

When the linearity calibration is complete, this bit is set. A bit clear will launch the transfer of the linearity factor 6 into the LINCALFACT[29:0] of the ADC_CALFACT2 register. The bit will be reset by hardware when the ADC_CALFACT2 register can be read (software must poll the bit until it is cleared).

When the LINCALRDYW6 bit is reset, a new linearity factor 6 value can be written into the LINCALFACT[29:0] of the ADC_CALFACT2 register. A bit set will launch the linearity factor 6 update and the bit will be effectively set by hardware once the update will be done (software must poll the bit until it is set to indicate the write is effective).

Note: ADC_CALFACT2[29:10] contains 0. ADC_CALFACT2[9:0] corresponds linearity correction factor bits[159:150].

The software is allowed to toggle this bit only if the LINCALRDYW5, LINCALRDYW4, LINCALRDYW3, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged, see chapter 25.4.8: Calibration (ADCAL, ADCALDIF, ADCALLIN, ADC_CALFACT) for details.

The software is allowed to update the linearity calibration factor by writing LINCALRDYWx only when ADEN=1 and ADSTART=0 and JADSTART=0 (ADC enabled and no conversion is ongoing)

Bit 26 LINCALRDYW5 : Linearity calibration ready Word 5

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[149:120].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW3, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged.

Bit 25 LINCALRDYW4 : Linearity calibration ready Word 4

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] correspond linearity correction factor bits[119:90].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW3, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged.

Bit 24 LINCALRDYW3 : Linearity calibration ready Word 3

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[89:60].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW4, LINCALRDYW2 and LINCALRDYW1 bits are left unchanged.

Bit 23 LINCALRDYW2 : Linearity calibration ready Word 2

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[59:30].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW4, LINCALRDYW3 and LINCALRDYW1 bits are left unchanged.

Bit 22 LINCALRDYW1 : Linearity calibration ready Word 1

Refer to LINCALRDYW6 description.

Note: ADC_CALFACT2[29:0] corresponds linearity correction factor bits[29:0].

The software is allowed to toggle this bit only if the LINCALRDYW6, LINCALRDYW5, LINCALRDYW4, LINCALRDYW3 and LINCALRDYW2 bits are left unchanged.

Bits 21:17 Reserved, must be kept at reset value.

Bit 16 ADCALLIN : Linearity calibration

This bit is set and cleared by software to enable the Linearity calibration.

0: Writing ADCAL will launch a calibration without the Linearity calibration.

1: Writing ADCAL will launch a calibration with the Linearity calibration.

Note: The 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 15:10 Reserved, must be kept at reset value.

Bits 9:8 BOOST[1:0] : Boost mode control

This bitfield is set and cleared by software to enable/disable the Boost mode.

00: used when ADC clock \( \leq \) 6.25 MHz

01: used when 6.25 MHz \( < \) ADC clock frequency \( \leq \) 12.5 MHz

10: used when 12.5 MHz \( < \) ADC clock \( \leq \) 25.0 MHz

11: used when 25.0 MHz \( < \) ADC clock \( \leq \) 50.0 MHz

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

When dual mode is enabled (bits DAMDF of ADCx_CCR register are not equal to zero), the BOOST bitfield of the slave ADC is no more writable and its content must be equal to the master ADC BOOST bitfield.

Bits 7:6 Reserved, must be kept at reset value.

Bit 5 JADSTP: ADC stop of injected conversion command

This 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: The 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).

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 command

This 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: The 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).

In auto-injection mode (JAUTO=1), setting ADSTP bit aborts both regular and injected conversions (do not use JADSTP).

In dual ADC regular simultaneous mode and interleaved mode, the bit ADSTP of the master ADC must be used to stop regular conversions. The other ADSTP bit is inactive.

Bit 3 JADSTART: ADC start of injected conversion

This 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:

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: The 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).

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 conversion

This 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:

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: The 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)

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 command

This 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: The 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 control

This 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: The software is allowed to set ADEN only when all bits of ADC_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)

25.6.4 ADC configuration register (ADC_CFGR)

Address offset: 0x0C

Reset value: 0x8000 0000

31302928272625242322212019181716
JQDISAWD1CH[4:0]JAUTOJAWD1ENAWD1ENAWD1SGLJQMJDISCENDISCNUM[2:0]DISCEN
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.AUTDLYCONTOVRMODEXTEN[1:0]EXTSEL[4:0]RES[2:0]DMNGT[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 JQDIS: Injected Queue disable

These bits are set and cleared by software to disable the Injected Queue mechanism:

0: Injected Queue enabled

1: Injected Queue disabled

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no regular nor injected conversion is ongoing).

A set or reset of JQDIS bit causes the injected queue to be flushed and the JSQR register is cleared.

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: ADC analog input channel-0 monitored by AWD1

00001: ADC analog input channel-1 monitored by AWD1

.....

10010: ADC analog input channel-19 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.

The 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: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no regular nor injected conversion is ongoing).

When dual mode is enabled (DAMDF bits in ADCx_CCR register are not equal to zero), the bit JAUTO of the slave ADC is no more writable and its content is equal to the bit JAUTO of the master ADC.

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: The 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: The 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: The software is allowed to write this bit 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 25.4.22: Queue of context for injected conversions for more information.

Note: The software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).

When dual mode is enabled (DAMDF bits in ADCx_CCR register are not equal to zero), the bit JQM of the slave ADC is no more writable and its content is equal to the bit JQM of the master ADC.

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: The software is allowed to write this bit only when JADSTART=0 (which ensures that no injected conversion is ongoing).

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.

When dual mode is enabled (bits DAMDF of ADCx_CCR register are not equal to zero), the bit JDISCEN of the slave ADC is no more writable and its content is equal to the bit JDISCEN of the master ADC.

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: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

When dual mode is enabled (DAMDF bits in ADCx_CCR register are not equal to zero), the bits DISCNUM[2:0] of the slave ADC are no more writable and their content is equal to the bits DISCNUM[2:0] of the master ADC.

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.

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.

The software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).

When dual mode is enabled (DAMDF bits in ADCx_CCR register are not equal to zero), the bit DISCEN of the slave ADC is no more writable and its content is equal to the bit DISCEN of the master ADC.

Bit 15 Reserved, must be kept at reset value. Bit 14 AUTDLY: Delayed conversion mode

This 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: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

When dual mode is enabled (DAMDF bits in ADCx_CCR register are not equal to zero), the bit AUTDLY of the slave ADC is no more writable and its content is equal to the bit AUTDLY of the master ADC.

Bit 13 CONT: Single / continuous conversion mode for regular conversions

This 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.

The software is allowed to write this bit only when ADSTART=0 (which ensures that no regular conversion is ongoing).

When dual mode is enabled (DAMDF bits in ADCx_CCR register are not equal to zero), the bit CONT of the slave ADC is no more writable and its content is equal to the bit CONT of the master ADC.

Bit 12 OVRMOD: Overrun Mode

This bit is set and cleared by software and configure the way data overrun is managed.

0: ADC_DR register is preserved with the old data when an overrun is detected.

1: ADC_DR register is overwritten with the last conversion result when an overrun is detected.

Note: The 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 channels

These 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: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

Bits 9:5 EXTSEL[4:0]: External trigger selection for regular group

These bits select the external event used to trigger the start of conversion of a regular group:

00000: Event 0

00001: Event 1

00010: Event 2

00011: Event 3

00100: Event 4

00101: Event 5

00110: Event 6

00111: Event 7

...

11111: Event 31

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

Bits 4:2 RES[2:0]: Data resolution

These bits are written by software to select the resolution of the conversion.

000: 16 bits

001: 14 bits (for devices revision Y), 14 bits in legacy mode (for devices revision V, not optimized power consumption)

101: 14 bits (for devices revision V)

010: 12 bits (for devices revision Y), 12 bits in legacy mode (for devices revision V, not optimized power consumption)

110: 12 bits (for devices revision V)

011: 10 bits

100: 8 bits (for devices revision Y)

111: 8 bits (for devices revision V)

Others: Reserved, must not be used.

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

Bits 1:0 DMNGT[1:0]: Data Management configuration

This bit is set and cleared by software to select how ADC interface output data are managed.

00: Regular conversion data stored in DR only

01: DMA One Shot Mode selected

10: DFSDM mode selected

11: DMA Circular Mode selected

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

In dual-ADC modes, this bit is not relevant and replaced by control bit DAMDF of the ADCx_CCR register.

25.6.5 ADC configuration register 2 (ADC_CFGR2)

Address offset: 0x10

Reset value: 0x0000 0000

31302928272625242322212019181716
LSHIFT[3:0]Res.Res.OSVR[9:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.RSHIFT4RSHIFT3RSHIFT2RSHIFT1ROVSMTROVSOVSS[3:0]Res.Res.Res.JOVSE ROVSE
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:28 LSHIFT[3:0] : Left shift factor

This bitfield is set and cleared by software to define the left shifting applied to the final result with or without oversampling.

0000: No left shift

0001: Shift left 1-bit

0010: Shift left 2-bits

0011: Shift left 3-bits

0100: Shift left 4-bits

0101: Shift left 5-bits

0110: Shift left 6-bits

0111: Shift left 7-bits

1000: Shift left 8-bits

1001: Shift left 9-bits

1010: Shift left 10-bits

1011: Shift left 11-bits

1100: Shift left 12-bits

1101: Shift left 13-bits

1110: Shift left 14-bits

1111: Shift left 15-bits

Note: The software is allowed to write this bit only when ADSTART=0 (which ensures that no conversion is ongoing).

Bits 27:26 Reserved, must be kept at reset value.

Bits 25:16 OSVR[9:0] : Oversampling ratio

This bitfield is set and cleared by software to define the oversampling ratio.

0: 1x (no oversampling)

1: 2x

2: 3x

...

1023: 1024x

Note: The software is allowed to write this bit only when ADSTART=0 (which ensures that no conversion is ongoing).

Bit 15 Reserved, must be kept at reset value.

Bit 14 RSHIFT4 : Right-shift data after Offset 4 correction

Refer to RSHIFT1 description.

Bit 13 RSHIFT3 : Right-shift data after Offset 3 correction

Refer to RSHIFT1 description

Bit 12 RSHIFT2 : Right-shift data after Offset 2 correction

Refer to RSHIFT1 description

Bit 11 RSHIFT1 : Right-shift data after Offset 1 correction

This bitfield is set and cleared by software to right-shift 1-bit data after offset1 correction. This bit can only be used for 8-bit and 16-bit data format (see Section : Data register, data alignment and offset (ADC_DR, ADC_JDRy, OFFSETy, OFFSETy_CH, OVSS, LSHIFT, RSHIFT, SSATE) for details).

0: Right-shifting disabled

1: Data is right-shifted 1-bit.

Bit 10 ROVSM : Regular Oversampling mode

This bit is set and cleared by software to select the regular oversampling mode.

0: Continued mode: When injected conversions are triggered, the oversampling is temporarily stopped and continued after the injection sequence (oversampling buffer is maintained during injected sequence)

1: Resumed mode: When injected conversions are triggered, the current oversampling is aborted and resumed from start after the injection sequence (oversampling buffer is zeroed by injected sequence start)

Note: The software is allowed to write this bit only when ADSTART=0 (which ensures that no conversion is ongoing).

Bit 9 TROVS : Triggered Regular Oversampling

This bit is set and cleared by software to enable triggered oversampling

0: All oversampled conversions for a channel are done consecutively following a trigger

1: Each oversampled conversion for a channel needs a new trigger

Note: The software is allowed to write this bit only when ADSTART=0 (which ensures that no conversion is ongoing).

Bits 8:5 OVSS[3:0] : Oversampling right shift

This bitfield is set and cleared by software to define the right shifting applied to the raw oversampling result.

0000: No right shift

0001: Shift right 1-bit

0010: Shift right 2-bits

0011: Shift right 3-bits

0100: Shift right 4-bits

0101: Shift right 5-bits

0110: Shift right 6-bits

0111: Shift right 7-bits

1000: Shift right 8-bits

1001: Shift right 9-bits

1010: Shift right 10-bits

1011: Shift right 11-bits

Others: Reserved, must not be used.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no conversion is ongoing).

Bits 4:2 Reserved, must be kept at reset value.

Bit 1 JOVSE : Injected Oversampling Enable

This bit is set and cleared by software to enable injected oversampling.

0: Injected Oversampling disabled

1: Injected Oversampling enabled

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing)

Bit 0 ROVSE : Regular Oversampling Enable

This bit is set and cleared by software to enable regular oversampling.

0: Regular Oversampling disabled

1: Regular Oversampling enabled

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing)

25.6.6 ADC sample time register 1 (ADC_SMPR1)

Address offset: 0x14

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.SMP9[2:0]SMP8[2:0]SMP7[2:0]SMP6[2:0]SMP5[2:1]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SMP5[0]SMP4[2:0]SMP3[2:0]SMP2[2:0]SMP1[2:0]SMP0[2:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:0 SMPx[2:0] : Channel x sampling time selection (x = 9 to 0)

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: 8.5 ADC clock cycles

011: 16.5 ADC clock cycles

100: 32.5 ADC clock cycles

101: 64.5 ADC clock cycles

110: 387.5 ADC clock cycles

111: 810.5 ADC clock cycles

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.7 ADC sample time register 2 (ADC_SMPR2)

Address offset: 0x18

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.SMP19[2:0]SMP18[2:0]SMP17[2:0]SMP16[2:0]SMP15[2:1]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SMP15[0]SMP14[2:0]SMP13[2:0]SMP12[2:0]SMP11[2:0]SMP10[2:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:0 SMPx[2:0] : Channel x sampling time selection (x = 19 to 10)

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: 8.5 ADC clock cycles

011: 16.5 ADC clock cycles

100: 32.5 ADC clock cycles

101: 64.5 ADC clock cycles

110: 387.5 ADC clock cycles

111: 810.5 ADC clock cycles

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.8 ADC channel preselection register (ADC_PCSEL)

Address offset: 0x1C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PCSEL1
9
PCSEL1
8
PCSEL1
7
PCSEL1
6
rwrwrwrw

1514131211109876543210
PCSE
L15
PCSE
L14
PCSE
L13
PCSE
L12
PCSE
L11
PCSE
L10
PCSEL
9
PCSEL
8
PCSEL
7
PCSEL
6
PCSEL
5
PCSEL
4
PCSEL3PCSEL2PCSEL1PCSEL0
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:0 PCSEL[19:0] : Channel x ( \( V_{INP[i]} \) ) pre selection (x = 0 to 19)

These bits are written by software to pre select the input channel at IO instance to be converted.

0: Input Channel x ( \( V_{inp\ x} \) ) is not pre selected for conversion, the ADC conversion result with this channel shows wrong result.

1: Input Channel x ( \( V_{inp\ x} \) ) is pre selected for conversion

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.9 ADC watchdog threshold register 1 (ADC_LTR1)

Address offset: 0x20

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.LTR1[25:16]
rwrwrwrwrwrwrwrwrwrw

1514131211109876543210
LTR1[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:0 LTR1[25:0] : Analog watchdog 1 lower threshold

These bits are written by software to define the lower threshold for the analog watchdog 1.

Refer to Section 25.4.30: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy)

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.10 ADC watchdog threshold register 1 (ADC_HTR1)

Address offset: 0x24

Reset value: 0x03FF FFFF

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.HTR1[25:16]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
HTR1[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:0 HTR1[25:0] : Analog watchdog 1 higher threshold

These bits are written by software to define the higher threshold for the analog watchdog 1.

Refer to Section 25.4.30: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy)

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.11 ADC regular sequence register 1 (ADC_SQR1)

Address offset: 0x30

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.SQ4[4:0]Res.SQ3[4:0]Res.SQ2[4]
rwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SQ2[3:0]Res.SQ1[4:0]Res.Res.L[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

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 (0..19) assigned as the 4th in the regular conversion sequence.

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 (0..19) assigned as the 3rd in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 2nd in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 1st in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

25.6.12 ADC regular sequence register 2 (ADC_SQR2)

Address offset: 0x34

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.SQ9[4:0]Res.SQ8[4:0]Res.SQ7[4]
rwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SQ7[3:0]Res.SQ6[4:0]Res.SQ5[4:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

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 (0..19) assigned as the 9th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 8th in the regular conversion sequence

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 7th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 6th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 5th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

25.6.13 ADC regular sequence register 3 (ADC_SQR3)

Address offset: 0x38

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.SQ14[4:0]Res.SQ13[4:0]Res.SQ12[4]
rwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SQ12[3:0]Res.SQ11[4:0]Res.SQ10[4:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw

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 (0..19) assigned as the 14th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 13th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 12th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 11th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 10th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

25.6.14 ADC regular sequence register 4 (ADC_SQR4)

Address offset: 0x3C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.SQ16[4:0]Res.SQ15[4:0]
rwrwrwrwrwrwrwrwrwrw

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 (0..19) assigned as the 16th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

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 (0..19) assigned as the 15th in the regular conversion sequence.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

25.6.15 ADC regular Data Register (ADC_DR)

Address offset: 0x40

Reset value: 0x0000 0000

31302928272625242322212019181716
RDATA[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RDATA[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 RDATA[31: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 25.4.27: Data management .

25.6.16 ADC injected sequence register (ADC_JSQR)

Address offset: 0x4C

Reset value: 0x0000 0000

31302928272625242322212019181716
JSQ4[4:0]Res.JSQ3[4:0]Res.JSQ2[4:1]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
JSQ2[0]Res.JSQ1[4:0]JEXTEN[1:0]JEXTSEL[4:0]JL[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:27 JSQ4[4:0] : 4th conversion in the injected sequence

These bits are written by software with the channel number (0..19) assigned as the 4th in the injected conversion sequence.

Note: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing) unless the context queue is enabled (JQDIS=0 in ADC_CFGR register).

Bit 26 Reserved, must be kept at reset value.

Bits 25:21 JSQ3[4:0] : 3rd conversion in the injected sequence

These bits are written by software with the channel number (0..19) assigned as the 3rd in the injected conversion sequence.

Note: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing) unless the context queue is enabled (JQDIS=0 in ADC_CFGR register).

Bit 20 Reserved, must be kept at reset value.

Bits 19:15 JSQ2[4:0] : 2nd conversion in the injected sequence

These bits are written by software with the channel number (0..19) assigned as the 2nd in the injected conversion sequence.

Note: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing) unless the context queue is enabled (JQDIS=0 in ADC_CFGR register).

Bit 14 Reserved, must be kept at reset value.

Bits 13:9 JSQ1[4:0] : 1st conversion in the injected sequence

These bits are written by software with the channel number (0..19) assigned as the 1st in the injected conversion sequence.

Note: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing) unless the context queue is enabled (JQDIS=0 in ADC_CFGR register).

Bits 8:7 JEXTEN[1:0]: External trigger enable and polarity selection for injected channels

These bits are set and cleared by software to select the external trigger polarity and enable the trigger of an injected group.

00: If JQDIS=0 (queue enabled), Hardware and software trigger detection disabled and
If JQDIS=1 (queue disabled), 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: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing).

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 25.4.22: Queue of context for injected conversions )

Bits 6:2 JEXTSEL[4:0]: External trigger selection for injected group

These bits select the external event used to trigger the start of conversion of an injected group:

00000: Event 0

00001: Event 1

00010: Event 2

00011: Event 3

00100: Event 4

00101: Event 5

00110: Event 6

00111: Event 7

...

11111: Event 31:

Note: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing).

Bits 1:0 JL[1:0]: Injected channel sequence length

These 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: The software is allowed to write these bits only when JADSTART is cleared to 0 (no injected conversion is ongoing).

25.6.17 ADC injected channel y offset register (ADC_OFRy)

Address offset: \( 0x60 + 0x04 * (y-1) \) , ( \( y = 1 \) to \( 4 \) )

Reset value: \( 0x0000\ 0000 \)

31302928272625242322212019181716
SSATEOFFSET_CH[4:0]OFFSET[25:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
OFFSET[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 SSATE: Signed saturation Enable

This bit is written by software to enable or disable the Signed saturation feature.

This bit can be enabled only for 8-bit and 16-bit data format (see Section : Data register, data alignment and offset (ADC_DR, ADC_JDRy, OFFSETy, OFFSETy_CH, OVSS, LSHIFT, RSHIFT, SSATE) for details).

0: Offset is subtracted maintaining data integrity and extending result size (9-bit and 17-bit signed format).

1: Offset is subtracted and result is saturated to maintain result size.

Note: The software is allowed to write this bit only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

Bits 30:26 OFFSET_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[25:0] will apply.

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

Bits 25:0 OFFSET[25: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 ADC_DR (regular conversion) or from in the ADC_JDRyi registers (injected conversion).

When OFFSETy[25:0] bitfield is reset, the offset compensation is disabled.

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

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[25:0] which is subtracted when converting channel 4.

25.6.18 ADC injected channel y data register (ADC_JDRy)

Address offset: 0x80 + 0x04 * (y-1), (y= 1 to 4)

Reset value: 0x0000 0000

31302928272625242322212019181716
JDATA[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
JDATA[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 JDATA[31: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 25.4.27: Data management .

25.6.19 ADC analog watchdog 2 configuration register (ADC_AWD2CR)

Address offset: 0xA0

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.AWD2CH[19:16]
rwrwrwrw
1514131211109876543210
AWD2CH[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:0 AWD2CH[19:0] : 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[19:0] = 000..0, the analog Watchdog 2 is disabled

Note: The channels selected by AWD2CH must be also selected into the SQRi or JSQRi registers.

The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.20 ADC analog watchdog 3 configuration register (ADC_AWD3CR)

Address offset: 0xA4

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.AWD3CH[19:16]
rwrwrwrw
1514131211109876543210
AWD3CH[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:0 AWD3CH[19:0] : 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[19:0] = 000..0, the analog Watchdog 3 is disabled

Note: The channels selected by AWD3CH must be also selected into the SQRI or JSQRI registers.

The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.21 ADC watchdog lower threshold register 2 (ADC_LTR2)

Address offset: 0xB0

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.LTR2[25:16]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
LTR2[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:0 LTR2[25:0] : Analog watchdog 2 lower threshold

These bits are written by software to define the lower threshold for the analog watchdog 2.

Refer to Section 25.4.30: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy) .

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.22 ADC watchdog higher threshold register 2 (ADC_HTR2)

Address offset: 0xB4

Reset value: 0x03FF FFFF

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.HTR2[25:16]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
HTR2[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:0 HTR2[25:0] : Analog watchdog 2 higher threshold

These bits are written by software to define the higher threshold for the analog watchdog 2.

Refer to Section 25.4.30: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy) .

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.23 ADC watchdog lower threshold register 3 (ADC_LTR3)

Address offset: 0xB8

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.LTR3[25:16]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
LTR3[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:0 LTR3[25:0] : Analog watchdog 3 lower threshold

These bits are written by software to define the lower threshold for the analog watchdog 3.

Refer to Section 25.4.30: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy) .

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.24 ADC watchdog higher threshold register 3 (ADC_HTR3)

Address offset: 0xBC

Reset value: 0x03FF FFFF

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.HTR3[25:16]
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
HTR3[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:26 Reserved, must be kept at reset value.

Bits 25:0 HTR3[25:0] : Analog watchdog 3 higher threshold

These bits are written by software to define the higher threshold for the analog watchdog 3.

Refer to Section 25.4.30: Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL, AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy)

Note: The software is allowed to write these bits only when ADSTART=0 and JADSTART=0 (which ensures that no conversion is ongoing).

25.6.25 ADC differential mode selection register (ADC_DIFSEL)

Address offset: 0xC0

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DIFSEL[19:16]
rwrwrwrw
1514131211109876543210
DIFSEL[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:0 DIFSEL[19:0] : Differential mode for channels 19 to 0

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: The 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).

25.6.26 ADC calibration factors register (ADC_CALFACT)

Address offset: 0xC4

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.CALFACT_D[10:0]
rwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.CALFACT_S[10:0]
rwrwrwrwrwrwrwrwrwrwrw

Bits 31:27 Reserved, must be kept at reset value.

Bits 26:16 CALFACT_D[10: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 conversion is launched.

Note: The 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:11 Reserved, must be kept at reset value.

Bits 10:0 CALFACT_S[10: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 conversion is launched.

Note: The 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).

25.6.27 ADC calibration factor register 2 (ADC_CALFACT2)

Address offset: 0xC8

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.LINCALFACT[29:16]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
LINCALFACT[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:0 LINCALFACT[29:0] : Linearity Calibration Factor

These bits are written by hardware or by software.

They hold 30-bit out of the 160-bit linearity calibration factor.

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: The 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).

25.7 ADC common registers

These registers define the control and status registers common to master and slave ADCs:

25.7.1 ADC x common status register (ADCx_CSR) (x=1/2 or 3)

Address offset: 0x00

Reset value: 0x0000 0000

The address offset is relative to the master ADC base address + 0x300.

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 ADC_ISR register.

ADC1 and ADC2 are controlled by the same interface, while ADC3 is controlled separately.

31302928272625242322212019181716
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
rrrrrrrrrrr

1514131211109876543210
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
rrrrrrrrrrr

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+1_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+1_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+1_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+1_ISR register.

  1. 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+1_ISR register.
  2. 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+1_ISR register.
  3. Bit 20 OVR_SLV : Overrun flag of the slave ADC
    This bit is a copy of the OVR bit in the corresponding ADCx+1_ISR register.
  4. 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+1_ISR register.
  5. 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+1_ISR register.
  6. 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+1_ISR register.
  7. Bit 16 ADRDY_SLV : Slave ADC ready
    This bit is a copy of the ADRDY bit in the corresponding ADCx+1_ISR register.
  8. Bits 15:11 Reserved, must be kept at reset value.
  9. 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 ADC_ISR register.
  10. Bit 9 AWD3_MST : Analog watchdog 3 flag of the master ADC
    This bit is a copy of the AWD3 bit in the corresponding ADC_ISR register.
  11. Bit 8 AWD2_MST : Analog watchdog 2 flag of the master ADC
    This bit is a copy of the AWD2 bit in the corresponding ADC_ISR register.
  12. Bit 7 AWD1_MST : Analog watchdog 1 flag of the master ADC
    This bit is a copy of the AWD1 bit in the corresponding ADC_ISR register.
  13. 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 ADC_ISR register.
  14. 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 ADC_ISR register.
  15. Bit 4 OVR_MST : Overrun flag of the master ADC
    This bit is a copy of the OVR bit in the corresponding ADC_ISR register.
  16. 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 ADC_ISR register.
  17. Bit 2 EOC_MST : End of regular conversion of the master ADC
    This bit is a copy of the EOC bit in the corresponding ADC_ISR register.
  18. 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 ADC_ISR register.
  19. Bit 0 ADRDY_MST : Master ADC ready
    This bit is a copy of the ADRDY bit in the corresponding ADC_ISR register.

25.7.2 ADC x common control register (ADCx_CCR) (x=1/2 or 3)

Address offset: 0x08

Reset value: 0x0000 0000

The address offset is relative to the master ADC base address + 0x300.

ADC1 and ADC2 are controlled by the same interface, while ADC3 is controlled separately.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.VBATENTSENVREFENPRESC[3:0]CKMODE[1:0]
rwrwrwrwrwrwrwrwrw
1514131211109876543210
DAMDF[1:0]Res.Res.DELAY[3:0]Res.Res.Res.DUAL[4:0]
rwrwrwrwrwrwrwrwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 VBATEN : VBAT enable

This bit is set and cleared by software to control V BAT channel.

0: V BAT channel disabled

1: V BAT channel enabled

Note: The 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 voltage enable

This bit is set and cleared by software to control V SENSE channel.

0: Temperature sensor channel disabled

1: Temperature sensor channel enabled

Note: The 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: The 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 PRESC[3:0] : ADC prescaler

These bits are set and cleared by software to select the frequency of the clock to the ADC. The clock is common for all the ADCs.

0000: input ADC clock not divided

0001: input ADC clock divided by 2

0010: input ADC clock divided by 4

0011: input ADC clock divided by 6

0100: input ADC clock divided by 8

0101: input ADC clock divided by 10

0110: input ADC clock divided by 12

0111: input ADC clock divided by 16

1000: input ADC clock divided by 32

1001: input ADC clock divided by 64

1010: input ADC clock divided by 128

1011: input ADC clock divided by 256

Others: Reserved, must not be used

Note: The software is allowed to write these bits only when the ADC is disabled (ADCAL=0, JADSTART=0, ADSTART=0, ADSTP=0, ADDIS=0 and ADEN=0). The ADC prescaler value is applied only when CKMODE[1:0] = 0b00.

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):

Devices revision Y:

00: CK_ADCx (x=1 to 3) (Asynchronous clock mode), generated at product level (refer to Section Reset and Clock Control (RCC) )

01: adc_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: adc_hclk/2 (Synchronous clock mode)

11: adc_hclk/4 (Synchronous clock mode)

In synchronous clock mode, there is no jitter in the delay from a timer trigger to the start of conversion.

Devices revision V:

00: CK_ADCx (x=1 to 23) (Asynchronous clock mode), generated at product level (refer to Section Reset and Clock Control (RCC) )

01: adc_sclk/1 (Synchronous clock mode).

10: adc_sclk/2 (Synchronous clock mode)

11: adc_sclk/4 (Synchronous clock mode)

Whatever CKMODE[1:0] settings, an additional divider factor of 2 is applied to the clock delivered to the analog ADC block.

In synchronous clock mode, when adc_ker_ck = 2 x adc_hclk, there is no jitter in the delay from a timer trigger to the start of a conversion.

Note: The 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:14 DAMDF[1:0] : Dual ADC Mode Data Format

This bit-field is set and cleared by software. It specifies the data format in the common data register ADCx_CDR.

Note: The software is allowed to write these bits only when ADSTART=0 (which ensures that no regular conversion is ongoing).

Bits 13:12 Reserved, must be kept at reset value.

Bits 11:8 DELAY[3:0] : Delay between 2 sampling phases

These bits are set and cleared by software. These bits are used in dual interleaved modes.
Refer to Table 220 for the value of ADC resolution versus DELAY bits values.

Note: The 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 7:5 Reserved, must be kept at reset value.

Bits 4:0 DUAL[4:0] : Dual ADC mode selection

These bits are written by software to select the operating mode.
All the ADCs are independent:

The configurations 00001 to 01001 correspond to the following operating modes: Dual mode, master and slave ADCs working together:

All other combinations are reserved and must not be programmed

Note: The 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).

Table 220. DELAY bits versus ADC resolution

DELAY bits16-bit resolution14-bit resolution12-bit resolution10-bit resolution8-bit resolution
0000\( 1.5 * T_{adc\_ker\_ck} \)\( 1.5 * T_{adc\_ker\_ck} \)\( 1.5 * T_{adc\_ker\_ck} \)\( 1.5 * T_{adc\_ker\_ck} \)\( 1.5 * T_{adc\_ker\_ck} \)
0001\( 2.5 * T_{adc\_ker\_ck} \)\( 2.5 * T_{adc\_ker\_ck} \)\( 2.5 * T_{adc\_ker\_ck} \)\( 2.5 * T_{adc\_ker\_ck} \)\( 2.5 * T_{adc\_ker\_ck} \)
0010\( 3.5 * T_{adc\_ker\_ck} \)\( 3.5 * T_{adc\_ker\_ck} \)\( 3.5 * T_{adc\_ker\_ck} \)\( 3.5 * T_{adc\_ker\_ck} \)\( 3.5 * T_{adc\_ker\_ck} \)
0011\( 4.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)
0100\( 5.5 * T_{adc\_ker\_ck} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)
0101\( 6.5 * T_{adc\_ker\_ck} \)\( 6.5 * T_{adc\_ker\_ck} \)\( 6.5 * T_{adc\_ker\_ck} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)
0110\( 7.5 * T_{adc\_ker\_ck} \)\( 7.5 * T_{adc\_ker\_ck} \)\( 6.5 * T_{adc\_ker\_c} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)

Table 220. DELAY bits versus ADC resolution (continued)

DELAY bits16-bit resolution14-bit resolution12-bit resolution10-bit resolution8-bit resolution
0111\( 8.5 * T_{adc\_ker\_ck} \)\( 7.5 * T_{adc\_ker\_ck} \)\( 6.5 * T_{adc\_ker\_ck} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)
1000\( 8.5 * T_{adc\_ker\_ck} \)\( 7.5 * T_{adc\_ker\_ck} \)\( 6.5 * T_{adc\_ker\_ck} \)\( 5.5 * T_{adc\_ker\_ck} \)\( 4.5 * T_{adc\_ker\_ck} \)
others:
reserved
-----

25.7.3 ADC x common regular data register for dual mode (ADCx_CDR) (x=1/2 or 3)

Address offset: 0x0C

Reset value: 0x0000 0000

The address offset is relative to the master ADC base address + 0x300.

ADC1 and ADC2 are controlled by the same interface, while ADC3 is controlled separately.

31302928272625242322212019181716
RDATA_SLV[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
RDATA_MST[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 RDATA_SLV[15:0] : Regular data of the slave ADC

In dual mode, these bits contain the regular data of the slave ADC. Refer to Section 25.4.32: Dual ADC modes .

The data alignment is applied as described in Section : Data register, data alignment and offset (ADC_DR, ADC_JDRy, OFFSETy, OFFSETy_CH, OVSS, LSHIFT, RSHIFT, SSATE)

Bits 15:0 RDATA_MST[15:0] : Regular data of the master ADC.

In dual mode, these bits contain the regular data of the master ADC. Refer to Section 25.4.32: Dual ADC modes .

The data alignment is applied as described in Section : Data register, data alignment and offset (ADC_DR, ADC_JDRy, OFFSETy, OFFSETy_CH, OVSS, LSHIFT, RSHIFT, SSATE)

In MDMA=0b11 mode, bits 15:8 contains SLV_ADC_DR[7:0], bits 7:0 contains MST_ADC_DR[7:0].

25.7.4 ADC x common regular data register for 32-bit dual mode (ADCx_CDR2) (x=1/2 or 3)

Address offset: 0x10

Reset value: 0x0000 0000

The address offset is relative to the master ADC base address + 0x300.

ADC1 and ADC2 are controlled by the same interface, while ADC3 is controlled separately.

31302928272625242322212019181716
RDATA_ALT[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
RDATA_ALT[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 RDATA_ALT[31:0] : Regular data of the master/slave alternated ADCs

In dual mode, these bits alternatively contains the regular 32-bit data of the master and the slave ADC. Refer to Section 25.4.32: Dual ADC modes .

The data alignment is applied as described in Section : Data register, data alignment and offset (ADC_DR, ADC_JDRy, OFFSETy, OFFSETy_CH, OVSS, LSHIFT, RSHIFT, SSATE) .

25.8 ADC register map

The following table summarizes the ADC registers.

Table 221. ADC global register map

OffsetRegister
0x000 - 0x0D0Master ADC1 or Master ADC3
0x0D4 - 0x0FCReserved
0x100 - 0x1D0Slave ADC2
0x1D4 - 0x2FCReserved
0x300 - 0x310Master and slave ADC common registers (ADC1/2 or ADC3)

Table 222. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x00ADC_ISRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LDORDYRes.JQOVFAWD3AWD2AWD1JEOSJEOCOVREOSEOCEOSMPADRDY
Reset value000000000000
0x04ADC_IERRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.JQOVFIEAWD3IEAWD2IEAWD1IEJEOSIEJEOCIEOVRIEEOSIEEOCIEEOSMPIEADRDYIE
Reset value00000000000
0x08ADC_CRADCALADCALDIFDEEPPWDADVREGENLINCALRDYW6LINCALRDYW5LINCALRDYW4LINCALRDYW3LINCALRDYW2LINCALRDYW1Res.Res.Res.Res.Res.ADCALLINRes.Res.Res.Res.Res.Res.BOOST[1:0] (1)Res.Res.JADSTPADSTPJADSTARTADSTARTADDISADEN
Reset value0010000000000000000
0x0CADC_CFGRJQDISAWD1CH[4:0]JAUTOJAWD1ENAWD1ENAWD1SGLJQMJDISCENDISCNUM [2:0]DISCENRes.AUTDLYCONTOVRMODEXTEN[1:0]EXTSEL [4:0]RES [2:0]DMNGT [1:0]
Reset value1000000000000000000000000000000
0x10ADC_CFGR2Res.Res.Res.Res.Res.Res.OSVR[9:0]Res.RSHIFT4RSHIFT3RSHIFT2RSHIFT1ROVSMTROVSOVSS[3:0]Res.Res.JOVSEROVSE
Reset value0000000000000000000000
0x14ADC_SMPR1Res.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]SMP0[2:0]
Reset value000000000000000000000000000000

Table 222. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC) (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x18ADC_SMPR2Res.Res.SMP19 [2:0]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 value000000000000000000000000000000
0x1CADC_PCSELRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PCSEL19PCSEL18PCSEL17PCSEL16PCSEL15PCSEL14PCSEL13PCSEL12PCSEL11PCSEL10PCSEL9PCSEL8PCSEL7PCSEL6PCSEL5PCSEL4PCSEL3PCSEL2PCSEL1PCSEL0
Reset value00000000000000000000
0x20ADC_LTR1Res.Res.Res.Res.Res.Res.LTR1[25:0]
Reset value00000000000000000000000000
0x24ADC_HTR1Res.Res.Res.Res.Res.Res.HTR1[25:0]
Reset value11111111111111111111111111
0x28ReservedRes.
0x2CReservedRes.
0x30ADC_SQR1Res.Res.Res.SQ4[4:0]Res.SQ3[4:0]Res.SQ2[4:0]Res.SQ1[4:0]Res.Res.L[3:0]
Reset value000000000000000000000000
0x34ADC_SQR2Res.Res.Res.SQ9[4:0]Res.SQ8[4:0]Res.SQ7[4:0]Res.SQ6[4:0]Res.Res.SQ5[4:0]
Reset value0000000000000000000000000
0x38ADC_SQR3Res.Res.Res.SQ14[4:0]Res.SQ13[4:0]Res.SQ12[4:0]Res.SQ11[4:0]Res.Res.SQ10[4:0]
Reset value0000000000000000000000000
0x3CADC_SQR4Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SQ16[4:0]Res.Res.SQ15[4:0]
Reset value0000000000
0x40ADC_DRRDATA[31:0]
Reset value00000000000000000000000000000000
0x44-0x48ReservedRes.
0x4CADC_JSQRJSQ4[4:0]Res.JSQ3[4:0]Res.JSQ2[4:0]Res.JSQ1[4:0]Res.JEXTEN[1:0]JEXTSEL[4:0]JL[1:0]
Reset value0000000000000000000000000000
0x50-0x5CReservedRes.
0x60ADC_OFR1SSATEOFFSET1_CH[4:0]OFFSET1[25:0]
Reset value00000000000000000000000000000000
0x64ADC_OFR2SSATEOFFSET2_CH[4:0]OFFSET2[25:0]
Reset value00000000000000000000000000000000

Table 222. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC) (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x68ADC_OFR3SSATEOFFSET3_CH[4:0]OFFSET3[25:0]
Reset value00000000000000000000000000000000
0x6CADC_OFR4SSATEOFFSET4_CH[4:0]OFFSET4[25:0]
Reset value00000000000000000000000000000000
0x70-0x7CReservedRes.
0x80ADC_JDR1JDATA1[31:0]
Reset value00000000000000000000000000000000
0x84ADC_JDR2JDATA2[31:0]
Reset value00000000000000000000000000000000
0x88ADC_JDR3JDATA3[31:0]
Reset value00000000000000000000000000000000
0x8CADC_JDR4JDATA4[31:0]
Reset value00000000000000000000000000000000
0x8C-0x9CReservedRes.
0xA0ADC_AWD2CRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.AWD2CH[19:0]
Reset value00000000000000000000
0xA4ADC_AWD3CRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.AWD3CH[19:0]
Reset value00000000000000000000
0xA8-0xACReservedRes.
0xB0ADC_LTR2Res.Res.Res.Res.Res.Res.LTR2[25:0]
Reset value00000000000000000000000000
0xB4ADC_HTR2Res.Res.Res.Res.Res.Res.HTR2[25:0]
Reset value11111111111111111111111111
0xB8ADC_LTR3Res.Res.Res.Res.Res.Res.LTR3[25:0]
Reset value00000000000000000000000000
0xBCADC_HTR3Res.Res.Res.Res.Res.Res.HTR3[25:0]
Reset value11111111111111111111111111
0xC0ADC_DIFSELRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DIFSEL[19:0]
Reset value00000000000000000000
0xC4ADC_CALFACTRes.Res.Res.Res.Res.CALFACT_D[10:0]Res.Res.Res.Res.Res.CALFACT_S[10:0]
Reset value0000000000000000000000
0xC8ADC_CALFACT2Res.Res.LINCALFACT[29:0]
Reset value000000000000000000000000000000

Table 222. ADC register map and reset values for each ADC (offset=0x000 for master ADC, 0x100 for slave ADC) (continued)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0xCC - 0xD0ReservedRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

1. Revision Y devices feature only one BOOST bit.

Table 223. ADC register map and reset values (master and slave ADC common registers) offset =0x300)

OffsetRegister name
reset value
313029282726252423222120191817161514131211109876543210
0x00ADCx_CSRRes.Res.Res.Res.Res.JQOVF_SLVAWD3_SLVAWD2_SLVAWD1_SLVJEOS_SLVJEOC_SLVOVR_SLVEOS_SLVEOC_SLVEOSMP_SLVADRDY_SLVRes.Res.Res.Res.Res.JQOVF_MSTAWD3_MSTAWD2_MSTAWD1_MSTJEOS_MSTJEOC_MSTOVR_MSTEOS_MSTEOC_MSTEOSMP_MSTADRDY_MST
slave ADC2master ADC1
Reset value0000000000000000000000
0x04ReservedRes.
0x08ADCx_CCRRes.Res.Res.Res.Res.Res.VBATENTSENVREFENPRESC[3:0]CKMODE[1:0]DAMDF[1:0]Res.Res.DELAY[3:0]Res.Res.Res.DUAL[4:0]
Reset value0000000000000000000
0x0CADCx_CDRRDATA_SLV[15:0]
Reset value00000000000000000000000000000000
0x10ADCx_CDR2RDATA_ALT[31:0]
Reset value00000000000000000000000000000000

Refer to Section 2.3 on page 129 for the register boundary addresses.