EasyManuals Logo
Home>ST>Microcontrollers>STM32G431

ST STM32G431 User Manual

ST STM32G431
2126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #796 background imageLoading...
Page #796 background image
Operational amplifiers (OPAMP) RM0440
796/2126 RM0440 Rev 4
Calibration procedure
Here are the steps to perform a full calibration of either one of the operational amplifiers:
1. Set the OPAEN bit in OPAMPx_CSR to 1 to enable the operational amplifier.
2. Set the USERTRIM bit in the OPAMPx_CSR register to 1.
3. Choose a calibration mode (refer to Table 201: Operating modes and calibration). The
steps 3 to 4 have to be repeated four times. For the first iteration select Normal mode
and N differential pair. This calibration mode correspond to OPAHSM = 0 and
CALSEL = 11 in the OPAMPx_CSR register.
4. Increment TRIMOFFSETN[4:0] in OPAMPx_OTR starting from 0b00000 until CALOUT
changes to 0 in OPAMPx_CSR.
Note: Between the write to the TRIMOFFSETP and TRIMOFFSETN bits 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 TRIMOFFSETP and TRIMOFFSETN bits.
Repeat steps 3 to 4 for:
Normal mode and P differential pair, CALSEL = 01
High-speed mode and N differential pair
High-speed mode and P differential pair
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 µA.
If the OPAMP output is internally connected to an ADC channel and disconnected from the
output pin (OPAINTOEN = 1 in the OPAMPx_CSR register), the offset trimming procedure
differs from the case where the OPAMP output is connected to the output pin
(OPAINTOEN = 0). The calibration procedure is the similar as above but the CALOUT bit
change detection cannot be used as indicated in step 4. Instead, the ADC output data must
be used as indicator to detect the OPAMP output change: a change of CALOUT from 1 to 0
corresponds to the change of ADC output data from values close to the maximum ADC
output to values close to the minimum ADC output (the ADC works as a comparator
connected to the OPAMP output). Another solution is to perform the calibration with
OPAINTOEN = 0, and then change OPAINTOEN to 1. In this case, the OPAMP output GPIO
toggles during the calibration and care must be taken that there is no conflict on this GPIO.
25.3.8 Timer controlled Multiplexer mode
The selection of the OPAMP inverting and non inverting inputs can be done automatically. In
this case, the switch from one input to another is done automatically. This automatic switch
is triggered by the TIM1 CC6 or TIM8 CC6 or TIM20 CC6 output arriving on the OPAMP
input multiplexers.
This is useful for dual motor control with a need to measure the currents on the 3 phases
simultaneously on a first motor and then on the second motor.
The automatic switch is enabled by setting the TxCMEN bit, x = 1,8,20, in the OPAMP
switch control register. The inverting and non inverting inputs selection is performed using

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32G431 and is the answer not in the manual?

ST STM32G431 Specifications

General IconGeneral
BrandST
ModelSTM32G431
CategoryMicrocontrollers
LanguageEnglish

Related product manuals