13. Sigma-delta analog-to-digital converter (SDADC)

13.1 Introduction

The SDADC module is a high-performance and low-power sigma-delta analog-to-digital converter, featuring 16-bit resolution and 9 differential analog channels with selectable gains.

The conversion speed is up to 16.6 ksps (kilo-samples per second) for each SDADC when converting multiple channels and up to 50 ksps per SDADC if only one channel conversion is used. There are two conversion modes: single conversion mode and continuous mode, capable of automatically scanning any number of channels. The data can be automatically stored in a system RAM buffer, reducing the software overhead.

A flexible timer triggering system can be used to control the start of conversion of the three SDADCs. This timing control is capable of triggering simultaneous conversions or inserting a programmable delay between the SDADCs.

Reference voltage for SDADC can be selected from external reference pins, internal 1.2/1.8V reference or SDADC analog power supply.

Four power modes are supported: Normal, Slow, Standby and Power down. In Standby mode, references stay powered on to reduce the startup time.

13.2 SDADC main features

13.3 SDADC pins

Table 36. ADC pins

NameSignal TypeRemarks
VREFSD+Input or In/Out, positive analog referenceWhen the external reference is selected (REFV=00), this pin must be driven externally to a voltage between 1.1 V and VDDSDx.
When an internal reference is selected (REFV is 01, 10, or 11), this pin must have an external capacitance connected to VREFSD-.
VREFSD-Input, negative analog referenceThis pin, when present, must be driven to the same voltage level as VSSSD.
VDDSDxInput, analog supplyAnalog power supply. Must be greater than 2.4 V (or 2.2 V in Slow mode) and less than 3.6 V.
VSSSDInput, analog supply groundAnalog ground power supply.
SDADCx_AIN[8:0]PAnalog inputPositive differential analog inputs for the 9 channels.
SDADCx_AIN[8:0]MAnalog inputNegative differential analog inputs for the 9 channels.

13.4 SDADC clock

The clock source for SDADC is derived from the system clock. This clock is divided by a selectable divider with 50% duty cycle.

Any of the following division ratios can be selected:

2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 36, 40, 44, 48.

The SDADC clock is automatically stopped in deepsleep mode.

The maximum operating frequency of the SDADC is 6 MHz. Its minimum operating frequency is 500 kHz.

A detailed diagram of SDADC clock is given in Section 7.2.9: SDADC clock on page 109

Figure 35. SDADC clock block diagram

Figure 35. SDADC clock block diagram. The diagram shows a 'System clock' input entering a block labeled 'Total division ratio: 2, 4, 6, 8, 10, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48'. The output of this block is connected to one input of an AND gate. The other input of the AND gate is labeled '(SDADC enable) and (not deepsleep)'. The output of the AND gate is labeled 'CK_SDAD'. The diagram is enclosed in a box with the identifier 'MS30230V2' in the bottom right corner.
Figure 35. SDADC clock block diagram. The diagram shows a 'System clock' input entering a block labeled 'Total division ratio: 2, 4, 6, 8, 10, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48'. The output of this block is connected to one input of an AND gate. The other input of the AND gate is labeled '(SDADC enable) and (not deepsleep)'. The output of the AND gate is labeled 'CK_SDAD'. The diagram is enclosed in a box with the identifier 'MS30230V2' in the bottom right corner.

13.5 SDADC functional description

Figure 36. Single SDADC block diagram

Figure 36. Single SDADC block diagram. The diagram shows the internal architecture of the SDADC. On the left, multiple differential input pairs (SD_ADCx_AIN0P/0M, SD_ADCx_AIN1P/1M, ..., SD_ADCx_AIN8P/8M) are connected to a multiplexer. The output of the multiplexer is connected to a gain block (Gain 0.5...32). The gain block output is connected to a sigma-delta modulator (ΣΔ). The modulator has inputs for reference voltage (REFV), slow clock (SLOWCK), and a start signal. The output of the modulator is connected to a digital filter. The digital filter has two outputs: JDATA[15:0] and RDATA[15:0]. The digital filter is controlled by a configuration block (configuration) which includes a configuration selector and configuration registers (CONFCH0[1:0], CONFCH1[1:0], ..., CONFCH8[1:0]). The configuration block is also connected to a channel selector (Injected channels JCHG[8:0], Regular channel RCH[3:0]). The SDADC clock (ck_sdad) is derived from the RCC (6 MHz or 1.5 MHz, min 500 kHz). The VDDSDx supply is connected to the modulator. The SDADC interrupt is generated by an AND gate with inputs from various flags (JEOCF, JEOCIE, JOVRF, JOVRIE, REOCF, REOCIE, ROVRF, ROVRIE, EOCALF, EOCALIE). The start signal for the modulator is generated by a logic block (JSTART) which includes inputs for RSWSTART, RSYNC, RSWSTART1, JSYNC, JSTART1, JSWSTART, JEXTEN, JEXTSEL, and TIMx/TIMy. A note indicates that the logic for JSTART is implemented only in SDADC2 and SDADC3. The diagram is labeled MS30934V2.
Figure 36. Single SDADC block diagram. The diagram shows the internal architecture of the SDADC. On the left, multiple differential input pairs (SD_ADCx_AIN0P/0M, SD_ADCx_AIN1P/1M, ..., SD_ADCx_AIN8P/8M) are connected to a multiplexer. The output of the multiplexer is connected to a gain block (Gain 0.5...32). The gain block output is connected to a sigma-delta modulator (ΣΔ). The modulator has inputs for reference voltage (REFV), slow clock (SLOWCK), and a start signal. The output of the modulator is connected to a digital filter. The digital filter has two outputs: JDATA[15:0] and RDATA[15:0]. The digital filter is controlled by a configuration block (configuration) which includes a configuration selector and configuration registers (CONFCH0[1:0], CONFCH1[1:0], ..., CONFCH8[1:0]). The configuration block is also connected to a channel selector (Injected channels JCHG[8:0], Regular channel RCH[3:0]). The SDADC clock (ck_sdad) is derived from the RCC (6 MHz or 1.5 MHz, min 500 kHz). The VDDSDx supply is connected to the modulator. The SDADC interrupt is generated by an AND gate with inputs from various flags (JEOCF, JEOCIE, JOVRF, JOVRIE, REOCF, REOCIE, ROVRF, ROVRIE, EOCALF, EOCALIE). The start signal for the modulator is generated by a logic block (JSTART) which includes inputs for RSWSTART, RSYNC, RSWSTART1, JSYNC, JSTART1, JSWSTART, JEXTEN, JEXTSEL, and TIMx/TIMy. A note indicates that the logic for JSTART is implemented only in SDADC2 and SDADC3. The diagram is labeled MS30934V2.

13.5.1 SDADC on-off control

The SDADC is enabled by setting the ADON bit in the SDADC_CR2 register. After the SDADC is powered on, it needs 100 \( \mu\text{s} \) to stabilize before it can start a conversion or launch calibration (unless PDI=1, see next section). An action requested in the meantime will be automatically started as soon as stabilization is complete. The end of stabilization is signalled by bit STABIP in the SDADC_ISR register.

Clearing ADON stops any conversion which may be in progress and puts the SDADC in power down mode.

13.5.2 Power down and Standby low-power modes

In order to reduce consumption, the SDADC can be automatically put into either Standby mode or power down mode when it is idle. "Idle" is defined as when RCIP=0, JCIP=0, and CALIBIP=0.

Setting PDI in the SDADC_CR1 register causes the SDADC to enter power down mode when idle, where it consumes about 10 µA instead of up to 1.2 mA (see datasheet for exact values). Whenever exiting power down mode, a period of 100 µs is needed for stabilization. During stabilization, a conversion may be requested, but it will not start until stabilization is complete (STABIP=0).

Similarly, setting SBI in the SDADC_CR1 register puts the SDADC in Standby mode when idle, where it consumes a maximum of about 200 µA. Whenever exiting Standby mode conversions, a period of 50 µs is required for stabilization.

