Embedded Systems I/O: Version 2 EE IIT, Kharagpur 1
Embedded Systems I/O: Version 2 EE IIT, Kharagpur 1
3
Embedded Systems I/O
Version 2 EE IIT, Kharagpur 1
Lesson
19
Analog Interfacing
Version 2 EE IIT, Kharagpur 2
Instructional Objectives
After going through this lesson the student would be able to
Pre-Requisite
Digital Electronics, Microprocessors
19(I) Introduction
Fig.19.1 shows a typical sensor network. You will find a number of sensors and actuators
connected to a common bus to share information and derive a collective decision. This is a
complex embedded system. Digital camera falls under such a system. Only the analog signals are
shown here. Last lesson discussed in detail about the AD and DA conversion methods. This
chapter shall discuss the inbuilt AD-DA converter and standalone converters and their
interfacing.
Vref: It is reference voltage which decides the range of the input voltage. By making it negative
bipolar inputs can be used.
AD_RESULT
For an A/D conversion, the high byte contains the eight MSBs from the conversion, while the
low byte contains the two LSBs from a 10- bit conversion (undefined for an 8-bit conversion),
indicates which A/D channel was used, and indicates whether the channel is idle. For a
Once the A/D converter receives the command to start a conversion, a delay time elapses
before sampling begins. During this sample delay, the hardware clears the successive
approximation register and selects the designated multiplexer channel. After the sample delay,
the device connects the multiplexer output to the sample capacitor for the specified sample time.
After this sample window closes, it disconnects the multiplexer output from the sample capacitor
so that changes on the input pin will not alter the stored charge while the conversion is in
progress. The device then zeros the comparator and begins the conversion. The A/D converter
uses a successive approximation algorithm to perform the analog-to-digital conversion. The
converter hardware consists of a 256-resistor ladder, a comparator, coupling capacitors, and a 10-
bit successive approximation register (SAR) with logic that guides the process. The resistive
ladder provides 20 mV steps (VREF = 5.12 volts), while capacitive coupling creates 5 mV steps
within the 20 mV ladder voltages. Therefore, 1024 internal reference voltage levels are available
for comparison against the analog input to generate a 10-bit conversion result. In 8- bit
conversion mode, only the resistive ladder is used, providing 256 internal reference voltage
levels. The successive approximation conversion compares a sequence of reference voltages to
START CLOCK
8-BIT A/D
CONTROL & END OF
TIMING CONVERSION
(INTERRUPT)
8
CHANNELS
MULTIPLE-
8 ANALOG
XING
INPUTS S.A.R
ANALOG
SWITCHES
COMPARATOR TRI-
STATE
OUTPUT 8-BIT
LATCH OUTPUTS
BUFFER
SWITCH TREE
Functional Description
Multiplexer
The device contains an 8-channel single-ended analog signal multiplexer. A particular input
channel is selected by using the address decoder. Table 1 shows the input states for the address
lines to select any channel. The address is latched into the decoder on the low-to-high transition
of the address latch enable signal.
TABLE 1
SELECTED ANALOG ADDRESS LINE
CHANNEL C B A
IN0 L L L
IN1 L L H
IN2 L H L
IN3 L H H
IN4 H L L
IN5 H L H
IN6 H H L
IN7 H H H
The Converter
This 8-bit converter is partitioned into 3 major sections: the 256R ladder network, the successive
approximation register, and the comparator. The converter’s digital outputs are positive true. The
1½ R
256 R TO
COMPARATOR
INPUT
R
½R
REF(-)
The bottom resistor and the top resistor of the ladder network in Fig.19.6 are not the same value
as the remainder of the network. The difference in these resistors causes the output characteristic
to be symmetrical with the zero and full-scale points of the transfer curve. The first output
transition occur when the analog signal has reached +1⁄2 LSB and succeeding output transitions
occur every 1 LSB later up to full-scale. The successive approximation register (SAR) performs
8-iterations to approximate the input voltage. For any SAR type converter, n-iterations are
required for an n-bit converter. Fig.19.7 shows a typical example of a 3-bit converter. The A/D
converter’s successive approximation register (SAR) is reset on the positive edge of the start
conversion (SC) pulse. The conversion is begun on the falling edge of the start conversion pulse.
A conversion in process will be interrupted by receipt of a new start conversion pulse.
Continuous conversion may be accomplished by tying the end-of-conversion (EOC) output to the
SC input. If used in this mode, an external start conversion pulse should be applied after power
up. End-of-conversion will go low between 0 and 8 clock pulses after the rising edge of start
conversion. The most important section of the A/D converter is the comparator. It is this section
which is responsible for the ultimate accuracy of the entire converter.
READ
INTERRUPT
500 kHz CLK 0E
ADDRESS 5.000V VREF (+) E0C INTERRUPT
DECODE
(AD4 – AD15)* 0.000V VREF (-)
2-1 DB7 MSB
START 2 -2
DB6
ALE 2-3 DB5
WRITE
2-4 DB4
AD0 A 2-5 DB3
ADC0808
AD1 B ADC0809 2 -6
DB2
-7
AD2 C 2 DB1
2-8 DB0 LSB
5V SUPPLY
In0 VIN 1
MSB LSB
A1 A2 A3 A4 A5 A6 A7 A8
RANGE
CURRENT SWITCHES I0
CONTROL
VREF (+)
NPN CURRENT VCC
SOURCE PAIR
VREF (-)
REFERENCE COMPEN
CURRENT AMP
VEE
GND 2 15
VREF(-)
VEE 3 14
VREF(+)
I0 4 13
VCC
DAC0808
MSB A1 5 12
A8 LSB
6 11
A2 A7
A3 7 10
A6
A4 8 9
A5
The pins are labeled A1 through A8, but note that A1 is the Most Significant Bit, and A8 is the
Least Significant Bit (the opposite of the normal convention). The D/A converter has an output
current, instead of an output voltage. An op-amp converts the current to a voltage. The output
current from pin 4 ranges between 0 (when the inputs are all 0) to Imax*255/256 when all the
inputs are 1. The current, Imax, is determined by the current into pin 14 (which is at 0 volts).
Since we are using 8 bits, the maximum value is Imax*255/256. The output of the D/A converter
takes some time to settle. Therefore there should be a small delay before sending the next data to
the DA. However this delay is very small compared to the conversion time of an AD Converter,
therefore, does not matter in most real time signal processing platforms. Fig.19.10 shows a
typical interface.
13
5 14 5.000k
MSBA1 10.000V = VREF
6
A2 5k
7 15
A3 5.000k
8 2
DIGITAL A4
9 DAC0808
INPUTS A5
10 4
A6 -
11
A7
12 16 LF351 V0
LSB A8 OUTPUT
3 0.1 μF +
VEE = -15V
19(V) Conclusion
In this lesson you learnt about the following
The internal AD converters of 80196 family of processor
The external microprocessor compatible AD0809 converter
A typical 8-bit DA Converter
Both the ADCs use successive approximation technique. Flash ADCs are complex and therefore
generate difficult VLSI circuits unsuitable for coexistence on the same chip. Sigma-Delta need
very high sampling rate.
Ans:
Stage-1 Signal Amplification and Conditioning This can also amplify the noise.
Stage-2 Anti-aliasing Filter Some useful information such as transients in the real systems
cannot be captured.
Stage-3 Sample and Hold The leakage and electromagnetic interference due to switching
Stage-4 Analog to Digital Converter Quantization error due to finite bit length
Stage-5 Digital Processing and Data manipulation in a Processor: Numerical round up errors due
to finite word length and the delay caused by the algorithm.
Stage-6 Processed Digital Values are temporarily stored in a latch before D-A conversion: Error
in reconstruction due to zero-order approximation
Q.2 Why it is necessary to separate the digital ground from analog ground in a typical ADC?
Ans: Digital circuit noise can get to analogue signal path if separate grounding systems are not
used for digital and analogue parts. Digital grounds are invariably noisier than analog grounds
because of the switching noise generated in digital chips when they change state. For large
current transients, PCB trace inductances causes voltage drops between various ground points on
the board (ground bounce). Ground bounce translates into varying voltage level bounce on signal
lines. For digital lines this isn't a problem unless one crosses a logic threshold. For analog it's just
plain noise to be added to the signals.