32. Operational amplifiers (OPAMP)

32.1 OPAMP introduction

The devices embed two operational amplifiers with two inputs and one output each. The three I/Os can be connected to the external pins, thus enabling any type of external interconnections. The operational amplifiers can be configured internally as a follower, as an amplifier with a non-inverting gain ranging from 2 to 16 or with inverting gain ranging from -1 to -15.

Refer to Section 32.3.3: Signal routing for detailed information on OPAMP input and output connection to internal peripherals.

32.2 OPAMP main features

Note: Refer to the product datasheet for detailed OPAMP characteristics.

32.3 OPAMP functional description

The OPAMP has several modes.

Each OPAMP can be individually enabled, when disabled the output is high-impedance.

When enabled, it can be in calibration mode, all input and output of the OPAMP are then disconnected, or in functional mode.

There are two functional modes, the high-speed mode and the normal mode. In functional mode the inputs and output of the OPAMP are connected as described in Section 32.3.3: Signal routing .

32.3.1 OPAMP reset and clocks

The operational amplifier clock is necessary for accessing the registers. When the application does not need to have read or write access to those registers, the clock can be switched off using the peripheral clock enable register (see OPAMPEN bit in Section 8.7.43: RCC APB1 clock register (RCC_APB1LENR) ).

The bit OPAEN enables and disables the OPAMP operation. The OPAMP registers configurations should be changed before enabling the OPAEN bit in order to avoid spurious effects on the output.

When the output of the operational amplifier is no more needed the operational amplifier can be disabled to save power. All the configurations previously set (including the calibration) are maintained while OPAMP is disabled.

32.3.2 Initial configuration

The default configuration of the operational amplifier is a functional mode where the three input/outputs are connected to external pins. In the default mode the operational amplifier uses the factory trimming values for its offset calibration. See electrical characteristics section of the datasheet for factory trimming conditions, usually the temperature is 30 °C and the voltage is 3 V. The trimming values can be adjusted, see Section 32.3.5: Calibration for changing the trimming values. The default configuration uses the normal mode, which provides the standard performance. The bit OPAHSM can be set in order to switch the operational amplifier to high-speed mode for a better slew rate. Both normal and high-speed mode characteristics are defined in Section: Electrical characteristics of the datasheet.

As soon as the OPAEN bit in OPAMPx_CSR register is set, the operational amplifier is functional. The two input pins and the output pin are connected as defined in Section 32.3.3: Signal routing and the default connection settings can be changed.

Note: The inputs and output pins must be configured in analog mode (default state) in the corresponding GPIOx_MODER register.

32.3.3 Signal routing

The routing for the operational amplifier pins is determined by OPAMPx_CSR register.

The connections of the two operational amplifiers (OPAMP1 and OPAMP2) are described in the table below.

Table 241. Operational amplifier possible connections

SignalPinInternalcomment
OPAMP1_VINMPC5(INM0)
PA7(INM1)
ADC1_INP7
ADC1_INM3
ADC1_INP8
ADC1_INM4
ADC2_INP7
ADC2_INM3
ADC2_INP8
ADC2_INM4
COMP1_OUT
OPAMP1_VOUT or
PGA
This pin is controlled by bits
PGA_GAIN and VM_SEL.
OPAMP1_VINPPB0dac1_out1
ADC1_INM5
ADC1_INP9
ADC2_INM5
ADC2_INP9
COMP1_INP1
This pin is controlled by bit
VP_SEL.
OPAMP1_VOUT (1)PC4ADC1_INP4
ADC2_INP4
COMP1_INM7
The pin is connected when the
OPAMP is enabled. The ADC
input is controlled by ADC.

Table 241. Operational amplifier possible connections (continued)

SignalPinInternalcomment
OPAMP2_VINMPE8(INM0)
PG1(INM1)
COMP2_OUT
OPAMP2_VOUT or
PGA
This pin is controlled by bits
PGA_GAIN and VM_SEL.
OPAMP2_VINPPE9dac1_out2
dac2_out1
COMP2_INP
controlled by bit VP_SEL
OPAMP2_VOUT (1)PE7COMP2_INM7-

1. Both OPAMP1_VOUT and OPAMP2_VOUT are not available on all packages. The unconnected OPAMP must not be activated (see Section 32.6.1: OPAMP1 control/status register (OPAMP1_CSR) ).

