HT8 MCU OPA Application Descriptions
Transcript of HT8 MCU OPA Application Descriptions
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 1 / 13 August 30, 2020
HT8 MCU OPA Application Descriptions
D/N:AN0521EN
Overview
In this application note the integrated operational amplifiers within four MCUs are introduced. The
MCUs in question are the HT66F45x0 series, HT45F56, HT45F5Q-2, and HT66FM(5230, 5240,
5242, 5440) series.
The HT66F45x0 series op-amp features include multiple switch and input path selections, multiple
reference voltage selections, multiple internal software gain controls, debounce time control,
hysteresis, input offset voltage calibration and four-bandwidths of 5kHz, 40kHz, 600kHz and 2MHz.
Software control allows users to adjust the op-amp bandwidth based on the required application
response speed. The device power consumption can also be optimisied by selecting a suitable
bandwidth. These features combine to enhance the circuit flexibility allowing them to be widely
used in a variety of applications such as smoke detectors and other related products.
The HT45F56 MCU contains an internal vibration detection circuit. In order to detect a tiny
vibration external analog signal, it integrates a 1~1000 gain PGA, a comparator and a 6-bit DAC
which can internally set a threshold voltage. This can then switch the input comparison path
multiplexer through an internal register. An external circuit can be matched with a variety of sensors
such as piezoelectric vibration sensors, magnetic induction vibration sensors, etc.
The HT45F5Q-2 MCU contains a charging management module which is divided into two parts. The
first part contains two OPAs and DACs for controlling the charging voltage and current. The charger's
constant voltage mode (CV) and constant current (CC) mode upper limit can be setup using the
programmable DAC. The CV control uses a 12-bit DAC while the CC control uses an 8-bit DAC. The
second part is a set of fixed gain OPAs which can be used to increase the current resolution and reduce
any power losses in the current detect resistor.
The HT66FM series of MCUs include a fully integrated phase current sensing circuit for motor
protection drive circuits.
The application note also describes the application and characteristic parameters of other common
op amp functions, such as non-inverting amplifiers, inverting amplifiers and voltage followers,
adders and subtractors, etc. The two OPA principles which are most important are those of the
virtual short and virtual open. For the virtual short point of view the two input terminals appear to
be short-circuited, that is they remain at the same potential. For the virtual open, the input
impedance appears as infinite, which is equivalent to the open circuit. This is to imply that the
current flowing into the positive and negative input terminals is effectively zero.
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 2 / 13 August 30, 2020
OPA Basic Concepts
Signal amplification is one of the most basic signal processing functions. Whenever a signal provided
by a sensor is very weak, for example, in the microvolt or millivolt range and whose energy is low,
signal amplification is required. Because the signal is weak, the reliability of the MCU signal
processing is poor, however if the signal amplitude is increased then signal processing becomes much
easier. When the signal is amplified, issues of linearity need to be considered. When considering signal
amplification, it is also necessary to pay attention to the OPA characteristics to avoid distortion in the
amplified signal, a phenomenon that no designer wishes to witness.
Functional Description
HT66F45x0 Series OPA Application Description
The internal OPA structure of the HT66F45x0 series is shown below. These MCUs also include a 12-
bit ADC. Both OPAs have a function whereby the input offset voltage can be adjusted. The devices
also have three 8-bit DACs. The two OPAs can be set to operate as unity gain buffers by the application
program as shown in Fig. 1 and Fig. 2. The OPA input offset voltage adjustment range can be set
according to user application requirements. Refer to the datasheet (VOS parameters in the OPA
characteristics table) to see how to adjust the internal offset. The offset voltage in the general
applications will be close to 0V.
Basic OPA application
OPA0: Can be used for current signal conversion or amplification, such as infrared signal detection
of smoke detectors or current detection of induction cookers.
OPA1: This is a programmable gain amplifier, PGA. The positive input can control the DC bias
through the internal 8-bit DAC or from an external resistor divider. It can also select the first stage
OPA0 output signal, OPA0O. The internal software program selects the (positive/negative) input of
OPA1 and then sets the second-stage either non-inverting or inverting amplification through the
internal switching circuit. The negative input of OPA1 can be controlled by internal software to set
the gain (as shown below), or an external resistor divider can be used to set the gain. The output of
both OPAs can be converted using a software control A/D channel input. For a wider range of
applications refer to the working principles of the HT66F45x0 series.
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 3 / 13 August 30, 2020
A0NI
A0PI
A1PI
A1NI
OPA0-
+A0O
R2
OPA0O
SDDAC0O
OPA1+
-A1O
8BitDAC0
OPA0O
SDDAC0O
OPA1O
(To A/D Converter)
(To A/D Converter)
SDA0OFMSDA0O
SDA1OFMSDA1O
HT66F45x0 Series Internal OPA Structure
A0NI
A0PI OPA0
-
+A0O
R2
8BitDAC0
OPA0O
SDDAC0O (To A/D Converter)
SDA0OFMSDA0O
Fig.1 OPA0 setup for voltage follower
A1PI
A1NI
OPA0O
SDDAC0O
OPA1+
-A1O
OPA1O (To A/D Converter)
SDA1OFMSDA1O
Fig.2 OPA1 setup for voltage follower
Example: For OPA1, when an inverting/non-inverting amplifier is setup, use the internal gain to
amplify the input signal
OPAMP1-
+
SDA1EN
SDS4
A0O
SDS3
SDS5
SDS6A1PI
SDS2
R1 R2A1NI
SDDAC0O
SDS7
SDPGA[2:0]
A1O
SDA1BW[1:0]
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 4 / 13 August 30, 2020
Circuit connections:
Inverting Amplifier Non-Inverting Amplifier
A1NI connected to VIN - A1PI connected to GND A1NI connected to GND - A1PI connected to VIN
OPA-
+VO
VIN
R1
R2
VO = −
R2
R1VIN
OPA-
+VIN
VO
R1
R2
VO = (1 +
R2
R1)VIN
HT45F56 OPA Application Description
The internal structure of the HT45F56 is shown below. The integrated PGA (x1~1000) is used to
amplify smaller analog input signals such as those from vibration sensors. The integrated CMP and
6-Bit R-2R DAC (DAC0) are then used to form a complete vibration sensing structure. For signal
amplification and comparison circuit details, refer to the HT45F56working principles.
DAC0
MUX
SENSORAnalog Inputs
Analog InputsAN1 / NA2
+
-CMP
MCU I/O
Gain:1~1000 15-level programmable gain
6 bis
-+PGA
HT45F5Q-2 OPA Application Description
The HT45F5Q-2 MCU has three integrated OPA structures as described below:
OPA0 and the 8-bit DAC0 are combined into a current error amplifier for charger constant
current control
OPA1 and the 12-bit DAC1 are combined into a voltage error amplifier for charger constant
voltage control
For detailed constant current and constant voltage operation, refer to the HT45F5Q-2 working
principles
OPA2 is a x10x non-inverting amplifier for current signal amplification to improve current
resolution to allow the use of lower value current sense resistors
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 5 / 13 August 30, 2020
OPA0E
DAC0EN
+-
OPA0N
D[7:0]
10KOPA0P
OPA0
AVDD
OPA1E
DAC1EN
+-
OPA1N
D[11:0]
10KOPA1P
AVDD
OPA1
OPA2-+OPA2P
10xA2P
R
9R
SAOPIN OP2EN
OOFMOPO
OOF[5:0]
OOFM
12-bit DAC1Ro=13K
8-bit DAC0Ro=10K
HT66FM Series OPA Application Description – HT66FM5230/5240/5242/5440
These MCUs include an overcurrent detection module that consists of an amplifier OPA0 (Av is
about 1/5/10/20 times), a 12-bit ADC, an 8-bit DAC, and a CMP0. If an overcurrent condition is
detected, the external motor drive circuit will be turned off in real time to avoid the motor being
damaged.
Two interrupts are used to detect overcurrent conditions:
1. ADC Interrrupt - Int_AHL_Lim
The Int_AHL_Lim interrupt has higher flexibility and can be selected by a software ADR value
and the ADLVD/ADHVD interrupt trigger condition. After comparison, the range can be used as
a buffer protection action.
2. CMP0 Interrupt - Int_Is
Int_Is can be used as a hardware emergency trigger interrupt protection where the external motor
drive circuit can be turned off immediately.
+
-
OPCM
Int_Is AP
OPA0 : Av=1/5/10/20
8-bitDAC
OPA0CMP0
Int_AD_EOC or int_AD_ISEOC
Int_AHL_ Lim
ADC
ADR
EOCB or ISEOCB
AD HL/LVTrigger
IntTrigger
ADLVD/ADHVD
OPA0 Output
PB0/OPA0O
PB0S[2:0]12-bit ADC
C0BPEComparator 0
Int A/D
Int_Is
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 6 / 13 August 30, 2020
Operating Principles
HT66F45x0 Series Operating Principles
The HT66F45x0 series is an MCU that can be applied for use in smoke detection. The external DC
bias voltage on the OPA0 positive input is supplied by an external resistor divider. When the IR
receives a signal, the current-to-voltage conversion is implemented by the R12 resistor. The converted
signal is transmitted via the AC coupling capacitor. After this, the second-stage OPA1 non-inverting
amplifier circuit receives this input and can set the input offset and the gain by the R14 resistor. The
second-stage amplification OPA1 outputs the amplified signal to the internal A/D. The analog signal
then triggers the interrupt to initiate the following on processing. In this way a full smoke detection
function can be implemented.
HT66F45x0 Series Smoke Detector
HT45F56 Operating Principles
The HT45F56 is an MCU which includes a vibration detection function. The device can detect small
external analog signals, amplify them using a PGA with a 15-level programmable gain of 1-1000 and
then compare them using a CMP and an internal 6-bit DAC threshold. The vibration sensitivity can be
determined by the internal PGA gain and the 6-bit DAC. The CMP digital signal output can directly
trigger an interrupt, or the number of pulses can be monitored to determine the vibration signal
magnitude. A single resistor can be connected in series at one end of the sensor to prevent voltages
which might be too large. The external circuit can be matched with a variety of sensors, such as
piezoelectric vibration sensors, magnetic induction vibration sensors, etc.
0.1µF
S N
Magnet Sensor
AD1AD2
+
−
CMPEN
CMPOP Debounce Circuit
DebounceInterrupt
CMPHY[1:0]
Pin-shared select
MUX
6-bitD/ADA[5:0]
CNSEL[1:0]
MUX
CPSEL[1:0]
SENOPA
GAS[3:0]
OPAEN
DSTAG[2:0]ComparatorInterrupt
HT45F56 Sensor Module
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 7 / 13 August 30, 2020
HT45F5Q-2 Operating Principles
The HT45F5Q-2 has an internal charge management module, which includes three OPAs (OPA0~2),
an 8-bit DAC (DAC0) and a 12-bit DAC (DAC1). The Open Drain OPA0 ~1 and DAC0~1 are used
for CV and CC signal control. The OPA output can be directly connected to an optocoupler, so that
the primary side PWM IC can adjust the output power. The integrated 10x signal amplification OPA
(OPA2) is used to amplify the charging current signal, improve current resolution and reduce power
losses in the current detect resistance. The following describes the CV mode, CC mode and 10 times
signal amplification OPA usage.
HT45F5Q-2 Battery Charging Module
Note: 1. OPA0 and OPA1 have no input offset calibration function (hardware limit).
2. OPA2 has an input offset calibration function (accuracy ±2 mV).
3. OPA0 and OPA1 are open-drain output types.
Constant Current Mode – CC
Constant current charging means charging at a fixed current regardless of how the internal
resistance of the battery changes. The principle is that the charging current generates a voltage
(V=I×R) through the detecting resistor R1. This is transmitted from the OPA0N to the negative end
of the OPA0. The OPA0N and DAC errors are amplified by the OPA0 output OPAE (NMOS) and
transmitted to the PWM IC via the optocoupler. If the OPA0N voltage is lower than the DAC (DA0)
voltage, the PWM IC increases the PWM duty cycle, otherwise it reduces the PWM duty cycle.
Note: DAC0 (8-bit DAC) (DA0) is the maximum current threshold.
Constant Voltage Mode – CV
Constant voltage charging is a fixed voltage charging regardless of the internal resistance of the battery.
The principle is that the charging voltage (B+) is divided by the resistor dividers R4 and R5 and is
transmitted from the OPA1N to the negative terminal of OPA1. The OPA1N and DAC errors are
amplified by the OPA1 output OPAE (NOMS) and transmitted to the PWM IC via the optocoupler. If
the OPA1N voltage is lower than the DAC voltage, the PWM IC increases the PWM duty cycle,
otherwise it reduces the PWM duty cycle.
Note: DAC1 (12-bit DAC) (DA1H and DA1L) is the maximum voltage threshold.
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 8 / 13 August 30, 2020
HT66FM Series Operating Principles Description –
HT66FM5230/5240/5242/5440
The HT66FM series of MCUs contain an overcurrent detection circuit, including an integrated OPA0
amplifier circuit (Av about 1, 5, 10 or 20 times), can be selected by PB0S whether to output through a
pin-sharing configuration and through a high-speed (2μs) 12-bit ADC, 8-bit DAC and CMP circuit to
monitor the presence or absence of overcurrent during motor driving. If an overcurrent situation should
occur, then immediately turn off the external gate drive circuits to avoid the motor being damaged.
HT66FM5440 Brushless Motor Control Driver Circuit
Over Current Protection – OCP
Motor current sampling is obtained using a current sampling resistor. When the current flows through
R_Shunt, a small voltage signal is generated. It needs to be amplified by the OPA in the OCP circuit
and then the ADC measured value or the DAC is used together with the CMP to determine whether
an overcurrent situation exists.
Characteristics and Parameter Description
Ideal OPA Characteristics
An ideal operational amplifier (ideal OP-AMP) should have the following characteristics:
● Infinite input impedance (ZIN=∞): The input of an ideal op amp does not allow any current
to flow in, that is, the input impedance is infinite.
● Output impedance close to zero (ZOUT = 0): The output of an ideal op amp is a perfect voltage
source. The output voltage of the amplifier is always constant regardless of the current flowing
to the amplifier load. Therefore its impedance is zero.
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 9 / 13 August 30, 2020
● Infinite open-loop gain (Ad=∞): An important property of an ideal op amp is that it has an
infinite voltage gain on the differential signal in the open-loop state. This feature makes the
op amp suitable for negative feedback configurations in actual applications.
● Infinite common-mode rejection ratio (CMRR=∞): An ideal op amp can only react to the
difference between the positive and negative input voltages. The same voltage on both of
the two-input signals (ie, the common-mode signal) will be completely ignored.
● Power supply voltage rejection ratio (PSRR=∞): This refers to the ability of the OPA to
maintain its output voltage when its DC supply voltage changes.
● Infinite bandwidth (BW=∞): An ideal op amp will amplify the same differential gain for any
frequency input signal and not be affected by changes in signal frequency.
● Offset is zero (OFFSET=0): The output is also zero when the input is zero.
OPA D.C Characteristic Description
There is no single OPA specification standard, therefore the behavior of a specific OPA should be
based on the corresponding specification. Detailed characteristic parameters are as follows.
OPA Characteristic Characteristic Description
VDD
OPA operating voltage range: This means that the OPA can meet the following characteristics within the working voltage range. If this voltage range does not match the MCU voltage range (for example, the MCU operating voltage range is 2.2V~5.5V), then pay attention to the actual voltages verified and used.
IQ OPA static current consumption (IOUT=0), specified as the current under no-load conditions
IOPA OPA operating power consumption, IOPA, specified as the power consumption of MCU when OPA on – power consumption current of MCU when OPA off
VOS
Input offset voltage (VOS) definition: In order to make the output voltage of the op amp equal to 0, it is necessary to add a small voltage to the two input terminals of the op amp. The small voltage that needs to be added is the input offset voltage VOS at the input end. This is mainly due to the mismatch between the differential input stage of the op amp. The smaller the VOS, the higher the matching degree of the OPA positive and negative input. Due to the limitations of the layout and the process, a perfect match is not possible. VOS=negative input voltage – positive input voltage (ideally zero)
IOS Input Offset Current (IOS) Definition: When the output DC voltage of the op amp is zero, the difference between the bias currents of the two inputs is IOS.
VCM
Common Mode Input Range (VCM) Definition
VCM = �(VIN+)+(VIN−)2
� (the lower the better)
Common mode input voltage is when the op amp's common-mode rejection ratio is significantly degraded when the op amp is operating within the linear region. Generally the CMRR is reduced to a certain value, such as 60dB.
CMRR(dB) = 20log �Gain×VCMVOUT
�
Gain is the differential mode gain of the amplifier, VCM is the common mode voltage present at the input and VOUT is the result of the input common mode voltage at the output.
VOR
The maximum output range (VOR) of the OPA is defined as the maximum voltage amplitude that the op amp can output when the current supply voltage is supplied under the specified load (VOR is the maximum and minimum voltage that the output MOS transistor can output. The result should be very close to the power supply.)
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 10 / 13 August 30, 2020
OPA A.C. Characteristic Description
OPA Characteristic Functional Description
AOL
Differential Mode Open Loop DC Voltage Gain (AOL): Defined as the ratio of the op amp output voltage to the differential mode input voltage when the op amp is operating in the linear region. Here open loop means operating without feedback. The amplification factor of the operational amplifier is called open loop gain. AOL=20log (△VOUT÷△VOS)
SR The conversion rate, also called slew rate, is defined as the output rise rate of the op amp measured from the output of the op amp when the op amp is in a closed loop condition and the input has a large signal which can include step signals.
GBW Gain bandwidth product definition: For an op-amp with a closed loop gain of 1 a small sinusoidal signal is input to the input of the op amp. The frequency corresponding to the 3dB point is then measured.
OPAMP Characteristic Description
OPA Characteristic Functional Description
PSRR
Power Supply Rejection Ratio (PSRR) Definition: The ratio of the op amp's input offset voltage to the power supply voltage when the op amp is operating in the linear region. (PSRR=20log(△VOS÷△VDD)) PSRR: For the noise immunity value of the power supply (the larger the value, the better), the smaller the output signal is affected by the power supply, the lower the noise/ripple. The calculation result of this equation is generally zero. For example, for an amplifier PSRR = 100dB, when applied to an application with a closed loop gain = 40dB, the overall circuit PSRR is: 100dB - 40dB = 60dB Thus, when the power supply has 1V of noise, the output noise is: 1V×10-60⁄20= 0.001V=1mV
CMRR
Common Mode Rejection Ratio (CMRR) Definition: The ratio of the op amp's differential mode gain to the common mode gain when the op amp is operating in the linear region (CMRR=20log(△VIN÷△VOS))
RO
The output impedance (RO) is defined as: ROUT = RO⁄(1+AO /β). The RO is determined by the internal output stage of the op amp and does not vary with the closed loop gain. It can be seen as a parameter inherent within the op amp. ROUT is different. This is the impedance that the op amp sees from the output after it forms a closed-loop amplifier circuit. It needs to be measured at the output. It will change as the closed loop gain changes.
OPA Basic Circuits
A variety of amplifier circuits can be formed by externally connecting different resistors and capacitors.
The following figure shows several practical amplifier circuits and formulas.
Inverting Amplifier Non-inverting Amplifier
OPA-
+VO
VIN
R1
R2
VO = −R2
R1VIN
OPA-
+VIN
VO
R1
R2
VO = (1 +R2
R1)VIN
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 11 / 13 August 30, 2020
Adder Subtractor
-
+OPA
RFR1
R2
R3
RN
VA
VB
VC
VN
Vo
VO = (−RF)[VAR1
+VBR2
+VCR3
+VNRN
]
-
+OPA
R2
R1
R2
VA
VB
R1
VO
VO = (VB−VA)[R2
R1]
Voltage Follower Low Pass Filter/Integrator
OPA-
+VIN
VO
VO = VIN
-
+OPA
RF
VINR1
VO
C
T = RC = RFC
VO = VIN �−RF
R1×
1RFCS + 1
�
High Pass Filter/Differentiator
-
+OPA
RF
VIN
R1
VO
C
VO = VIN �−RF
RIN×
RINCSRINCS + 1
�
Precautions when using the op amps
1. Note whether the amplified signal is a DC signal or an AC signal.
2. Note whether it is non- inverting amplification or inverting amplification.
3. It is necessary to pay attention to whether the maximum value of the input signal multiplied by
the amplification factor exceeds the power supply voltage of the OPA.
OPA Input Voltage Range
For operational flexibility, the input voltage can be positive or negative in different PGA operation modes.
When the input voltage VIN > 0, the PGA is set to operate in the non-inverting mode and the OPA
output VOUT = (1 + R2R1
)VIN.
When the input voltage VIN < 0, the PGA is set to operate in the inverting mode and the OPA output
VOUT = −(R2R1
)VIN.
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 12 / 13 August 30, 2020
Note: If the input voltage is negative, its value should not be less than -0.2V to avoid current leakage
which will affect the OPA normal performance.
Application Range
1. HT66F45x0 series is used in smoke detectors, handheld measuring tools, environmental
monitoring, voice which can be used for audio, OCP, OVP and other applications.
2. The HT45F56 can be applied for small signal amplification, such as piezoelectric vibration
sensors, magnetic induction vibration sensors and so on.
3. The HT45F5Q-2 is used in a variety of charging systems.
4. The HT66FM (5230, 5240, 5242, 5440) series has a phase current detection module for motor
protection.
Conclusion
This application note has introduced the operational amplifiers within four MCUs. It has described
the internal OPA functions and also notes for their practical application. What has been described
here can be used for similar OPAs within other MCUs.
Reference Material
For more information consult the HT66F45x0 series, HT45F56, HT45F5Q-2 and
HT66FM5230/5240/5242/5440 series datasheets.
For more information consult the Holtek website: www.holtek.com.
Version and Modification Information
Versions Information Date Author Issue
2020.07.23 吳嘉乾 V1.10
2019.01.29 蔡俊男 V1.00
Modification Information
V1.10:Title modified.
HT8 MCU OPA Application Descriptions
AN0521EN V1.10 13 / 13 August 30, 2020
Disclaimer
All information, trademarks, logos, graphics, videos, audio clips, links and other items appearing
on this website ('Information') are for reference only and is subject to change at any time without
prior notice and at the discretion of Holtek Semiconductor Inc. and its related companies
(hereinafter 'Holtek', 'the company', 'us', 'we' or 'our'). Whilst Holtek endeavors to ensure the
accuracy of the Information on this website, no express or implied warranty is given by Holtek to
the accuracy of the Information. Holtek will bear no responsibility for any incorrectness or leakage.
Holtek will not be liable for any damages (including but not limited to computer virus, system
problems or data loss) whatsoever arising in using or in connection with the use of this website by
any party. There may be links in this area, which allow you to visit the websites of other companies.
These websites are not controlled by Holtek. Holtek will bear no responsibility and no guarantee to
whatsoever Information displayed at such sites. Hyperlinks to other websites are at your own risk.
Limitation of Liability
In no event shall Holtek Limited be liable to any other party for any loss or damage whatsoever or
howsoever caused directly or indirectly in connection with your access to or use of this website, the
content thereon or any goods, materials or services.
Governing Law
The Disclaimer contained in the website shall be governed by and interpreted in accordance with
the laws of the Republic of China. Users will submit to the non-exclusive jurisdiction of the
Republic of China courts.
Update of Disclaimer
Holtek reserves the right to update the Disclaimer at any time with or without prior notice, all
changes are effective immediately upon posting to the website.