While the SDADC is stabilizing, the stabilization in progress status bit, STABIP, in SDADC_ISR is set to '1'.

When enforcing the stabilization times, the SDADC measures these durations assuming that the prescaler outputs a clock at 6 MHz. This means that the 100 µs period after power on is defined as 600 SDADC clock cycles (or 150 if SLOWCK=1, where the SDADC frequency should be 1.5 MHz), and the 50 µs period after exiting Standby mode is defined as 300 SDADC clock cycles (or 75 if SLOWCK=1).

When SBI=1, if a conversion or calibration is requested within the first 50 µs after ADON is activated, a stabilization period of 100 µs (rather than 50 µs) is observed starting from the moment that the conversion or calibration is requested.

13.5.3 SDADC clock

The SDADC clock, which is used to drive the analog logic, is generated by the RCC block. When not in Slow mode, its prescaler should be configured so that the SDADC can run at its maximum frequency of 6 MHz. The minimum operating frequency of the SDADC is 500 kHz.

Slow mode

Setting the SLOWCK bit in the SDADC_CR1 register puts the SDADC in Slow mode. When SLOWCK=1, the analog consumes less and is able to operate down to a voltage of 2.2 V, but the frequency of the SDADC clock must be reduced to 1.5 MHz. The minimum frequency is still 500 kHz in Slow mode.

13.5.4 Channel selection

There are 9 multiplexed channels which can be selected for conversion using the injected channel group and using the regular channel.

The injected channel group is a selection of any or all of the 9 channels. JCHG[8:0] in the SDADC_JCHGR register selects the channels of the injected group, where JCHG[i]=1 means that channel i is selected.

Injected conversions are always executed in scan mode, which means that each of the selected channels are converted in series. The lowest selected channel is converted first, followed immediately by the next higher selected channel until all the channels selected by JCHG[8:0] have been converted.

Injected conversions can be launched by software or by a trigger. They are never interrupted by regular conversions.

The regular channel is a selection of just one of the 9 channels. RCH[3:0] in the SDADC_CR2 register indicates the selected channel.

Regular conversions can be launched only by software (not by a trigger). A sequence of continuous regular conversions is temporarily interrupted when a injected conversion is requested.

13.5.5 Differential and single-ended modes

Each SDADC channel has 2 differential inputs (positive and negative: SDADCx_AIN[n]P, SDADCx_AIN[n]M). Configuring of those inputs to pins connection can be obtained several measurement modes.

Differential mode: Simple mode where both - positive and negative inputs - are connected to external pins. The output signal is positive or negative depending on the connected signal polarity. The corresponding SE[1:0] bits must be set to “00” (see Section 13.5.6: Configuring the analog inputs ) to select this mode.

In additional to this differential mode, conversions may be performed in one of two single-ended modes. When in single-ended mode, the negative input is set to VREFSD- pin internally, leaving the corresponding pin for the negative input (SDADCx_AIN[n]M) free to be used for other purposes. The signal to be measured is applied to the positive input.

Single-ended offset mode: The corresponding SE[1:0] bits must be set to “01” (see Section 13.5.6: Configuring the analog inputs ) to select this mode. The output signal is always positive, thus excluding the negative half of the dynamic range. In this mode, the signal to noise ratio (SNR) is degraded by 6 dB.

Single-ended zero reference mode: The corresponding SE[1:0] bits must be set to “11” (see Section 13.5.6: Configuring the analog inputs ) to select this mode. This mode injects an offset of half scale to the SDADC thus maintaining the full positive/negative dynamic range like in differential mode. In this mode, the offset is dependent on gain variations.

The correct application design of the PCB is important for a good SDADC analog performance. The STM32F37x device has several ground (and voltage supply) signals, which must be designed according Section 6.1.2: Correct grounding for analog applications .

Examples of possible modes Figure 37. Switch configuration in single-ended mode Switch configuration diagram in single-ended mode showing connections between pads (PAD0 to PAD9) and internal nodes (AIN0P to AIN8P, AIN0M to AIN8M).

The diagram illustrates the internal switch configuration for single-ended mode. On the left, external connections are labeled: CH8 sing. to PAD0, CH7 sing. to PAD1, CH6 sing. to PAD2, CH5 sing. to PAD3, CH4 sing. to PAD4, CH3 sing. to PAD5, CH2 sing. to PAD6, CH1 sing. to PAD7, CH0 sing. to PAD8, PAD9 (marked with an X), and REF M. Each pad connects to an internal node: PAD0 to AIN8P, PAD1 to AIN7P, PAD2 to AIN6P, PAD3 to AIN5P, PAD4 to AIN4P, PAD5 to AIN3P, PAD6 to AIN2P, PAD7 to AIN1P, PAD8 to AIN0P, PAD9 to a common node, and REF M to the same common node. Each positive node (AIN0P to AIN8P) is connected via a switch to its corresponding negative node (AIN0M to AIN8M). All switches on the left (between pads and positive nodes) are shown as open. All switches on the right (between positive nodes and negative nodes) are shown as closed. The common node for PAD9 and REF M is also connected to all negative nodes (AIN0M to AIN8M) via a single switch. The diagram is labeled MSV30231V2 in the bottom right corner.

Switch configuration diagram in single-ended mode showing connections between pads (PAD0 to PAD9) and internal nodes (AIN0P to AIN8P, AIN0M to AIN8M).

Figure 38. Switch configuration in differential mode

Circuit diagram showing switch configuration in differential mode for an SDADC. It maps pads PAD0 through PAD9 and REFM to internal nodes AIN0P through AIN8P and AIN0M through AIN8M. Brackets on the left group PAD0-PAD1 as CH8 diff., PAD2-PAD3 as CH6 diff., PAD4-PAD5 as CH4 diff., PAD6-PAD7 as CH2 diff., and PAD8-PAD9 as CH0 diff. REFM is marked with an X. Switches are shown connecting pads to internal nodes, with some closed and some open. MSV30233V2 is noted at the bottom right.

The diagram illustrates the internal switch configuration of an SDADC in differential mode. On the left, external pads are labeled PAD0 through PAD9 and REFM. Brackets on the far left group these into differential channels: CH8 diff. (PAD0, PAD1), CH6 diff. (PAD2, PAD3), CH4 diff. (PAD4, PAD5), CH2 diff. (PAD6, PAD7), and CH0 diff. (PAD8, PAD9). The REFM pad is marked with an 'X', indicating it is not used. On the right, internal nodes are labeled AIN0P through AIN8P and AIN0M through AIN8M. Switches connect each pad to its corresponding positive internal node (e.g., PAD0 to AIN8P). Additional switches connect these positive nodes to their corresponding negative internal nodes (e.g., AIN8P to AIN8M). The diagram shows that for the active channels (CH8, CH6, CH4, CH2, CH0), the switches on the left are closed and the switches on the right are open. For the unused channels (CH7, CH5, CH3, CH1) and REFM, the switches are open.

MSV30233V2

Circuit diagram showing switch configuration in differential mode for an SDADC. It maps pads PAD0 through PAD9 and REFM to internal nodes AIN0P through AIN8P and AIN0M through AIN8M. Brackets on the left group PAD0-PAD1 as CH8 diff., PAD2-PAD3 as CH6 diff., PAD4-PAD5 as CH4 diff., PAD6-PAD7 as CH2 diff., and PAD8-PAD9 as CH0 diff. REFM is marked with an X. Switches are shown connecting pads to internal nodes, with some closed and some open. MSV30233V2 is noted at the bottom right.

Figure 39. Switch configuration in mixed mode (example 1)

Switch configuration diagram for SDADC in mixed mode. It shows 10 pads (PAD0 to PAD9) and a REFM pin connected to internal SDADC pins (AIN0P to AIN8P and AIN0M to AIN8M). The diagram illustrates differential and single-ended channel configurations. CH8, CH4, and CH2 are differential; CH6, CH5, and CH0 are single-ended. PAD9 is marked as unused.

