04-11-2016, 03:05 PM
1464683610-adc.ppt (Size: 600 KB / Downloads: 30)
Analog-to-Digital Conversion
Terminology
analog: continuously valued signal, such as temperature or speed, with infinite possible values in between
digital: discretely valued signal, such as integers, encoded in binary
analog-to-digital converter: ADC, A/D, A2D; converts an analog signal to a digital signal
digital-to-analog converter: DAC, D/A, D2A
An embedded system’s surroundings typically involve many analog signals.
Analog-to-digital converters
Proportional Signals
Simple Equation
Assume minimum voltage of 0 V.
Vmax = maximum voltage of the analog signal
a = analog value
n = number of bits for digital encoding
2n = number of digital codes
M = number of steps, either 2n or 2n – 1
d = digital encoding
a / Vmax = d / M
Resolution
Let n = 2
M = 2n – 1
3 steps on the digital scale
d0 = 0 = 0b00
dVmax = 3 = 0b11
M = 2n
4 steps on the digital scale
d0 = 0 = 0b00
dVmax - r = 3 = 0b11 (no dVmax )
r, resolution: smallest analog change resulting from changing one bit
DAC vs. ADC
DAC:
n digital inputs for digital encoding d
analog input for Vmax
analog output a
ADC:
Given a Vmax analog input and an analog input a, how does the converter know what binary value to assign to d in order to satisfy the ratio?
may use DAC to generate analog values for comparison with a
ADC “guesses” an encoding d, then checks its guess by inputting d into the DAC and comparing the generated analog output a’ with original analog input a
How does the ADC guess the correct encoding?
ADC: Digital Encoding
Guessing the encoding is similar to finding an item in a list.
Sequential search – counting up: start with an encoding of 0, then 1, then 2, etc. until find a match.
2n comparisons: Slow!
Binary search – successive approximation: start with an encoding for half of maximum; then compare analog result with original analog input; if result is greater (less) than the original, set the new encoding to halfway between this one and the minimum (maximum); continue dividing encoding range in half until the compared voltages are equal
n comparisons: Faster, but more complex converter
Takes time to guess the encoding: start conversion input, conversion complete output
ADC using successive approximation
Given an analog input signal whose voltage should range from 0 to 15 volts, and an 8-bit digital encoding, calculate the correct encoding for 5 volts. Then trace the successive-approximation approach to find the correct encoding.
Assume M = 2n – 1
a / Vmax = d / M
5 / 15 = d / (256 - 1)
d = 85 or binary 01010101
ADC using successive approximation
ADC using successive approximation
Constructing ADC
Bit Weight
Notice the concept of bit weight in the last example:
bit 7 = 7.5 V = 15/2
bit 6 = 3.75 V = 15/4
Each bit is weighted with an analog value, such that a 1 in that bit position adds its analog value to the total analog value represented by the digital encoding.
Example: -5 V to +5 V analog range, n=8
Bit Weight
Example (continued): -5 V to +5 V analog range, n=8
Digital numbers for a few analog values
Values shown increment by 6 bits (weight for bit position 5 is 1.25 V)
Maximum digital number only approximates the maximum analog value in the range
Try (-5) + sum of all bit weights
Terms & Equations
Offset: minimum analog value
Span (or Range): difference between maximum and minimum analog values
Max - Min
n: number of bits in digital code (sometimes referred to as n-bit resolution)
Bit Weight: analog value corresponding to a bit in the digital number
Step Size (or Resolution): smallest analog change resulting from changing one bit in the digital number, or the analog difference between two consecutive digital numbers; also the bit weight of the
Span / 2n (Assume M = 2n)
Let AV be Analog Value; DN be Digital Number:
AV = DN * Step Size + Offset = (DN / 2n )* Span + Offset
DN = (AV - Offset) / Step Size = (AV - Offset) * 2n / Span