1. Analog To Digital Converters
Damien Gaudry
Russell Marzette
Cindy Perreira
February 5, 2003
Presentation Outline
Introduction
β What is an analog to digital converter?
β What are the different types and their advantages?
Successive Approximation ADC example
ADC and the HC11
Applications
2. What is an Analog to Digital
Converter?
Analog signals have infinite states available
β mercury thermometer
β needle speedometer
Digital signals have two states - on (1) or off (0)
β lights (on or off)
β door (open or closed)
ADC digitize an analog signal by converting data with
infinite states to a series of pulses. The amplitudes of
these pulse can only achieve a finite number of states.
What is an Analog to Digital
Converter?
Converting analog signals into binary words
Clock signal
Input Sample A/D Output
and hold Conversion
analog analog Equally spaced
signal signal Digital signal
segment
3. What is an Analog to Digital
Converter?
Conceptually, conversion is a two step
process:
β Quantizing - breaking down analog value into a
a set of finite states.
β Coding - assigning a digital word or number to
each state.
Quantizing
8
7
Takes 0-10v
Output States
6
5
4 signals and
3 separates it
2
1 into set of
0 discrete out
ranges.
25
0
5
0
0
5
5
00
.7
.5
.5
.0
.2
.7
1.
0.
-2
-3
-5
-7
-6
-8
-
-1
00
25
50
75
00
25
50
75
0.
1.
2.
3.
5.
6.
7.
8.
Dicretized Voltage Ranges
4. Quantizing
How many states are possible?
β Based on number of bit combinations that the
converter can output.
N=2n where n is number of bits (8)
β Number of decision points = N-1 (7)
β Analog quantization size
Q=(Vmax-Vmin)/N (1.25 V)
Coding
7 1 11
6 1 10
5 1 01
4 1 00
3 0 11
2 0 10
1 0 01
0 0 00
O utp ut Ou tput
-1.25
-2.50
-3.75
-5.00
-6.25
-7.50
-8.75
0
S tate C od e
-10.0
0 .0 0
1 .2 5
2 .5 0
3 .7 5
5 .0 0
6 .2 5
7 .5 0
8 .7 5
Dicretized Voltage Ranges
Output state is assigned
digital word
5. Accuracy
ADC accuracy can be improved by:
β increasing resolution of ADC
β increasing sampling rate of ADC
Accuracy - Resolution
Low High
9 9
8 Resolution = 2.50 v 8
Resolution = 1.25 v
Signal Value
7
7
Signal Value
6
6
5
5
4
4
3
3
2
2
1
1
0
0
Time Time
Resolution = analog 2 bit converter 10v/22=2.50v
quantization size (Q)
3 bit converter 10v/23=1.25v
6. Accuracy - Sampling Rate
Low High
9 9
8 8
7
1 Hz 7
2 Hz
Signal Value
6 6
Signal Value
5 5
4 4
3 3
2 2
1 1
0 0
Time Time
Sampling rate - Frequency which ADC evaluates analog
signal
Sampling Rate - Aliasing
Rule of thumb -
Use a sampling
frequency at least
twice as high as
the signal to avoid
aliasing.
7. Accuracy
9 9
8
Resolution = 2.50 V 8
Resolution = 1.25 V
7 Sampling rate = 1 Hz 7 Sampling rate = 2 Hz
Signal Value
6 6
Signal Value
5 5
4 4
3 3
2 2
1 1
0 0
Time Time
Both sampling rate and resolution can be increased to
obtain better accuracy.
Different Types of A/D Converters
Flash (Parallel) Converters
Dual Slope Converters
Voltage-to-Frequency Converters
Successive-Approximation Converters
8. Flash (Parallel) Converter
(Logic high) An n-bit flash
converter uses 2n-
(Logic low) 1 comparators
Flash (Parallel) Converter
10v Vin
Example-
resistor
If Vin = 6.00v, then the
8.75v Digital Code first 4 comparators from
Output the bottom will return a
7.50v
logic high signal while
6.25v the top three will return a
5.00v low signal.
Octal to
3.75v
Binary
2.50v Encoder Octal 4 = Binary 100
1.25v
0.00v
Comparator
9. Flash (Parallel) Converter
Advantages
β Very Fast
Disadvantages
β Lower resolution (many comparators are required
for higher resolution: 8 bit = 255 comparators)
β Higher cost
Dual-Slope Converter
C CTRL allows capacitor (C) to
R charge with rate given by
Vin/RC for time T0 (N0 clock
cycles). Then CTRL switched
and allows capacitor to
discharge for to time T1 (N1
clock cycles) at a rate given by
Vref/RC.
Vref/N1=Vin/N0
Vref/RC Vref and N0 are known and N1 is
Vin/RC measured, so:
Vin=(N1/N0)Vref
10. Dual-Slope Converter
Advantages
β Higher resolution
β Higher accuracy
β Lower cost
β Good noise immunity
Disadvantages
β Slow
Voltage-to-Frequency Converters
Converter takes in a
voltage (Vin) and
returns a series of
pulses. Frequency
of pulses is
proportional to Vin.
11. Voltage-to-Frequency Converters
Advantages
β Excellent noise reduction
Disadvantages
β Slow
β Generally limited to 10bits or less
Successive Approximation
Converter
Guess the answer, use a D/A to Similar to the ordering weighing
convert it to an analog voltage (on a scale) of an unknown
and compare it to the voltage quantity on a precision balance,
being measured β adjust your using a set of weights, such as
guess accordingly 1g, 0.5g, 0.25g, etc.
Comparator
+ VIN
Control Logic
-
Set Clear
Bit Bit
Result Digital to
Analog
Converter
Digital Output VREFH VREFL
12. Successive Approximation Converter
Reliable
Capable of high speed
Conversion time is clock rate times number
of bits.
β Example with 8-bit, 2-MHz clock rate:
Conversion time= (clock period) x (#bits being
converted)
Conversion time= (0.5 micro-sec) x (8-bits) = 4Β΅s
Summary of Convert Types
Converter Type Speed Resolution Noise Immunity Cost
Voltage/Frequency slow 14-24 good medium
Dual Slope slow 12-18 good low
Successive Approximation medium 10-16 little low
Flash (Parallel) fast 4-8 little high
*Resolution given in bits.
13. Successive Approximation Example
10-bit resolution or Bit Voltage
0.0009765625V of Vref 1 .5
2 .25
Vin =0.6V
3 .125
Vref =1V 4 .0625
Find the digital value of 5 .03125
Vin 6 .015625
7 .0078125
8 .00390625
9 .001952125
10 .0009765625
Successive Approximation Example
(cont.)
MSB (bit 1)
β Divide Vref by 2 = .5V
β Compare Vref /2 with Vin
β If Vin is greater, turn MSB* ON
β If Vin is less than Vref /2, turn MSB off
β Compare Vin=0.6V and V= 0.5V
β Since 0.6 > 0.5 β MSB =1 (turned on)
1
14. Successive Approximation Example
(cont.)
Calculate the state of MSB-1 (bit 2)
β Compare Vin =0.6V and V=Vref /2 + Vref/4 = 0.5+0.25 = 0.75V
β Since 0.6 < 0.75 β MSB-1 =0 (turned off)
Calculate the state of MSB-2 (bit 3)
β Go back to the last voltage value that caused it to be turned on (in
this case 0.5V) and add Vref/8 to it and compare with Vin.
β Compare Vin and (0.5 + (Vref/8)=0.625)
β Since 0.6 < 0.625 β MSB-2 =0 (turned off)
1 0 0
Successive Approximation Example (cont.)
Calculate the state of MSB-3 (bit 4)
β Go back to the last voltage value that caused it to
be turned on (in this case 0.5V) and add Vref/16 to
it and compare with Vin.
β Compare Vin and (0.5 + (Vref/16)=0.5625)
β Since 0.6 > 0.5625 β MSB-3 =1 (turned on)
MSB MSB-1 MSB-2 MSB-3 β¦
1 0 0 1
15. Successive Approximation Example
(cont.)
Digital Results:
MSB MSB-1 MSB-2 MSB-3 β¦ LSB
1 0 0 1 1 0 0 1 1 0
1 1 1 1 1
+ + + + = . 599609375 V
Results = 2 16 32 256 512
1
0.8
0.6
Voltage
0.4
0.2
0
9 8 7 6 5 4 3 2 1 0
Bit
A/D Conversion w/ MC68HC11A8
8-Channel, 8-Bit
Successive Approximation Converter
Four Main Hardware Components
β Multiplexer
β Analog Converter
β Digital Control
β Results Storage
Single & Multiplexed Modes
16. Successive Approximation:
Low Level Hardware
All Capacitor Charge-Redistribution
β An array of eight capacitors is charged during the sampling
period using the analog input signal.
β In simplest terms each capacitor corresponds a bit in the
Successive Approximation Register (SAR), the content of
which is the digitized analog input.
β From MSB to LSB the capacitors are switched to the high
voltage line, VRH and a comparator is used to determine
whether to leave a capacitor high or low.
Successive-Approximation:
Components
A/D Charge Pump
β This drives the analog logic switches of the multiplexer and
capacitor array.
β Note: the ADC will not work unless the charge pump has been
turned on using the OPTION Register (#$1039)
Clocks
β The clock used as the βconversionβ clock affects the accuracy of
your conversion (set also by OPTION Register).
β E clock:
Has the advantage of providing synchronization with the system
clock, avoiding noise and other conflicts.
β Resistor-Capacitor Oscillator
In order to avoid unfavorable conflicts employees a delay
between each conversion.
17. Successive-Approximation:
Components (cont)
A/D System Configuration Register (OPTION)
Flag Bit Description
ADPU 7 A/D Power-Up Bit
CSEL 6 Clock Select Bit (0 β E clock, 1 βRC Oscillator)
IRQE 5 Configure IRQ for Edge Sensitive Only Operation
DLY 4 Enable Oscillator Start-up Display
CME 3 Clock Monitor Enable Bit
CR [1:0] COP Timer Rate Select Bits
Successive-Approximation:
Components (cont)
A/D System Configuration Register (OPTION) β (cont)
E β Clock Freq. CSEL What & Why
< 750 KHz 1 E β clock is to slow to ensure conversion before significant charge loss occurs.
750KHz 2MHz 0 To ensure highest accuracy during conversion.
1 If using EEPROM (EEPROM has a separate charge pump affected by CSEL)
2MHz 0 Almost always set to E-clock
DLY β Control delay after resume from STOP (if 0 MCU resumes
in 4 bus cycles, if 1 MCU waits 4000 E-clock cycles)
18. Stop and Wait Modes
Stop or Wait Modes will suspend a
conversion.
β As Wait Mode is terminated, the A/D circuits are
stable and valid results will be immediately
obtained.
β In Stop Mode, the analog converter is partially
shut down, a delay must be present upon its
termination (affected by DLY flag of OPTION
register).
Successive-Approximation:
Components (cont)
A/D Control/Status Register (ADCTL) The ADCTL must be
written to initiate
conversion.
An in progress conversion
can be halted by initiating
a new write to this register.
Flag Bit Description
CCF 7 Conversions Complete Flag
SCAN 5 Continuous Scan Control Bit
MULT 4 Multiple-Channel/Single-Channel Control Bit
CD, CC, CB, CA 3,2,1,0 Channel Select Bit
19. Successive-Approximation:
Components (cont)
A/D Control/Status Register (ADCTL) β (cont)
Single, Multi-channel, and Scanning Flag Descriptions
MULT = 0 MULT=1
Single Channel: One channel
Multi Channel: Four channels are
converted four times consecutively.
SCAN = 0 converted successively, stored in
The results are stored in ADR1-
ADR1-ADR4. Conversion stops.
ADR4. Conversion stops.
Multi Channel: Four channels are
One channel is converted converted continuously. Store in
repeatedly. The results are written ADR1-ADR4. The results are written
SCAN = 1
to ADR1-ADR4, wrapping around to ADR1-ADR4, wrapping around
and overwriting data. and overwriting data and the
channels are cycled through.
Successive-Approximation:
Components (cont)
A/D Control/Status Register (ADCTL) β (cont)
21. Successive-Approximation:
Components (cont)
Conversion Time Line (Sequence) β (Cont)
β Conversion begins one clock cycle after a write to the ADCTL
register was initiated.
β Stabilization of the analog bias voltages require a delay of as
much as 100Β΅s.
ADC Hardware Components
Multiplexer
Analog Converter
Digital Control
Result Registers
PORT E
22. Multiplexer
The multiplexer is Port E
Port E, accepts digital inputs or analog inputs
that are to be converted.
Users of Port E should take care not to
attempt to read a digital input at the same
time as an analog input.
Notes of Voltages
With respect to conversion VRL and VRH convert to $00 and $FF
(full scale).
Charge pump allows a maximum VRH of 7-8V(Typical values
however a indicated in the table to follow).
A/D input should not go below Vss = VRL = 0, otherwise
permanent damage can occur to the hardware.
Other:
β External clamping diodes
β Maximum external source impedance (10kβ¦) β Errors!!!
β Minimum-desirable source impedance (should limit current to
25mA) β Damaged Hardware!!!
β Rate of charge of analog signal if external low-pass filter is used
(Less that ideal RC selection may cut out meaning full transitions)
23. A/D Converter Applications
Strain Gages
Load Cells
Thermocouples
Pressure Transducers
Data Acquisition Devices
Process and Store
Microphones (voice circuitry)
Digital Music Recording
Digital Speedometer
Questions ?