Analog To Digital Conversion (ADC)
Analog To Digital Conversion (ADC)
Analog To Digital Conversion (ADC)
(ADC)
Signal Types
Analog Signals
Analog signals – directly measurable
quantities in terms of some other
quantity
analog: continuously valued signal,
such as temperature or speed, with
infinite possible values in between
Examples:
•Thermometer – mercury height
rises as temperature rises
t
•Car Speedometer – Needle moves
farther right as you accelerate
– Binary States
– On and off
0
•Computers can only perform
processing on digitized signals
Examples:
• Light switch can be either on or off
• Door to a room is either open or closed
Examples of A/D Applications
• Microphones - take your voice varying pressure waves in the air
and convert them into varying electrical signals
• Strain Gages - determines the amount of strain (change in
dimensions) when a stress is applied
• Thermocouple – temperature measuring device converts
thermal energy to electric energy
• Voltmeters
• Digital Multimeters
Just what does an
A/D converter DO?
t
ADC Conversion Process
Two main steps of process
1.Sampling and Holding
2.Quantization and Encoding
Analog-to-Digital Converter
Quantizing
and
Encoding
Sampling and
Hold
t
Input: Analog Signal t
ADC Basic Principle:
• The basic principle of operation is to use the comparator principle to determine whether
or not to turn on a particular bit of the binary number output.
• It is typical for an ADC to use a digital-to analog converter (DAC) to determine one of
the inputs to the comparator
Quantization
• Quantization is the process of converting the sampled continuous- Valued signals into
discrete-valued data
Quantizing
The number of possible states that the converter can output is:
N=2^n
where n is the number of bits in the AD converter
Q is the Resolution
Analog /Digital Conversion
2-Step Process:
Output Discrete
Voltage
• Quantizing - breaking down analog value is a
Ranges (V)
set of finite states
0 0.00-1.25
• Encoding - assigning a digital word or number to
each state and matching it to the input signal
1 1.25-2.50
Or Assigning a unique digital code to each state for
input into the microprocessor
2 2.50-3.75
3 3.75-5.00
4 5.00-6.25
Step 1: Quantizing
Example: You have 0-10V signals. Separate them into a 5 6.25-7.50
Set of discrete states with 1.25V increments. (How
.01did we get 1.25V?
6 7.50-8.75
(Discussed in previous slide)
States
7 8.75-10.0
Step 2. Encoding
• Here we assign the digital value (binary number) to each state for the computer to read.
Output
Sampling Rate
Frequency at which ADC evaluates analog signal. As we see in the second picture,
evaluating the signal more often more accurately depicts the ADC signal.
Overall Better Accuracy
01
00
K=22 00
01
10
11
ADC Process
Quantization & Coding
01
00
K=22 00
01
10
11
ADC Process
Quantization & Coding
K=23 000
001
010
011
100
101
110
111
ADC Process
Quantization & Coding
t t
Sampling Rate, Ts Resolution, Q
•Based on number of steps •Improves accuracy in
required in the conversion measuring amplitude of analog
process signal
•Increases the maximum •Limited by the signal-to-noise
frequency that can be ratio (~6dB)
measured
ADC Process-Accuracy
The accuracy of an ADC can be improved by increasing:
t t
Sampling Rate, Ts Resolution (bit depth), Q
•Based on number of steps •Improves accuracy in
required in the conversion measuring amplitude of analog
process signal
•Increases the maximum
frequency that can be
measured
ADC-Error Possibilities
• Aliasing (sampling)
– Occurs when the input signal is changing much faster
than the sample rate
– Should follow the Nyquist Rule when sampling
• Answers question of what sample rate is required
• Use a sampling frequency at least twice as high as the
maximum frequency in the signal to avoid aliasing
• fsample>2*fsignal
• Quantization Error (resolution)
– Optimize resolution
– Dependent on ADC converter of microcontroller
Types of ADC
0
Vin lies in between Vcomp5 & Vcomp6
0
Vcomp5 = Vref*5/8 = 5V
Vcomp6 = Vref*6/8 = 6V 1
1
Advantages Disadvantages
Simplest in terms of
operational theory Lower resolution
Expensive
Most efficient in terms of For each additional output bit,
speed, very fast the number of comparators is
limited only in terms of doubled
comparator and gate
i.e. for 8 bits, 256
propagation delays
comparators needed
Analog –to Digital Conversion Methods-
FLASH (SIMULTANEOUS ) ADC CONVERTER (1)…
33
FLASH (SIMULTANEOUS ) ADC CONVERTER (2)…
C7
C6
C5
C4
C3
C2
C1
34
FLASH (SIMULTANEOUS ) ADC CONVERTER (3)… Operation of 3-bit flash ADC
The flash method utilizes comparators that compare reference voltages with
the analog input voltage. When the input voltage exceeds the reference voltage
for a given comparator, a HIGH is generated.
The reference voltage for each comparator is set by the resistive voltage-
divider circuit. The output of each comparator is connected to an input of the
8-input priority encoder.
The encoder is enabled by a pulse on the EN input, and a 3-bit code
representing the value of the input appears on the encoder’s outputs. The
binary code is determined by the highest order input having a HIGH level.
Assume the step size of 1 V. The voltage divider sets up reference levels for
each comparator so that there are 3 levels corresponding to 1V, 2V, 3V, 4V, 5V,
6V and 7V. The analog input is connected to other input of each comparator.
With analog input <1V, all the seven comparator outputs will be LOW. Suppose
the analog input is between 2V and 3V, outputs C1 and C2 will be HIGH. The
priority encoder will respond to HIGH on C2, and will produce a binary output
of 010.
35
FLASH (SIMULTANEOUS ) ADC CONVERTER (4)…
Example-3-bit Flash ADC
Determine the binary code output of the 3-bit Flash ADC for the input signal
And the encoder enable pulses as shown below. Assume VREF=+8V
36
FLASH (SIMULTANEOUS ) ADC CONVERTER (5)
Solution -3-bit Flash ADC
37
Dual Slope ADC
Dual Slope ADC
– When an analog value is applied the capacitor begins to charge in a linear manner and
the oscillator passes to the counter.
– The counter continues to count until it reaches a predetermined value. Once this value
is reached the count stops and the counter is reset. The control logic switches the input
to the first comparator to a reference voltage, providing a discharge path for the
capacitor.
– When the capacitor voltage reaches the reference voltage the count stops and the
value is stored in the register
Dual Slope Converter
Vin
tFIX tmeas
t
td
Vin Vref
tu
SIGMA - DELTA ADC
This method is based on delta modulation where the
difference between two successive samples is quantized.
43
SIGMA - DELTA ADC (2)…
Figure 10 A simplified illustration of sigma-delta analog-to-digital conversion.
A maximum number of
1’s correspond to
maximum positive input
voltage. A number of
1’s equal to one - half
the maximum
corresponds to an input
voltage of 0.
No 1’s correspond to
the maximum negative
input voltage.
44
SIGMA - DELTA ADC
The basic block diagram in Fig 11 accomplishes the conversion . The
analog input signal and the analog signal form the converted quantized
bit stream form the DAC in the feedback loop are applied to the
summation point .
The difference signal output of the sum is integrated and the 1-bit
ADC increases or decreases the number of 1’s depending on the
difference signal. This action attempts to keep the quantization signal
that is feedback equal to the incoming analog signal. The 1 bit
quantizer is essentially a comparator followed by a latch.
45
Delta-Sigma ADC – How It Works
• Input over sampled, goes to integrator
• Integration compared with ground
• Iteration drives integration of error to zero
• Output is a stream of serial bits
Sigma-Delta ADC
Advantages Disadvantages
the basic block diagram of a 4 bit Successive - approximation ADC . It consists of a DAC,
Successive-Approximation Register (SAR), and a comparator
49
Successive - approximation ADC (2)… Basic operation
The input bits of the DAC are enabled one at a time starting with the
MSB
As each bit is enabled the comparator produces an output that
indicate whether the input signal voltage is greater or lesser than the
output of DAC.
If the DAC output is greater than the input signal ,the comparator’s
output is LOW, causing the bit in the register to reset.
If the DAC output is less than the input signal, the bit 1 is retained in
the register.
The system does this with the MSB first, then the next right bit of MSB,
then the next and so on.
After all the bits in the DAC are tried , the conversion cycle is complete.
50
Successive - approximation ADC (3)…
Illustration of Basic operation with an example
51
Step 1: Step 2:
23 bit (MSB) = 1 22 bit =1
The output of the DAC is 8 V. The output of the DAC is 4 V.
Since this is greater than the input of Since this is less than the input of
5.1 V, the output of the comparator is LOW, causing the 5.1 V, the output of the comparator switches to
MSB in the Successive Approximation Register (SAR) to
be reset to a 0
HIGH, causing this bit retained In SAR .
Step 3: Step 4:
21 bit = 1 20 bit =1
The output of the DAC is 6 V. The output of the DAC is 5 V.
Since this is greater than the input of 5.1 V, the output Since this is less than the input of 5.1 V, the output of the
of the comparator switches to LOW, causing this bit to be reset to 0. comparator switches to HIGH, causing this bit retained in SAR. 52
Successive - approximation ADC (6)
Illustration of Basic operation with an example
53
Successive Approximation
Is Vin > ½ ADC range?
- • Sets MSB
SAR DAC
VIN + • Converts MSB to
1000 0000
0100
analog using DAC
Out • Compares guess to
If no, then test next bit input
• Set bit
• Test next bit
Successive Approximation
Advantages Disadvantages
0 5 10 15 20 25
Resolution (Bits)
• 10 bit resolution or
0.0009765625V of Vref
• Vin= .6 volts
• Vref=1volts
• Find the digital value of
Vin
Successive Approximation
• MSB (bit 9)
– Divided Vref by 2
– Compare Vref /2 with Vin
– If Vin is greater than Vref /2 , turn MSB on (1)
– If Vin is less than Vref /2 , turn MSB off (0)
– Vin =0.6V and V=0.5
– Since Vin>V, MSB = 1 (on)
Successive Approximation
• Next Calculate MSB-1 (bit 8)
– Compare Vin=0.6 V to V=Vref/2 + Vref/4= 0.5+0.25 =0.75V
– Since 0.6<0.75, MSB is turned off
• Calculate MSB-2 (bit 7)
– Go back to the last voltage that caused it to be turned on (Bit 9)
and add it to Vref/8, and compare with Vin
– Compare Vin with (0.5+Vref/8)=0.625
– Since 0.6<0.625, MSB is turned off
Successive Approximation
• Calculate the state of MSB-3 (bit 6)
– Go to the last bit that caused it to be turned on (In
this case MSB-1) and add it to Vref/16, and
compare it to Vin
– Compare Vin to V= 0.5 + Vref/16= 0.5625
– Since 0.6>0.5625, MSB-3=1 (turned on)
Successive Approximation
• This process continues for all the remaining
bits.