32.3.4 OPAMP modes

The operational amplifier inputs and outputs are all accessible on terminals. The amplifiers can be used in multiple configuration environments:

Note: The amplifier output pin is directly connected to the output pad to minimize the output impedance. When the amplifier is enabled, it cannot be used as a general purpose I/O, even if the amplifier is configured as a PGA and only connected to the internal channel.

The impedance of the signal must be maintained below a level which avoids the input leakage to create significant artifacts (due to a resistive drop in the source). Please refer to the electrical characteristics section in the datasheet for further details.

Standalone mode (external gain setting mode)

The procedure to use the OPAMP in standalone mode is presented hereafter.

Starting from the default value of OPAMPx_CSR, and the default state of GPIOx_MODER, as soon as the OPAEN bit is set, the two input pins and the output pin are connected to the operational amplifier.

This default configuration uses the factory trimming values and operates in normal mode (highest performance). The behavior of the OPAMP can be changed as follows:

Figure 245. Standalone mode: external gain setting mode

Circuit diagram of an operational amplifier (OPAMP) in standalone mode with external gain setting. The diagram shows an STM32 microcontroller connected to an OPAMP. The non-inverting input (INP0) is connected to a DAC output (dac_outx). The inverting input (INM0 or 1) is connected to a voltage source (VOUT) through a resistor and a capacitor. The output (opamp_out) is connected to the inverting input through a feedback path containing a variable resistor and a capacitor. The diagram is labeled MSv38380V3.

The diagram illustrates the internal architecture of an operational amplifier (OPAMP) within an STM32 microcontroller, configured for standalone mode with external gain setting. The OPAMP is represented by a triangle with '+' and '-' inputs. The non-inverting input (+) is connected to a pin labeled INP0, which is driven by a DAC output (dac_outx). The inverting input (-) is connected to a pin labeled INM0 or 1. This pin is connected to an external voltage source (VOUT) through a resistor and a capacitor. The output of the OPAMP is labeled opamp_out. This output is connected back to the inverting input through a feedback path consisting of a variable resistor and a capacitor. The entire OPAMP circuit is enclosed in a dashed box labeled STM32. The diagram is labeled MSv38380V3 in the bottom right corner.

Circuit diagram of an operational amplifier (OPAMP) in standalone mode with external gain setting. The diagram shows an STM32 microcontroller connected to an OPAMP. The non-inverting input (INP0) is connected to a DAC output (dac_outx). The inverting input (INM0 or 1) is connected to a voltage source (VOUT) through a resistor and a capacitor. The output (opamp_out) is connected to the inverting input through a feedback path containing a variable resistor and a capacitor. The diagram is labeled MSv38380V3.

Follower configuration mode

The procedure to use the OPAMP in follower mode is presented hereafter.

Note: The pin corresponding to OPAMPx_VINM is free for another usage.

The signal on the OPAMP1 output is also seen as an ADC input. As a consequence, the OPAMP configured in follower mode can be used to perform impedance adaptation on input signals before feeding them to the ADC input, assuming the input signal frequency is compatible with the operational amplifier gain bandwidth specification.

Figure 246. Follower configuration

Circuit diagram of an operational amplifier in a follower configuration within an STM32 microcontroller.

The diagram illustrates the internal follower configuration of an operational amplifier (OPAMP) within an STM32 microcontroller. The microcontroller is represented by a dashed box labeled 'STM32'. Inside, an OPAMP symbol is shown with its non-inverting input (+) connected to a DAC output labeled 'dac_outx' and its inverting input (-) connected to a switch. The switch can connect the inverting input to either 'VINM0 or 1' or to the OPAMP's output. The output of the OPAMP is labeled 'opamp_out' and is connected to an external pin labeled 'VOUT'. A feedback path, consisting of a variable resistor and a fixed resistor connected to ground, is shown between the output and the inverting input. A note indicates that the inverting input is 'Always connected to OPAMP output'. The diagram is identified by the code 'MSv38381V4' in the bottom right corner.

Circuit diagram of an operational amplifier in a follower configuration within an STM32 microcontroller.

Programmable gain amplifier mode

The procedure to use the OPAMP as programmable gain amplifier is presented hereafter.

As soon as the OPAEN bit is set, the voltage on pin OPAMPx_VINP is amplified by the selected gain and visible on pin OPAMPx_VOUT.

