(opamps, a/d, d/a) l9: analog building blocks · the inside of a 741 opamp differential input stage...
TRANSCRIPT
L9: 6.111 Spring 2004 1Introductory Digital Systems Laboratory
L9: Analog Building BlocksL9: Analog Building Blocks
(OpAmps, A/D, D/A)(OpAmps, A/D, D/A)
Courtesy of Dave Wentzloff. Used with permission.
L9: 6.111 Spring 20042
Introductory Digital Systems Laboratory
Introduction to Operational AmplifiersIntroduction to Operational Amplifiers
DC Model Typically very high input resistance ~ 300K
High DC gain (~105)
Output resistance ~75idva
idv
inR outR
outv
inout VfaV )(
a(f)
f10Hz
105 -20dB/
decade
LM741 Pinout
+10 to +15V
-10 to -15V
(Reprinted with permission of National Semiconductor Corporation. Used with permission.)
L9: 6.111 Spring 2004 3Introductory Digital Systems Laboratory
The Inside of a 741 The Inside of a 741 OpAmpOpAmp
Differential
Input Stage
Additional
Gain Stage Output StageCurrent Source
for biasing
Bipolar version
has small input
Bias current
MOS OpAmps
have ~ 0 input
current
Gain is Sensitive to Operating Condition (e.g., Device, Temperature, Power supply voltage, etc.)
Output devices
provides large
drive current
(Reprinted with permission of National Semiconductor Corporation. Used with permission.)
L9: 6.111 Spring 2004 4Introductory Digital Systems Laboratory
Simple Model for an Simple Model for an OpAmpOpAmp
+
-
i+ ~ 0
i- ~ 0+
-
+
-vid
vout
vout
vid
VCC = 10V
-VCC = -10V
= 100 V
-100 V
Reasonable
approximation
+
-
vid+- avid
+
-vout
Linear Mode
If -VCC < vout < VCC
+
-
vid -VCC
+
-vout
Negative Saturation
vid < -
-+
+
-
vid
+
-vout
Positive Saturation
vid >
-+ +VCC
-VCC
VCC
Small input range for “Open” loop Configuration
L9: 6.111 Spring 2004 5Introductory Digital Systems Laboratory
The Power of (Negative) FeedbackThe Power of (Negative) Feedback
-
+
vid+- avid
+
-voutinv
R2
-+
R11R2R
-+ +
-outv
inv
021R
vv
R
vvidoutidin
2211
11
RR
a
Ra
v
R
v outin
a
vv outid
11 1
2
21
2 aifR
R
RRa
aR
v
v
in
out
Overall (closed loop) gain does not depend of open loop gain
Trade gain for robustness
Easier analysis approach: “virtual short circuit approach”
v+ = v- = 0 if OpAmp is linear
L9: 6.111 Spring 2004 6Introductory Digital Systems Laboratory
BasicBasic OpAmpOpAmp CircuitsCircuits
invoutv
2R
1R
inR
RR
out vv1
21
Non-invertingVoltage Follower (buffer)
1inv
outv2inv
1R
1R
2R
2R
121
2
ininR
R
outvvv
Differential Input
invoutv
inout vv
+
-
Integrator
inv
outv
R C
t
inRCout dtvv 1
L9: 6.111 Spring 2004 7Introductory Digital Systems Laboratory
Use With Open LoopUse With Open Loop
Analog Comparator:
Is V+ > V- ?
The Output is a DIGITAL signal
LM311 is a single supply
comparator
L9: 6.111 Spring 2004 8Introductory Digital Systems Laboratory
Data Conversion: Quantization NoiseData Conversion: Quantization Noise
A/D Conversion D/A Conversion
00 01 10 110
4
refV
2
refV
4
3 refV
Binary code
An
alo
g O
utp
ut
00
01
10
11
04
refV
2
refV
4
3 refV
Analog Input
Bin
ary
Ou
tpu
t
refV
Quantization noise exists even with ideal A/D and D/A converters
noisev
LSB
A/D D/A
digital
code
inv
Quantization
noise
4
refV
2
refV
4
3 refV
refVinv
L9: 6.111 Spring 2004 9Introductory Digital Systems Laboratory
NonNon--idealities in Data Conversionidealities in Data Conversion
Offset – a constant voltage offset that appears
at the output when the digital input is 0Gain error – deviation of slope from ideal value
of 1
Binary code
An
alo
g
Ideal
Offset
error
Binary code
An
alo
g
Ideal
Gain
error
Integral Nonlinearity – maximum deviation fromthe ideal analog output voltage
Differential nonlinearity – the largest increment in analog output for a 1-bit change
Binary code
An
alo
g Ideal
Non-
monoticity
Binary code
An
alo
g
Ideal
Integral
nonlinearity
L9: 6.111 Spring 2004 10Introductory Digital Systems Laboratory
RR--2R Ladder DAC Architecture2R Ladder DAC Architecture
-1
Note that the driving point impedance (resistance) is the same
for each cell.
R-2R Ladder achieves large current division ratios with only two resistor values
L9: 6.111 Spring 2004 11Introductory Digital Systems Laboratory
DAC (AD 558) Specs DAC (AD 558) Specs -- Used in Lab 3 Used in Lab 3
8-bit DAC
Single Supply Operation: 5V to 15V
Integrates required references (bandgap voltage reference)
Uses a R-2R resistor ladder
Settling time 1 s
Programmable output range from
0V to 2.56V or 0V to 10V
Simple Latch based interface
(Courtesy of Analog Devices. Used with permission.)
L9: 6.111 Spring 2004 12Introductory Digital Systems Laboratory
Chip Architecture and InterfaceChip Architecture and Interface
CE CS
LATCHD[7:0]
Outputs are noisy
when input bits settles,
so it is best to have inputs
stable before latching
the input data
(Courtesy of Analog Devices. Used with permission.)
L9: 6.111 Spring 2004 13Introductory Digital Systems Laboratory
Setting the Voltage RangeSetting the Voltage Range
Very similar to a
non-inverting amp
Strap output for
different voltage
ranges
Convert data to
Offset binary
(Courtesy of Analog Devices. Used with permission.)
L9: 6.111 Spring 2004 14Introductory Digital Systems Laboratory
Another Approach: BinaryAnother Approach: Binary--Weighted DACWeighted DAC
Analog Devices AD9768 uses two banks of ratioed currents
Additional current division performed by 750 resistor between the two banks
Switch binary-weighted currents
MSB to LSB current ratio is 2N
AD9768
3b
2b
1b 0
b
R
outv
081
141
221
3bbbbIRv
out
+-
I2
II4
I8
Reference current source(Courtesy of Analog Devices. Used with permission.)
L9: 6.111 Spring 2004 15Introductory Digital Systems Laboratory
GlitchingGlitching and Thermometer D/Aand Thermometer D/A
Glitching is caused when switching times in a D/A are not synchronized
Example: Output changes from 011 to 100 – MSB switch is delayed
Filtering reduces glitch but increases the D/A settling time
One solution is a thermometer code D/A – requires 2N – 1switches but no ratioedcurrents
100011outv
t
Binary Thermometer
0 0 0 0 0
0 1 0 0 1
1 0 0 1 1
1 1 1 1 1
0T
I
R
outv
210 TTTIRvout
I I
1T 2T
L9: 6.111 Spring 2004 16Introductory Digital Systems Laboratory
SuccessiveSuccessive--Approximation A/DApproximation A/D
D/A converters are typically compact and easier to design. Why not A/D convert using a D/A converter and a comparator?
D to A generates analog voltage which is compared to the input voltage
If D to A voltage > input voltage then set that bit; otherwise, reset that bit
This type of A to D takes a fixed amount of time proportional to the bit length
Example: 3-bit A/D conversion, 2 LSB < Vin < 3 LSB
Vin code
D/A
Comparator
out
C
L9: 6.111 Spring 2004 17Introductory Digital Systems Laboratory
SuccessiveSuccessive--Approximation A/DApproximation A/D
Successive
Approximation
Generator
Control
Done
Go
-
+Sample/
Hold
D/A
Converter
vin
N
Data
Serial conversion takes a time equal to N(tD/A + tcomp)
L9: 6.111 Spring 2004 18Introductory Digital Systems Laboratory
SuccessiveSuccessive--Approximation A/D Approximation A/D (AD670)(AD670) –– Used in Lab 3Used in Lab 3
~10µs conversion time
Unipolar (BPO =0)
Bipolar (BPO =1)
(Courtesy of Analog Devices. Used with permission.)
L9: 6.111 Spring 2004 19Introductory Digital Systems Laboratory
Single Write, Single Read OperationSingle Write, Single Read Operation(see data sheet for other modes)(see data sheet for other modes)
R/W
CE, CS
Data Data Valid
tw
Valid
tDC
tw
(write/start pulse width) = 300ns (min)
tDC
(delay to start conversion) = 700ns (max)
tc
(conversion time) = 10 s (max)
tTD
(Bus Access Time) = 250 (max)
tDT
(Output Float Delay) = 150 (max)
tc tTDtDT
Write
Read
Status
Control bits CE and CS can be wired to ground if A/D is the only chip driving the bus
Tie the CE and CS pins together for lab3 and hardwire BPO and Format
L9: 6.111 Spring 2004 20Introductory Digital Systems Laboratory
Simple A/D Interface FSMSimple A/D Interface FSM
Data[7:0]
STATUS
CS
CE
AD670
cs_b
R/Wr_w_b
FSM
clk
reset
DQ
dataavail
statussample
Status should be
synchronized: why?
Courtesy of James Oey and
Cemal Akcaba
L9: 6.111 Spring 2004 21Introductory Digital Systems Laboratory
Example A/D Example A/D VerilogVerilog InterfaceInterface
2/5
module AD670 (clk, reset, sample, dataavail,
r_wbar, cs_bar, status, state);
// System Clk
input clk;
// Global Reset signal, assume it is synchronized
input reset;
// User Interface
input sample;
output dataavail;
// A-D Interface
input status;
reg status_d1, status_d2;
output r_wbar, cs_bar;
output [3:0] state;
// internal state
reg [3:0] state;
reg [3:0] nextstate;
reg r_wbar_int, r_wbar;
reg cs_bar_int, cs_bar;
reg dataavail; 1/5
// State declarations.
parameter IDLE = 0;
parameter CONV0 = 1;
parameter CONV1 = 2;
parameter CONV2 = 3;
parameter WAITSTATUSHIGH = 4;
parameter WAITSTATUSLOW = 5;
parameter READDELAY0 = 6;
parameter READDELAY1 = 7;
parameter READCYCLE = 8;
always @ (posedge clk or negedge reset)
begin
if (!reset) state <=IDLE;
else state <=nextstate;
status_d1 <= status;
status_d2 <= status_d1;
r_wbar <= r_wbar_int;
cs_bar <=cs_bar_int;
end
L9: 6.111 Spring 2004 22Introductory Digital Systems Laboratory
Example A/D Example A/D VerilogVerilog Interface (cont.)Interface (cont.)
3/5
always @ (state or status_d2 or sample) begin// defaults
r_wbar_int = 1; cs_bar_int = 1; dataavail = 0;
case (state)
IDLE: begin
if(sample) nextstate = CONV0;
else nextstate = IDLE;
end
CONV0:
begin
r_wbar_int = 0;
cs_bar_int = 0;
nextstate = CONV1;
end
CONV1:
begin
r_wbar_int = 0;
cs_bar_int = 0;
nextstate = CONV2;
end
CONV2:
begin
r_wbar_int = 0;
cs_bar_int = 0;
nextstate = WAITSTATUSHIGH;
end
WAITSTATUSHIGH:
begin
cs_bar_int = 0;
if (status_d2) nextstate = WAITSTATUSLOW;
else nextstate = WAITSTATUSHIGH;
end
WAITSTATUSLOW:
begin
cs_bar_int = 0;
if (!status_d2) nextstate = READDELAY0;
else nextstate = WAITSTATUSLOW;
end
4/5
L9: 6.111 Spring 2004 23Introductory Digital Systems Laboratory
Example A/D Example A/D VerilogVerilog Interface(contInterface(cont.).)
READDELAY0:
begin
cs_bar_int = 0;
nextstate = READDELAY1;
end
READDELAY1:
begin
cs_bar_int = 0;
nextstate = READCYCLE;
end
READCYCLE:
begin
cs_bar_int = 0;
dataavail = 1;
nextstate = IDLE;
end
default: nextstate = IDLE;
endcase // case(state)
end // always @ (state or status_d2 or sample)
endmodule // adcInterface
5/5
L9: 6.111 Spring 2004 24Introductory Digital Systems Laboratory
SimulationSimulation
r_w_b must stay low for at least 3 cycles (@ 100ns period) –
Don’t need 3 cycles if you use the 1.8432MHz clockOn reset, present state goes to 0
Sample pulse initiates
data conversionNotice a one cycle delay since A/D
control signal delayed through a register
Wait for ~10 s for status to go low
Enable read flip-flop
Status is synchronized – two register delays
L9: 6.111 Spring 2004 25Introductory Digital Systems Laboratory
Flash A/D ConverterFlash A/D Converter
Brute-force A/D conversion
Simultaneously compare the analog value with every possible reference value
Fastest method of A/D conversion
Size scales exponentially with precision(requires 2N comparators)
C
C
CR
R
refV inv
0b
1b
Th
er m
om
et e
rt o
bin
ar y
ComparatorsR
R
Another example of OpAmp in open loop
L9: 6.111 Spring 2004 26Introductory Digital Systems Laboratory
AD 775 AD 775 –– Flash Data ConverterFlash Data Converter
(Courtesy of Analog Devices. Used with permission.)
L9: 6.111 Spring 2004 27Introductory Digital Systems Laboratory
High Performance Converters:High Performance Converters:Use Pipelining and Parallelism!Use Pipelining and Parallelism!
Sample/
Hold
Amplifier1-bit
A/D
Converter
D/A
Converter 2
Sample/
Hold
Amplifier1-bit
A/D
Converter
D/A
Converter2 …
Pipelining (used in video rate, RF basestations, etc.)
Parallelism (use many slower A/D’s in parallel to build very
high speed A/D converters)
[ISSCC 2003],
Poulton et. al.
20Gsample/sec,
8-bit ADC
from Agilent Labs
L9: 6.111 Spring 2004 28Introductory Digital Systems Laboratory
Summary of Analog BlocksSummary of Analog Blocks
Analog blocks are integral components of any system. Need data converters (analog to digital and digital to analog), analog processing (OpAmps circuits, switched capacitors filters, etc.), power converters (e.g., DC-DC conversion), etc.
We looked at example interfaces for A/D and D/A converters
Make sure you register critical signals (enables, R/W, etc.)
Analog design incorporate digital principlesGlitch free operation using coding
Parallelism and Pipelining!
More advanced concepts such as calibration