Mechatronics Lab ME 140L: Dac: Digital-To-Analog Conversion Adc: Analog-To-Digital Conversion
Mechatronics Lab ME 140L: Dac: Digital-To-Analog Conversion Adc: Analog-To-Digital Conversion
ME 140L
Excellent websites:
http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/adc.html
http://en.wikipedia.org/wiki/Digital-to-analog_converter
http://www.analog.com/en/cat/0,2878,760,00.html
http://www.irctt.com/pdf_files/LADDERNETWORKS.pdf
http://www.allaboutcircuits.com/vol_4/chpt_13/8.html
1
B. Sample and Hold
• Take analog signal and digitize (make into a series amplitude
modulated pulses). Use sample and hold: switch and capacitor
2
C. Quantization
n-bit binary string defines 2n distinct states.
Resolution of one part in 2n.
Example: Signal varies from 0 to 1V—to be represented by 3 bits.
23=8 distinct states with resolution 0.125=1/8
States Voltage
000 0.000
001 0.125
010 0.250
011 0.375
100 0.500
101 0.625
110 0.750
111 0.875
3
A. The Weighted Resistance DAC
Binary-weighted-input DAC—Consider three binary inputs—input resistors
on a summing amplifier are multiple powers of two: R, 2R, and 4R
(therefore binary-weighted inputs)
⎛V V V ⎞
From op - amps : Vout = (I1 + I 2 + I 3 )R f = -⎜ 1 + 2 + 3 ⎟R f
⎜ R 2R 4R ⎟
⎝ ⎠
⎛V V V ⎞
and with R f = R Vout = -⎜ 1 + 2 + 3 ⎟
⎜ 1 2 4 ⎟⎠
⎝
⎛a a a ⎞
Vout = -⎜ 1 + 2 + 3 ⎟ Vref where a i = 0 or 1, a1 = most significant bit
⎜1 2 4 ⎟⎠
⎝
⎛a a a a a a a a ⎞R
Vout = -⎜ 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 ⎟ f Vref ← 8 − bit DAC
⎜1 2 4 8 16 32 64 128 ⎟⎠ R
⎝
4
Example: 4-bit Weighted Resistance DAC
1000
R
Rf
V ⎡V ⎤
i = out = − ⎢ in ⎥
Vin 2R R
f ⎢⎣ R ⎥⎦
4R Vout R
→ Vout = −V f
8R
in R
1010
R
Rf
Vout ⎡V V ⎤
i= =− ⎢ in + in ⎥
Vin 2R R
f ⎢⎣ R 4R ⎥⎦
5 Rf
4R Vout
→ Vout = −V
8R in 4 R
Vin1
0111
R
Rf
V ⎡V V V ⎤
i = out = − ⎢ in + in + in ⎥
2R R
f ⎢⎣ 2R 4R 8R ⎥⎦
4R Vout
7 Rf
→ Vout = −V
8R
in 8 R
Vin
1111
R
Rf
V ⎡V V V V ⎤
i = out = − ⎢ in + in + in + in ⎥
2R R
f ⎢⎣ R 2R 4R 8R ⎥⎦
Vout
4R
15 R f
→ Vout = −V
8R in 8 R
Vin
5
B. R-2R LADDER DAC
• Uses only two kinds of resistor values and with only a modest
increase in resistor count.
⎡D D D D ⎤R
Vout = ⎢ 3 + 2 + 1 + 0 ⎥ f Vref
⎣ 2 4 8 16 ⎦ R
6
III. ADC: ANALOG-TO-DIGITAL CONVERSION
Most ADCs contain DACs to do conversion
If you were asked to guess a number between 0 and 10 and if wrong I would
tell you which direction to go, what would your first guess be?
• Counts by trying all values of bits starting with the most-significant
bit and stepping through to finish at the least-significant bit.
• At each step, the register monitors the comparator's output to see if the
binary count is less than or greater than the analog signal input,
adjusting the bit values accordingly.
• Uses a successive approximation register (SAR), comparator and
DAC
7
Example:
8
B. Tracking ADC
• Counter starts counting upward. When the DAC output exceeds the
analog input, the counter switches into the "count down" mode.
• Then the DAC output always counts in the proper direction to track
the input signal. The binary output is updated with every clock pulse.
9
III. PRACTICAL CONSIDERATIONS FOR ADC
A. Resolution
Most important consideration.
Resolution is the number of binary bits output by the converter.
10-bit ADC can represent up to 1024 =210 unique states. Over the range of
measurement from 0% to 100%, there will be exactly 1024 unique binary
numbers output by the converter (from 0000000000 to 1111111111, or in
decimal from 0 to 1023).
If the sample period is too long (too slow), substantial details of the analog
signal will be missed. ADC sample time must be sufficiently fast to capture
details of the signal.
The highest-frequency waveform that an ADC can theoretically capture is
called the Nyquist frequency, equal to one-half of the ADC's sample
frequency.
That is, you must sample at least twice the frequency of the highest
frequency in the signal. If you wish to reproduce a signal with 2500 Hz, the
ADC circuit must sample at a frequency of 5000 Hz.
10
Aliasing
If the analog input signal has frequency that exceeds the Nyquist
frequency for that ADC, the converter will output a digitized signal of
falsely low frequency—called aliasing.
Note: the period of the output waveform is much longer (slower) than that of
the input waveform. Also waveform shapes are very different.
Moreover, the frequency content of the signal is not usually known apriori.
If so, determine what the maximum frequency you are interested in, and
place a low-pass filter before the input of the ADC, to filter any signal
frequencies greater than the your desired maximum frequency.
11
12
13
14