Note: To avoid saturation, the input voltage should stay below \( V_{DDA} \) divided by the selected gain.

Figure 247. PGA mode, internal gain setting (x2/x4/x8/x16), inverting input not used

Circuit diagram of an operational amplifier (OPAMP) in Programmable Gain Amplifier (PGA) mode. The diagram shows the internal structure of the OPAMP within an STM32 microcontroller. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0 or 1) is connected to a feedback network consisting of a variable resistor and a capacitor, which is also connected to the output (VOUT). The output (VOUT) is labeled 'opamp_out'. A note indicates that the output is 'Always connected to OPAMP output'. The diagram is labeled MSV38382V4.

The diagram illustrates the internal configuration of an operational amplifier (OPAMP) within an STM32 microcontroller for Programmable Gain Amplifier (PGA) mode. The OPAMP is represented by a triangle with '+' and '-' inputs. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0 or 1) is connected to a feedback network consisting of a variable resistor and a capacitor, which is also connected to the output (VOUT). The output (VOUT) is labeled 'opamp_out'. A note indicates that the output is 'Always connected to OPAMP output'. The diagram is labeled MSV38382V4.

Circuit diagram of an operational amplifier (OPAMP) in Programmable Gain Amplifier (PGA) mode. The diagram shows the internal structure of the OPAMP within an STM32 microcontroller. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0 or 1) is connected to a feedback network consisting of a variable resistor and a capacitor, which is also connected to the output (VOUT). The output (VOUT) is labeled 'opamp_out'. A note indicates that the output is 'Always connected to OPAMP output'. The diagram is labeled MSV38382V4.

Programmable gain amplifier mode with external filtering

The procedure to use the OPAMP to amplify the amplitude of an input signal, with an external filtering, is presented hereafter.

Any external connection on INM can be used in parallel with the internal PGA, for example a capacitor can be connected between opamp_out and INM for filtering purpose (see datasheet for the value of resistors used in the PGA resistor network).

Figure 248. PGA mode, internal gain setting (x2/x4/x8/x16), inverting input used for filtering

Circuit diagram of an operational amplifier (OPAMP) in PGA mode with external filtering. The diagram shows an STM32 microcontroller connected to an OPAMP. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0) is connected to the output (opamp_out) in a unity-gain feedback configuration. A capacitor is connected between the output and the inverting input (VINM0) for filtering. The output (opamp_out) is also connected to a resistor and a capacitor to ground. The diagram is labeled 'Equivalent to' and 'Allows optional low-pass filtering (1)'. The reference MSV38383V3 is shown in the bottom right corner.

The diagram illustrates the internal architecture of an operational amplifier (OPAMP) within an STM32 microcontroller, configured for programmable gain amplifier (PGA) mode with external filtering. The OPAMP is shown as a triangle with its non-inverting input (+) connected to VINP, which is driven by a DAC output (dac_outx). The inverting input (-) is connected to VINM0. The output of the OPAMP is labeled opamp_out. A feedback path connects opamp_out back to VINM0. On the opamp_out line, there is a capacitor connected to ground and a variable resistor (potentiometer) also connected to ground. A dashed line with an arrow points from the text 'Equivalent to' to the feedback path. On the left side, a capacitor is connected between VINM0 and VOUT, with a label 'Allows optional low-pass filtering (1)'. The entire circuit is enclosed in a dashed box labeled 'STM32' at the top. The reference 'MSV38383V3' is in the bottom right corner.

Circuit diagram of an operational amplifier (OPAMP) in PGA mode with external filtering. The diagram shows an STM32 microcontroller connected to an OPAMP. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0) is connected to the output (opamp_out) in a unity-gain feedback configuration. A capacitor is connected between the output and the inverting input (VINM0) for filtering. The output (opamp_out) is also connected to a resistor and a capacitor to ground. The diagram is labeled 'Equivalent to' and 'Allows optional low-pass filtering (1)'. The reference MSV38383V3 is shown in the bottom right corner.
  1. 1. The gain depends on the cut-off frequency.

Programmable gain amplifier, non-inverting with external bias or inverting mode

The procedure to use the OPAMP to amplify the amplitude of an input signal with bias voltage for non-inverting mode or inverting mode.

Figure 249. PGA mode, non-inverting gain setting (x2/x4/x8/x16) or inverting gain setting (x-1/x-3/x-7/x-15)