The diagram illustrates the internal switch configuration for the SDADC in mixed mode. The pads are arranged vertically on the left: PAD0 through PAD9, and REFM. On the right, a block represents the SDADC with internal pins AIN8P/M down to AIN0P/M. Connections are as follows:

MSV30234V2

Switch configuration diagram for SDADC in mixed mode. It shows 10 pads (PAD0 to PAD9) and a REFM pin connected to internal SDADC pins (AIN0P to AIN8P and AIN0M to AIN8M). The diagram illustrates differential and single-ended channel configurations. CH8, CH4, and CH2 are differential; CH6, CH5, and CH0 are single-ended. PAD9 is marked as unused.

Figure 40. Switch configuration in mixed mode (example 2)

Figure 40: Switch configuration in mixed mode (example 2). The diagram shows a 10-pin SDADC interface (PAD0 to PAD9 and REF M) connected to internal AIN pins (AIN0P to AIN8P and AIN0M to AIN8M). The connections are as follows: PAD0 (CH8 sing.) connects to AIN8P; PAD1 is not used; PAD2 (CH6 diff. +) connects to AIN6P; PAD3 (CH6 diff. -) connects to AIN5P; PAD4 (CH4 diff. +) connects to AIN4P; PAD5 (CH4 diff. -) connects to AIN3P; PAD6 (CH2 sing.) connects to AIN2P; PAD7 (CH1 sing.) connects to AIN1P; PAD8 (CH0 diff. +) connects to AIN0P; PAD9 (CH0 diff. -) connects to AIN0M; REF M connects to AIN0M. Internal switches connect the positive inputs (AIN0P to AIN8P) to the negative inputs (AIN0M to AIN8M) for differential channels (CH0, CH2, CH4, CH6, CH8) and to the common reference (AIN0M) for single-ended channels (CH1, CH2, CH8).
Figure 40: Switch configuration in mixed mode (example 2). The diagram shows a 10-pin SDADC interface (PAD0 to PAD9 and REF M) connected to internal AIN pins (AIN0P to AIN8P and AIN0M to AIN8M). The connections are as follows: PAD0 (CH8 sing.) connects to AIN8P; PAD1 is not used; PAD2 (CH6 diff. +) connects to AIN6P; PAD3 (CH6 diff. -) connects to AIN5P; PAD4 (CH4 diff. +) connects to AIN4P; PAD5 (CH4 diff. -) connects to AIN3P; PAD6 (CH2 sing.) connects to AIN2P; PAD7 (CH1 sing.) connects to AIN1P; PAD8 (CH0 diff. +) connects to AIN0P; PAD9 (CH0 diff. -) connects to AIN0M; REF M connects to AIN0M. Internal switches connect the positive inputs (AIN0P to AIN8P) to the negative inputs (AIN0M to AIN8M) for differential channels (CH0, CH2, CH4, CH6, CH8) and to the common reference (AIN0M) for single-ended channels (CH1, CH2, CH8).

13.5.6 Configuring the analog inputs

The following parameters must be configured for the analog inputs:

Three distinct configurations can be specified using the SDADC_CONF0R, SDADC_CONF1R, and SDADC_CONF2R registers. Each SDADC_CONFxR register contains the fields GAINx[2:0], COMMONx[1:0], SE[1:0], and OFFSETx[11:0].

Each individual input can select one of the three configurations, by way of the SDADC_CONFCHR1 and SDADC_CONFCHR2 registers.

13.5.7 Launching calibration and determining the offset values

Calibration can be used to determine the offset values of the configurations defined in each of the three SDADC_CONFxR registers. OFFSETx[11:0] is determined based on GAINx[2:0], COMMONx[1:0], and SEx[1:0] (where x is 0, 1, or 2).

During the offset calibration positive and negative SDADC inputs are shorted internally and connected to common voltage given by COMMONx[1:0] setting. GAINx[2:0] is applied and then is performed a conversion which determines the OFFSETx[11:0] value (12-bit signed value).

The calibration sequence consists of the following steps:

13.5.8 Launching conversions

Injected conversions can be launched using the following methods:

Each time an injected conversion is launched, all of the selected channels in the injected group are converted sequentially, starting with the lowest selected channel.

Only one injected conversion can be pending or ongoing at a given time. Thus, any request to launch an injected conversion is ignored if another request for an injected conversion has already been issued but not yet completed.

Regular conversions can be launched using the following methods:

Only one regular conversion can be pending or ongoing at a given time. Thus, any request to launch a regular conversion is ignored if another request for a regular conversion has already been issued but not yet completed.

13.5.9 Continuous and fast continuous modes

Setting the JCONT bit in the SDADC_CR2 register causes injected conversions launched by software to execute in continuous mode. If software writes ‘1’ to the JCONT bit at the

same time as it writes '1' to the JSWSTART bit, the same scan sequence is performed repeatedly, always starting over at the lowest selected channel after the highest selected channel is finished.

Similarly, setting the RCONT bit causes regular conversions to execute in continuous mode. RCONT=1 means that the channel selected by the RCH[3:0] bits is converted repeatedly after '1' is written to the RSWSTART bit.

The sequence of injected conversions executing in continuous mode can be stopped by writing '0' to the JCONT bit. After clearing the JCONT bit, only the on-going conversion will be completed; the scan sequence is interrupted, and thus the final conversion will not be the last (highest) selected channel unless it was the one being converted when the JCONT bit was cleared.

Similarly, writing '0' to the RCONT bit stops continuous regular conversions, allowing only the currently executing conversion to complete.

If just a single channel is selected in continuous mode (either by executing a regular conversion or by executing a injected conversion with only one channel selected), the sampling rate can be increased three fold by setting the FAST bit in the SDADC_CR2 register. The conversion of each channel normally requires 360 SDADC clock cycles (60 µs at 6 MHz). In fast continuous mode (FAST=1), the first conversion takes still 360 SDADC clocks, but then each subsequent conversion finishes in 120 SDADC clocks.

13.5.10 Request precedence

In summary, the calibration sequence has the highest precedence, followed by injected conversions, while regular conversions have the lowest priority. However, an individual conversion which is already in progress is never interrupted by the request for another action. Also, a request is ignored if a like action is already pending or in progress. Finally, no action can start before stabilization has finished. The following text gives examples and more details.

Injected conversions can not be launched if another injected conversion is pending or already in progress: any request to launch a injected conversion (either by JSWSTART or by a trigger) is ignored when the bit JCAP (in the SDADC_ISR register) is '1'.

Similarly, regular conversions can not be launched if another regular conversion is pending or already in progress: any request to launch a regular conversion (using RSWSTART) is ignored when the RCAP bit in the SDADC_ISR register is '1'.

However, if a injected conversion is requested while a regular conversion is already in progress (or vice-versa), the injected conversion is launched as soon as the regular conversion is finished (or vice-versa, assuming that the injected scans sequence is finished and JCONT=0).

Injected conversions have precedence over regular conversions in that a injected conversion can temporarily interrupt a sequence of continuous regular conversions (after the current conversion finishes). When the sequence of injected conversions finishes (at the end of the scan sequence or by writing '0' to the JCONT bit in the case of continuous injected conversion mode), the continuous regular conversions start again if the RCONT bit is still set.

Precedence matters also when actions are initiated by the same write to SDADC, or if multiple actions are pending at the end of an other action. For example, suppose that while stabilization is in process (STABIP=1), a single write operation to SDADC_CR2 writes '1' to both the RSWSTART and STARTCALIB bits, requesting a regular conversion as well as a

calibration sequence. Then a trigger event occurs which requests an injected conversion, still during stabilization. When stabilization finishes, precedence dictates that the calibration sequence will execute first, followed by the injected scan sequence, and then finally the regular conversion is performed.

13.5.11 Launching conversions with deterministic timing

