In this document, we will introduce how to use the amplifier function on the MB95F430 series.
Chapter 2 gives an overview on operational amplifier.
Chapter 3 introduces the operations of operational amplifier.
Chapter 4 introduces Operational Amplifier setting procedure.
Chapter 5 introduces amplifier drivers.
Chapter 6 introduces amplifier application demo.
MCU-AN-500080-E-10 - Page 4
Operational Amplifier Version 1.0
Chapter 2 Amplifier Overview
2 Amplifier Overview Amplifier Overview
The operational amplifier can be used to sense the ground current, and support front-end
The operational amplifier can be used to sense the ground current, and support front-end
analog signal conditioning prior to A/D conversion. It can operate in either closed loop mode or
analog signal conditioning prior to A/D conversion. It can operate in either closed loop mode or
standalone open loop mode.
standalone open loop mode.
■ Closed Loop Mode ■ Closed Loop Mode
The operational amplifier can be configured as a non-inverting closed loop operational
The operational amplifier can be configured as a non-inverting closed loop operational
amplifier.
amplifier.
It has six software-selectable closed loop gain options for ground current sensing according to
It has six software-selectable closed loop gain options for ground current sensing according to
different sense voltage values.
different sense voltage values.
■ Standalone Open Loop Mode
In this mode, the operational amplifier input pins are connected to external signals without any
output feedback.
The standalone open loop mode is designed for users that can choose more flexible gain using
external resistors.
MCU-AN-500080-E-10- Page 5
Operational Amplifier Version 1.0
Chapter 2 Amplifier Overview
2.1 Block Diagram of Operational Amplifier
Figure 1 Block Diagram of Operational Amplifier
2.2 Pins of Operational Amplifier
The OPAMP uses the OPAMP_P pin and the OPAMP_N pin as the analog input pins of the
operational amplifier, and uses the OPAMP_O pin as the analog output pin of the operational
amplifier.
When GS [5] is set to "1B" and GS [4:0] is set to "00000B", the OPAMP will work as a
standalone open loop operational amplifier.
When GS [5] is set to "0B", the OPAMP will work as a non-inverting closed loop operational
amplifier. It provides six different closed loop gain settings through the software.
MCU-AN-500080-E-10 - Page 6
Operational Amplifier Version 1.0
Chapter 2 Amplifier Overview
2.3 OPAMP Control Register
The OPAMP control register (OPCR) is used to turn on and off the OPAMP, to enable and
disable OPAMP analog output, and to enable and disable OPAMP analog input.
The register can also be used to set the OPAMP to operate as a standalone open loop
operational amplifier, or a non-inverting closed loop operational amplifier with six different
closed loop gain settings that can be selected by the software.
Figure 2 OPAMP Control Register
MCU-AN-500080-E-10- Page 7
Operational Amplifier Version 1.0
Chapter 2 Amplifier Overview
■ Functions of Bits in OPAMP Control Register (OPCR)
■ OPAMP Operating Mode Settings
Notes:
•While the OPAMP is operating, modifying the settings of RES2, RES1 and RES0 is allowed,
however, do not use the output signal of the OPAMP or execute A/D conversion until OPAMP
output becomes stable.
•It is recommended to turn off the operational amplifier before modifying the settings of RES2,
RES1 and RES0.
MCU-AN-500080-E-10 - Page 8
Operational Amplifier Version 1.0
Chapter 3 Operations of Operational Amplifier
3 Operations of Operational Amplifier Operations of Operational Amplifier
The operational amplifier can be activated by setting the PD bit in the OPCR register using the
The operational amplifier can be activated by setting the PD bit in the OPCR register using the
software. It can operate in closed loop mode or open loop mode, depending on the settings of
software. It can operate in closed loop mode or open loop mode, depending on the settings of
the RES2, RES1 and RES0 bits in the OPCR register.
the RES2, RES1 and RES0 bits in the OPCR register.
■ Activating Operational Amplifier by Software ■ Activating Operational Amplifier by Software
The settings shown in Figure 24.5-1 are required for activating the operational amplifier using
The settings shown in Figure 24.5-1 are required for activating the operational amplifier using
the software.
the software.
Figure 3 Settings for Activating Operational Amplifier
After the bits in the OPCR register are set as shown above, the operational amplifier will not
After the bits in the OPCR register are set as shown above, the operational amplifier will not
start operating until it stabilizes.
start operating until it stabilizes.
■ Operations of OPAMP in Closed Loop Mode ■ Operations of OPAMP in Closed Loop Mode
Before being activated, the operational amplifier can be set to operate in closed loop mode in
Before being activated, the operational amplifier can be set to operate in closed loop mode in
advance by setting RES[2:0] in the OPCR register to "000B", "001B", "010B", "011B", "100B" or
advance by setting RES[2:0] in the OPCR register to "000B", "001B", "010B", "011B", "100B" or
"101B".
"101B".
Six different closed loop gains are available to be used in closed loop mode. Select a desired
Six different closed loop gains are available to be used in closed loop mode. Select a desired
closed loop gain by setting RES[2:0] in OPCR to the value corresponding to that gain.
closed loop gain by setting RES[2:0] in OPCR to the value corresponding to that gain.
■ Operations of OPAMP in Open Loop Mode
Before being activated, the operational amplifier can be set to operate in open loop mode in
advance by setting RES [2:0] in the OPCR register to "110B".
MCU-AN-500080-E-10- Page 9
Operational Amplifier Version 1.0
Chapter 4 Amplifier setting procedure
4 Amplifier setting procedure
Below is an example of procedure for setting the operational amplifier.
● Initial settings
1) Set both OPCR: OPID and OPCR: OPOD to "0" to enable both OPAMP analog input and
OPAMP analog output.
2) Set the feedback resistor and RES [2:0] in OPCR.
3) Set OPCR: PD to "0" to turn on the operational amplifier.
4) Wait until the operation amplifier stabilizes.
5) Start A/D conversion if necessary.
MCU-AN-500080-E-10 - Page 10
Operational Amplifier Version 1.0
Chapter 5 Amplifier Driver
5 Amplifier Driver
This is OPAMP driver description.
5.1 Peripheral Usage
The MCU pins used as below:
OPAMP_N,used as amplifier negative input;
OPAMP_P,used as amplifier positive input;
OPAMP_O,used as amplifier output;
5.2 Driver Code
5.2.1 General Definition
typedef unsigned char BOOLEAN;
typedef unsigned char INT8U; /* Unsigned 8 bit quantity */
typedef signed char INT8S; /* Signed 8 bit quantity */
typedef unsigned int INT16U; /* Unsigned 16 bit quantity */
typedef signed int INT16S; /* Signed 16 bit quantity */
typedef unsigned long INT32U; /* Unsigned 32 bit quantity */
typedef signed long INT32S; /* Signed 32 bit quantity */
{
DDR6_P60=0;
DDR6_P61=0;
DDR6_P62=1;
OPCR=0x40;//Amplifier gain is 20V/V
}
MCU-AN-500080-E-10 - Page 12
Operational Amplifier Version 1.0
Chapter 6 Typical Application
6 Typical Application
This is the typical application introduction.
6.1 HW Design
In this application, we will test the operational amplifier in the MB95F430K. The HW is designed
as below. The R1, R2, R3 is used in open-loop amplifier.
Figure 4 Hardware Design
6.2 Sample Code
void main(void)
Return : none.
Parameters : none;
Description : system main programm.
Example : main();
This function is a placeholder for all vector definitions.
Either use your own placeholder or add necessary code here
(the real used resource interrupt handlers should be defined in the main.c).
-----------------------------------------------------------------------------*/
__interrupt void DefaultIRQHandler(void)
{
__DI(); // disable interrupts
while(1)
__wait_nop(); // halt system
}
MCU-AN-500080-E-10 - Page 18
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.