Figure 249: Internal architecture of the OPAMP in PGA mode. The diagram shows an STM32 microcontroller connected to an operational amplifier. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0) is connected to the output (opamp_out) through a feedback network consisting of a variable resistor and a fixed resistor. The output (opamp_out) is also connected to a VOUT pin. A note indicates that the VOUT pin is 'Always connected to OPAMP output'. The diagram is labeled MSv38384V4.
Figure 249: Internal architecture of the OPAMP in PGA mode. The diagram shows an STM32 microcontroller connected to an operational amplifier. The non-inverting input (VINP) is connected to a DAC output (dac_outx). The inverting input (VINM0) is connected to the output (opamp_out) through a feedback network consisting of a variable resistor and a fixed resistor. The output (opamp_out) is also connected to a VOUT pin. A note indicates that the VOUT pin is 'Always connected to OPAMP output'. The diagram is labeled MSv38384V4.

Figure 250. Example configuration

Figure 250: Two example configurations for the OPAMP. The left configuration shows a non-inverting amplifier where the input signal (VINP) is connected to the non-inverting input (+), and the inverting input (-) is connected to the output (VOUT) through a feedback network. The inverting input is also connected to a bias voltage (VINM0) through a resistor. The gain is specified as Gain:x2, x4, x8, x16. The right configuration shows an inverting amplifier where the input signal (VINM0) is connected to the inverting input (-) through a resistor, and the non-inverting input (+) is connected to a bias voltage (VINP). The output (VOUT) is connected to the inverting input through a feedback network. The gain is specified as Gain:x-1, x-3, x-7, x-15. The diagram is labeled MSv38387V3.
Figure 250: Two example configurations for the OPAMP. The left configuration shows a non-inverting amplifier where the input signal (VINP) is connected to the non-inverting input (+), and the inverting input (-) is connected to the output (VOUT) through a feedback network. The inverting input is also connected to a bias voltage (VINM0) through a resistor. The gain is specified as Gain:x2, x4, x8, x16. The right configuration shows an inverting amplifier where the input signal (VINM0) is connected to the inverting input (-) through a resistor, and the non-inverting input (+) is connected to a bias voltage (VINP). The output (VOUT) is connected to the inverting input through a feedback network. The gain is specified as Gain:x-1, x-3, x-7, x-15. The diagram is labeled MSv38387V3.

Programmable gain amplifier, non-inverting with external bias or inverting mode with filtering

The procedure to use the OPAMP to amplify the amplitude of an input signal with bias voltage for non-inverting mode or inverting mode with filtering

Any external connection on VM1 can be used in parallel with the internal PGA, for example a capacitor can be connected between opamp_out and VM1 for filtering purpose (see datasheet for the value of resistors used in the PGA resistor network).

Figure 251. PGA mode, non-inverting gain setting (x2/x4/x8/x16) or inverting gain setting (x-1/x-3/x-7/x-15) with filtering

Internal architecture diagram of the OPAMP in STM32 showing non-inverting and inverting gain configurations with filtering. The diagram shows VINP connected to a DAC output (dac_outx) and the non-inverting input (+) of the opamp. The inverting input (-) is connected to a feedback network consisting of a resistor and a variable gain resistor (PGA). The output (opamp_out) is connected to the inverting input and also to a capacitor for optional low-pass filtering. The diagram is labeled 'Equivalent to' and 'Allows optional low-pass filtering (1)'. The reference MSv38386V4 is shown in the bottom right.
Internal architecture diagram of the OPAMP in STM32 showing non-inverting and inverting gain configurations with filtering. The diagram shows VINP connected to a DAC output (dac_outx) and the non-inverting input (+) of the opamp. The inverting input (-) is connected to a feedback network consisting of a resistor and a variable gain resistor (PGA). The output (opamp_out) is connected to the inverting input and also to a capacitor for optional low-pass filtering. The diagram is labeled 'Equivalent to' and 'Allows optional low-pass filtering (1)'. The reference MSv38386V4 is shown in the bottom right.

Figure 252. Example configuration

