By: Saumya Ranjan Behura
Analog-Digital Converters
Agenda
 Introduction to ADC
 Types of ADC
 Characteristics of ADC in MC9S12C
 Application and Selection of ADC
Introduction of ADC
 What is ADC?
 Why is ADC important?
 How does it work?
What is ADC?
 ADC (Analog to Digital Converter) is an electronic device that
converts a continuous analog input signal to discrete digital
numbers (binary)
 Analog
 Real world signals that contain noise
 Continuous in time
 Digital
 Discrete in time and value
 Binary digits that contain values 0 or 1
Why is ADC Important?
 All microcontrollers store information using digital logic
 Compress information to digital form for efficient storage
 Medium for storing digital data is more robust
 Digital data transfer is more efficient
 Digital data is easily reproducible
 Provides a link between real-world signals and data storage
How ADC Works
2 Stages:
 Sampling
 Sample-Hold Circuit
 Aliasing
 Quantizing and Encoding
 Resolution
Binary
output
Sampling
 Reduction of a continuous signal to a discrete signal
 Achieved through sampling and holding circuit
 Switch ON – sampling of signal (time to charge capacitor w/ Vin)
 Switch OFF - voltage stored in capacitor (hold operation)
 Must hold sampled value constant for digital conversion
Response of Sample and Hold CircuitSimple Sample and Hold Circuit
Sampling
 Sampling rate depends on clock
frequency
 Use Nyquist Criterion
 Increasing sampling rate
increases accuracy of conversion
 Possibility of aliasing
max2 ffs ∗>
s
s
f
T
1
=
Sampling Signal:
Sampling Period:
Nyquist Criterion:
wT
Aliasing
 High and low frequency samples are indistinguishable
 Results in improper conversion of the input signal
 Usually exists when Nyquist Criterion is violated
 Can exist even when:
 Prevented through the use of Low-Pass (Anti-aliasing) Filters
max2 ffs ∗>
Quantizing and Encoding
 Approximates a continuous range of values and
replaces it with a binary number
 Error is introduced between input voltage and output
binary representation
 Error depends on the resolution of the ADC
