12. Analog digital converter (ADC)

The STM32WB05xZ embeds a 12-bit ADC. The ADC consists of a 12-bit successive approximation analog-to-digital converter (SAR) with 2 x 8 multiplexed channels allowing measurements of up to eight external sources and up to two internal sources.

12.1 Features

12.2 ADC presentation

Figure 22. ADC top level diagram shows the top level diagram of the ADC.

The analog ADC can be configured to interface with the following inputs:

Figure 22. ADC top level diagram

ADC top level diagram showing the internal architecture of the ADC subsystem. It includes input channels (VDDA, GND, TEMP SENSOR, VBAT, SELN_VINP[3:0], SELN_VINM[3:0], VINP, VINM) connected to a Muxing block. The Muxing block feeds into a SAR ADC 12bits block, which is connected to a Reference block. The SAR ADC output (12 bits) goes to an ADC Offset Correction and Bit Inversion block. This block feeds into a Down Sampler (16 bits) and a TO ADC WATCHDOG block. The Down Sampler output (16 bits) goes to a DATA REG1 block. The DATA REG1 block is connected to an APB MEMORY PORT. The APB MEMORY PORT is connected to an APB bus, which is connected to a CPU or DMA to RAM. The APB bus also connects to a Digital ADC Subsystem and an Analog ADC Subsystem. The Digital ADC Subsystem contains a CONF REG, CONTROL REG, WD TRIG REG, INT REG, and STATUS REG. The Analog ADC Subsystem contains a WD Block and a Sequencer Block. The WD Block and Sequencer Block are connected to the APB bus. The INT REG is connected to an INT to CPU block. The DATA REG1 block is also connected to a DREQ1 block. The DREQ1 block is connected to the APB bus. The APB bus is labeled 'APB'.
ADC top level diagram showing the internal architecture of the ADC subsystem. It includes input channels (VDDA, GND, TEMP SENSOR, VBAT, SELN_VINP[3:0], SELN_VINM[3:0], VINP, VINM) connected to a Muxing block. The Muxing block feeds into a SAR ADC 12bits block, which is connected to a Reference block. The SAR ADC output (12 bits) goes to an ADC Offset Correction and Bit Inversion block. This block feeds into a Down Sampler (16 bits) and a TO ADC WATCHDOG block. The Down Sampler output (16 bits) goes to a DATA REG1 block. The DATA REG1 block is connected to an APB MEMORY PORT. The APB MEMORY PORT is connected to an APB bus, which is connected to a CPU or DMA to RAM. The APB bus also connects to a Digital ADC Subsystem and an Analog ADC Subsystem. The Digital ADC Subsystem contains a CONF REG, CONTROL REG, WD TRIG REG, INT REG, and STATUS REG. The Analog ADC Subsystem contains a WD Block and a Sequencer Block. The WD Block and Sequencer Block are connected to the APB bus. The INT REG is connected to an INT to CPU block. The DATA REG1 block is also connected to a DREQ1 block. The DREQ1 block is connected to the APB bus. The APB bus is labeled 'APB'.

The input of the data path can come from the analog ADC through the possible inputs mentioned previously. The conversion data path can go through a downsampler (for static or low frequency input signals).

Caution: Do not change the configuration registers related to the function in use. Any change done by the user on the different bits are applied immediately, with an immediate effect on the on-going process (conversion, decimator filter or downsampler). This action can lead to unexpected results.

For VBAT < 2.7 V, the IO booster needs to be activated to maintain linearity.

12.2.1 Temperature sensor subsystem

The temperature sensor can be used to measure the junction temperature ( \( T_j \) ) of the device. The temperature sensor is internally connected to the ADC input channels, which are used to convert the sensor output voltage to a digital value.

The temperature sensor output voltage changes linearly with temperature. The offset of this line varies from chip-to-chip due to process variation. The uncalibrated internal temperature sensor is more suited for applications that detect temperature variations instead of absolute temperatures. To improve the accuracy of the temperature sensor measurement, calibration values are stored in system memory for each device by ST during production. During the manufacturing process, the calibration data of the temperature sensor and the internal voltage reference are stored in the system memory area. The user application can then read them and use them to improve the accuracy of the temperature sensor or the internal reference. In this way the temperature can be calculated with this formula:

\[ \text{Temperature in Celsius} = (C_{\text{meas}} - C_{30} + T_{\text{CK}}) / 10 \quad (1) \]

Where:

TCK is the chuck temperature in 0.1 °C (e.g. 30 °C = 300) readable @0x10001E5C.

C30 is the temperature sensor calibration value acquired at 30 °C readable @0x10001E60.

Cmeas is the actual temperature sensor output value converted by ADC.

Note: ADC gain and offset calibration are left as default values, 0xFFF.

Note: Refer to Section 27: Device electronic signature (DESIG) for information about the location where these calibration values are stored.

12.2.2 Battery sensor

The battery sensor can be used to measure the internal battery voltage of the device. The battery input is internally connected to the ADC input channels which are used to convert the sensor output voltage to a digital value.

The battery sensor range is up to 3.6 V.

The formula for ADC converted data after calibration is the following:

Code = Integer(4096/3.6 * VIN) [clamped at 4095]

As calibration points the VBAT is considered as single negative input with 3.6 V range.

Note: Refer to Section 27.1: DESIG registers for information about the location where these calibration values are stored.

12.2.3 ADC input mode conversion

The ADC is designed to deliver a digital value corresponding to the ratio between the voltage applied on the converted channel and the reference voltage, VDDA. Note that VDDA is also the ADC's power supply.

The formula for ADC digital converted data after calibration and offset is the following:

12.2.4 Steady-state input impedance

As the input nature of the ADC is a switched-capacitor, its steady-state input impedance is defined as the impedance seen in DC. It depends only on the analog sampling frequency, Fs, and the input capacitor, Cin: \( Z_{in} = 1/(C_{in} \cdot F_s) \) .

12.2.5 Input signal sampling transient response

As represented in Figure 24. Effect of analog source resistance , the analog signal path consists of a series resistance (Rext) between source and pin, the internal switch resistor (Rin), and the internal sampling capacitor (Cin). The charging of the capacitor is controlled by Rin. When there is Rext in series, the effective value of charging of Cin is governed by Rin+Rext. So, the charging time constant becomes (Rin+Rext)*Cin and the necessary time to reach a given accuracy is longer. The ADC's sampling time, Tsw, is a function of the ADC's frequency, 1/Ts as follows:

\[ T_{sw} = T_s - 825 \times 10^{-9} \]

Figure 23. ADC sampling time Tsw and sampling period Ts

Timing diagram showing a square wave. The sampling time Tsw is indicated as 125ns, and the sampling period Ts is indicated as 1us.

The diagram shows a square wave representing the ADC sampling signal. A horizontal double-headed arrow at the top indicates the sampling time \( T_{sw} = 125\text{ns} \) , which corresponds to the duration of the high state. A horizontal double-headed arrow at the bottom indicates the sampling period \( T_s = 1\text{us} \) , which corresponds to the duration of one full cycle (high + low).

Timing diagram showing a square wave. The sampling time Tsw is indicated as 125ns, and the sampling period Ts is indicated as 1us.

Figure 24. Effect of analog source resistance

Circuit diagram showing the effect of analog source resistance. An external voltage source Vin is connected through an external resistance Rext to the AUXADC Interface. Inside the interface, there is an internal resistance Rin, a sampling switch with a sampling time Tsw=125ns, and an internal capacitance Cin.

The diagram illustrates the equivalent circuit for an ADC input. An external voltage source \( V_{in} \) is connected to the ADC input through an external source resistance \( R_{ext} \) . Inside the 'AUXADC Interface', there is an internal input resistance \( R_{in} \) . A switch, representing the sampling switch, is shown in series with \( R_{in} \) . This switch has a sampling time \( T_{sw} = 125\text{ns} \) . Following the switch, there is an internal sampling capacitance \( C_{in} \) connected to ground.

Circuit diagram showing the effect of analog source resistance. An external voltage source Vin is connected through an external resistance Rext to the AUXADC Interface. Inside the interface, there is an internal resistance Rin, a sampling switch with a sampling time Tsw=125ns, and an internal capacitance Cin.

Knowing that: \( R_{in} = 550\ \Omega \) , \( C_{in} = 4\ \text{pF} \) , and imposing a maximum sampling error of 1/2 bits, we can determine the maximum input resistance as below:

\[ \epsilon = (V_s - V_{in})/V_{in} = -e^{(-t/RC)} \]

\[ \ln|\epsilon| \leq t/(R_{ext} + R_{in}) * C_{in} \]

\[ (R_{ext} + R_{in}) * C_{in} \leq t / \ln|\epsilon| \]

\[ (R_{ext} + R_{in}) * C_{in} \leq 125\text{e-}9 / \ln(122\text{e-}6) \]

\[ (R_{ext} + R_{in}) * C_{in} \leq 14\ \text{ns} \]

\[ R_{ext} \leq 14\ \text{ns} / 4\ \text{pF} - 550\ \Omega \]

\[ R_{ext} \leq 2950\ \Omega \]

Where:

\[ |\epsilon| \leq 1/2^{13} \]

\[ |\epsilon| \leq 122\text{e-}6 \]

12.2.6 Calibration points

Calibration values are stored in the system memory for each device by ST during production. Each value consists of a 12-bit unsigned value for the gain and an 8-bit signed value for the offset as follows:

OFFSET[18:12] | GAIN[11:0]

These values can be written inside the registers COMP_x with \( x = 1, 2, 3, 4 \) to apply a point to a particular ADC input. The COMP_SEL register allows a specific calibration point to be associated to one of the ADC inputs.

The offset value can be written inside the COMP_x register only if it fits in the 7-bit of register field, that means offset is in [-64, 63]. Otherwise, it can be removed by the output raw data manually as \( \text{raw\_value} + \text{offset} \) .

The negative offset values need to be converted as:

offset | 0x80, if the bitfield BIT_INVERT_SN=1 (default value).

Below the list of the calibration points and their location in the system memory.

Table 31. Calibration points