Two external circuit diagrams for the OPAMP. The left diagram shows a non-inverting configuration where VINP is connected to the non-inverting input (+), and the inverting input (-) is connected to a feedback network with a variable gain resistor. The output (VOUT) is connected to the inverting input. The gain is labeled 'Gain:x2, x4, x8, x16'. The right diagram shows an inverting configuration where an input signal is connected to the inverting input (-) through a resistor, and the non-inverting input (+) is connected to a bias voltage. The output (VOUT) is connected to the inverting input. The gain is labeled 'Gain:x-1, x-3, x-7, x-15'. The reference MSv38387V3 is shown in the bottom right.
Two external circuit diagrams for the OPAMP. The left diagram shows a non-inverting configuration where VINP is connected to the non-inverting input (+), and the inverting input (-) is connected to a feedback network with a variable gain resistor. The output (VOUT) is connected to the inverting input. The gain is labeled 'Gain:x2, x4, x8, x16'. The right diagram shows an inverting configuration where an input signal is connected to the inverting input (-) through a resistor, and the non-inverting input (+) is connected to a bias voltage. The output (VOUT) is connected to the inverting input. The gain is labeled 'Gain:x-1, x-3, x-7, x-15'. The reference MSv38387V3 is shown in the bottom right.

32.3.5 Calibration

The OPAMP interface continuously sends trimmed offset values to the operational amplifiers. At startup, the trimming values are initialized with the preset 'factory' trimming value.

Each operational amplifier can be trimmed by the user. Specific registers allow to have different trimming values for normal mode and for high-speed mode.

The aim of the calibration is to cancel as much as possible the OPAMP inputs offset voltage. The calibration circuitry allows to reduce the input offset voltage to less than +/-1.5 mV within stable voltage and temperature conditions.

For each operational amplifier and each mode two trimming value needs to be trimmed, one for N differential pair and one for P differential pair.

There are two registers for trimming the offsets for each operational amplifiers, one for normal mode (OPAMPx_OTR) and one high-speed mode (OPAMPx_HSOTR). Each register is composed of five bits for P differential pair trimming and five bits for N differential pair trimming. These are the 'user' values.

The user is able to switch from 'factory' values to 'user' trimmed values using the USERTRIM bit in the OPAMPx_CSR register. This bit is reset at startup and so the 'factory' value are applied by default to the OPAMP option registers.

User is liable to change the trimming values in calibration or in functional mode.

The offset trimming registers are typically configured after the calibration operation is initialized by setting bit CALON to 1. When CALON = 1 the inputs of the operational amplifier are disconnected from the functional environment.

When CALON = 1, the bit CALOUT will reflect the influence of the trimming value selected by CALSEL and OPAHSM. The software should increment the TRIMOFFSETN bits in the OPAMP control register from 0x00 to the first value that causes the CALOUT bit to change from 1 to 0 in the OPAMP register. If the CALOUT bit is reset, the offset is calibrated correctly and the corresponding trimming value must be stored. The CALOUT flag needs up to 1 ms after the trimming value is changed to become steady (see \( t_{OFFTRIMmax} \) delay specification in the electrical characteristics section of the datasheet).

Note: The closer the trimming value is to the optimum trimming value, the longer it takes to stabilize (with a maximum stabilization time remaining below 1 ms in any case).

Table 242. Operating modes and calibration

ModeControl bitsOutput
OPAENOPAHSMCALONCALSELV OUTCALOUT flag
Normal operating mode100Xanalog0
High-speed mode110Xanalog0
Power down0XXXZ0

Table 242. Operating modes and calibration (continued)

ModeControl bitsOutput
OPAENOPAHSMCALONCALSELV OUTCALOUT flag
Offset calibration N difference for normal mode10111analogX
Offset calibration P difference for normal mode10101analogX
Offset calibration N difference for high-speed mode11111analogX
Offset calibration P difference for high-speed mode11101analogX

Calibration procedure

Here are the steps to perform a full calibration of either one of the operational amplifiers:

  1. 1. Set the OPAEN bit in OPAMPx_CSR to 1 to enable the operational amplifier.
  2. 2. Set the USERTRIM bit in the OPAMPx_CSR register to 1.
  3. 3. Choose a calibration mode (refer to Table 242: Operating modes and calibration ). The steps 3 to 4 will have to be repeated 4 times. For the first iteration select
    • – Normal mode and N differential pair
    The above calibration mode correspond to OPAHSM=0 and CALSEL=11 in the OPAMPx_CSR register.
  4. 4. Increment TRIMOFFSETN[4:0] in OPAMPx_OTR starting from 00000b until CALOUT changes to 0 in OPAMPx_CSR.

