RM0366
that causes the OUTCAL bit to change from 1 to 0 in the OPAMP register. If the OUTCAL bit
is reset, the offset is calibrated correctly and the corresponding trimming value must be
stored.
The calibration of the PMOS differential pair is performed in the same way, with two
differences: the TRIMOFFSETP bits-fields are used and the CALSEL bits must be
programmed to '01' (an internal low voltage reference (0.1 x V
on the inverting and non inverting OPAMP inputs connected together).
Note:
During calibration mode, to get the correct OUTCAL value, please make sure the
OFFTRIMmax delay (specified in the datasheet electrical characteristics section) has
elapsed between the write of a trimming value (TRIMOFFSETP or TRIMOFFSETN) and the
read of the OUTCAL value,
To calibrate the NMOS differential pair, use the following software procedure:
1.
Enable OPAMP by setting the OPAMPxEN bit
2.
Enable the user offset trimming by setting the USERTRIM bit
3.
Connect VM and VP to the internal reference voltage by setting the CALON bit
4.
Set CALSEL to 11 (OPAMP internal reference =0.9 x V
5.
In a loop, increment the TRIMOFFSETN value. To exit from the loop, the OUTCAL bit
must be reset. In this case, the TRIMOFFSETN value must be stored.
The same software procedure must be applied for PMOS differential pair calibration with
CALSEL = 01 (OPAMP internal reference = 0.1 V
15.3.6
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 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
instantaneously on a first motor and then on the second motor.
The automatic switch is enabled by setting the TCM_EN bit in the OPAMP control register.
The inverting and non inverting inputs selection is performed using the VPS_SEL and
VMS_SEL bit fields in the OPAMP control register. If the TCM_EN bit is cleared, the
selection is done using the VP_SEL and VM_SEL bit fields in the OPAMP control register.
Legend:
Figure 82. Timer controlled Multiplexer mode
CCR6
ADC sampling points
Sec
Def
OPAMP input selection type
RM0366 Rev 5
Operational amplifier (OPAMP)
).
DDA
T1 counter
T8 counter
T1 output (1 out of 3)
T8 output (1 out of 3)
T1 CC6 output arriving on OPAMP input mux
Sec
Def
Sec
OPAMP input selection:
Def = default OPAMP input selection
Sec = secondary OPAMP input selection
) is generated and applied
DDA
)
DDA
MS192230V2
305/874
312
Need help?
Do you have a question about the STM32F301 6 Series and is the answer not in the manual?