Calibration pointAddress location
VINPx - VINMx range 1.2 V0x10001E00
VINMx range 1.2 V0x10001E04
VINPx range 1.2 V0x10001E08
VINPx - VINMx range 2.4 V0x10001E0C
VINMx range 2.4 V0x10001E10
VINPx range 2.4 V0x10001E14
VINPx - VINMx range 3.6 V0x10001E18
VINMx range 3.6 V0x10001E1C
VINPx range 3.6 V0x10001E20

Note: Previous version of the calibration points has the offset in 7-bit signed. This version can be recognized as the user can read at address 0x10001EFC the value 0.

Note: Refer to Section 27.1: DESIG registers for information about the location where these calibration values are stored.

12.2.7 Down sampler (DS)

This down sampler is a simple averaging filter, which can divide the ADC frequency by 1 to 128 by power of 2. The goal is to handle multiple ADC samples and average them into a single data with increased data width ranging from 12-bit to 16-bit.

The down sampler increases the data precision but reduces the output data rate.

Note: A constraint on the ratio between APB system clock ( \( F_{PCLK} \) ) and the output data rate ( \( DR_{out} \) ) must be respected:

Example: \( F_{PCLK} \) must be at least 2 MHz to have a \( DR_{out} = 500 \) kHz.

If the DMA is not used to get the data output by the down sampler filter path, the CPU needs to be clocked at a frequency ratio high enough (taking into account bus matrix latency) to avoid missing samples.

12.3 Interrupts

There are 5 maskable interrupts generated by the ADC block. These interrupts are combined to produce one single interrupt output, which is the only interrupt line from the ADC to the CPU.

Table 32. ADC interrupt requests

Interrupt eventEvent flagInterrupt / flag clearing methodInterrupt enable control bit
ADC end of Conversion (Test mode only)EOC_IRQWrite 1 on EOC_IRQ bitEOC_IRQ_ENA
Down sampler end of conversionEODS_IRQWrite 1 on EODS_IRQ bitEODS_IRQ_ENA
End of conversion sequenceEOS_IRQWrite 1 on EOS_IRQ bitEOS_IRQ_ENA
Analog watchdog eventAWD_IRQWrite 1 on AWD_IRQ bitAWD_IRQ_ENA
Down sampler overrunOVR_DS_IRQWrite 1 on OVR_DS_IRQ bitOVR_DS_IRQ_ENA

12.4 DMA interface

The ADC has one DMA channel interface to get down sampler data output value.

The DMA feature is enabled by software through the CONF register by DMA_DS_ENA bit.

When DMA feature is disabled, the CPU reads the data through the corresponding APB register.

12.5 ADC mode

ADC is the only conversion mode available for STM32WB05xZ.

The input signal can come from:

The conversion can be continuous or single mode.

Table 33. ADC mode summary

ModeInput signalDS (1)Continuous or single
ADC
  • • 8 single external channels (or 4 when coupled as differential)
  • • VBAT
  • • Temperature sensor
DSContinuous or single

1. Down Sampler

12.5.1 ADC mode overview

Presentation

The ADC mode has the following characteristics:

ADC mode usage

This paragraph describes the process to use the ADC mode:

Note: To have more than one conversion, ensure the bit SEQUENCE is well at 1 in CONF register.

Note: If the CPU does not manage to get the converted data before a new converted data is generated, the OVR_DS_IRQ flag is raised to inform a data has been lost. The software can program the hardware behavior in case of overrun through the OVR_DS_CFG bit in CONF register:

12.6 ADC registers

12.6.1 Version register (VERSION_ID)

Address offset: 0x00

Reset value: 0x0000 0030

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.VERSION_ID[7:0]
rrrrrrrr
Bits 31:8Reserved, must be kept at reset value.
Bit 7:0VERSION_ID[7:0] : Version of the embedded IP.

12.6.2 ADC configuration register (CONF)

Address offset: 0x04

Reset value: 0x0002 0002

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.SAMPLE_RATE_MSBADC_CONT_1V2BIT_INVERT_DIFFBIT_INVERT_SN
rwrwrwrw
1514131211109876543210
OVR_DS_CFGRes.DMA_DS_ENASAMPLE_RATE[1:0]Res.Res.Res.Res.SMPS_SYNCHRO_ENASEQ_LEN[3:0]
rwrwrwrwrwrwrw
Bits 31:24Reserved, must be kept at reset value.
Bits 23:21SAMPLE_RATE_MSB : Sample Rate MSB
This field is an extension of SAMPLE_RATE definition in bits 12,11 of CONF register. It impacts the conversion rate of ADC (F_ADC). See SAMPLE_RATE bits for the full description.
Bit 20Reserved, must be kept at reset value.
Bit 19ADC_CONT_1V2 : Select the input sampling method:
  • 0: Sampling time is 125 ns regardless of the sampling period
  • 1: Sampling time is a function of the sampling period