Note: Between the write to the OPAMPx_OTR register and the read of the CALOUT value, make sure to wait for the \( t_{OFFTRIM}max \) delay specified in the electrical characteristics section of the datasheet, to get the correct CALOUT value.

The commutation means that the is correctly compensated and that the corresponding trim code must be saved in the OPAMPx_OTR register.

Repeat steps 3 to 4 for:

If a mode is not used, it is not necessary to perform the corresponding calibration.

All operational amplifier can be calibrated at the same time.

Note: During the whole calibration phase the external connection of the operational amplifier output must not pull up or down currents higher than 500 \( \mu \) A.

32.4 OPAMP low-power modes

Table 243. Effect of low-power modes on the OPAMP

ModeDescription
SleepNo effect.
D2 StopNo effect, OPAMP registers content is kept.
StandbyThe OPAMP registers are powered down and must be re-initialized after exiting Standby.

32.5 OPAMP PGA gain

When OPAMP is configured as PGA mode, it can select the gain of x2,x4,x8,x16 for non-inverting mode and x-1, x-3, x-7, x-15 for inverting mode.

When OPAMP is configured as non-inverting mode, the Gain error can be refer to the product datasheet. When it is configured as inverting mode, Gain factor is defined not only the on chip feedback resistor but also the signal source output impedance. If signal source output impedance is not negligible compare to the input feedback resistance of PGA, it will create the gain error. Please refer to the PGA resistance value in the product datasheet.

32.6 OPAMP registers

The registers of this peripheral can only be accessed by-word (32-bit).

32.6.1 OPAMP1 control/status register (OPAMP1_CSR)

Address: 0x00

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.CAL OUTTST REFRes.Res.Res.Res.Res.Res.Res.Res.Res.USER TRIMPGA_GAIN
rrwrwrwrw

1514131211109876543210
PGA_GAINCALSELCALONRes.Res.OPA HSMRes.VM_SELRes.VP_SELFORCE _VPOPAEN
rwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 CALOUT : Operational amplifier calibration output

OPAMP output status flag. During the calibration mode, OPAMP is used as comparator.

0: Non-inverting < inverting

1: Non-inverting > inverting

Bit 29 TSTREF : OPAMP calibration reference voltage output control (reserved for test)

0: INTVREF of OPAMP is not output

1: INTVREF of OPAMP is output

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

Bit 18 USERTRIM : User trimming enable

This bit allows to switch from 'factory' AOP offset trimmed values to 'user' AOP offset trimmed values

This bit is active for both mode normal and high-power.

0: 'factory' trim code used

1: 'user' trim code used

Bits 17:14 PGA_GAIN : Operational amplifier Programmable amplifier gain value

0000: Non-inverting internal Gain 2, VREF- referenced

0001: Non-inverting internal Gain 4, VREF- referenced

0010: Non-inverting internal Gain 8, VREF- referenced

0011: Non-inverting internal Gain 16, VREF- referenced

0100: Non-inverting internal Gain 2 with filtering on INM0, VREF- referenced

0101: Non-inverting internal Gain 4 with filtering on INM0, VREF- referenced

0110: Non-inverting internal Gain 8 with filtering on INM0, VREF- referenced

0111: Non-inverting internal Gain 16 with filtering on INM0, VREF- referenced

1000: Inverting gain=-1/ Non-inverting gain =2 with INM0 node for input or bias

1001: Inverting gain=-3/ Non-inverting gain =4 with INM0 node for input or bias

1010: Inverting gain=-7/ Non-inverting gain =8 with INM0 node for input or bias

1011: Inverting gain=-15/ Non-inverting gain =16 with INM0 node for input or bias

1100: Inverting gain=-1/ Non-inverting gain =2 with INM0 node for input or bias, INM1 node for filtering

1101: Inverting gain=-3/ Non-inverting gain =4 with INM0 node for input or bias, INM1 node for filtering

1110: Inverting gain=-7/ Non-inverting gain =8 with INM0 node for input or bias, INM1 node for filtering

1111: Inverting gain=-15/ Non-inverting gain =16 with INM0 node for input or bias, INM1 node for filtering

Bits 13:12 CALSEL : Calibration selection

It is used to select the offset calibration bus used to generate the internal reference voltage when CALON = 1 or FORCE_VP= 1.

00: 0.033*VDDA applied on OPAMP inputs

