31. Voltage reference buffer (VREFBUF)

31.1 VREFBUF introduction

The devices embed a voltage reference buffer which can be used as voltage reference for the on-chip ADCs, and also as voltage reference for external components through the VREF+ pin.

31.2 VREFBUF implementation

The table below describes the VREFBUF voltage typical values:

Table 314. VREFBUF typical values

SymbolValue
\(V_{\text{REFBUF0}}\)2.5 V
\(V_{\text{REFBUF1}}\)2.048 V
\(V_{\text{REFBUF2}}\)1.8 V

Note: Refer to the product datasheet for more details.

31.3 VREFBUF functional description

Figure 322. VREFBUF block diagram

Block diagram of the VREFBUF circuit. It shows an operational amplifier with its non-inverting input (+) connected to VREFINT and its inverting input (-) connected to a feedback node. The feedback node is connected to a switch that selects between two parallel resistor networks. One network consists of two resistors in parallel, and the other consists of a single resistor. The output of the op-amp is connected to the VREF+ pin, which is also connected to a capacitor and ground. The bottom of the resistor networks is connected to VSSA.

The diagram illustrates the internal structure of the VREFBUF. An operational amplifier (op-amp) is the core component. Its non-inverting input (+) is connected to the \(V_{\text{REFINT}}\) pin. The inverting input (-) is connected to a feedback node. This feedback node is connected to a switch that selects between two different resistor configurations. One configuration has two resistors in parallel, and the other has a single resistor. The output of the op-amp is connected to the \(V_{\text{REF+}}\) pin. The \(V_{\text{REF+}}\) pin is also connected to a capacitor and ground. The bottom of the resistor networks is connected to the \(V_{\text{SSA}}\) pin.

Block diagram of the VREFBUF circuit. It shows an operational amplifier with its non-inverting input (+) connected to VREFINT and its inverting input (-) connected to a feedback node. The feedback node is connected to a switch that selects between two parallel resistor networks. One network consists of two resistors in parallel, and the other consists of a single resistor. The output of the op-amp is connected to the VREF+ pin, which is also connected to a capacitor and ground. The bottom of the resistor networks is connected to VSSA.

The internal voltage reference buffer is an operational amplifier, with programmable gain. The amplifier input is connected to the internal voltage reference \(V_{REFINT}\). The VREFBUF supports three voltages, which are configured with VRS bits in the VREFBUF_CSR register:

The internal voltage reference can be configured in four different modes depending on ENVR and HIZ bits configuration. These modes are provided in the table below:

Table 315. VREF buffer modes

ENVRHIZVREF buffer configuration
00VREFBUF buffer off mode:
– VREF+ pin pulled-down to \(V_{SSA}\)
01External voltage reference mode (default value):
– VREFBUF buffer off
– VREF+ pin input mode
10Internal voltage reference mode:
– VREFBUF buffer on
– VREF+ pin connected to VREFBUF buffer output
11Hold mode:
– VREF is enable without output buffer, VREF+ pin voltage is hold with the external capacitor
– VRR detection disabled and VRR bit keeps last state

After enabling the VREFBUF by setting ENVR bit and clearing HIZ bit in the VREFBUF_CSR register, the user must wait until VRR bit is set, meaning that the voltage reference output has reached its expected value.

31.4 VREFBUF trimming

The VREFBUF output voltage is factory-calibrated by ST. At reset, and each time the VRS setting is changed, the calibration data is automatically loaded to the TRIM register.

Optionally user can trim the output voltage by changing the TRIM register bits directly. In this case, the VRS setting has no more effect on the TRIM register until the device is reset.

31.5 VREFBUF registers

31.5.1 VREFBUF control and status register (VREFBUF_CSR)

Address offset: 0x00

Reset value: 0x0000 0002

31.5 31.5.1column_2column_3column_4column_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15RM0481
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.VRS[2:0]VRRRes.HIZENVR
rwrwrwrrwrw
Bits 6:4VRS[2:0]: Voltage reference scale
Bit 3VRR: Voltage reference buffer ready
Bit 2 Bit 1HIZ: High impedance mode
Refer toTable 315: VREF buffer modes configuration.for the mode descriptions depending on ENVR bit
Bit 0ENVR: Voltage reference buffer mode enable

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

Bits 6:4 VRS[2:0]: Voltage reference scale

These bits select the value generated by the voltage reference buffer.

VRS = 000: \(V_{\text{REFBUF0}}\) voltage selected.

VRS = 001: \(V_{\text{REFBUF1}}\) voltage selected.

VRS = 010: \(V_{\text{REFBUF2}}\) voltage selected.

Others: Reserved

Note: Refer to the product datasheet for each \(V_{\text{REFBUF}_x}\) voltage setting value.

The software can program this bitfield only when the VREFBUF is disabled (ENVR=0).

Bit 3 VRR: Voltage reference buffer ready

0: the voltage reference buffer output is not ready.

1: the voltage reference buffer output reached the requested level.

Bit 2 Reserved, must be kept at reset value.

Bit 1 HIZ: High impedance mode

This bit controls the analog switch to connect or not the VREF+ pin.

0: VREF+ pin is internally connected to the voltage reference buffer output.

1: VREF+ pin is high impedance.

Refer to Table 315: VREF buffer modes for the mode descriptions depending on ENVR bit configuration.

Bit 0 ENVR: Voltage reference buffer mode enable

This bit is used to enable the voltage reference buffer mode.

0: Internal voltage reference mode disable (external voltage reference mode).

1: Internal voltage reference mode (reference buffer enable or hold mode) enable.

31.5.2 VREFBUF calibration control register (VREFBUF_CCR)

Address offset: 0x04

Reset value: 0x0000 00XX

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.TRIM[5:0]
rwrwrwrwrwrw

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

Bits 5:0 TRIM[5:0]: Trimming code

The TRIM code is a 6-bit unsigned data (minimum 000000, maximum 111111) that is set and updated according the mechanism described below.

Reset:

TRIM[5:0] is automatically initialized with the VRS = 0 trimming value stored in the flash memory during the production test.

VRS change:

TRIM[5:0] is automatically initialized with the trimming value (corresponding to VRS setting) stored in the flash memory during the production test.

Write in TRIM[5:0]:

User can modify the TRIM[5:0] with an arbitrary value. This is permanently disabling the control of the trimming value with VRS (until the device is reset).

Note: If the user application performs the trimming, the trimming code must start from 000000 to 111111 in ascending order.

31.5.3 VREFBUF register map

The following table gives the VREFBUF register map and the reset values.

Table 316. VREFBUF register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x00VREFBUF_CSRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.VRS[2:0]VRRRes.HIZENVR
Reset value000010
0x04VREFBUF_CCRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.TRIM[5:0]
Reset valueXXXXXXX

Refer to Section 2.3 for the register boundary addresses.