12. Analog to digital converter (ADC)

The STM32WB09xE embeds a 12-bit ADC. The ADC consists in 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 three internal sources.

12.1 Features

12.2 ADC presentation

Figure 20 shows the top level diagram of the ADC.

The analog ADC is designed to support sixteen possible inputs:

Figure 20. ADC top level diagram

ADC top level diagram showing the internal architecture of the ADC. The diagram is divided into Analog ADC Subsystem (blue dashed boundary) and Digital ADC Subsystem (orange dashed boundary). Analog ADC Subsystem includes inputs VDDA (2 lines), GND (2 lines), TEMP SENSOR, VBAT, SELN_VINP[3:0] (4 lines), SELN_VINM[3:0] (4 lines), VINP, and VINM connected through a Muxing block to a SAR ADC 12bits block powered by a Reference. The output (12 bits) goes to ADC Offset Correction and Bit Inversion blocks, outputting 12 bits to a Down Sampler (which outputs 16 bits to DATA REG1) and TO ADC WATCHDOG. The Digital ADC Subsystem includes CONF REG (with CONTROL REG, WD TRIG REG, INT REG, STATUS REG), WD Block, Sequencer Block, and ADC CONTROLLER managing DATA REG1 with signals DATA1, DREQ1, ACQ1, APB MEMORY PORT, connected via APB bus, INT to CPU, and APB interface To/from CPU Or DMA to RAM.
ADC top level diagram showing the internal architecture of the ADC. The diagram is divided into Analog ADC Subsystem (blue dashed boundary) and Digital ADC Subsystem (orange dashed boundary). Analog ADC Subsystem includes inputs VDDA (2 lines), GND (2 lines), TEMP SENSOR, VBAT, SELN_VINP[3:0] (4 lines), SELN_VINM[3:0] (4 lines), VINP, and VINM connected through a Muxing block to a SAR ADC 12bits block powered by a Reference. The output (12 bits) goes to ADC Offset Correction and Bit Inversion blocks, outputting 12 bits to a Down Sampler (which outputs 16 bits to DATA REG1) and TO ADC WATCHDOG. The Digital ADC Subsystem includes CONF REG (with CONTROL REG, WD TRIG REG, INT REG, STATUS REG), WD Block, Sequencer Block, and ADC CONTROLLER managing DATA REG1 with signals DATA1, DREQ1, ACQ1, APB MEMORY PORT, connected via APB bus, INT to CPU, and APB interface To/from CPU Or DMA to RAM.

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 down sampler (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.

Caution: 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 (Tj) 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} = (\text{Cmeas} - \text{C30} + \text{TCK}) / 10\]

Where:

