Data Converters Final
Data Converters Final
Digital Signals
• Despite what you hear in the media, we don’t live in a digital world!
• When analog signals are restricted to one of a series of discrete voltages, we can map each of
these voltage levels to one of n numbers. When we do this, we call it digital.
• Today, almost all digital systems operate on two discrete voltage levels. This maps nicely into
a binary domain. Because of this, people will use the terms binary and digital interchangeably
although they don’t technically have to mean the same thing.
Analog Signals vs. Digital Signals
• Different logic families (TTL, CMOS, ECL, et cetera) map different voltages to logic 0 and logic 1:
• TTL: 0V = logic 0, +?V = logic 1
• CMOS: 0V = logic 0, +?V = logic 1
• ECL: -?V = logic 0, 0V = logic 1
• When negative logic is employed, the voltages that normally correspond to logic 0 and logic 1 are
reversed!
• On our breadboard in the lab, we treat +3.3V as a logic 1 and 0V as a logic 0.
• Acronyms:
TTL = Transistor-to-Transistor Logic
CMOS = Complementary Metal Oxide Semiconductor Logic
ECL = Emitter-Coupled Logic
Transducers convert one form of energy into another
• Transducers
• Allow us to convert physical phenomena to a voltage potential in a well-defined way.
A transducer is a device that converts one type of energy to another. The conversion can be to/from
electrical, electro-mechanical, electromagnetic, photonic, photovoltaic, or any other form of energy. While
the term transducer commonly implies use as a sensor/detector, any device which converts energy can
be considered a transducer. – Wikipedia.
Convert light to voltage with a CdS photocell
• Force • Acceleration
• strain gauges - foil, conductive ink • MEMS
• conductive rubber • Pendulum
• rheostatic fluids • Monitoring
• Piezorestive (needs bridge) • Battery-level
• piezoelectric films • voltage
• capacitive force • Motor current
• Stall/velocity
• Charge source
• Temperature
• Sound • Voltage/Current Source
• Microphones • Field
• Both current and charge versions • Antenna
• Sonar • Magnetic
• Usually Piezoelectric • Hall effect
• Flux Gate
• Position
• microswitches • Location
• shaft encoders • Permittivity
• gyros • Dielectric
• What we want
Physical Engineering
Phenomena Units
f (x ) Counts
Voltage (discrete)
(continuous)
f sampled (x)
t
TS
Choosing the range
• Fixed # of bits (e.g. 8-bit ADC)
• Span a particular input voltage range
• What do the sample values represent?
– Some fraction within the range of values
→ What range to use?
Vr + Vr +
Vr − Vr −
t t
Range Too Small Range Too Big
Vr +
Vr −
t
Ideal Range
Choosing the granularity
• Resolution
• Number of discrete values that represent a range of
analog values
• MSP430: 12-bit ADC
• 4096 values
• Range / 4096 = Step
Larger range ➔ less info / bit
• Quantization Error
• How far off discrete value is from actual
• ½ LSB → Range / 8192
Larger range ➔ larger error
Choosing the sample rate
• What sample rate do we need?
• Too little: we can’t reconstruct the signal we care about
• Too much: waste computation, energy, resources
f (x )
f sampled (x)
t
Converting between voltages, ADC counts, and engineering units
Vr + Vin -Vr-
N ADC = 4095´
Vin Vr+ -Vr-
N ADC
Vr+ -Vr-
Vr − Vin = N ADC ´
t 4095
• Converting: Voltage Engineering Units
time
time
• Sample – the action of duplicating the voltage value of the input
signal.
• Hold – the action of holding the voltage for a brief amount of time by
use of a capacitor.
ANALOG TO DIGITAL CONVERTERS
ANALOG TO DIGITAL CONVERTERS
time
• The Sample is accomplished by momentarily connecting the signal to
a capacitor in order to charge it up to the same voltage.
• The Hold is accomplished by disconnecting the signal and allowing
the conversion to be conducted on the voltage on the capacitor.
time
• The Sample-and-Hold circuitry is designed so that this can be
accomplished very quickly so that it can disconnect from the input
signal as soon as possible to avoid altering its signal integrity.
VR+
VR- time
• Input Voltage Range – The voltage is digitized within a range of
voltages from:
o Voltage Reference High (VR+)
o Voltage Reference High (VR-)
VR+
VR- time
• The goal of the conversion is to convert the analog voltage into a
digital number.
• This is called digitizing, quantizing, or discretizing.
VR+
1
0
VR- time
n=1
Sample=0
• n represents the number of bits in the digital value of the conversion.
VR+
1
0
VR- time
n=1
Sample=0
• n represents the number of bits in the digital value of the conversion.
• The input voltage range is divided into 2n discrete zones.
VR+
1
0
VR- time
n=1
Sample=0
• The larger the n, the closer the digital value is to the actual analog
voltage.
VR+
11
10
01
00
VR- time
n=2
Sample=01
• The larger the n, the closer the digital value is to the actual analog
voltage.
VR+
111
110
101
100
011
010
001
000
VR- time
n=3
Sample=010
• The larger the n, the closer the digital value is to the actual analog
voltage.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The larger the n, the closer the digital value is to the actual analog
voltage.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The number of bits n is called the ADC’s resolution.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The number of bits n is called the ADC’s resolution.
• MCU’s typically have ADC’s with resolutions of 8 to 16 bits.
microcontroller unit (MCU)
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The number of bits n is called the ADC’s resolution.
• MCU’s typically have ADC’s with resolutions of 8 to 16 bits.
• The MSP430 has up to 12-bits of resolution.
ANALOG TO DIGITAL CONVERTERS
ANALOG TO DIGITAL CONVERTERS
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The precision of an ADC is the smallest voltage that the LSB of the
digital output can represent.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The precision of an ADC is the smallest voltage that the LSB of the
digital output can represent.
• This is found by dividing the input voltage
range by the number of discrete zones.
• ANALOG TO DIGITAL CONVERTERS
ANALOG TO DIGITAL CONVERTERS
VR+
VR- time
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The original analog value is found by multiplying the digital
conversion result (NADC) with the resolution.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The accuracy is how close the digital output is to the input signal.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4
Sample=0100
• The accuracy is how close the digital output is to the input signal.
• By design, an ADC will only ever be able
to get within +/- ½ LSB of the original
analog value.
ANALOG TO DIGITAL CONVERTERS
ANALOG TO DIGITAL CONVERTERS
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111
0101
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001
0101
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001
0101 1101
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
TSA
• The sample period (TSA) is the time between samples.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
TSA
• The sampling rate is the frequency of sampling: fSA= 1/TSA
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
TSA
• The sampling rate is the frequency of sampling: fSA= 1/TSA
• This has units of samples-per-second (i.e., ksps, Msps).
ANALOG TO DIGITAL CONVERTERS
ANALOG TO DIGITAL CONVERTERS
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
• If you sample fast enough, you can reconstruct the original signal.
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
• If you sample fast enough, you can reconstruct the original signal.
• Nyquist-Shannon Sampling Theorem states you need to sample at
least twice as fast as the frequency of the incoming signal to
accurately reconstruct the original waveform.
ANALOG TO DIGITAL CONVERTERS
VR+
1111
1110
1101
1100
1011
1010
1001
1000
0111
0110
0101
0100
0011
0010
0001
0000
VR- time
n=4 0100
1000
0111 1001 1110
0101 1101 1101
12-bit
Example
Voltage is proportional
0 = 00000000 -> 0V to number magnitude.
63 = 00111111 -> +1.25V
Dividing number by two
127 = 01111111 -> +2.5V will divide the output voltage
in half.
255 = 11111111 -> +5V
• This D/A converter is simply a low-pass filter with rolloff frequency defined as follows:
frolloff = 1/(2*π*R*C)
• When a zero voltage is applied to the top terminal of the capacitor, the capacitor
starts discharging.
• The voltage at the output of the D/A converter is simply the average voltage
presented at Vin.
• As with D/A converters, A/D converters are designed to work with a specific number of bits
(resolution/precision).
• A device that accepts an analog voltage and produces a corresponding number to represent
that voltage is called an analog-to-digital converter, A/D converter, or ADC.
• The binary output of an A/D converter can be handed to another device in parallel or as a serial
bit stream.
• As with D/A converters, there are many ways to design A/D converters.
• A/D converters use a reference voltage to define what voltage will yield the maximum binary
output…
Analog-to-Digital Conversion (A/D)
• Basic equation (for single input, single voltage reference):
Dout = Vin/Vref * (2n - 1)
• Applied voltages to an A/D converter can be scaled and shifted using additional analog
circuitry to meet the requirements of the A/D converter.
• This means that the digital output is not entirely accurate for all voltage inputs.
D TO A CONVERTERS
Vo = output voltage
VFS = full scale output voltage
K - scaling factor usually adjusted to unity
d1d2... dn = n-bit binary fractional word with the decimal point located at the left
d1- most significant bit (MSB) with a weight of VFS/2
dn - least significant bit (LSB) with a weight of VFS/2n
Current to Voltage Converter
D= (0110)2 = 6
Vo = (1V/LSB) x 6 = 6V.
DAC SPECIFICATIONS
• Resolution: (2n -1) Total No. of Steps.
% Resolution = x 100
• Linearity. Relation between input & output.
• Accuracy: Expressed as fraction of LSB
• Settling time. Time required for the O/P of DAC to
settle to with in ½ LSB of the final value for a
given digital input.
• Speed of conversion. Conversion Time.
• Supply Rejection:
• The ability of DAC to maintain accuracy and
linearity when the supply voltage changes.
Types of DAC
1.Binary weighted DAC
2.R-2R ladder type DAC
BINARY WEIGHTED DAC
When RF = R, Vo is given as
LIMITATIONS OF
BINARY WEIGHTED RESISTORS
LSB MSB
0 0 0 1
Fig.11.8 Four Bit R/2R Ladder D/A Converter Let b1b2b3b4 1000
║el
(R+R) ║ 2R
+
V0 = -VR/2
= VR/2
V0 = VR/2
Ladder Type Voltage-Switched R-2R DAC
voltage scaling is used
-VR
-VR/2 R
LSB MSB
0 0 0 1
Fig.11.8 Four Bit R/2R Ladder D/A Converter Let b1b2b3b4 1000
Conversion
TYPES OF ADC
Example:
For an input voltage of 0-10V, what is the resolution?
1LSB = 10V/28= 39.1mV
What is the input voltage that generates all 1’s at output?
10V-39.1mV = 9.961V.
What is the digital output for an input voltage of 4.8V?
D= 4.8/39.1 = 122.76 say 123.
The binary value is 01111011
Quantization Error
Fig. 8.26 shows that the binary output is 001 for all values
of Vi between 1/4 and ½ V. There is an unavoidable
uncertainty about the exact value of Vi when the output is
001.
This uncertainty is specified as quantization error. Its
value is ½ LSB. It is given as,
QE = (3)
❖Widely used
❖Similar to Counter type ADC except that ,a SAR is used
❖SAR acts as programmable Up/Down counter
❖Completion of conversion , triggered by a change in the
state of the comparator
❖Much faster than the counter type
SUCCESSIVE APPROXIMATION ADC
Implements Binary search algorithm
• Initially, DAC input set to midscale (MSB =1)
• VIN > VDAC , MSB remains 1. Next bit is set to 1
• VIN < VDAC , MSB set to 0. Next bit is set to 1
•MSB’s remain same after each conversion and next 3
bits are processed. Then next 2 bits, first 2 remaining
Typical
same etc. accuracy levels of 8 to 12 bits .
2
Lower arrow 0
Vin> 11
1 Next bit is
always changed
to ‘1’
Vin<01
Vinteg ≈ Vin
Vinteg
integrator comparator
T1
MSB=0
MSB=1
• Conceptually simple
• Consists of just a multistage voltage divider and a
chain of comparators
• Fully parallel, and therefore very fast.
• Example: n= 2 bits, gives 4 possible states,
representing 4 separate voltage intervals.
Vin
• Analog input will fall into one of these intervals - we
encode this assignment using the 2 bits
• Defining the boundaries of 2n intervals requires 2n-1
comparators, with the threshold of each comparator
set to the appropriate boundary voltage.
=12V
FIG.1
=9V
=6V
= V/2
=3V
FIG.2
A/D Conversion Specifications
The time for one analog to digital conversion must
depend on both the clock's period T and number
of bits n. It is given as,
Tc =T(n + 1)
Where Tc = conversion time
T=clock period
n=number of bits
Example -1 : An 8 bit successive approximation ADC is
driven by a 1 MHz clock. Find its conversion time.
Solution : f = 1 MHz; T=1/f = 1/106 = 1μSec. n=8
Tc = T(n+1) = 1(8+1) = 9 μSec.
Problem-2.
A 10-bit dual slope integrating A/D converter has a full-scale
input of 10V. If the clock period is 15 μS, how long will it take to
convert an input of 4V? How long for an input of 10V?