lec05 ad da conversion
TRANSCRIPT
-
7/29/2019 Lec05 Ad Da Conversion
1/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 1
ANALOG DIGITAL CONVERSION
Physical world is analog (to a certain extend)
Analog/digital conversion can be a part of the instrument or theactuator, e.g.
Incremental encoder analog position get encoded into digital pulse
Stepper motor digital step pulse get transformed to analog position
To be processed by computers, all information must be converted:
Quantization Level (Q)
For an N-bit converter
Quantization error can be up to one full quantization level (usually
referred to as the least significant bit, LSB)
Analog World
Digital World
2 1
James A. Mynderse ME588 A/D and D/A Conversion 2
INTEGER CODES
Digital word is finite precision
Coding is arbitrary
Once in a computer (digital form), codes are relative easy to
convert from one type code to another
Unipolar Voltages
Can be coded to unsigned integers
Example 0-5 volts coded to 3 bit unsigned integer
-
7/29/2019 Lec05 Ad Da Conversion
2/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 3
INTEGER CODES
Bipolar Coding
Twos Complement
Offset Binary
Voltage(1) Voltage(2) Digital Value Decimal Equivalent
+3.75 +5 011 3
+2.50 +3.33 010 2
+1.25 +1.67 001 1
0 0 000 0
-1.25 -1.67 111 -1
-2.50 -3.33 110 -2
-3.75 -5 101 -3
-5 -- 100 -4
Voltage Digital Value Decimal Equivalent
-5 000 0
-3.57 001 1-2.14 010 2
-0.71 011 3+0.71 100 4+2.14 101 5
+3.57 110 6
+5 111 7
James A. Mynderse ME588 A/D and D/A Conversion 4
INTEGER CODES
Sign Extension
Precision of ADC or DAC is independent of the precision being
used in the computer.
A/D and D/A converter precision rarely match the computers word
size.
To convert from one to the other, filling of extra (additional) bits to
the right depends on the coding scheme.
Offset binary and unsigned integer codes have no ambiguity.
Twos complement coding requires a bit more consideration.
Negative numbers must be filled with 1s and positive numbers
with 0s.
Example:
3 bit Code 6 bit Code
101 111 101011 000 011
-
7/29/2019 Lec05 Ad Da Conversion
3/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 5
DIGITAL-TO-ANALOG (D/A) CONVERSION
Ideal DA Conversion:
DA Conversion Errors:
000 001 010 011 100 101 110 111
James A. Mynderse ME588 A/D and D/A Conversion 6
DIGITAL-TO-ANALOG (D/A) CONVERSION
Digital value is stored in a register (latch), then converted.
Output of the DAC remains the same until the next value is sent to the
register (latch) a zero-order hold.
Basic concept:
Weighted (Scaled) Resistor DAC
Fast!
Not practical for large number of bits.
Requires
Accurate reference voltage.
Higher precision resistor.VREF
VOUT
D/A
Converte
r
LatchDigital
Input
Analog
Output
2 2
2 2
2
-
7/29/2019 Lec05 Ad Da Conversion
4/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 7
DIGITAL-TO-ANALOG (D/A) CONVERSION
R/2R Ladder DAC
Requires only two resistance values (2R and R) closely matched.
Input forms a resistor divider network, different digital values
configure the switches to form a different series-parallel voltage
divider configuration.
Bipolar output can be achieved by substituting the ground with a
negative voltage source.
If only MSB (100) is
asserted:
If all bits are asserted (111):
4
8
1
2
7
8
2 2
2 2
2
James A. Mynderse ME588 A/D and D/A Conversion 8
DIGITAL-TO-ANALOG (D/A) CONVERSION
Multiplying DAC
Conventional DAC has internal reference voltage VREF that is
derived from the fixed power supply.
Multiplying DAC has an externally supplied reference voltage.
Advantages:
Use a constant frequency sinusoidal reference signal to achieve
amplitude modulation, i.e. let VREF = VR sin(t).
External reference voltage can be precisely controlled to adjust as
well as compensated for drift.
Internally
ReferencedMultiplying DAC
(Externally Referenced)
2 2
2 2
2
-
7/29/2019 Lec05 Ad Da Conversion
5/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 9
DIGITAL-TO-ANALOG (D/A) CONVERSION
Interfacing with a DAC
Non-multiplying DAC use AD558 as example
James A. Mynderse ME588 A/D and D/A Conversion 10
DIGITAL-TO-ANALOG (D/A) CONVERSION
Pulse Width Modulation (PWM)
Poor mans DAC
Low pass filter the PWM signal can obtain an analog signal whose
magnitude is proportional to the pulse width of the PWM signal
For motor/motion control, the motor/motion
system will act as the low pass filter
Unipolar output
Best suited when an analog output is needed
but does not require a high resolution DACarea
under
the curveIntegrate
20 dB/decade
1/T
T
Cut-off
frequency
Mag
log
1/(RC) =
-
7/29/2019 Lec05 Ad Da Conversion
6/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 11
ANALOG-TO-DIGITAL (A/D) CONVERSION
Ideal AD Conversion:
AD Conversion Error:
0 1/8 1/4 3/8 1/2 5/8 3/4 7/8
0 FS
James A. Mynderse ME588 A/D and D/A Conversion 12
ANALOG-TO-DIGITAL (A/D) CONVERSION
Flash ADC
Uses comparators to determine the input voltage range.
Uses logic to convert comparator outputs to digital value.
Fast! Typical conversion time: 10 100 nsec.
Typically, 4 to 8 bit precision (8 bits requires 254 comparators).
Example: 2 bit Flash ADC
Code:
Needs: 3 comparators Use truth table to get output values:
C1: V > 1.25
C2: V > 2.5
C3: V > 3.75
0 1.25 2.5 3.75 5
00 01 10 11
C3 C2 C1 MSB LSB
0 0 0 0 00 0 1 0 1
0 1 0 X X0 1 1 1 0
1 0 0 X X
1 0 1 X X1 1 0 X X1 1 1 1 1
-
7/29/2019 Lec05 Ad Da Conversion
7/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 13
ANALOG-TO-DIGITAL (A/D) CONVERSION
Flash ADC
If input is changing during conversion, erroneous value will be
produced Need to provide sample-and-hold at the input side.
Output is only valid a specific time after input is held.
Continuous sampling can be done by using Gray code as input
changes, the outputs are guaranteed to be continuous. Requires lots of comparators:
Adjacent comparators must have monotonic range change.
2No.ofBits 1
James A. Mynderse ME588 A/D and D/A Conversion 14
SUCCESSIVE APPROXIMATION ADC
Workhorse method.
Used for wide variety of applications
Slower than flash ADC. Typical conversion time: 1 100 sec.Easily extensible to higher precision.
Precision is limited by the quality of the components.
Basic idea: Check bits starting from the high order bit (MSB).
Algorithm:
This is a form ofinterval halving.
START CONVERSION
SET Result to 0
FOR i = N-1 TO 0
SET i-th bit of Result to 1
IF INPUT VOLTAGE < DtoA(Result)SET i-th bit of Result to 0
END FOR-loop
OUTPUT Result
END CONVERSION
-
7/29/2019 Lec05 Ad Da Conversion
8/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 15
SUCCESSIVE APPROXIMATION ADC
General structure:
Successive-approximation converters are quite expensive.
Usually used with a multiplexer -- many channels feed to a single
converter.
Effective conversion speed for multiplexed ADC depends on
number of channel used.
Sample-and-hold normally precedes the converter.
James A. Mynderse ME588 A/D and D/A Conversion 16
INTEGRATING CONVERTERS
Slowest of the commonly used converters. Typical conversion
time is many milliseconds.
Can be made very accurate and precise used in DVMs (several
conversion per second).
Uses timing to determine digital value of unknown (input) voltage.
-
7/29/2019 Lec05 Ad Da Conversion
9/10
2/6/20
James A. Mynderse ME588 A/D and D/A Conversion 17
ANALOG-TO-DIGITAL (A/D) CONVERSION
Interfacing with an ADC
Successive approximation ADC use AD673 as exampleConvert timing
Reading timing
James A. Mynderse ME588 A/D and D/A Conversion 18
ANALOG-TO-DIGITAL (A/D) CONVERSION
ADC with Serial Output
Reduce pinouts and package size
Can be easily interfaced with a microcontroller or a microprocessor
with built in serial interface (SCLK, SDATA, T/R)
Sample rate limited by the maximum SCLK rate.
Use AD7476 as example 1 MSPS 6 pin ADC
-
7/29/2019 Lec05 Ad Da Conversion
10/10