In applications where certain conversions must be launched at precise intervals, it is a problem if these conversions get delayed by another conversion which is already in progress. This issue can be resolved by setting the JDS (delay start of injected conversions) bit in the SDADC_CR2 register.

When JDS=1, the start of each injected conversion is delayed by 500 cycles, during which time no new regular conversions may be launched. Since no conversion can take longer than 360 cycles once it is started, there is guaranteed to be no regular conversions which are in progress at the end of the delay. Note that if PDI=1 (power down mode when idle) and SLOWCK=0 (when the SDADC clock frequency can be as high as 6 MHz), the delay is increased from 500 cycles to 600 cycles since the SDADC needs that many cycles to stabilize as it wakes from power down mode.

In this manner, applications can launch regular conversions at any time without affecting the timing of the injected conversions. If continuous regular conversions are executing, they will restart automatically after the injected conversions are complete.

13.5.12 Reference voltage

The reference voltage, common to all three sigma-delta ADCs (SDADC1, SDADC2, and SDADC3), is always seen on the VREFSD+ pin

The REFV[1:0] control bits are available only in the register set of SDADC1.

For applications which do not use the SDADC, the VREFSD+ pin must not be left floating. The VREFSD+ pin must be tied to \( V_{DD} \) , or software must set REFV to “11”. The VREFSD- pin must always be grounded.

The selected reference voltage is always present on the VREFSD+ pin. This pin must be decoupled by a capacitor (1 \( \mu\text{F} \) recommended). If VDDSDx is selected through the reference voltage selection bits (REFV="11" in SDADC_CR1 register), the application must first configure REFV and then wait for at least 2 ms before enabling the SDADC (ADON=1 in SDADC_CR2 register). The 1 \( \mu\text{F} \) decoupling capacitor must be fully charged before enabling the SDADC.

The voltage on VREFSD+ pin must meet the following conditions:

13.5.13 Analog input signal ranges

The input analog voltage on input channel pins (SDADCx_AIN[8:0]P, SDADCx_AIN[8:0]M) must be in the SDADC power supply range (VSSSD, VDDSDx) for all selected measurement modes and gains.

The input analog voltage range corresponding to full-scale SDADC output data range depends on the measurement mode ( Section 13.5.5: Differential and single-ended modes ), on the selected channel gain, and on the selected reference voltage (configured through REFV[1:0] bits):

\[ V_{IN} = \frac{-VREFSD}{2 \times \text{gain}} \text{ to } \frac{VREFSD}{2 \times \text{gain}} \]

\[ V_{IN} = VREFSD- \text{ to } \frac{VREFSD}{2 \times \text{gain}} \]

\[ V_{IN} = VREFSD- \text{ to } \frac{VREFSD}{\text{gain}} \]

where \( VREFSD = VREFSD+ - VREFSD- \) .

13.5.14 Input impedance of SDADC analog input and VREFSD reference voltage

Input impedance of SDADC depends from the selected SDADC clock, selected gain and if conversion is in progress. The input equivalent circuit is on the following figure.

Figure 41. Equivalent input circuit for input channel

Figure 41. Equivalent input circuit for input channel. The diagram shows a differential input stage with two channels, SDADCx_AINxP and SDADCx_AINxM. Each channel has a switch controlled by chclk and chclkz signals. The circuit includes capacitors labeled C = 0.543 pF + 0.152 pF * gain and 0.167 pF. A voltage source of -140mV is shown on the right side. The diagram is labeled MSv37540V1 in the bottom right corner.
Figure 41. Equivalent input circuit for input channel. The diagram shows a differential input stage with two channels, SDADCx_AINxP and SDADCx_AINxM. Each channel has a switch controlled by chclk and chclkz signals. The circuit includes capacitors labeled C = 0.543 pF + 0.152 pF * gain and 0.167 pF. A voltage source of -140mV is shown on the right side. The diagram is labeled MSv37540V1 in the bottom right corner.

Note:

Gain can be from 0.5x to 8x (16x and 32x are digital gains)

Both chclk and chclkz are 0 when the channel is not active (not sampled) and both switch with opposite phases when the channel is active.

The average impedance during the channel conversion is:

\[ R_{in} = \frac{1}{2 \cdot F_{clk} \cdot C} \]

Input equivalent circuit for external reference voltage (VREFSD+) input is shown in the next Figure.

Figure 42. Equivalent input circuit for VREFSD input

Equivalent input circuit for VREFSD input

The diagram shows the equivalent input circuit for the VREFSD input of an SDADC. A Vref buffer is connected to the VREFSD+ input. The CK_SDAD input is connected to a clock signal (clk). The VREFSD+ input is connected to a switch that is controlled by the clk signal. The switch is connected to a capacitor C = 0.7 pF. The VREFSD- input is connected to a switch that is controlled by the clkz signal. The switch is connected to a capacitor C = 0.7 pF. The clkz signal is the inverted clock signal. The diagram is labeled MS30237V3.

Equivalent input circuit for VREFSD input

The average impedance of external VREFSD+ input during SDADC operation is:

\[ R_{in} = \frac{1}{F_{clk} \cdot C} \]

13.6 SDADC registers

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

13.6.1 Register write protection

Table 37. Register write protection

ADON=1INITRDY=0
and
ADON=1
JCIP=1RCIP=1CALIBIP=1
RSYNC-ro---
JSYNC-ro---
PDI/SBIro----
SLOWCKro----
REFVro (1)----
FAST-ro---
RSWSTART-ignored (2)-ignored-
JSWSTART-ignored (2)ignored--
JEXTEN-ro---
JEXTSEL-ro---
JDS-ro---
STARTCALIB-ignored (2)--ignored
CALIBCNT-ro---
SDADC_JCHGRrwnzrwnzrwnzrwnzrwnz
SDADC_CONFxR-ro---
SDADC_CONFCHRx-ro---

1. REFV can be modified only when all of the SDADC modules are disabled (ADON=0 for all SDADCs).

2. The “START” bits are ignored when INIT=1 (as soon as initialization mode is requested). All bits can be modified when ADON=0.

Table legend

ro = read only

rwnz = read and write-non-zero (writes of all-zero values are ignored)

blank = read and write (no protection)

13.6.2 SDADC control register 1 (SDADC_CR1)

Address offset: 0x00

Reset value: 0x0000 0000

31302928272625242322212019181716
INITRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RDMAENJDMAEN
rwrwrw

1514131211109876543210
RSYNCJSYNCRes.PDISBISLOWCKREFV[1:0]Res.Res.Res.ROVRIEREOCI EJOVRIEJEOCI EEOCALIE
rwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 INIT : Initialization mode request

0: Initialization mode is disabled and many control and configuration registers are read only

1: Initialization mode has been requested and firmware must wait for INITRDY to become '1' to write to the control and configuration registers

When INIT=1, all requests to launch conversions (software, trigger, synchronized) or calibration are ignored.

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

Bit 17 RDMAEN : DMA channel enabled to read data for the regular channel

0: The DMA channel is not enabled to read regular data

1: The DMA channel is enabled to read regular data

RDMAEN must not be '1' if JDMAEN=1.

Bit 16 JDMAEN : DMA channel enabled to read data for the injected channel group

0: The DMA channel is not enabled to read injected data

1: The DMA channel is enabled to read injected data

JDMAEN must not be '1' if RDMAEN=1.

Bit 15 RSYNC : Launch regular conversion synchronously with SDADC1

0: Do not launch a regular conversion synchronously with SDADC1

1: Launch a regular conversion in this SDADC at the same moment that a regular conversion is launched in SDADC1

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

Bit 14 JSYNC : Launch a injected conversion synchronously with SDADC1

0: Do not launch injected conversion synchronously with SDADC1

1: Launch an injected conversion in this SDADC at the same moment that an injected conversion is launched in SDADC1

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

Bit 13 Reserved, must be kept at reset value.

Bit 12 PDI : Enter power down mode when idle

0: Do not enter power down mode when the SDADC is idle

1: Enter Power down when idle

