• No results found

Analog-to-Digital Conversion

N/A
N/A
Protected

Academic year: 2021

Share "Analog-to-Digital Conversion"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

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.

(2)

Analog-to-digital converters

proportionality Vmax = 7.5V 0V 1111 1110 0000 0010 0100 0110 1000 1010 1100 0001 0011 0101 0111 1001 1011 1101 0.5V 1.0V 1.5V 2.0V 2.5V 3.0V 3.5V 4.0V 4.5V 5.0V 5.5V 6.0V 6.5V 7.0V analog to digital 4 3 2 1 t1 t2 t3 t4 0100 0110 0110 0101 time ana log input ( V) Digital output digital to analog 4 3 2 1 0100 1000 0110 0101 t1 t2 t3 t4 time ana log output ( V) Digital input

Embedded Systems Design: A Unified

(3)

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

Vmax 0 V 1..1 = 2n-1 0..0 = 0

(4)

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

Vmax 0 V 3=11 2=10 1=01 0=00 r 3=11 2=10 1=01 0=00

(5)

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?

DAC

Vmax x0 x1 Xn-1 a

(6)

ADC: Digital Encoding

Guessing the encoding is similar to finding an item in a list.

1.

Sequential search – counting up: start with an encoding of

0, then 1, then 2, etc. until find a match.

• 2n comparisons: Slow!

2.

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

(7)

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 = 2

n

– 1

a / Vmax = d / M

5 / 15 = d / (256 - 1)

(8)

ADC using successive

approximation

0 1 0 0 0 0 0 0

½(Vmax – Vmin) = 7.5 volts Vmax = 7.5 volts. ½(7.5 + 0) = 3.75 volts Vmin = 3.75 volts. 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 ½(7.5 + 3.75) = 5.63 volts Vmax = 5.63 volts ½(5.63 + 3.75) = 4.69 volts Vmin = 4.69 volts. 0 1 0 1 0 0 0 0

Embedded Systems Design: A Unified

Hardware/Software Introduction, (c) 2000 Vahid/Givargis

(9)

ADC using successive

approximation

½(5.63 + 4.69) = 5.16 volts Vmax = 5.16 volts. 0 1 0 1 0 0 0 0 ½(5.16 + 4.69) = 4.93 volts Vmin = 4.93 volts. 0 1 0 1 0 1 0 0 ½(5.16 + 4.93) = 5.05 volts Vmax = 5.05 volts. 0 1 0 1 0 1 0 0 ½(5.05 + 4.93) = 4.99 volts 0 1 0 1 0 1 0 1

Embedded Systems Design: A Unified

Hardware/Software Introduction, (c) 2000 Vahid/Givargis

(10)

Constructing ADC

SAR

Comparator

DAC

Vmax

Vmin

Analog

input

SAR

BUF

Digital

output

State

machine

SAR: Successive

approximation register

Timing control

(11)

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

(12)

Scan Sequence and Conversion

• After the ADC is initialized, a sequence of scans is set up as a “queue” in the CCW Table.

• Each channel to be scanned is added to the queue at successive

positions 0, 1, 2, etc. For example: CCW0, CCW1, CCW2, CCW3.

– An end-of-queue marker should be added at the next position.

• The ADC starts the scan and conversion when it is triggered by the enable bit.

• The ADC reads the CCWs, one after another until end-of-queue is reached, and for each CCW, it converts the signal on the specified channel.

– A conversion on a channel stores a result in the respective position of the Result Table, e.g., the result for CCW0 is stored at Result0, etc.

• When the scan and conversion is complete for all CCWs, then the ADC sets the completion flag to 1. Now all digital results are available to be read from the Result Table.

References

Related documents

The Analog Input node controls the A/D converter, which converts the analog input signal (from the microphone, function generator, or any other analog sound source) to a sequence

V in Comparator Control Logic D A C Counter START V in Comparato r Digital Output clock Once the digital output has been read by the associated circuitry, a new start signal is

Model Simulation of “Sawah-Kolam” System for Rainwater Harvesting to Support Rainfed Paddy Production (S Triyono, Zeovany, Oktafri, and B Rosadi): The study was used to

Under current US GAAP, traditional non-participating insur- ance contracts (FAS 60 and FAS 97 limited pay) hold net premium reserves based on assumptions that are locked in when

Ongoing research by the National Institute of Child Health and Human Development suggests that children in quality daycare centers may even have an intellectual edge over those

Use your hybrid map and the Biloxi index map to locate a photographic image that includes the intersection of Front Beach Drive and Martin Avenue in Ocean Springs, MS (note

A careful inventory and assessment of technology resources is the first crucial step in developing a Business Continuity Plan for technology. This assessment defines what the Plan

In spring 2013, hazelnut leaves, fruit clusters and shoots showing powdery mildew infection symptoms different from those observed previously were discovered in Giresun, Ordu