01: 0.1*VDDA applied on OPAMP inputs (for PMOS calibration)

10: 0.5*VDDA applied on OPAMP inputs

11: 0.9*VDDA applied on OPAMP inputs (for NMOS calibration)

Bit 11 CALON : Calibration mode enabled

0: Normal mode

1: Calibration mode (all switches opened by HW)

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

Bit 8 OPAHSM : Operational amplifier high-speed mode

The operational amplifier must be disabled to change this configuration.

0: operational amplifier in normal mode

1: operational amplifier in high-speed mode

Bit 7 Reserved, must be kept at reset value.

Note: If OPAMP1 is unconnected in a specific package, it must remain disabled (keep OPAMP1_CSR register default value).

32.6.2 OPAMP1 trimming register in normal mode (OPAMP1_OTR)

Address: 0x04
Reset value: 0x0000 XXXX (factory trimmed values)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.TRIMOFFSETPRes.Res.Res.TRIMOFFSETN
rwrwrwrwrwrwrwrwrwrw

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

Bits 12:8 TRIMOFFSETP[4:0] : Trim for PMOS differential pairs

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

Bits 4:0 TRIMOFFSETN[4:0] : Trim for NMOS differential pairs

32.6.3 OPAMP1 trimming register in high-speed mode (OPAMP1_HSOTR)

Address: 0x08

Reset value: 0x0000 XXXX (factory trimmed values)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.TRIMHSOFFSETPRes.Res.Res.TRIMHSOFFSETN
rwrwrwrwrwrwrwrwrwrw

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

Bits 12:8 TRIMHSOFFSETP[4:0] : High-speed mode trim for PMOS differential pairs

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

Bits 4:0 TRIMHSOFFSETN[4:0] : High-speed mode trim for NMOS differential pairs

32.6.4 OPAMP option register (OPAMP_OR)

Address: 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.Res.Res.Res.Res.Res.

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

32.6.5 OPAMP2 control/status register (OPAMP2_CSR)

Address: 0x10

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.CAL OUTTST REFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.USER TRIMPGA_GAIN
rrwrwrwrw
1514131211109876543210
PGA_GAINCALSELCALONRes.Res.OPA HSMRes.VM_SELRes.VP_SELFORCE VPOPAEN
rwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 CALOUT : Operational amplifier calibration output

OPAMP output status flag. During the calibration mode, OPAMP is used as comparator.

0: Non-inverting < inverting

1: Non-inverting > inverting

Bit 29 TSTREF : OPAMP calibration reference voltage output control (reserved for test)

0: INTVREF of OPAMP is not output

1: INTVREF of OPAMP is output

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

Bit 18 USERTRIM : User trimming enable

This bit allows to switch from 'factory' AOP offset trimmed values to 'user' AOP offset trimmed values

This bit is active for both mode normal and high-power.

0: 'factory' trim code used

1: 'user' trim code used

Bits 17:14 PGA_GAIN : Operational amplifier Programmable amplifier gain value

0000: Non-inverting internal Gain 2, VREF- referenced

0001: Non-inverting internal Gain 4, VREF- referenced

0010: Non-inverting internal Gain 8, VREF- referenced

0011: Non-inverting internal Gain 16, VREF- referenced

0100: Non-inverting internal Gain 2 with filtering on INM0, VREF- referenced

0101: Non-inverting internal Gain 4 with filtering on INM0, VREF- referenced

0110: Non-inverting internal Gain 8 with filtering on INMINM0, VREF- referenced

0111: Non-inverting internal Gain 16 with filtering on INM0, VREF- referenced

1000: Inverting gain=-1/ Non-inverting gain =2 with INM0 node for input or bias

1001: Inverting gain=-3/ Non-inverting gain =4 with INM0 node for input or bias

1010: Inverting gain=-7/ Non-inverting gain =8 with INM0 node for input or bias

1011: Inverting gain=-15/ Non-inverting gain =16 with INM0 node for input or bias

1100: Inverting gain=-1/ Non-inverting gain =2 with INM0 node for input or bias, INM1 node for filtering

1101: Inverting gain=-3/ Non-inverting gain =4 with INM0 node for input or bias, INM1 node for filtering

1110: Inverting gain=-7/ Non-inverting gain =8 with INM0 node for input or bias, INM1 node for filtering

1111: Inverting gain=-15/ Non-inverting gain =16 with INM0 node for input or bias, INM1 node for filtering