When the SDADC is in power down mode due to PDI=1 and a conversion is requested, the SDADC takes 100µs to stabilize before launching the conversion.

This bit can be modified only when ADON=0 (SDADC_CR2).

Bit 11 SBI : Enter Standby mode when idle

0: Do not put the SDADC in Standby mode when it is idle

1: Put the SDADC in Standby mode when it is idle

When the SDADC is in Standby mode and a conversion is requested, the SDADC takes 50µs to stabilize before launching the conversion.

Software must not write '1' to SBI at the same time that it writes '1' to PDI.

This bit can be modified only when ADON=0 (SDADC_CR2).

Bit 10 SLOWCK : Slow clock mode enable

0: Disable Slow mode

1: Enable Slow mode (where the SDADC clock frequency should be only 1.5MHz) allowing a lower level of current consumption as well as operation at a lower minimum voltage

This bit may be written only when ADON=0 (SDADC_CR2).

Bits 9:8 REFV[1:0] : Reference voltage selection

00: External reference where the VREFSD+ pin must be forced externally

01: Internal reference where the reference voltage is forced to the 1.2V bandgap voltage internally and the VREFSD+ pin must be connected externally to a capacitance coupled to VREFSD-

10: Internal reference where the reference voltage is forced to the 1.8V bandgap voltage internally and the VREFSD+ pin must be connected externally to a capacitance coupled to VREFSD-

11: Internal reference where the reference voltage is forced internally to VDDSDx and the VREFSD+ pin must be externally connected to a capacitance coupled to VREFSD-. See Section : Constrains on VDDSDx versus VREFSD voltage .

These bits are available only in the register set of SDADC1 and may be written only when ADON=0 (SDADC_CR2) for all SDADC modules.

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

Bit 4 ROVRIE : Regular data overrun interrupt enable

0: Regular data overrun interrupt disabled

1: Regular data overrun interrupt enabled

Please see explanation of ROVRF in SDADC_ISR.

Bit 3 REOCIE : Regular end of conversion interrupt enable

0: Regular end of conversion interrupt disabled

1: Regular end of conversion interrupt enabled

Refer to the description of the REOCF bit in the SDADC_ISR register.

Bit 2 JOVRIE : Injected data overrun interrupt enable

0: Injected data overrun interrupt disabled

1: Injected data overrun interrupt enabled

Refer to the description of the JOVRF bit in the SDADC_ISR register.

Bit 1 JEOCIE : Injected end of conversion interrupt enable

0: Injected end of conversion interrupt disabled

1: Injected end of conversion interrupt enabled

Refer to the description of the JEOCF bit in the SDADC_ISR register.

Bit 0 EOCALIE : End of calibration interrupt enable

0: End of calibration interrupt disabled

1: End of calibration interrupt enabled

Refer to the description of the EOCAF bit in the SDADC_ISR register.

13.6.3 SDADC control register 2 (SDADC_CR2)

Address offset: 0x04

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.FASTRSW
START
RCONTRes.Res.RCH[3:0]
rwrc_w1rwrwrwrwrw

1514131211109876543210
JSW
START
JEXTEN[1:0]Res.Res.JEXTSEL[2:0]Res.JDSJCONTSTART
CALIB
Res.CALIBCNT[1:0]ADON
rc_w1rwrwrwrwrwrwrwrc_w1rwrwrw

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

Bit 24 FAST : Fast conversion mode selection

0: Fast conversion mode disabled

1: Fast conversion mode enabled

When converting a single channel in continuous mode, having enabled fast mode causes each conversion (except for the first) to execute 3 times faster (taking 120 SDADC cycles rather than 360). This bit has no effect for conversions which are not continuous.

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

Bit 23 RSWSTART : Software start of a conversion on the regular channel

0: Writing '0' has no effect

1: Writing '1' makes a request to start a conversion on the regular channel and causes RCIP to become '1'. If RCIP=1 already or if INIT=1, writing to RSWSTART has no effect

This bit is always read as '0'.

Bit 22 RCONT : Continuous mode selection for regular conversions

0: The regular channel is converted just once for each conversion request

1: The regular channel is converted repeatedly after each conversion request

Writing '0' to this bit while a continuous regular conversion is already in progress stops continuous mode after the conversion already in progress is finished.

Setting this bit to '1' has no effect on any regular conversion which is pending or already in progress.

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

Bits 19:16 RCH[3:0] : Regular channel selection

0: Channel 0 is selected as regular channel

1: Channel 1 is selected as regular channel

...

8: Channel 8 is selected as regular channel

9-15: Reserved, these values are forbidden

Writing these bits when RCIP=1 takes effect when the next regular conversion begins. This is especially useful in continuous mode (when RCONT=1). It affects also regular conversions which are pending (due to stabilization or due to an ongoing injected conversion).

Bit 15 JSWSTART : Start a conversion of the injected group of channels

0: Writing '0' has no effect.

1: Writing '1' makes a request to convert the channels in the injected conversion group, causing JCAP to become '1' at the same time. If JCAP=1 already or if INIT=1, then writing to JSWSTART has no effect.

This bit is always read as '0'.

Bits 14:13 JEXTEN[1:0] : Trigger enable and trigger edge selection for injected conversions

00: Trigger detection is disabled

01: Each rising edge on the selected trigger makes a request to launch a injected conversion

10: Each falling edge on the selected trigger makes a request to launch a injected conversion

11: Both rising edges and falling edges on the selected trigger make requests to launch injected conversions

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

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

Bits 10:8 JEXTSEL[2:0] : Trigger signal selection for launching injected conversions

0x0-0x7: Trigger inputs selected by following table.

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

SDADC1SDADC2SDADC3
0x00TIM13_CH1TIM17_CH1TIM16_CH1
0x01TIM14_CH1TIM12_CH1TIM12_CH2
0x02TIM15_CH2TIM2_CH3TIM2_CH4
0x03TIM3_CH1TIM3_CH2TIM3_CH3
0x04TIM4_CH1TIM4_CH2TIM4_CH3
0x05TIM19_CH2TIM19_CH3TIM19_CH4
0x06EXTI15EXTI15EXTI15
0x07EXTI11EXTI11EXTI11

Bit 7 Reserved, must be kept at reset value.

Bit 6 JDS : Delay start of injected conversions.

0: Injected conversions begin as soon as possible after the request

1: After a request for a injected conversion is made, the SDADC waits a fixed interval before launching the conversion, allowing time for any regular conversions which is already in progress to finish, and thus assuring that the timing of the launch is deterministic.

The delay is 500 ADC clocks, unless PDI=1 and SLOWCK=0, in which case the delay is 600 ADC clocks.

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

Bit 5 JCONT : Continuous mode selection for injected conversions

0: The series of conversions which converts each selected channel (the scan sequence) is executed just once for each conversion request

1: The series of conversions for the injected group channels is repeated continuously, starting over with the lowest selected channel each time the highest selected channel finishes its conversion

Writing '0' to this bit while a continuous injected conversion is already in progress stops continuous mode after the conversion already in progress is finished. If an injected conversions is pending or is already in progress when this bit changes to '1', it does not become continuous.

Bit 4 STARTCALIB : Start calibration

0: Writing '0' has no effect

1: Writing '1' makes a request to start the calibration sequence, causing CALIBIP to become '1' at the same time

After the request is made, the calibration starts as soon as any ongoing activity (stabilization or a conversion) is finished, or immediately if the SDADC is stabilized and idle.

Writing this bit when CALIBIP=1 or when INIT=1 has no effect.

This bit is always read as '0'.

Bit 3 Reserved, must be kept at reset value.

Bits 2:1 CALIBCNT[1:0] : Number of calibration sequences to be performed (number of valid configurations)

0: One calibration sequence will be performed to calculate OFFSET0[11:0]

1: Two calibration sequences will be performed to calculate OFFSET0[11:0] and OFFSET1[11:0]

