You are on page 1of 10

2/6/2012

1
James A. Mynderse ME588 A/D and D/A Conversion 1
ANALOG DI GI TAL CONVERSI ON
Physical world is analog (to a certain extend)
Analog/digital conversion can be a part of the instrument or the
actuator, 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
=
I
P0LL SCALL
2
N
- 1
James A. Mynderse ME588 A/D and D/A Conversion 2
I NTEGER 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
2/6/2012
2
James A. Mynderse ME588 A/D and D/A Conversion 3
I NTEGER 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
I NTEGER 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 101
011 000 011
2/6/2012
3
James A. Mynderse ME588 A/D and D/A Conversion 5
DI GI TAL-TO-ANALOG (D/A) CONVERSI ON
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
DI GI TAL-TO-ANALOG (D/A) CONVERSI ON
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.
V
REF
V
OUT
D/A
Converte
r
Latch
Digital
Input
Analog
Output
I
001
= b
N-1
2
N-1
+ b
N-2
2
N-2
+ + b
1
2
1
+ b
0
2
0

I
RLP
2
N
2/6/2012
4
James A. Mynderse ME588 A/D and D/A Conversion 7
DI GI TAL-TO-ANALOG (D/A) CONVERSI ON
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):
I
001
=
4
8
I
RLP
=
1
2
I
RLP
I
001
=
7
8
I
RLP
I
001
= b
N-1
2
N-1
+ b
N-2
2
N-2
+ + b
1
2
1
+ b
0
2
0

I
RLP
2
N
James A. Mynderse ME588 A/D and D/A Conversion 8
DI GI TAL-TO-ANALOG (D/A) CONVERSI ON
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 V
REF
= V
R
sin(t).
External reference voltage can be precisely controlled to adjust as
well as compensated for drift.
Internally
Referenced
Multiplying DAC
(Externally Referenced)
I
001
= b
N-1
2
N-1
+ b
N-2
2
N-2
+ + b
1
2
1
+ b
0
2
0

I
RLP
2
N
2/6/2012
5
James A. Mynderse ME588 A/D and D/A Conversion 9
DI GI TAL-TO-ANALOG (D/A) CONVERSI ON
Interfacing with a DAC
Non-multiplying DAC use AD558 as example
James A. Mynderse ME588 A/D and D/A Conversion 10
DI GI TAL-TO-ANALOG (D/A) CONVERSI ON
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 DAC
area
under
the curve
Integrate
20 dB/decade
1/T
T
Cut-off
frequency
Mag
log
1/(RC) =
2/6/2012
6
James A. Mynderse ME588 A/D and D/A Conversion 11
ANALOG-TO-DI GI TAL (A/D) CONVERSI ON
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-DI GI TAL (A/D) CONVERSI ON
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 0
0 0 1 0 1
0 1 0 X X
0 1 1 1 0
1 0 0 X X
1 0 1 X X
1 1 0 X X
1 1 1 1 1
2/6/2012
7
James A. Mynderse ME588 A/D and D/A Conversion 13
ANALOG-TO-DI GI TAL (A/D) CONVERSI ON
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.
2
No. of Bits
- 1
James A. Mynderse ME588 A/D and D/A Conversion 14
SUCCESSI VE APPROXI MATI ON 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 of interval 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
2/6/2012
8
James A. Mynderse ME588 A/D and D/A Conversion 15
SUCCESSI VE APPROXI MATI ON 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
I NTEGRATI NG 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.
2/6/2012
9
James A. Mynderse ME588 A/D and D/A Conversion 17
ANALOG-TO-DI GI TAL (A/D) CONVERSI ON
Interfacing with an ADC
Successive approximation ADC use AD673 as example
Convert timing
Reading timing
James A. Mynderse ME588 A/D and D/A Conversion 18
ANALOG-TO-DI GI TAL (A/D) CONVERSI ON
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
2/6/2012
10
James A. Mynderse ME588 A/D and D/A Conversion 19
SAMPLI NG AND ALI ASI NG
When signal (data) is sampled, information is lost.
Sampling theorem (Shannon, Nyquist) gives limits Sampling rate
must be faster than twice the highest frequency present (even if the
highest frequency is noise).
Slower sampling will lose the frequency information but preserve the
amplitude information aliasing.
0 1 2 3 4 5 6 7 8 9 10
-1
0
1
Original
Signal
0 1 2 3 4 5 6 7 8 9 10
-1
0
1
20
Sample
/unit time
1
0 1 2 3 4 5 6 7 8 9 10
-1
0
5 Sample
/unit time
0 1 2 3 4 5 6 7 8 9 10
-1
0
1
Time (sec)
0.9
Sample
/unit time
James A. Mynderse ME588 A/D and D/A Conversion 20
OVER-SAMPLI NG AND SUB-SAMPLI NG
If A/D conversion is fast enough, it is possible to sample much faster
in the converter than is needed by the application digital filter can
than be applied to remove the unwanted spectral components.
Anti-aliasing filter can be split between analog and digital filtering
DSP is often used to implement digital filter.
Over-sampling converters may be less expensive or flexible, but they
do not have better performance than other converters.
Stream of over-sampled data has more data values that can be used.
Sub-sampling picks out every Nth data value and throws away (N1)/N
of the data (N is the over-sampling ratio).
Analog
Anti-Aliasing
Filter
A/D
Digital
Filter
Down-Sample
In Hardware or Software
Actual sampling rate
used for control
In Hardware
Over-Sampling
Bandwidth depends on
A/D sampling rate
y(t)

You might also like