Resolution
)12/( −= n
rangeVresolution
)12/(71
3
0.7
3
−=
=
=
VV
n
VVrange
 Maximum value of quantization error
 Error is reduced with more available memory
Example:
Vrange=Input Voltage Range
n= # bits of ADC
Resolution
V
resolutionQerror
5.
2/
±=
±=
Resolution
 Increase in resolution improves the accuracy of the conversion
Minimum voltage step recognized by ADC
Analog Signal Digitized Signal- High
Resolution
Digitized Signal- Low
Resolution
Flash A/D Converter
Successive Approximation A/D Converter
Example of Successive Approximation
Dual Slope A/D Converter
Delta – Sigma A/D Converter
Types of A/D Converters
Elements of a Flash A/D Converter
Encoder
Comparator
FLASH A/D CONVERTER
3 Bit Digital Output
Resolution
23
-1 = 7 Comparators
Flash A/D Converter Contd.
Pros
• Fastest (in the
order of nano
seconds)
• Simple
operational
theory
• Speed is limited
only by gate and
comparator
propagation delay
• Each additional bit
of resolution
requires twice the
number of
comparators
•Expensive
• Prone to produce
glitches in the
output
Cons
Integrator
Elements of Dual-Slope ADC
Dual-Slope ADC
*
Elements of the Successive Approximation ADC
Takes in a Combination of Bits
Successive Approximation Register
Digital to Analog Converter
SUCESSIVE APPROXIMATION A/D CONVERTER
Example
Show the timing waveforms that would occur in SAR ADC when
converting an analog voltage of 6.84V to 8-bit binary, assume that the
full scale input voltage of the DAC is 10V.
Vref = 10
V
Vin = 6.84 V
DAC Input DAC Vout
Cumulative
Voltage
D7 5.0000 5.0000
D6 2.5000 7.5000
D5 1.2500 8.7500
D4 0.6250 9.3750
D3 0.3125 9.6875
D2 0.15625 9.84375
D1 0.078125 9.921875
D0 0.0390625 9.9609375
6.84 V
5
7.5
6.25
6.875
6.5625
6.71875
6.796875
6.8359375
5
7.5
6.25
6.875
6.5625
6.71875
6.796875
6.8359375
Dual Slope A/D Converter Contd.
Pros
• High accuracy
• Fewer adverse
affects from noise
• Slow
• Accuracy is
dependent on the
use of precision
external
components
Cons
Delta-Sigma ADC
#1 Delta-Sigma Modulator
Delta-Sigma ADC contd.
#2 Digital Filter
Delta-Sigma ADC contd.
Decimator
Sigma-Delta A/D Converter Contd.
Pros
•High Resolution
•No need of
precision
components
• Slow due to over
sampling
• Good for low
bandwidth
Cons
Type Speed(relative) Cost(Relative)
Dual Slope Slow Med
Flash Very fast High
Successive approx Medium fast Low
Sigma-Delta Slow Low
ADC Comparison
ATD10B8C on MC9S12C32
 Presented by:
 Michael Hochman
MC9S12C32 Block Diagram
ATD10B8C Block Diagram
ATD10B8C Key Features
 Resolution
 8/10 bit (manually chosen)
 Conversion Time
 7 usec, 10 bit
 Successive Approximation ADC architecture
 8-channel multiplexed inputs
 External trigger control
 Conversion modes
 Single or continuous sampling
 Single or multiple channels
ATD10B8C External Pins
 12 external pins
 AN7 / ETRIG / PAD7
 Analog input channel 7
 External trigger for ADC
 General purpose digital I/O
 AN6/PAD6 – AN0/PAD0
 Analog input
 General purpose digital I/O
 VRH, VRL
 High and low reference voltages for ADC
 VDDA, VSSA
 Power supplies for analog circuitry
ATD10B8C Registers
 6 Control Registers ($0080 - $0085)
 Configure general ADC operation
 2 Status Registers ($0086, $008B)
 General status information regarding ADC
 2 Test Registers ($0088 - $0089)
 Allows for analog conversion of internal states
 16 Conversion Result Registers ($0090 - $009F)
 Formatted results (2 bytes)
 1 Digital Input Enable Register ($008D)
 Convert channels to digital inputs
 1 Digital Port Data Register ($008F)
 Contains logic levels of digital input pins
Control Register 2
Control Register 3
Control Register 4
Control Register 5
Single Channel Conversions
Multi-channel Conversions
Status Register 0
Status Register 1
Results Registers
ATD Input Enable Register
Port Data Register
Setting up the ADC
Applications For ADC
 What are some applications for Analog to
Digital Converters?
 Measurements / Data Acquisition
 Control Systems
 PLCs (Programmable Logic Controllers)
 Sensor integration (Robotics)
 Cell Phones
 Video Devices
 Audio Devices
Measurements / Data
Acquisition
 The sampling of the
real world to generate
data that can be
manipulated by a
computer
 (DSP) Digital Signal
Processing first
requires a digital signal
 Eg. Analysis of data
from weather balloons
by the National
Weather Service
What is Data Acquisition
NI X-Series Data Acquisition
Card
Control Systems
S/H
&
ADC
Digital
CPU
Co ntro lle r
D/A
&
Hold
Plant
Transduce
r
Clock
Digital Control System
+
-
R Y
t t
e e*
Controller
0010
0101
0011
1011
∆t
e*(∆t)
1001
0010
1010
0101
∆t
u*(∆t)
e
e*(∆t) u*(∆t)
u
The Old Way…. Analog
Computers
Comdyna  GP6
The New Way
t t
e e*
Controller
0010
0101
0011
1011
∆t
e*(∆t)
1001
0010
1010
0101
∆t
u*(∆t)
ADC
Analog
Input
D/A
Analog
Output
Programmable Logic
Controllers
 PLCs are the industry standard
for automation tasks including:
 Motion Control
 Safety Systems
 designed for:
 multiple inputs and output
arrangements
 extended temperature ranges
 immunity to electrical noise
 resistance to vibration and impact
 Most I/O are Boolean, however
most PLC systems have an
analog I/O module
ADC in PLCs Rockwell PLC
Analog I/O Module
Sensor Integration (Robotics)
 Many robots use
microprocessors
 ADC allows robots to
interpret environmental
cues and compensate
 If the algorithm needs
to be changed it’s a
simple matter of
modifying the code
 Analog control
systems require a
complete circuit
redesign
Cell Phones
 Digital signals can be easily
manipulated
 Digital phones convert your voice
into binary information and then
compress it
 This compression allows between
three and 10 digital calls to
occupy the space of
a sing le  analog call.
 The analog-to-digital and digital-
to-analog conversion chips
translate the outgoing audio
signal from analog to digital and
the incoming signal from digital
back to analog
Why Digital?
Audio Devices
 ADCs are integral to
current music reproduction
technology
 They sample audio
streams and store the
digital data on media like
compact disks
 The current crop of AD
converters utilized in music
can sample at rates up to
192 kilohertz
 Sound Cards
Examples ADC FromSound Card
Video Devices
 Analog video and audio
signals are converted to
digital signals for
display to user
 Slingbox converts
analog input stream
and rebroadcasts it
across the internet in
digital form
 CCDs use ADCs to
process image data
TV Tuners
Selection of an ADC
 Important Considerations:
 Input Type – Differential or Single Ended
 Resolution - Most Important
 Scaling - allows the user to divide or multiply the input
voltage to more closely match the full scale range of the
ADC
 Sample Rate - The sample rate must be at least twice the
frequency the you are measuring, but 5 times is much
better
 Channel Scan Rate - The channel scan rate is the
maximum rate that the ADC can select a new channel and
make a measurement. many ADCs have a relatively slow
scan rate (when compared to the sample rate.)
 Eg. To achieve a sample rate of 600Hz on three channels, you
will need a channel scan rate of at least 1.8kHz
Example: Selecting an ADC
 We want to digitize a vibration signal
measured by an accelerometer with the
following characteristics (PCB 301A10):
 Sensitivity: (±2.0%) 100 mV/g
 Measurement Range: ±50 g pk
 Frequency Range: (±5%) 0.5 to 10000 Hz
 Select a satisfactory Analog to Digital
Converter….
Example Continued
 Desired Signal:
 Sensitivity: (±2.0%) 100 mV/g
 Measurement Range: ±50 g pk
 Frequency Range: (±5%) 0.5 to 10000 Hz
 Resolution:
 Minimum Sampling Freq:
 Ideal Sampling Freq:
12 −
= n
Vrange
resolution
maxmin *2 ffs =
maxmin *5 ffs =
Solution
bitbitn 866.6
)2ln(
)1
1.0
10
ln(
⇒=
+
=
Hz
Hzfs
50000
10000*5min
=
=
Choosing AD7892
 From Analog Devices:
 The AD7892 is a high speed, low
power, 12-bit A/D converter that
operates from a single +5 V
supply. The part contains a 1.47
µs successive approximation
ADC, an on-chip track/hold
amplifier, an internal +2.5 V
reference and on-chip versatile
interface structures that allow
both serial and parallel
connection to a microprocessor.
The part accepts an analog input
range of ±10 V or±5 V.
Overvoltage protection on the
analog inputs for the AD7892-1
and AD7892-3 allows the input
voltage to go to ±17 V or ±7 V
respectively without damaging
the ports.
References
 Cetinkunt, Sabri. Mechatronics 2007
 www.me.gatech.edu/mechatronics_course
 en.wikipedia.org/
 www.engineer.tamuk.edu/
 www.scm.tees.ac.uk
 Bishop, Ron. Basic Microprocessors and the 6800
 MC912SC Family Data Sheet
 MC912SC Reference Manual
 MC912SC Programming Reference Guide
THANK YOUTHANK YOU

Analog to digital converters, adc

  • 1.
    By: Saumya RanjanBehura Analog-Digital Converters
  • 2.
    Agenda  Introduction toADC  Types of ADC  Characteristics of ADC in MC9S12C  Application and Selection of ADC
  • 3.
    Introduction of ADC What is ADC?  Why is ADC important?  How does it work?
  • 4.
    What is ADC? ADC (Analog to Digital Converter) is an electronic device that converts a continuous analog input signal to discrete digital numbers (binary)  Analog  Real world signals that contain noise  Continuous in time  Digital  Discrete in time and value  Binary digits that contain values 0 or 1
  • 5.
    Why is ADCImportant?  All microcontrollers store information using digital logic  Compress information to digital form for efficient storage  Medium for storing digital data is more robust  Digital data transfer is more efficient  Digital data is easily reproducible  Provides a link between real-world signals and data storage
  • 6.
    How ADC Works 2Stages:  Sampling  Sample-Hold Circuit  Aliasing  Quantizing and Encoding  Resolution Binary output
  • 7.
    Sampling  Reduction ofa continuous signal to a discrete signal  Achieved through sampling and holding circuit  Switch ON – sampling of signal (time to charge capacitor w/ Vin)  Switch OFF - voltage stored in capacitor (hold operation)  Must hold sampled value constant for digital conversion Response of Sample and Hold CircuitSimple Sample and Hold Circuit
  • 8.
    Sampling  Sampling ratedepends on clock frequency  Use Nyquist Criterion  Increasing sampling rate increases accuracy of conversion  Possibility of aliasing max2 ffs ∗> s s f T 1 = Sampling Signal: Sampling Period: Nyquist Criterion: wT
  • 9.
    Aliasing  High andlow frequency samples are indistinguishable  Results in improper conversion of the input signal  Usually exists when Nyquist Criterion is violated  Can exist even when:  Prevented through the use of Low-Pass (Anti-aliasing) Filters max2 ffs ∗>
  • 10.
    Quantizing and Encoding Approximates a continuous range of values and replaces it with a binary number  Error is introduced between input voltage and output binary representation  Error depends on the resolution of the ADC
  • 11.
    Resolution )12/( −= n rangeVresolution )12/(71 3 0.7 3 −= = = VV n VVrange Maximum value of quantization error  Error is reduced with more available memory Example: Vrange=Input Voltage Range n= # bits of ADC Resolution V resolutionQerror 5. 2/ ±= ±=
  • 12.
    Resolution  Increase inresolution improves the accuracy of the conversion Minimum voltage step recognized by ADC Analog Signal Digitized Signal- High Resolution Digitized Signal- Low Resolution
  • 13.
    Flash A/D Converter SuccessiveApproximation A/D Converter Example of Successive Approximation Dual Slope A/D Converter Delta – Sigma A/D Converter Types of A/D Converters
  • 14.
    Elements of aFlash A/D Converter Encoder Comparator
  • 15.
    FLASH A/D CONVERTER 3Bit Digital Output Resolution 23 -1 = 7 Comparators
  • 16.
    Flash A/D ConverterContd. Pros • Fastest (in the order of nano seconds) • Simple operational theory • Speed is limited only by gate and comparator propagation delay • Each additional bit of resolution requires twice the number of comparators •Expensive • Prone to produce glitches in the output Cons
  • 17.
  • 18.
  • 19.
    Elements of theSuccessive Approximation ADC Takes in a Combination of Bits Successive Approximation Register Digital to Analog Converter
  • 20.
  • 21.
    Example Show the timingwaveforms that would occur in SAR ADC when converting an analog voltage of 6.84V to 8-bit binary, assume that the full scale input voltage of the DAC is 10V. Vref = 10 V Vin = 6.84 V
  • 22.
    DAC Input DACVout Cumulative Voltage D7 5.0000 5.0000 D6 2.5000 7.5000 D5 1.2500 8.7500 D4 0.6250 9.3750 D3 0.3125 9.6875 D2 0.15625 9.84375 D1 0.078125 9.921875 D0 0.0390625 9.9609375 6.84 V 5 7.5 6.25 6.875 6.5625 6.71875 6.796875 6.8359375 5 7.5 6.25 6.875 6.5625 6.71875 6.796875 6.8359375
  • 23.
    Dual Slope A/DConverter Contd. Pros • High accuracy • Fewer adverse affects from noise • Slow • Accuracy is dependent on the use of precision external components Cons
  • 24.
  • 25.
  • 26.
    #2 Digital Filter Delta-SigmaADC contd. Decimator
  • 27.
    Sigma-Delta A/D ConverterContd. Pros •High Resolution •No need of precision components • Slow due to over sampling • Good for low bandwidth Cons
  • 28.
    Type Speed(relative) Cost(Relative) DualSlope Slow Med Flash Very fast High Successive approx Medium fast Low Sigma-Delta Slow Low ADC Comparison
  • 29.
    ATD10B8C on MC9S12C32 Presented by:  Michael Hochman
  • 30.
  • 31.
  • 32.
    ATD10B8C Key Features Resolution  8/10 bit (manually chosen)  Conversion Time  7 usec, 10 bit  Successive Approximation ADC architecture  8-channel multiplexed inputs  External trigger control  Conversion modes  Single or continuous sampling  Single or multiple channels
  • 33.
    ATD10B8C External Pins 12 external pins  AN7 / ETRIG / PAD7  Analog input channel 7  External trigger for ADC  General purpose digital I/O  AN6/PAD6 – AN0/PAD0  Analog input  General purpose digital I/O  VRH, VRL  High and low reference voltages for ADC  VDDA, VSSA  Power supplies for analog circuitry
  • 34.
    ATD10B8C Registers  6Control Registers ($0080 - $0085)  Configure general ADC operation  2 Status Registers ($0086, $008B)  General status information regarding ADC  2 Test Registers ($0088 - $0089)  Allows for analog conversion of internal states  16 Conversion Result Registers ($0090 - $009F)  Formatted results (2 bytes)  1 Digital Input Enable Register ($008D)  Convert channels to digital inputs  1 Digital Port Data Register ($008F)  Contains logic levels of digital input pins
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
    Applications For ADC What are some applications for Analog to Digital Converters?  Measurements / Data Acquisition  Control Systems  PLCs (Programmable Logic Controllers)  Sensor integration (Robotics)  Cell Phones  Video Devices  Audio Devices
  • 48.
    Measurements / Data Acquisition The sampling of the real world to generate data that can be manipulated by a computer  (DSP) Digital Signal Processing first requires a digital signal  Eg. Analysis of data from weather balloons by the National Weather Service What is Data Acquisition NI X-Series Data Acquisition Card
  • 49.
    Control Systems S/H & ADC Digital CPU Co ntrolle r D/A & Hold Plant Transduce r Clock Digital Control System + - R Y t t e e* Controller 0010 0101 0011 1011 ∆t e*(∆t) 1001 0010 1010 0101 ∆t u*(∆t) e e*(∆t) u*(∆t) u
  • 50.
    The Old Way….Analog Computers Comdyna  GP6
  • 51.
    The New Way tt e e* Controller 0010 0101 0011 1011 ∆t e*(∆t) 1001 0010 1010 0101 ∆t u*(∆t) ADC Analog Input D/A Analog Output
  • 52.
    Programmable Logic Controllers  PLCsare the industry standard for automation tasks including:  Motion Control  Safety Systems  designed for:  multiple inputs and output arrangements  extended temperature ranges  immunity to electrical noise  resistance to vibration and impact  Most I/O are Boolean, however most PLC systems have an analog I/O module ADC in PLCs Rockwell PLC Analog I/O Module
  • 53.
    Sensor Integration (Robotics) Many robots use microprocessors  ADC allows robots to interpret environmental cues and compensate  If the algorithm needs to be changed it’s a simple matter of modifying the code  Analog control systems require a complete circuit redesign
  • 54.
    Cell Phones  Digitalsignals can be easily manipulated  Digital phones convert your voice into binary information and then compress it  This compression allows between three and 10 digital calls to occupy the space of a sing le  analog call.  The analog-to-digital and digital- to-analog conversion chips translate the outgoing audio signal from analog to digital and the incoming signal from digital back to analog Why Digital?
  • 55.
    Audio Devices  ADCsare integral to current music reproduction technology  They sample audio streams and store the digital data on media like compact disks  The current crop of AD converters utilized in music can sample at rates up to 192 kilohertz  Sound Cards Examples ADC FromSound Card
  • 56.
    Video Devices  Analogvideo and audio signals are converted to digital signals for display to user  Slingbox converts analog input stream and rebroadcasts it across the internet in digital form  CCDs use ADCs to process image data TV Tuners
  • 57.
    Selection of anADC  Important Considerations:  Input Type – Differential or Single Ended  Resolution - Most Important  Scaling - allows the user to divide or multiply the input voltage to more closely match the full scale range of the ADC  Sample Rate - The sample rate must be at least twice the frequency the you are measuring, but 5 times is much better  Channel Scan Rate - The channel scan rate is the maximum rate that the ADC can select a new channel and make a measurement. many ADCs have a relatively slow scan rate (when compared to the sample rate.)  Eg. To achieve a sample rate of 600Hz on three channels, you will need a channel scan rate of at least 1.8kHz
  • 58.
    Example: Selecting anADC  We want to digitize a vibration signal measured by an accelerometer with the following characteristics (PCB 301A10):  Sensitivity: (±2.0%) 100 mV/g  Measurement Range: ±50 g pk  Frequency Range: (±5%) 0.5 to 10000 Hz  Select a satisfactory Analog to Digital Converter….
  • 59.
    Example Continued  DesiredSignal:  Sensitivity: (±2.0%) 100 mV/g  Measurement Range: ±50 g pk  Frequency Range: (±5%) 0.5 to 10000 Hz  Resolution:  Minimum Sampling Freq:  Ideal Sampling Freq: 12 − = n Vrange resolution maxmin *2 ffs = maxmin *5 ffs = Solution bitbitn 866.6 )2ln( )1 1.0 10 ln( ⇒= + = Hz Hzfs 50000 10000*5min = =
  • 60.
    Choosing AD7892  FromAnalog Devices:  The AD7892 is a high speed, low power, 12-bit A/D converter that operates from a single +5 V supply. The part contains a 1.47 µs successive approximation ADC, an on-chip track/hold amplifier, an internal +2.5 V reference and on-chip versatile interface structures that allow both serial and parallel connection to a microprocessor. The part accepts an analog input range of ±10 V or±5 V. Overvoltage protection on the analog inputs for the AD7892-1 and AD7892-3 allows the input voltage to go to ±17 V or ±7 V respectively without damaging the ports.
  • 61.
    References  Cetinkunt, Sabri.Mechatronics 2007  www.me.gatech.edu/mechatronics_course  en.wikipedia.org/  www.engineer.tamuk.edu/  www.scm.tees.ac.uk  Bishop, Ron. Basic Microprocessors and the 6800  MC912SC Family Data Sheet  MC912SC Reference Manual  MC912SC Programming Reference Guide
  • 62.