2: Three calibration sequences will be performed to calculate OFFSET0[11:0], OFFSET1[11:0], and OFFSET2[11:0]

3: Reserved, must not use this value

This bit can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

Bit 0 ADON : SDADC enable

0: All SDADC functions are disabled. Power down mode is entered, and the flags and the data are cleared

1: SDADC is enabled.

When PDI=0, the SDADC exits power down mode and the 100us of stabilization are observed starting at the moment that ADON is set to '1'.

13.6.4 SDADC interrupt and status register (SDADC_ISR)

Address offset: 0x08

Reset value: 0x0000 0000

31302928272625242322212019181716
INITRDYRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
r
1514131211109876543210
STABIPRCIPJCIPCALIBIPRes.Res.Res.Res.Res.Res.Res.ROVRFREOCFJOVRFJEOCFEOCALF
rrrrrrrrr

Bit 31 INITRDY : Initialization mode is ready

0: The SDADC is not in initialization mode.

1: The SDADC is in initialization mode

Many control and configuration registers (see their descriptions) can be modified only when INITRDY=1.

Hardware clears this bit as soon as INIT (SDADC_CR1) is cleared.

Hardware sets this bit after the INIT bit is set. If a conversion or calibration is pending or ongoing when INIT is cleared, INITRDY stays at '0' until all operations have complete. Otherwise, INITRDY becomes '1' about two SDADC clock cycles after INIT is set.

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

Bit 15 STABIP : Stabilization in progress status

0: The SDADC is either stabilized or it is in power down mode or Standby mode

1: The SDADC is currently in the process of stabilization, after waking up from either power down mode or Standby mode

A request to start the calibration sequence or to start a conversion can be issued while STABIP=1, with the actions automatically delayed until after stabilization is complete.

Bit 14 RCIP : Regular conversion in progress status

0: No request to convert the regular channel has been issued

1: The conversion of the regular channel is in progress or a request for a regular conversion is pending

A request to start a regular conversion is ignored when RCIP=1.

Bit 13 JCIP : Injected conversion in progress status

0: No request to convert the injected channel group (neither by software nor by trigger) has been issued

1: The conversion of the injected channel group is in progress or a request for a injected conversion is pending, due either to '1' being written to JSWSTART or to a trigger detection

A request to start a injected conversion is ignored when JCIP=1.

Bit 12 CALIBIP : Calibration in progress status

0: No calibration request has been issued

1: Calibration is in progress or a request to start calibration is pending

A request to start calibration is ignored when CALIBIP=1.

Bits 11:5 Reserved, must be kept at reset value.

Bit 4 ROVRF : Regular conversion overrun flag

0: No regular conversion overrun has occurred

1: A regular conversion overrun has occurred, which means that a regular conversion finished while REOCF was already '1'. RDATAR is not affected by overruns

This bit is set by hardware. It can be cleared by software using the CLRROVRF bit in the SDADC_CLRISR register.

Bit 3 REOCF : End of regular conversion flag

0: No regular conversion has completed

1: A regular conversion has completed and its data may be read

This bit is set by hardware. It is cleared when software reads SDADC_RDATAR.

Bit 2 JOVRF : Injected conversion overrun flag

0: No injected conversion overrun has occurred

1: A injected conversion overrun has occurred, which means that a injected conversion finished while JEOCF was already '1'. JDATAR is not affected by overruns

This bit is set by hardware. It can be cleared by software using the CLRJOVRF bit in the SDADC_CLRISR register.

Bit 1 JEOCF : End of injected conversion flag

0: No injected conversion has completed

1: A injected conversion has completed and its data may be read

This bit is set by hardware. It is cleared when software reads SDADC_JDATAR.

Bit 0 EOCALF : End of calibration flag

0: No calibration sequence has completed

1: Calibration has completed and the offsets have been updated

This bit is set by hardware. It can be cleared by software using the CLR EO CALF bit in SDADC_CLRISR.

Note: For each of the flag bits (ROVRF, REOCF, JOVRF, JEOCF, and EOCALF), an interrupt can be enabled by setting the corresponding bit in the SDADC_CR1 register. If an interrupt is requested, the flag must be cleared before exiting the interrupt service routine.

All the bits of SDADC_ISR except INITRDY are cleared automatically when ADON=0.

13.6.5 SDADC interrupt and status clear register (SDADC_CLRISR)

Address offset: 0x0C

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.CLR
ROVR
F
Res.CLR
JOVRF
Res.CLR
EOCALF
rc_w1rc_w1rc_w1

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

Bit 4 CLRROVRF : Clear the regular conversion overrun flag

0: Writing '0' has no effect

1: Writing '1' clears the ROVRF bit in the SDADC_ISR register

Bit 3 Reserved, must be kept at reset value.

Bit 2 CLRJOVRF : Clear the injected conversion overrun flag

0: Writing '0' has no effect

1: Writing '1' clears the JOVRF bit in the SDADC_ISR register

Bit 1 Reserved, must be kept at reset value.

Bit 0 CLREOCALF : Clear the end of calibration flag

0: Writing '0' has no effect

1: Writing '1' clears the EOCALF bit in the SDADC_ISR register

Note: The bits of SDADC_CLRISR are always read as '0'.

13.6.6 SDADC injected channel group selection register (SDADC_JCHGR)

Address offset: 0x14

Reset value: 0x0000 0001

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.JCHG[8:0]
rwrwrwrwrwrwrwrwrw

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

Bits 8:0 JCHG[8:0] : Injected channel group selection

0: If JCHG[i]=0, then channel i is not part of the injected group (where, \( 0 \le i \le 8 \) )

1: If JCHG[i]=1, then channel i is part of the injected group (where, \( 0 \le i \le 8 \) )

A injected conversion operates always in scan mode, which means that each of selected channels are converted, one after another. The lowest selected channel is converted first and the sequence ends at the highest selected channel.

If JCONT=1, this series of conversions is performed continuously.

If JCONT=1, FAST=1, and there is only one channel selected in the injected group, then each of the conversions (besides the first) finishes in only 120 SDADC cycles (rather than 360).

This field can be modified while an injected conversion is in progress and it will take effect for the next group conversion. Writing JCHG also affects injected conversions which are pending (due to stabilization or due to the delay caused by JDS=1).

At least one channel must always be selected for the injected group. Writes causing all JCHG bits to be zero are ignored.

13.6.7 SDADC configuration 0 register (SDADC_CONF0R)

This register specifies the parameters for configuration 0. If CONFCHi[1:0]='00', then each conversion of channel "i" will use the configuration settings specified in this register.

Address offset: 0x20

Reset value: 0x0000 0000