Bit 18BIT_INVERT_DIFF: Invert bit-to-bit the ADC data output (1's complement) when a differential input is connected to the ADC:
  • • 0: No inversion (default)
  • • 1: Enable the inversion
Bit 17BIT_INVERT_SN: Invert bit-to-bit the ADC data output (1's complement) when a single negative input is connected to the ADC:
  • • 0: No inversion
  • • 1: Enable the inversion (default)
Bit 16Reserved, must be kept at reset value.
Bit 15OVR_DS_CFG: Down sampler overrun configuration:
  • • 0: The previous data is kept, the new one is lost (default)
  • • 1: The previous data is lost, the new one is kept
Bit 14Reserved, must be kept at reset value.
Bit 13DMA_DS_EN: Enable the DMA mode for the down sampler data path:
  • • 0: DMA mode is disabled
  • • 1: DMA mode is enabled
Bits 12:11SAMPLE_RATE[1:0]: Conversion rate of ADC ( \( F\_ADC \) ):
\( F\_ADC = F\_ADC\_CLK / (16 + 16 * \text{SAMPLE\_RATE\_MSB} + 4 * \text{SAMPLE\_RATE}) \) , where \( F\_ADC\_CLK \) is the analog ADC clock frequency. By default \( F\_ADC\_CLK \) is 16MHz frequency.
Bits 10:7Reserved, must be kept at reset value.
Bit 6SMPS_SYNCHRO_ENA: Synchronize the ADC start conversion with a pulse generated by the SMPS:
  • • 0: SMPS synchronization is disabled for all ADC clock frequencies
  • • 1: SMPS synchronization is enabled
Note: SMPS_SYNCHRO_ENA must be 0 when PWRC_CR5.NOSMPS=1.
Bits 5:2SEQ_LEN[3:0]: Number of conversions in a regular sequence:
  • • 0000: 1 conversion, starting from SEQ 0
  • • 0001: 2 conversions, starting from SEQ 0
  • • ...
  • • 1111: 16 conversions, starting from SEQ 0
Bit 1SEQUENCE: Enable the sequence mode (active by default):
  • • 0: Sequence mode is disabled, only SEQ0 is selected
  • • 1: Sequence mode is enabled, conversions from SEQ0 to SEQx with x=SEQ_LEN (default)
Note: Clearing this bit is equivalent to SEQUENCE=1 and SEQ_LEN=0000. Ideally, this bit can be kept high as redundant with keeping high and setting SEQ_LEN=0000.
Bit 0CONT: Regular sequence runs continuously when ADC mode is enabled:
  • • 0: Enable the single conversion: when the sequence is over, the conversion stops
  • • 1: Enable the continuous conversion: when the sequence is over, the sequence starts again until the software sets the CTRL.STOP_OP_MODE bit

12.6.3 ADC control register (CTRL)

Address offset: 0x08

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.Res.Res.Res.Res.Res.ADC_LDO_ENARes.Res.STOP_OP_MODESTART_CONVADC_ON_OFF
rwrwttrw
Bits 31:6Reserved, must be kept at reset value.
Bit 5ADC_LDO_ENA : Enable the LDO associated to the ADC block:
  • 0: Disable the ADCLDO
  • 1: Enable the ADCLDO
Warning: This bit must not be set on VFQFPN32 packages.
Bit 4Reserved, must be kept at reset value.
Bit 3Reserved, must be kept at reset value.
Bit 2STOP_OP_MODE (1) : Stop the on-going ADC mode:
  • 0: No effect
  • 1: Stop on-going ADC mode
Note: This bit is set by software and cleared by hardware.
Bit 1START_CONV (1) : Generates a start pulse to initiate an ADC conversion:
  • 0: No effect
  • 1: Start the ADC conversion
Note: This bit is set by software and cleared by hardware.
Bit 0ADC_ON_OFF :
  • 0: Power off the ADC
  • 1: Power on the ADC
  1. 1. When setting the STOP_MODE_OP , the user has to wait around 10 µs before starting a new ADC conversion by setting the START_CONV bit.

12.6.4 ADC input voltage switch selection register (SWITCH)

Address offset: 0x14

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
SE_VIN_7[1:0]SE_VIN_6[1:0]SE_VIN_5[1:0]SE_VIN_4[1:0]SE_VIN_3[1:0]SE_VIN_2[1:0]SE_VIN_1[1:0]SE_VIN_0[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:16Reserved, must be kept at reset value.
Bits 15:14SE_VIN_7[1:0] : Input voltage for VINP[3].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 13:12SE_VIN_6[1:0] : Input voltage for VINP[2].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 11:10SE_VIN_5[1:0] : Input voltage for VINP[1].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 9:8SE_VIN_4[1:0] : Input voltage for VINP[0].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 7:6SE_VIN_3[1:0] : Input voltage for VINM[3] / VINP[3]-VINM[3].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 5:4SE_VIN_2[1:0] : Input voltage for VINM[2] / VINP[2]-VINM[2].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 3:2SE_VIN_1[1:0] : Input voltage for VINM[1] / VINP[1]-VINM[1].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V
Bits 1:0SE_VIN_0[1:0] : Input voltage for VINM[0] / VINP[0]-VINM[0].
  • 00: Vininput = 1.2 V
  • 01: Reserved (not used for this cut)
  • 10: Vininput = 2.4 V
  • 11: Vininput = 3.6 V

12.6.5 Down sampler configuration register (DS_CONF)

Address offset: 0x1C

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.Res.Res.Res.Res.Res.DS_WIDTH[2:0]DS_RATIO[2:0]
rwrwrwrwrwrw
Bits 31:6Reserved, must be kept at reset value.
Bits 5:3DS_WIDTH[2:0]: Program the down sampler width of data output (DSDATA).
  • 000: DS_DATA output on 12-bit (default)
  • 001: DS_DATA output on 13-bit
  • 010: DS_DATA output on 14-bit
  • 011: DS_DATA output on 15-bit
  • 100: DS_DATA output on 16-bit
  • 1xx: Reserved
Bits 2:0DS_RATIO[2:0]: Program the down sampler ratio (N factor).
  • 000: ratio = 1, no down sampling (default)
  • 001: ratio = 2
  • 010: ratio = 4
  • 011: ratio = 8
  • 100: ratio = 16
  • 101: ratio = 32
  • 110: ratio = 64
  • 111: ratio = 128

12.6.6 ADC sequence programming 1 register (SEQ_1)

Address offset: 0x20

Reset value: 0x0000 0000

31302928272625242322212019181716
SEQ7[3:0]SEQ6[3:0]SEQ5[3:0]SEQ4[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SEQ3[3:0]SEQ2[3:0]SEQ1[3:0]SEQ0[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:28SEQ7[3:0] : Channel number code for 8 th conversion of the sequence.
See SEQ0 for code detail.
Bits 27:24SEQ6[3:0] : Channel number code for 7 th conversion of the sequence. See SEQ0 for code detail.
Bits 23:20SEQ5[3:0] : Channel number code for 6 th conversion of the sequence. See SEQ0 for code detail.
Bits 19:16SEQ4[3:0] : Channel number code for 5 th conversion of the sequence. See SEQ0 for code detail.
Bits 15:12SEQ3[3:0] : Channel number code for 4 th conversion of the sequence. See SEQ0 for code detail.
Bits 11:8SEQ2[3:0] : Channel number code for 3 rd conversion of the sequence. See SEQ0 for code detail.
Bits 7:4SEQ1[3:0] : Channel number code for second conversion of the sequence. See SEQ0 for code detail.
Bits 3:0SEQ0[3:0] : Channel number code for first conversion of the sequence
  • 0000: VINM[0] to ADC single negative input
  • 0001: VINM[1] to ADC single negative input
  • 0010: VINM[2] to ADC single negative input
  • 0011: VINM[3] to ADC single negative input
  • 0100: VINP[0] to ADC single positive input
  • 0101: VINP[1] to ADC single positive input
  • 0110: VINP[2] to ADC single positive input
  • 0111: VINP[3] to ADC single positive input
  • 1000: VINP[0]-VINM[0] to ADC differential input
  • 1001: VINP[1]-VINM[1] to ADC differential input
  • 1010: VINP[2]-VINM[2] to ADC differential input
  • 1011: VINP[3]-VINM[3] to ADC differential input
  • 1100: VBAT - battery level detector
  • 1101: Temperature sensor
  • 111x: Reserved

12.6.7 ADC sequence programming 2 register (SEQ_2)

Address offset: 0x24

Reset value: 0x0000 0000

31302928272625242322212019181716
SEQ15[3:0]SEQ14[3:0]SEQ13[3:0]SEQ12[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SEQ11[3:0]SEQ10[3:0]SEQ9[3:0]SEQ8[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:28SEQ15[3:0] : Channel number code for 16 th conversion of the sequence. See SEQ8 for code detail.
Bits 27:24SEQ14[3:0] : Channel number code for 15 th conversion of the sequence. See SEQ8 for code detail.
Bits 23:20SEQ13[3:0] : Channel number code for 14 th conversion of the sequence. See SEQ8 for code detail.
Bits 19:16SEQ12[3:0] : Channel number code for 13 th conversion of the sequence. See SEQ8 for code detail.
Bits 15:12SEQ11[3:0] : Channel number code for 12 th conversion of the sequence. See SEQ8 for code detail.
Bits 11:8SEQ10[3:0] : Channel number code for 11 th conversion of the sequence. See SEQ8 for code detail.
Bits 7:4SEQ9[3:0] : Channel number code for 10 th conversion of the sequence. See SEQ8 for code detail.
Bits 3:0SEQ8[3:0] : Channel number code for 9 th conversion of the sequence.
  • 0000: VINM[0] to ADC single negative input
  • 0001: VINM[1] to ADC single negative input
  • 0010: VINM[2] to ADC single negative input
  • 0011: VINM[3] to ADC single negative input
  • 0100: VINP[0] to ADC single positive input
  • 0101: VINP[1] to ADC single positive input
  • 0110: VINP[2] to ADC single positive input
  • 0111: VINP[3] to ADC single positive input
  • 1000: VINP[0]-VINM[0] to ADC differential input
  • 1001: VINP[1]-VINM[1] to ADC differential input
  • 1010: VINP[2]-VINM[2] to ADC differential input
  • 1011: VINP[3]-VINM[3] to ADC differential input
  • 1100: VBAT - battery level detector
  • 1101: Temperature sensor
  • 111x: Reserved

12.6.8 ADC gain and offset correction 1 register (COMP_1)

Address offset: 0x28

Reset value: 0x0000 0555

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OSFFSET1[7:4]
rwrwrwrw
1514131211109876543210
OSFFSET1[3:0]GAIN1[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:20Reserved, must be kept at reset value.
Bits 19:12OFFSET1[7:0] : First calibration point: signed offset compensation[7:0].
Bits 11:0GAIN1[11:0] : First calibration point: gain AUXADC_GAIN_1V2[11:0].

Note: Refer to Section 27: Device electronic signature (DESIG) for information about the location where these calibration values are stored.

12.6.9 ADC gain and offset correction 2 register (COMP_2)

Address offset: 0x2C

Reset value: 0x0000 0555

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET2[7:4]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
OFFSET2[3:0]GAIN2[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:20Reserved, must be kept at reset value.
Bits 19:12OFFSET2[7:0] : Second calibration point: signed offset compensation[7:0].
Bits 11:0GAIN2[11:0] : Second calibration point: gain AUXADC_GAIN_1V2[11:0].

Note: Refer to Section 27: Device electronic signature (DESIG) for information about the location where these calibration values are stored.

12.6.10 ADC gain and offset correction 3 register (COMP_3)

Address offset: 0x30

Reset value: 0x0000 0555

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OSFFSET3[7:4]
rwrwrwrw
1514131211109876543210
OSFFSET3[3:0]GAIN1[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:20Reserved, must be kept at reset value.
Bits 19:12OFFSET3[7:0] : Third calibration point: signed offset compensation[7:0].
Bits 11:0GAIN3[11:0] : Third calibration point: gain AUXADC_GAIN_1V2[11:0].

Note: Refer to Section 27: Device electronic signature (DESIG) for information about the location where these calibration values are stored.

12.6.11 ADC gain and offset correction 4 register (COMP_4)

Address offset: 0x34

Reset value: 0x0000 0555

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OSFFSET4[7:4]
rwrwrwrw
1514131211109876543210
OSFFSET4[3:0]GAIN1[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:19Reserved, must be kept at reset value.
Bits 19:12OFFSET4[7:0] : Fourth calibration point: signed offset compensation[7:0].
Bits 11:0GAIN4[11:0] : Fourth calibration point: gain AUXADC_GAIN_1V2[11:0].

Note: Refer to Section 27: Device electronic signature (DESIG) for information about the location where these calibration values are stored.

12.6.12 ADC gain and offset selection register (COMP_SEL)

Address offset: 0x38

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET_GAIN8[1:0]
rwrw
1514131211109876543210
OFFSET_GAIN7[1:0]OFFSET_GAIN6[1:0]OFFSET_GAIN5[1:0]OFFSET_GAIN4[1:0]OFFSET_GAIN3[1:0]OFFSET_GAIN2[1:0]OFFSET_GAIN1[1:0]OFFSET_GAIN0[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:18Reserved, must be kept at reset value.
Bits 17:16OFFSET_GAIN8[1:0]: Gain / offset used in ADC differential mode with Vinput range = 3.6 V:
  • • 00: OFFSET1 and GAIN1 from COMP_1
  • • 01: OFFSET2 and GAIN2 from COMP_2
  • • 10: OFFSET3 and GAIN3 from COMP_3
  • • 11: OFFSET4 and GAIN4 from COMP_4
Bits 15:14OFFSET_GAIN7[1:0]: Gain / offset used in ADC single positive mode with Vinput range = 3.6 V:
  • • 00: OFFSET1 and GAIN1 from COMP_1
  • • 01: OFFSET2 and GAIN2 from COMP_2
  • • 10: OFFSET3 and GAIN3 from COMP_3
  • • 11: OFFSET4 and GAIN4 from COMP_4
Bits 13:12OFFSET_GAIN6[1:0]: Gain / offset used in ADC single negative mode with Vinput range = 3.6 V (this field also selects the gain/offset for VBAT input):
  • • 00: OFFSET1 and GAIN1 from COMP_1
  • • 01: OFFSET2 and GAIN2 from COMP_2
  • • 10: OFFSET3 and GAIN3 from COMP_3
  • • 11: OFFSET4 and GAIN4 from COMP_4
Bits 11:10OFFSET_GAIN5[1:0]: Gain / offset used in ADC differential mode with Vinput range = 2.4 V:
  • • 00: OFFSET1 and GAIN1 from COMP_1
  • • 01: OFFSET2 and GAIN2 from COMP_2
  • • 10: OFFSET3 and GAIN3 from COMP_3
  • • 11: OFFSET4 and GAIN4 from COMP_4
Bits 9:8OFFSET_GAIN4[1:0]: Gain / offset used in ADC single positive mode with Vinput range = 2.4 V:
  • • 00: OFFSET1 and GAIN1 from COMP_1
  • • 01: OFFSET2 and GAIN2 from COMP_2
  • • 10: OFFSET3 and GAIN3 from COMP_3
  • • 11: OFFSET4 and GAIN4 from COMP_4
Bits 7:6OFFSET_GAIN3[1:0]: Gain / offset used in ADC single negative mode with Vinput range = 2.4 V:
  • • 00: OFFSET1 and GAIN1 from COMP_1
  • • 01: OFFSET2 and GAIN2 from COMP_2
  • • 10: OFFSET3 and GAIN3 from COMP_3
  • 11: OFFSET4 and GAIN4 from COMP_4
Bits 5:4OFFSET_GAIN2[1:0]: Gain / offset used in ADC differential mode with Vinput range = 1.2 V:
  • 00: OFFSET1 and GAIN1 from COMP_1
  • 01: OFFSET2 and GAIN2 from COMP_2
  • 10: OFFSET3 and GAIN3 from COMP_3
  • 11: OFFSET4 and GAIN4 from COMP_4
Bits 3:2OFFSET_GAIN1[1:0]: Gain / offset used in ADC single positive mode with Vinput range = 1.2 V (this field also selects the gain/offset for temperature sensor input):
  • 00: OFFSET1 and GAIN1 from COMP_1
  • 01: OFFSET2 and GAIN2 from COMP_2
  • 10: OFFSET3 and GAIN3 from COMP_3
  • 11: OFFSET4 and GAIN4 from COMP_4
Bits 1:0OFFSET_GAIN0[1:0]: Gain / offset used in ADC single negative mode with Vinput range = 1.2 V:
  • 00: OFFSET1 and GAIN1 from COMP_1
  • 01: OFFSET2 and GAIN2 from COMP_2
  • 10: OFFSET3 and GAIN3 from COMP_3
  • 11: OFFSET4 and GAIN4 from COMP_4

12.6.13 ADC watchdog threshold register (WD_TH)

Address offset: 0x3C

Reset value: 0x0FFF 0000

31302928272625242322212019181716
Res.Res.Res.Res.WD_HT[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.WD_LT[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw
Bits 31:28Reserved, must be kept at reset value.
Bits 27:16WD_HT[11:0]: Analog watchdog high level threshold.
Bits 15:12Reserved, must be kept at reset value.
Bits 11:0WD_LT[11:0]: Analog watchdog low level threshold.

12.6.14 ADC watchdog configuration register (WD_CONF)

Address offset: 0x40

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
AWD_CHX[15:0]
r/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w
Bits 31:16Reserved, must be kept at reset value.
Bits 15:0AWD_CHX[15:0] : Analog watchdog channel selection to define which input channel(s) need to be guarded by the watchdog.
  • • Bit0: VINM[0] to ADC negative input
  • • Bit1: VINM[1] to ADC negative input
  • • Bit2: VINM[2] to ADC negative input
  • • Bit3: VINM[3] to ADC negative input
  • • Bit4: Not used
  • • Bit5: VBAT to ADC negative input
  • • Bit6: GND to ADC negative input
  • • Bit7: VDDA to ADC negative input
  • • Bit8: VINP[0] to ADC positive input
  • • Bit9: VINP[1] to ADC positive input
  • • Bit10: VINP[2] to ADC positive input
  • • Bit11: VINP[3] to ADC positive input
  • • Bit12: Not used
  • • Bit13: TEMP to ADC positive input
  • • Bit14: GND to ADC positive input
  • • Bit15: VDDA to ADC positive input

12.6.15 Down sampler data out register (DS_DATAOUT)

Address offset: 0x44

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
DS_DATA[15:0]
rrrrrrrrrrrrrrrr
Bits 31:16Reserved, must be kept at reset value.
Bits 15:0DS_DATA[15:0] : Contains the converted data at the output of the down sampler.

12.6.16 ADC interrupt status register (IRQ_STATUS)

Address offset: 0x4C

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.Res.Res.Res.Res.Res.OVR_DS_IRQAWD_IRQEOS_IRQRes.EODS_IRQEOC_IRQ
rc_w1rc_w1rc_w1rc_w1rc_w1
Bits 31:6Reserved, must be kept at reset value.
Bit 5

OVR_DS_IRQ: Set to indicate a down sampler overrun (at least one data is lost). When read, provide the status of the interrupt:

  • 0: No overrun occurred
  • 1: Overrun occurred

Writing this bit clears the status of the interrupt:

  • 0: No effect
  • 1: Clear the interrupt
Bit 4

AWD_IRQ: Set when an analog watchdog event occurs. When read, provide the status of the interrupt:

  • 0: No analog watchdog event occurred
  • 1: Analog watchdog event has occurred.

Writing this bit clears the status of the interrupt:

  • 0: No effect
  • 1: Clear the interrupt
Bit 3

EOS_IRQ: Set when a sequence of conversion is completed. When read, provide the status of the interrupt:

  • 0: Sequence of conversion is not completed
  • 1: Sequence of conversion is completed.

Writing this bit clears the status of the interrupt:

  • 0: No effect
  • 1: Clear the interrupt
Bit 2Reserved, must be kept at reset value.
Bit 1

EODS_IRQ: Set when the down sampler conversion is completed. When read, provide the status of the interrupt:

  • 0: Down sampler conversion is not completed
  • 1: Down sampler conversion is completed

Writing this bit clears the status of the interrupt:

  • 0: No effect
  • 1: Clear the interrupt
Bit 0

EOC_IRQ (Used in test mode only): set when the ADC conversion is completed.

When read, provide the status of the interrupt:

  • 0: ADC conversion is not completed
  • 1: ADC conversion is completed

Writing this bit clears the status of the interrupt:

  • 0: no effect
  • 1: clear the interrupt

12.6.17 ADC interrupt enable register (IRQ_ENABLE)

Address offset: 0x50

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.Res.Res.Res.Res.Res.OVR_DS_IRQ_ENAAWD_IRQ_ENAEOS_IRQ_ENARes.EODS_IRQ_ENAEOC_IRQ_ENA
rwrwrwrwrw
Bits 31:6Reserved, must be kept at reset value.
Bit 5OVR_DS_IRQ_ENA: Down sampler overrun interrupt enable:
  • 0: Down sampler interrupt is disabled
  • 1: Down sampler interrupt is enabled
Bit 4AWD_IRQ_ENA: Analog watchdog interrupt enable:
  • 0: Analog watchdog interrupt is disabled
  • 1: Analog watchdog interrupt is enabled
Bit 3EOS_IRQ_ENA: End of regular sequence interrupt enable:
  • 0: EOS interrupt is disabled
  • 1: EOS interrupt is enabled
Bit 2Reserved, must be kept at reset value.
Bit 1EODS_IRQ_ENA: End of conversion interrupt enable for the down sampler output:
  • 0: EODF interrupt is disabled
  • 1: EODF interrupt is enabled
Bit 0EOC_IRQ_ENA (Used in test mode only): End of ADC conversion interrupt enable:
  • 0: EOC interrupt is disabled
  • 1: EOC interrupt is enabled

12.6.18 ADC register map

Table 34. ADC register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x00VERSION_IDRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.VERSION_ID[7:0]
Reset value00110000
0x04CONFRes.Res.Res.Res.Res.Res.Res.Res.SAMPLE_RATE_MSBRes.ADC_CONT_1V2BIT_INVERT_DIFFBIT_INVERT_SNRes.OVR_DS_CFGRes.DMA_DS_ENASAMPLE_RATE[1:0]Res.Res.Res.Res.SMPS_SYNCHRO_ENA
Reset value00000100000000010
0x08CTRLRes.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.ADC_LDO_ENA
Reset value0
0x14SWITCHRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SE_VIN_7[1:0]SE_VIN_6[1:0]SE_VIN_5[1:0]SE_VIN_4[1:0]SE_VIN_3[1:0]SE_VIN_2[1:0]SE_VIN_1[1:0]SE_VIN_0[1:0]
Reset value000000000000000
0x1CDS_CONFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DS_WIDTH[2:0]
Reset value000000
0x20SEQ_1SEQ7[3:0]SEQ6[3:0]SEQ5[3:0]SEQ4[3:0]SEQ3[3:0]SEQ2[3:0]SEQ1[3:0]SEQ0[3:0]
Reset value0000000000000000000000000000000
0x24SEQ_2SEQ15[3:0]SEQ14[3:0]SEQ13[3:0]SEQ12[3:0]SEQ11[3:0]SEQ10[3:0]SEQ9[3:0]SEQ8[3:0]
STMicroelectronics logo
STMicroelectronics logo
OffsetRegister313029282726252423222120191817161514131211109876543210
0x24Reset value000000000000000000000000000000000
0x28COMP_1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET1[7:0]GAIN1[11:0]
Reset value00000000010101010101
0x2CCOMP_2Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET2[7:0]GAIN2[11:0]
Reset value00000000010101010101
0x30COMP_3Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET3[7:0]GAIN3[11:0]
Reset value00000000010101010101
0x34COMP_4Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET4[7:0]GAIN4[11:0]
Reset value00000000010101010101
0x38COMP_SELRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET_GAIN8[1:0]OFFSET_GAIN7[1:0]OFFSET_GAIN6[1:0]OFFSET_GAIN5[1:0]OFFSET_GAIN4[1:0]OFFSET_GAIN3[1:0]OFFSET_GAIN2[1:0]OFFSET_GAIN1[1:0]OFFSET_GAIN0[1:0]
Reset value00000000000000000
0x3CWD_THRes.Res.Res.Res.WD_HT[11:0]Res.Res.Res.Res.WD_LT[11:0]
Reset value111111111111000000000000
0x40WD_CONFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.AWD_CHX[15:0]
Reset value0000000000000000
0x44DS_DATAOUTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.DS_DATA[15:0]
Reset value0000000000000000
0x4CIRQ_STATUSRes.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.OV R _DS_IRQAWD_IRQEOS_IRQRes.EODS_IRQ
Reset value0000
OffsetRegister313029282726252423222120191817161514131211109876543210
0x50IRQ_ENABLERes.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.OVR_DS_IRQ_ENAAWD_IRQ_ENAEOS_IRQ_ENARes.EODS_IRQ_ENAEOC_IRQ_ENA
Reset value00000

Refer to Table 3. STM32WB05xZ memory map and peripheral register boundary addresses for the register boundary addresses.

STMicroelectronics logo
STMicroelectronics logo