A-D Converter OP-AMP Gain Adjustment Connection Mode
1. Abstract
This application note describes the operation of gain adjustment by using operational amplifier for A-D converter.
2. Introduction
This application note is applied to the M16C/62 group Microcomputers.
This program can be also operated under the condition of M16C family products with the same SFR (Special Function
Register) as M16C/62 Group products. Because some functions may be modified of the M16C family products, see the user’s
manual. When using the functions shown in this application note, evaluate them carefully for an operation.
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 1 of 13
A
A
A
A
A
A
A
A
A
A
A
A
M16C/62 Group
A-D Converter OP-AMP Gain Adjustment Connection Mode
3. Detailed description
This example describes the operation of gain adjustment by using external operational amplifier for M16C/62 group
microcomputers.
3.1 Example of wiring
Figure 1 illustrates the operation of gain adjustment by using external operational amplifier.
380k
330k
270k
220k
170k
150k
120k
100k
7
+5V
VCC
VCC
VREF
N7
N6
N5
N4
N3
N2
N1
N0
NEX0
NEX1
VSS
VSS
M16C/62 group
100k
BA4558
100k
6
+
5
Input
100k
+12V
2
8
-
+
3
1
4
-12V
Figure1. Example of wiring
Note
(1)In this example, using 2nd inverting amplified circuit, feedback to in-phase.
The result shows a difference from this sample when use non-inverting amplified circuit.
(2)In this example, values input to AN0 to AN7 are amplified as below, due to the ratio of the value of resistance.
AN0: 100k/100k=1 (1 time amplified)
AN1: 120k/100k=1.2 (1.2 times amplified)
AN2: 150k/100k=1.5 (1.5 time amplified)
AN3: 170k/100k=1.7 (1.7 times amplified)
AN4: 220k/100k=2.2 (2.2 times amplified)
AN5: 270k/100k=2.7 (2.7 times amplified)
AN6: 330k/100k=3.3 (3.3 times amplified)
AN7: 380k/100k=3.8 (3.8 times amplified)
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 2 of 13
A
A
M16C/62 Group
A-D Converter OP-AMP Gain Adjustment Connection Mode
3.2 How to set up
This section shows the setting procedures when A-D conversion is carried out, for the output of the gain adjustment, by using
external operational amplifier. Examples of A-D conversion with sample & hold function for one-shot mode and 10-bit mode are
described.
(1) Setting ADCON2 register (A-D control register 2)
Setting A-D conversion method and frequency select bit
1
b0 b7
0
SMP: A-D conv ersi o n met hod sel e ct bit
"0": Without sample & hold
"1": With sample & hold
DGSEL1-0: A-D input group select bit (Note 1)
CKS2: Frequency selected bit 2 (Note 1,2)
Note 1: Only applied to M16C/62P group. For other group please set to "00".
Note 2: Select the frequency of φAD for M16C/62P group according to the following combination.
CKS2 CKS1 CKS0
0 0 0 Divided-by-4 of fAD
0 0 1 Divided-by-2 of fAD
0 1 0
0 1 1
1 0 0 Divided-by-12 of fAD
1 0 1 Divided-by-6 of fAD
1 1 0
1 1 1
fAD
Divided-by-3 of fAD
"00": Select port P10 group
"01": Don’t set it
"10": Select port P0 group
"11": Select port P2 group
"0": fAD, fAD divided by 2 or fAD divided by 4 is selected
"1": fAD divided by 3, fAD divided by 6 or fAD divided by 12
is selected
φAD
(2) Setting ADCON0 register (A-D control register 0)
Analog input pin select bit, A-D operation mode, frequency select bit
b0 b7
0 0 0 0
CH2 to 0: Analog input pin select bit
Set input pin for A-D conversion
MD1 to 0: A-D operation mode select bit 0
Set to "00" (one-shot mode)
TRG: Trigger select bit
Set to "0" (Software trigger)
DST: A-D conversion start flag
CKS0: Frequency select bit 0 (Note 3)
Note 3: Refer to "3.2 (1) Note 2" for details the setting example for M16C/62P group.
Set to "0" (A-D conversion disabled)
"0": fAD divided by 4 is selected
"1": fAD divided by 2 is selected
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 3 of 13
M16C/62 Group
A-D Converter OP-AMP Gain Adjustment Connection Mode
(3) Setting ADCON1 register (A-D control register 1)
Setting A-D operation mode select bit 1, 8/10-bit mode select bit, frequency select bit 1, external op- amp connection
mode bit.
b0b7
0 1 1 1 1
SCAN1 to 0: A-D sweep pin select bit
Invalid in one-shot mode
MD2: A-D operation mode select bit 2
BITS: 8/10 bit mode select bit
CKS1: Frequency select bit 1 (Note 1)
VCUT: VREF connection bit
OPA1 to OPA0: External op-amp connection mode bit
Note 1: Refer to "3.2 (1) Note 2" for details the setting example for M16C/62P group.
Set to "0"
Set to "1" (10-bit mode)
"0": fAD divided by 2 or fAD divided by 4 is selected
"1": fAD is selected
Set to "1" (VREF connected)
Set to "11" (External op-amp connection mode)
(4) ADIC register (A-D interrupt control register)
b0 b7
0 0 0 0 0
ILVL2 to 0: Interrupt priority level select bit
Select interrupt priority select level
IR : Interrupt request bit
No interrupt requested
(5) Waiting until external op-amp operation is stable
Waiting until external op-amp operation is stable. (Varied from the op-amp being used)
In the wiring example of 3.1, it takes 50µs until input value to ANEX1 pin becomes stable.
About 50µs
Input to ANEX1 pin
(6) A-D conversion start
A-D conversion start when setting ADST bit of ADCON0 register to "1".
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 4 of 13
(7) Waiting for A-D conversion complete
Wait until IR bit in ADIC register reaches to "1" (interrupt request).
(8) Reading of result of A-D conversion
Read A-D register i (i=0 to 7) corresponding to selected pin in analog input select bit.
M16C/62 Group
A-D Converter OP-AMP Gain Adjustment Connection Mode
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 5 of 13
A-D Converter OP-AMP Gain Adjustment Connection Mode
4. Reference
Hardware Manual
M16C/62 group (M16C/62P) Hardware Manual Rev.1.11
M16C/62 group data sheet Rev.H2
M16C/62A group data sheet Rev.C1
M16C/62N group data sheet Rev.1.1
(Use the latest version on the web-site: http://www.renesas.com)
User’s Manual
M16C/62 group User’s Manual Rev.C3
M16C/62A group User’s Manual Rev.1.0
(Use the latest version on the web-site: http://www.renesas.com)
5. Web-site and contact for support
Renesas web-site
http://www.renesas.com/
Contact for Renesas technical support
E-mail: support_apl@renesas.com
M16C/62 Group
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 6 of 13
M16C/62 Group
A-D Converter OP-AMP Gain Adjustment Connection Mode
6. The example of a reference program
The following program shows a sequential reading of gain amplified value from AN0 to AN7 by connecting to external
operational amplifier.
;**********************************************************************
;
; M16C/62 Group Program Collection
;
; FILE NAME : rjj05b0441_src.a30
; CPU : M16C/62 Group
; FUNCTION : The example of A-D conversion at the time of external
; operational amplifier gain adjustment
; HISTORY : 2004.01.15 Ver 1.00
;
; Copyright (C) 2004. Renesas Technology Corp.
; Copyright (C) 2004. Renesas Solutions Corp.
; All right reserved.
;
;**********************************************************************
; ----- include define ---- .list off
.include sfr62p.inc
.list on
A-D Converter OP-AMP Gain Adjustment Connection Mode
.lword dummyi ;63=
;
;/////////////////////////////////////////////////////////////////////
; Non-Maskable interrupt vector table
;/////////////////////////////////////////////////////////////////////
.section vector,romdata
.org vvector
;
.lword undi ; ffffdc to f Undefined instruction interrupt
.lword ovfli ; ffffe0 to 3 Overflow interrupt
.lword brki ; ffffe4 to 7 BRK instruction interrupt
.lword addri ; ffffe8 to b Address match interrupt
.lword dummyi ; ffffec to f
.lword wdti ; fffff0 to 3 Watch-dog timer interrupt
.lword dummyi ; fffff4 to 7
.lword nmii ; fffff8 to b NMI interrupt
.lword reset ; fffffc to f RESET
;
.end
M16C/62 Group
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 11 of 13
Revision history
M16C/62 Group
A-D Converter OP-AMP Gain Adjustment Connection Mode
Rev. Issue date
1.00 2004.03.18 - First edition issued
Revised
Page Point
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 12 of 13
A-D Converter OP-AMP Gain Adjustment Connection Mode
Keep safety first in your circuit designs!
Keep safety first in your circuit designs!
1. Renesas Technology Corporation puts the maximum effort into making semiconductor products
better and more reliable, but there is always the possibility that trouble may occur with them. Trouble
with semiconductors may lead to personal injury, fire or property damage.
Remember to give due consideration to safety when making your circuit designs, with appropriate
measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or
(iii) prevention against any malfunction or mishap.
M16C/62 Group
Notes regarding these materials!
Notes regarding these materials
1. These materials are intended as a reference to assist our customers in the selection of the Renesas
Technology Corporation product best suited to the customer's application; they do not convey any
license under any intellectual property rights, or any other rights, belonging to Renesas Technology
Corporation or a third party.
2. Renesas Technology Corporation assumes no responsibility for any damage, or infringement of any
third-party's rights, originating in the use of any product data, diagrams, charts, programs,
algorithms, or circuit application examples contained in these materials.
3. All information contained in these materials, including product data, diagrams, charts, programs and
algorithms represents information on products at the time of publication of these materials, and are
subject to change by Renesas Technology Corporation without notice due to product improvements
or other reasons. It is therefore recommended that customers contact Renesas Technology
Corporation or an authorized Renesas Technology Corporation product distributor for the latest
product information before purchasing a product listed herein.
The information described here may contain technical inaccuracies or typographical errors.
Renesas Technology Corporation assumes no responsibility for any damage, liability, or other loss
rising from these inaccuracies or errors.
Please also pay attention to information published by Renesas Technology Corporation by various
means, including the Renesas Technology Corporation Semiconductor home page
(http://www.renesas.com).
4. When using any or all of the information contained in these materials, including product data,
diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total
system before making a final decision on the applicability of the information and products. Renesas
Technology Corporation assumes no responsibility for any damage, liability or other loss resulting
from the information contained herein.
5. Renesas Technology Corporation semiconductors are not designed or manufactured for use in a
device or system that is used under circumstances in which human life is potentially at stake.
Please contact Renesas Technology Corporation or an authorized Renesas Technology Corporation
product distributor when considering the use of a product contained herein for any specific
purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear,
or undersea repeater use.
6. The prior written approval of Renesas Technology Corporation is necessary to reprint or reproduce
in whole or in part these materials.
7. If these products or technologies are subject to the Japanese export control restrictions, they must
be exported under a license from the Japanese government and cannot be imported into a country
other than the approved destination.
Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the
country of destination is prohibited.
8. Please contact Renesas Technology Corporation for further details on these materials or the
products contained therein.
REJ05B0442-0100Z/Rev.1.00
March 2004
Page 13 of 13
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.