31302928272625242322212019181716
COMMON0[1:0]]Res.Res.SE0[1:0]Res.Res.Res.GAIN0[2:0]Res.Res.Res.Res.
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.OFFSET0[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 COMMON0[1:0] : Common mode for configuration 0

00: Ground

01: VCM (VDD/2)

10: VDD

11: Reserved, must not use this value

This value is used only during calibration, i.e., when determining the offset. It has no direct effect on the conversions.

Bits 29:28 Reserved, must be kept at reset value.

Bits 27:26 SE0[1:0] : Single-ended mode for configuration 0

00: Conversions are executed in differential mode

01: Conversions are executed in single-ended offset mode

10: Reserved, do not use this setting

11: Conversions are executed in single-ended zero-volt reference mode

When this field is non-zero, the corresponding negative differential analog input, SDADCx_AINxM, is connected internally to VREFSD- so that its pin can be used for other functions.

Bits 25:23 Reserved, must be kept at reset value.

Bits 22:20 GAIN0[2:0] : Gain setting for configuration 0

000: 1x gain

001: 2x gain

010: 4x gain

011: 8x gain

100: 16x gain

101: 32x gain

111: 0.5x gain

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

Bits 11:0 OFFSET0[11:0] : Twelve-bit calibration offset for configuration 0

For channels which select configuration 0, OFFSET0 is applied to the results of each conversion.

This value is automatically set during calibration.

Note: This register can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

13.6.8 SDADC configuration 1 register (SDADC_CONF1R)

This register specifies the parameters for configuration 1. If CONFCHi[1:0]='01', then each conversion of channel "i" will use the configuration settings specified in this register.

Address offset: 0x24

Reset value: 0x0000 0000

31302928272625242322212019181716
COMMON1
[1:0]
Res.Res.SE1[1:0]Res.Res.Res.GAIN1[2:0]Res.Res.Res.Res.
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.OFFSET1[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 COMMON1[1:0] : Common mode for configuration 1

00: Ground

01: VCM (VDD/2)

10: VDD

11: Reserved, must not use this value

This value is used only during calibration, i.e., when determining the offset. It has no direct effect on the conversions.

Bits 29:28 Reserved, must be kept at reset value.

Bits 27:26 SE1[1:0] : Single-ended mode for configuration 1

00: Conversions are executed in differential mode

01: Conversions are executed in single-ended offset mode

10: Reserved, do not use this setting

11: Conversions are executed in single-ended zero-volt reference mode

When this field is non-zero, the corresponding negative differential analog input, INNx, is connected internally to VREFSD- so that its pin can be used for other functions.

Bits 25:23 Reserved, must be kept at reset value.

Bits 22:20 GAIN1[2:0] : Gain setting for configuration 1

000: 1x gain

001: 2x gain

010: 4x gain

011: 8x gain

100: 16x gain

101: 32x gain

111: 0.5x gain

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

Bits 11:0 OFFSET1[11:0] : Twelve-bit calibration offset for configuration 1

For channels which select configuration 1, OFFSET1 is applied to the results of each conversion.

This value is automatically set during calibration if CALIBCNT (SDADC_CR2) has a value greater than or equal to 1.

Note: This register can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

13.6.9 SDADC configuration 2 register (SDADC_CONF2R)

This register specifies the parameters for configuration 2. If CONFCHi[1:0]='10', then each conversion of channel "i" will use the configuration settings specified in this register.

Address offset: 0x28

Reset value: 0x0000 0000

31302928272625242322212019181716
COMMON2
[1:0]
Res.Res.SE2[1:0]Res.Res.Res.GAIN2[2:0]Res.Res.Res.Res.
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.OFFSET2[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 COMMON2[1:0] : Common mode for configuration 2

00: VSSSD

01: VDDSDx/2

10: VDDSDx

11: Reserved, this value is forbidden

This value is used only during calibration, i.e., when determining the offset. It has no direct effect on the conversions.

Bits 29:28 Reserved, must be kept at reset value.

Bits 27:26 SE2[1:0] : Single-ended mode for configuration 2

00: Conversions are executed in differential mode

01: Conversions are executed in single-ended offset mode

10: Reserved, do not use this setting

11: Conversions are executed in single-ended zero-volt reference mode

When this field is non-zero, the corresponding negative differential analog input, INNx, is connected internally to VREFSD- so that its pin can be used for other functions.

Bits 25:23 Reserved, must be kept at reset value.

Bits 22:20 GAIN2[2:0] : Gain setting for configuration 2

000: 1x gain

001: 2x gain

010: 4x gain

011: 8x gain

100: 16x gain

101: 32x gain

111: 0.5x gain

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

Bits 11:0 OFFSET2[11:0] : Twelve-bit calibration offset for configuration 2

For channels which select configuration 2, OFFSET2 is applied to the results of each conversion.

This value is automatically set during calibration if CALIBCNT (SDADC_CR2) has a value greater than or equal to 2.

Note: This register can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

13.6.10 SDADC channel configuration register 1 (SDADC_CONFCHR1)

This register specifies which configurations are to be used by channels 0-7.

Address offset: 0x40

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.CONFCH7[1:0]Res.Res.CONFCH6[1:0]Res.Res.CONFCH5[1:0]Res.Res.CONFCH4[1:0]
rwrwrwrwrwrwrwrw
1514131211109876543210
Res.Res.CONFCH3[1:0]Res.Res.CONFCH2[1:0]Res.Res.CONFCH1[1:0]Res.Res.CONFCH0[1:0]
rwrwrwrwrwrwrwrw

CONFCHi[1:0]: Channel i configuration

00: Channel i uses the configuration specified in SDADC_CONF0R

01: Channel i uses the configuration specified in SDADC_CONF1R

10: Channel i uses the configuration specified in SDADC_CONF2R

11: Reserved, must not use this value

Note: This register can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

13.6.11 SDADC channel configuration register 2 (SDADC_CONFCHR2)

This register specifies which configuration is to be used by channel 8.

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
Res.CONFCH8[1:0]
rwrw

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

Bits 1:0 CONFCH8[1:0]: Channel 8 configuration

00: Channel 8 uses the configuration specified in SDADC_CONF0R

01: Channel 8 uses the configuration specified in SDADC_CONF1R

10: Channel 8 uses the configuration specified in SDADC_CONF2R

11: Reserved, must not use this value

Note: This register can be modified only when INITRDY=1 (SDADC_ISR) or ADON=0 (SDADC_CR2).

13.6.12 SDADC data register for injected group (SDADC_JDATAR)

This register contains the data resulting from the recently completed conversion of a channel in the injected group.

Address offset: 0x60

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.JDATACH[3:0]Res.Res.Res.Res.Res.Res.Res.Res.
rrrr
1514131211109876543210
JDATA[15:0]
rrrrrrrrrrrrrrrr

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

Bits 27:24 JDATACH[3:0] : Injected channel most recently converted

When each conversion of a channel in the injected group finishes, JDATACH[3:0] is updated to indicate which channel was converted. This field is valid when JEOCF=1, and is set to zero when JEOCF is cleared. Thus, when JEOCF=1, JDATA[15:0] holds the data that corresponds to the channel indicated by JDATACH[3:0].

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

Bits 15:0 JDATA[15:0] : Injected group conversion data

When each conversion of a channel in the injected group finishes, its resulting data is stored in this field. The data is valid when JEOCF=1. Reading this register clears both this field as well as the corresponding JEOCF.

Note: DMA may be used to read the data from this register. Half-word accesses may be used to read only the conversion data.

Note: This register is cleared as soon as it is read. Reading this register also clears JEOCF in SDADC_ISR. Thus, firmware must not read this register if DMA is activated to read data from this register.

13.6.13 SDADC data register for the regular channel (SDADC_RDATAR)

This register contains the data resulting from the recently completed conversion of the regular channel.

Address offset: 0x64

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
RDATA[15:0]
rrrrrrrrrrrrrrrr

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

Bits 15:0 RDATA[15:0] : Regular channel conversion data

When each regular conversion finishes, its data is stored in this register. The data is valid when REOCF=1. Reading this register clears both this field as well as the corresponding JEOCF.

Note: This register is cleared as soon as it is read. Reading this register also clears REOCF in SDADC_ISR.

13.6.14 SDADC1 and SDADC2 injected data register (SDADC_JDATA12R)

This register contains the data resulting from the recently completed conversions of injected channels of SDADC1 and SDADC2. The data is a mirror image of the data in the corresponding SDADC_JDATAR registers. This register is available only in the set of registers for SDADC1 and must not be accessed unless the JSYNC bit of SDADC2 is set.

Address offset: 0x70

Reset value: 0x0000 0000

31302928272625242322212019181716
JDATA2[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
JDATA1[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 JDATA2[15:0] : Injected group conversion data for SDADC2

When each conversion of a channel in the injected group of SDADC2 finishes, its resulting data is stored in this field. The data is valid only when JEOCF of SDADC2 is set. Reading this register clears both this field as well as the corresponding JEOCF.

Bits 15:0 JDATA1[15:0] : Injected group conversion data for SDADC1

When each conversion of a channel in the injected group of SDADC1 finishes, its resulting data is stored in this field. The data is valid only when JEOCF of SDADC1 is set. Reading this register clears both this field as well as the corresponding JEOCF.

Note: DMA may be used to read the data from this register, in which case 32-bit word accesses must be used.

Note: This register is cleared as soon as it is read. Reading this register also clears JEOCF in the corresponding two SDADC_ISR registers. Thus, firmware must not read this register nor the SDADC_JDATA registers of SDADC1 and SDADC2 if DMA is activated to read data from this register.

13.6.15 SDADC1 and SDADC2 regular data register (SDADC_RDATA12R)

This register contains the data resulting from the recently completed conversions of regular channels of SDADC1 and SDADC2. The data is a mirror image of the data in the corresponding SDADC_RDATAR registers. This register is available only in the set of registers for SDADC1 and must not be accessed unless the RSYNC bit of SDADC2 is set.

Address offset: 0x74

Reset value: 0x0000 0000

31302928272625242322212019181716
RDATA2[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
RDATA1[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 RDATA2[15:0] : Regular conversion data for SDADC2

When each conversion of the regular channel of SDADC2 finishes, its resulting data is stored in this field. The data is valid only when REOCF of SDADC2 is set. Reading this register clears both this field as well as the corresponding REOCF.

Bits 15:0 RDATA1[15:0] : Regular conversion data for SDADC1

When each conversion of the regular channel of SDADC1 finishes, its resulting data is stored in this field. The data is valid only when REOCF of SDADC1 is set. Reading this register clears both this field as well as the corresponding REOCF.

Note: DMA may be used to read the data from this register, in which case 32-bit word accesses must be used.

Note: This register is cleared as soon as it is read. Reading this register also clears REOCF in the corresponding two SDADC_ISR registers. Thus, firmware must not read this register nor the SDADC_RDATA registers of SDADC1 and SDADC2 if DMA is activated to read data from this register.

13.6.16 SDADC1 and SDADC3 injected data register (SDADC_JDATA13R)

This register contains the data resulting from the recently completed conversions of injected channels of SDADC1 and SDADC3. The data is a mirror image of the data in the corresponding SDADC_JDATAR registers. This register is available only in the set of registers for SDADC1 and must not be accessed unless the JSYNC bit of SDADC3 is set.

Address offset: 0x78

Reset value: 0x0000 0000

31302928272625242322212019181716
JDATA3[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
JDATA1[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 JDATA3[15:0] : Injected group conversion data for SDADC3

When each conversion of a channel in the injected group of SDADC3 finishes, its resulting data is stored in this field. The data is valid only when JEOCF of SDADC3 is set. Reading this register clears both this field as well as the corresponding JEOCF.

Bits 15:0 JDATA1[15:0] : Injected group conversion data for SDADC1

When each conversion of a channel in the injected group of SDADC1 finishes, its resulting data is stored in this field. The data is valid only when JEOCF of SDADC1 is set. Reading this register clears both this field as well as the corresponding JEOCF.

Note: DMA may be used to read the data from this register, in which case 32-bit word accesses must be used.

Note: This register is cleared as soon as it is read. Reading this register also clears JEOCF in the corresponding two SDADC_ISR registers. Thus, firmware must not read this register nor the SDADC_JDATA registers of SDADC1 and SDADC3 if DMA is activated to read data from this register.

13.6.17 SDADC1 and SDADC3 regular data register (SDADC_RDATA13R)

This register contains the data resulting from the recently completed conversions of regular channels of SDADC1 and SDADC3. The data is a mirror image of the data in the corresponding SDADC_RDATAR registers. This register is available only in the set of registers for SDADC1 and must not be accessed unless the RSYNC bit of SDADC3 is set.

Address offset: 0x7C

Reset value: 0x0000 0000

31302928272625242322212019181716
RDATA3[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
RDATA1[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 RDATA3[15:0] : Regular conversion data for SDADC3

When each conversion of the regular channel of SDADC3 finishes, its resulting data is stored in this field. The data is valid only when REOCF of SDADC3 is set. Reading this register clears both this field as well as the corresponding REOCF.

Bits 15:0 RDATA1[15:0] : Regular conversion data for SDADC1

When each conversion of the regular channel of SDADC1 finishes, its resulting data is stored in this field. The data is valid only when REOCF of SDADC1 is set. Reading this register clears both this field as well as the corresponding REOCF.

Note: DMA may be used to read the data from this register, in which case 32-bit word accesses must be used.

Note: This register is cleared as soon as it is read. Reading this register also clears REOCF in the corresponding two SDADC_ISR registers. Thus, firmware must not read this register nor the SDADC_RDATA registers of SDADC1 and SDADC3 if DMA is activated to read data from this register.

13.6.18 SDADC register map

The following table summarizes the ADC registers.

Table 38. SDADC register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x00SDADC_CR1INITRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RDMAENJDMAENRSYNC (1)JSYNC (1)Res.Res.SBISLOWCKREFV[1:0] (2)Res.Res.Res.ROVRIEREOCIEJOVRIEJEOCIEEOCALIE
Reset value00000000000000
0x04SDADC_CR2Res.Res.Res.Res.Res.Res.Res.FASTRSWSTARTRCONTRes.Res.RCH [3:0]JSWSTARTJEXTENRes.Res.JEXTSEL [3:0]Res.JDSJCONTSTARTCALIBRes.CALIB CNT [1:0]ADON
Reset value00000000000000000000
0x08SDADC_ISRINITRDYRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.STABIPRCIPJCIPCALIBIPRes.Res.Res.Res.Res.Res.Res.ROVRFREOCFJOVRFJEOCFEOCALF
Reset value0000000000
0x0CSDADC_CLRISRRes.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.CLRROVRFREOCFCLRJOVRFJEOCFCLREOCALF
Reset value000
0x10Res.
0x14SDADC_JCHGRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.JCHG[8:0]
Reset value000000001
0x18Res.
0x1CRes.
0x20SDADC_CONF0RCOMMON0 [1:0]Res.Res.SE0 [1:0]Res.Res.Res.Res.Res.GAIN0 [2:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET0[11:0]
Reset value0 00 00 0 0000000000000
0x24SDADC_CONF1RCOMMON1 [1:0]Res.Res.SE1 [1:0]Res.Res.Res.Res.Res.GAIN1 [2:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET1[11:0]
Reset value0 00 00 0 0000000000000
0x28SDADC_CONF2RCOMMON2 [1:0]Res.Res.SE2 [1:0]Res.Res.Res.Res.Res.GAIN2 [2:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OFFSET2[11:0]
Reset value0 00 00 0 0000000000000
0x2C - 0x3CRes.

Table 38. SDADC register map and reset values (continued)

OffsetRegister313029282726252423222120191817161514131211109876543210
0x40SDADC_CONFCHR1Res.Res.CON F CH7 [1:0]Res.Res.CON F CH6 [1:0]Res.Res.CON F CH5 [1:0]Res.Res.CON F CH4 [1:0]Res.Res.CON F CH3 [1:0]Res.Res.CON F CH2 [1:0]Res.Res.CON F CH1 [1:0]Res.Res.CON F CH0 [1:0]
Reset value0 00 00 00 00 00 00 00 00 0
0x44SDADC_CONFCHR2Res.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.CON F CH8 [1:0]
Reset value0 0
0x48 - 0x5CRes.
0x60SDADC_JDATARRes.Res.Res.JDATAH [3:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.JDATA[15:0]
Reset value0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0x64SDADC_RDATARRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RDATA[15:0]
Reset value0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0x68 - 0x6CRes.
0x70SDADC_JDATA12R (2)JDATA2[15:0]
Reset value0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0x74SDADC_RDATA12R (2)RDATA2[15:0]
Reset value0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0x78SDADC_JDATA13R (2)JDATA3[15:0]
Reset value0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0x7CSDADC_RDATA13R (2)RDATA3[15:0]
Reset value0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0x80 - 0xBCRes.

1. Not available in SDADC1.

2. Available only in SDADC1.

Refer to Section 2.2 on page 40 for the register boundary addresses.