TCK is the chuck temperature in 0.1 °C (for example. 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.

  1. Note:
  2. 1 ADC gain and offset calibration are left as default values, 0xFFF.
  3. 2 Refer to Section 27.1: DESIG registers 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:

\[\text{Code} = \text{Integer}(4096/3.6 * \text{VIN}) \text{ [clamped at 4095]}\]

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

12.2.3 ADC input modes 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:

\[\text{Code} = \text{Integer}(\text{Slope} * \text{VIN}) \text{ [clamped at 4095]}\]

where Slope for single ended input mode has the following value:

3.6V mode: Slope = 4096/3.6 [calibrated gain = 1/3]

2.4V mode: Slope = 4096/2.4 [calibrated gain = 1/2]

1.2V mode: Slope = 4096/1.25 [calibrated gain = 0.96, gain clamped at 1]

\[\text{Code} = \text{Integer}(\text{Slope} * (\text{VINP} - \text{VINN})) + 2048 \text{ [clamped at 4095]}\]

where Slope for differential input mode has the following value:

3.6V mode: Slope = 2048/3.6 [calibrated gain = 1/3]

2.4V mode: Slope = 2048/2.4 [calibrated gain = 1/2]

1.2V mode: Slope = 2048/1.25 [calibrated gain = 0.96, gain clamped at 1]

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, \(F_s\), and the input capacitor, \(C_{in}\): \(Z_{in} = 1/(C_{in} \cdot F_s)\).

12.2.5 Input signal sampling transient response

As shown in Figure 22, the analog signal path consists of a series resistance (\(R_{ext}\)) between source and pin, the internal switch resistor (\(R_{in}\)) and the internal sampling capacitor (\(C_{in}\)). The charging of the capacitor is controlled by \(R_{in}\). When there is \(R_{ext}\) in series, the effective value of charging of \(C_{in}\) is governed by \(R_{in} + R_{ext}\). So the charging time constant becomes \((R_{in} + R_{ext}) \cdot C_{in}\) and the necessary time to reach a given accuracy is longer. The ADC sampling time \(T_{sw}\) is dependent on ADC frequency which is \(1/T_s\) as shown in Figure 21.

Figure 21. ADC sampling time \(T_{sw}\) and sampling period \(T_s\)

Figure 21: A timing diagram showing a square wave signal. The sampling time Tsw is indicated as 125 ns, and the sampling period Ts is indicated as 1 µs. The diagram shows two full cycles of the square wave with a dashed line indicating the continuation of the signal.

MSv58545V1

Figure 21: A timing diagram showing a square wave signal. The sampling time Tsw is indicated as 125 ns, and the sampling period Ts is indicated as 1 µs. The diagram shows two full cycles of the square wave with a dashed line indicating the continuation of the signal.

Figure 22. Effect of analog source resistance

Figure 22: A circuit diagram showing the effect of analog source resistance. An AC source Vin is connected to a resistor Rext. This is followed by the AUXADC Interface, which contains a switch resistor Rin and a sampling capacitor Cin. The sampling time Tsw is 125 ns. The output of the interface is Vs.
Figure 22: A circuit diagram showing the effect of analog source resistance. An AC source Vin is connected to a resistor Rext. This is followed by the AUXADC Interface, which contains a switch resistor Rin and a sampling capacitor Cin. The sampling time Tsw is 125 ns. The output of the interface is Vs.

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

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

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

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

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

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

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

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

\[\text{where: } |\varepsilon| \leq 1/213\]

\[|\varepsilon| \leq 122e-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 raw_value + offset.

The negative offset values need to be converted as:

\[\text{offset} | 0x80, \text{ if the bitfield BIT\_INVERT\_SN}=1(\text{default value})\]

The table below lists 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

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 then 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 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 CONF register by DMA_DS_ENA bit.

When DMA feature is disabled, the data can be read by the CPU through the corresponding APB register.

12.5 ADC mode

ADC mode is the only conversion mode available. As a consequence no concurrent mode is also available.

The input signal can come from:

The conversion can be continuous or single mode.

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:

if 0, the previous data is kept, the new one is lost.

if 1, the previous data is lost, the new one is kept.

STOP_OP_MODE bit in the CTRL register. In this case, the ADC stops immediately, and the data from any ongoing conversion is discarded.

12.6 ADC registers

12.6.1 Version register (VERSION_ID)

Address offset: 0x00

Reset value: 0x0000 0021

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:8 Reserved, must be kept at reset value.

Bits 7:0 VERSION_ID[7:0]: version of the embedded IP.

ST logo
ST logo

12.6.2 ADC configuration register (CONF)

Address offset: 0x04

Reset value: 0x000A 0002

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.SAMPLE_RATE_MSBRes.ADC_CONT_1V2BIT_INVERT_DIFFBIT_INVERT_SNRes.
rwrwrwrwrwrw
1514131211109876543210
OVR_DS_CFGRes.DMA_DS_ENASAMPLE_RATE[1:0]Res.Res.Res.Res.SMPS_SYNCHRO_ENASEQ_LEN[3:0]SEQUENCECONT
rwrwrwrwrwrwrwrwrwrw

Bits 31: 24 Reserved

Bits 23:21 SAMPLE_RATE_MSB: sample rate most significant bit

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 20 Reserved, must be kept at reset value.

Bit 19 ADC_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 (default)

Bit 18 BIT_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 17 BIT_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 16 Reserved, must be kept at reset value.

Bit 15 OVR_DS_CFG: Down Sampler overrun configuration:

0: the previous data is kept, the new one is lost

1: the previous data is lost, the new one is kept

Bit 14 Reserved, must be kept at reset value.

Bit 13 DMA_DS_EN: enable the DMA mode for the Down Sampler data path:

0: DMA mode is disabled

1: DMA mode is enabled

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.Res.Res.Res.STOP_OP_MODESTART_CONVADC_ON_OFF
ttrw

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

Bit 2 STOP_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 1 START_CONV(1): generate 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 0 ADC_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 us before to start 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
ResResResResResResResResResResResResResResResRes
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:16 Reserved, must be kept at reset value.

Bits 15:14 SE_VIN_7[1:0]: input voltage for VINP[3]

Bits 13:12 SE_VIN_6[1:0]: input voltage for VINP[2]

Bits 11:10 SE_VIN_5[1:0]: input voltage for VINP[1]

Bits 9:8 SE_VIN_4[1:0]: input voltage for VINP[0]

Bits 7:6 SE_VIN_3[1:0]: input voltage for VINM[3] / VINP[3]-VINM[3]

Bits 5:4 SE_VIN_2[1:0]: input voltage for VINM[2] / VINP[2]-VINM[2]

00: Vinput = 1.2 V

01: reserved (not used for this cut)

10: Vinput = 2.4 V

11: Vinput = 3.6 V

Bits 3:2 SE_VIN_1[1:0]: input voltage for VINM[1] / VINP[1]-VINM[1]

00: Vinput = 1.2 V

01: reserved (not used for this cut)

10: Vinput = 2.4 V

11: Vinput = 3.6 V

Bits 1:0 SE_VIN_0[1:0]: input voltage for VINM[0] / VINP[0]-VINM[0]

00: Vinput = 1.2 V

01: reserved (not used for this cut)

10: Vinput = 2.4 V

11: Vinput = 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:6 Reserved, must be kept at reset value.

Bits 5:3 DS_WIDTH[2:0]: program the Down Sampler width of data output (DSDTATA)

Bits 2:0 DS_RATIO[2:0]: program the Down Sampler ratio (N factor)

ST logo
ST logo

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

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:28 SEQ15[3:0]: channel number code for 16th conversion of the sequence.
See SEQ8 for code detail.

Bits 27:24 SEQ14[3:0]: channel number code for 15th conversion of the sequence.
See SEQ8 for code detail.

Bits 23:20 SEQ13[3:0]: channel number code for 14th conversion of the sequence.
See SEQ8 for code detail.

Bits 19:16 SEQ12[3:0]: channel number code for 13th conversion of the sequence.
See SEQ8 for code detail.

Bits 15:12 SEQ11[3:0]: channel number code for 12th conversion of the sequence.
See SEQ8 for code detail.

Bits 11:8 SEQ10[3:0]: channel number code for 11th conversion of the sequence.
See SEQ8 for code detail.

Bits 7:4 SEQ9[3:0]: channel number code for 10th conversion of the sequence.
See SEQ8 for code detail.

Bits 3:0 SEQ8[3:0]: channel number code for 9th 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:20 Reserved, must be kept at reset value.

Bits 19:12 OFFSET1[7:0]: first calibration point: signed offset compensation[6:0]

Bits 11:0 GAIN1[11:0]: first calibration point: gain AUXADC_GAIN_1V2[11:0]

Note: Refer to Section 27.1: DESIG registers for information about the location where the 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.OSFFSET2[7:4]
rwrwrwrw
1514131211109876543210
OSFFSET2[3:0]GAIN2[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bits 19:12 OFFSET2[7:0]: first calibration point: signed offset compensation[6:0]

Bits 11:0 GAIN2[11:0]: second calibration point: gain AUXADC_GAIN_1V2[11:0]

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

12.6.10 ADC gain and offset correction 3 register (COMP_3)

Address offset: 0x30

Reset value: 0x0000 0555

31302928272625242322212019181716
ResResResResResResResResResResResResOSFFSET3[7:4]
rwrwrwrw
1514131211109876543210
OSFFSET3[3:0]GAIN3[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bits 19:12 OFFSET3[7:0]: first calibration point: signed offset compensation[6:0]

Bits 11:0 GAIN3[11:0]: third calibration point: gain AUXADC_GAIN_1V2[11:0]

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

12.6.11 ADC gain and offset correction 4 register (COMP_4)

Address offset: 0x34

Reset value: 0x0000 0555

31302928272625242322212019181716
ResResResResResResResResResResResResOSFFSET4[7:4]
rwrwrwrw
1514131211109876543210
OSFFSET4[3:0]GAIN4[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bits 19:12 OFFSET4[7:0]: first calibration point: signed offset compensation[6:0]

Bits 11:0 GAIN4[11:0]: fourth calibration point: gain AUXADC_GAIN_1V2[11:0]

Note: Refer to Section 27.1: DESIG registers for information about the location where the 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:18 Reserved, must be kept at reset value.

Bits 17:16 OFFSET_GAIN8[1:0]: gain / offset used in ADC differential mode with \(V_{input}\) range = 3.6V:

Bits 15:14 OFFSET_GAIN7[1:0]: gain / offset used in ADC single positive mode with \(V_{input}\) range = 3.6V:

Bits 13:12 OFFSET_GAIN6[1:0]: gain / offset used in ADC single negative mode with \(V_{input}\) range = 3.6V. This field also selects the gain/offset for VBAT input:

Bits 11:10 OFFSET_GAIN5[1:0]: gain / offset used in ADC differential mode with \(V_{input}\) range = 2.4V:

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:28 Reserved, must be kept at reset value.

Bits 27:16 WD_HT[11:0]: analog watchdog high level threshold.

Bits 15:12 Reserved, must be kept at reset value.

Bits 11:0 WD_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
ResResResResResResResResResResResResResResResRes
1514131211109876543210
AWD_CHX[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

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

Bits 15:0 AWD_CHX[15:0]: analog watchdog channel selection to define which input channel(s) need to be guarded by the watchdog.

12.6.15 Down sampler data out register (DS_DATAOUT)

Address offset: 0x44

Reset value: 0x0000 0000

31302928272625242322212019181716
ResResResResResResResResResResResResResResResRes
1514131211109876543210
DS_DATA[15:0]
rrrrrrrrrrrrrrrr

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

Bits 15:0 DS_DATA[15:0]: contain the converted data at the output of the Down Sampler.

ST logo
ST logo

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:6 Reserved, 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 2 Reserved, 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_EN
A
AWD_IRQ_ENAEOS_IRQ_ENARes.EODS_IRQ_ENAEOC_IRQ_ENA
r/wr/wr/wr/wr/w

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

Bit 5 OVR_DS_IRQ_ENA: Down Sampler overrun interrupt enable:

0: Down Sampler interrupt is disabled

1: Down Sampler interrupt is enabled

Bit 4 AWD_IRQ_ENA: analog watchdog interrupt enable:

0: analog watchdog interrupt is disabled

1: analog watchdog interrupt is enabled

Bit 3 EOS_IRQ_ENA: End of regular sequence interrupt enable:

0: EOS interrupt is disabled

1: EOS interrupt is enabled

Bit 2 Reserved, must be kept at reset value.

Bit 1 EODS_IRQ_ENA: End of conversion interrupt enable for the Down Sampler output:

0: EODF interrupt is disabled

1: EODF interrupt is enabled

Bit 0 EOC_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

Refer to Table 3: Memory map and peripheral register boundary addresses for the ADC base address location in the STM32WB09xE.

Table 33. 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 value00100001
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_ENASEQ_LEN[3:0]SEQUENCECONT.
Reset value00010100000000010
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.Res.Res.Res.STOP_OP_MODESTART_CONVADC_ON_OFF
Reset value000
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 value0000000000000000
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.Res.DS_WIDTH[2:0]DS_RATIO[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 value00000000000000000000000000000000
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]
Reset value00000000000000000000000000000000
0x28COMP_1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET1[8:0]GAIN1[11:0]
Reset value000000000000101010101

Table 33. ADC register map and reset values (continued)

OffsetRegister313029282726252423222120191817161514131211109876543210
0x2CCOMP_2ResResResResResResResResResResResResOFFSET2[0]GAIN2[11:0]
Reset value00000000010101010101
0x30COMP_3ResResResResResResResResResResResResOFFSET3[0]GAIN3[11:0]
Reset value00000000010101010101
0x34COMP_4ResResResResResResResResResResResResOFFSET4[0]GAIN4[11:0]
Reset value00000000010101010101
0x38COMP_SELResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value
0x3CWD_THResResResResWD_HT[11:0]ResResResResWD_LT[11:0]
Reset value111111111111000000000000
0x40WD_CONFResResResResResResResResResResResResResResResResAWD_CHX[15:0]
Reset value0000000000000000
0x44DS_DATAOUTResResResResResResResResResResResResResResResResDS_DATA[15:0]
Reset value0000000000000000
0x4CIRQ_STATUSResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value
0x50IRQ_ENABLEResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResResRes
Reset value
ST logo
ST logo