Bits 13:12 CALSEL : Calibration selection

It is used to select the offset calibration bus used to generate the internal reference voltage when CALON = 1 or FORCE_VP= 1.

00: 0.033*VDDA applied on OPAMP inputs

01: 0.1*VDDA applied on OPAMP inputs (for PMOS calibration)

10: 0.5*VDDA applied on OPAMP inputs

11: 0.9*VDDA applied on OPAMP inputs (for NMOS calibration)

Bit 11 CALON : Calibration mode enabled

0: Normal mode

1: Calibration mode (all switches opened by HW)

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

Bit 8 OPAHSM : Operational amplifier high-speed mode

The operational amplifier must be disabled to change this configuration.

0: operational amplifier in normal mode

1: operational amplifier in high-speed mode

Bit 7 Reserved, must be kept at reset value.

Bits 6:5 VM_SEL : Inverting input selection

00: INM0 connected to OPAMP INM input

01: INM1 connected to OPAMP INM input

10: Feedback resistor is connected to OPAMP INM input (PGA mode), Inverting input selection depends on the PGA_GAIN setting

11: opamp_out connected to OPAMP INM input (Follower mode)

Bit 4 Reserved, must be kept at reset value.

Bits 3:2 VP_SEL : Non-inverted input selection

00: GPIO connected to OPAMPx_VINP

01: DAC connected to OPAMPx_VINP

10: Reserved

11: Reserved

Bit 1 FORCE_VP : Force internal reference on VP (reserved for test)

0: Normal operating mode. Non-inverting input connected to inputs.

1: Calibration verification mode: Non-inverting input connected to calibration reference voltage.

Bit 0 OPAEN : Operational amplifier Enable

0: operational amplifier disabled

1: operational amplifier enabled

Note: If OPAMP2 is unconnected in a specific package, it must remain disabled (keep OPAMP2_CSR register default value).

32.6.6 OPAMP2 trimming register in normal mode (OPAMP2_OTR)

Address: 0x14

Reset value: 0x0000 XXXX (factory trimmed values)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.TRIMOFFSETPRes.Res.Res.TRIMOFFSETN
rwrwrwrwrwrwrwrwrwrw

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

Bits 12:8 TRIMOFFSETP[4:0] : Trim for PMOS differential pairs

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

Bits 4:0 TRIMOFFSETN[4:0] : Trim for NMOS differential pairs

32.6.7 OPAMP2 trimming register in high-speed mode (OPAMP2_HSOTR)

Address: 0x18

Reset value: 0x0000 XXXX (factory trimmed values)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.TRIMHSOFFSETPRes.Res.Res.TRIMHSOFFSETN
rwrwrwrwrwrwrwrwrwrw

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

Bits 12:8 TRIMHSOFFSETP[4:0] : High-speed mode trim for PMOS differential pairs

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

Bits 4:0 TRIMHSOFFSETN[4:0] : High-speed mode trim for NMOS differential pairs

32.6.8 OPAMP register map

Table 244. OPAMP register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x00OPAMP1_CSRRes.CALOUTTSTREFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.USERTRIMPGA_GAINCALSELCALONRes.Res.OPAHSNRes.VM_SELRes.Res.VP_SELFORCE_VPOPAEN
Reset value0000000000000000
0x04OPAMP1_OTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRIM_OFFSETP[4:0]Res.Res.Res.TRIM_OFFSETN[4:0]
Reset value(1)(1)
0x08OPAMP1_HSOTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRIMHS_OFFSETP[4:0]Res.Res.Res.TRIMHS_OFFSETN[4:0]
Reset value(1)(1)
0x0COPAMP_ORRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value
0x10OPAMP2_CSRRes.CALOUTTSTREFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.USERTRIMPGA_GAINCALSELCALONRes.Res.OPAHSNRes.VM_SELRes.Res.VP_SELFORCE_VPOPAEN
Reset value0000000000000000
0x14OPAMP2_OTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRIM_OFFSETP[4:0]Res.Res.Res.TRIM_OFFSETN[4:0]
Reset value(1)(1)
0x18OPAMP2_HSOTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRIMHS_OFFSETP[4:0]Res.Res.Res.TRIMHS_OFFSETN[4:0]
Reset value(1)(1)

1. Factory trimmed values.

Refer to Section 2.3 on page 131 for the register boundary addresses.