The ADC0801, ADC0802, ADC0803, ADC0804 and
ADC0805 are CMOS 8-bit successive approximation A/D
converters that use a differential potentiometric ladderÐ
similar to the 256R products. These converters are designed to allow operation with the NSC800 and INS8080A
derivative control bus with TRI-STATE
output latches di-
É
rectly driving the data bus. These A/Ds appear like memory
locations or I/O ports to the microprocessor and no interfacing logic is needed.
Differential analog voltage inputs allow increasing the common-mode rejection and offsetting the analog zero input
voltage value. In addition, the voltage reference input can
be adjusted to allow encoding any smaller analog voltage
span to the full 8 bits of resolution.
Features
Y
Compatible with 8080 mP derivativesÐno interfacing
logic needed - access time - 135 ns
Y
Easy interface to all microprocessors, or operates
‘‘stand alone’’
Typical Applications
Y
Differential analog voltage inputs
Y
Logic inputs and outputs meet both MOS and TTL voltage level specifications
Y
Works with 2.5V (LM336) voltage reference
Y
On-chip clock generator
Y
0V to 5V analog input voltage range with single 5V
supply
Y
No zero adjust required
Y
0.3×standard width 20-pin DIP package
Y
20-pin molded chip carrier or small outline package
Y
Operates ratiometrically or with 5 VDC, 2.5 VDC, or analog span adjusted voltage reference
Key Specifications
Y
Resolution8 bits
Y
Total error
Y
Conversion time100 ms
g
(/4 LSB,g(/2 LSB andg1 LSB
TL/H/5671– 1
8080 Interface
Error Specification (Includes Full-Scale,
Zero Error, and Non-Linearity)
Part
Number
Full-
Scale
Adjusted
V
/2e2.500 VDCV
REF
(No Adjustments)(No Adjustments)
/2eNo Connection
REF
ADC0801g(/4 LSB
ADC0802
g
(/2 LSB
ADC0803g(/2 LSB
ADC0804
TL/H/5671– 31
TRI-STATEÉis a registered trademark of National Semiconductor Corp.
Z-80
is a registered trademark of Zilog Corp.
É
C
1995 National Semiconductor CorporationRRD-B30M115/Printed in U. S. A.
TL/H/5671
ADC0805
g
1 LSB
g
1 LSB
Absolute Maximum Ratings (Notes1&2)
If Military/Aerospace specified devices are required,
please contact the National Semiconductor Sales
Office/Distributors for availability and specifications.
Note 1: Absolute Maximum Ratings indicate limits beyond which damage to the device may occur. DC and AC electrical specifications do not apply when operating
the device beyond its specified operating conditions.
Note 2: All voltages are measured with respect to Gnd, unless otherwise specified. The separate A Gnd point should always be wired to the D Gnd.
Note 3: A zener diode exists, internally, from V
Note 4: For V
conduct for analog input voltages one diode drop below ground or one diode drop greater than the V
as high level analog inputs (5V) can cause this input diode to conduct – especially at elevated temperatures, and cause errors for analog inputs near full-scale. The
spec allows 50 mV forward bias of either diode. This means that as long as the analog V
code will be correct. To achieve an absolute 0 V
variations, initial tolerance and loading.
Note 5: Accuracy is guaranteed at f
extended so long as the minimum clock high time interval or minimum clock low time interval is no less than 275 ns.
Note 6: With an asynchronous start pulse, up to 8 clock periods may be required before the internal clock phases are proper to start the conversion process. The
start request is internally latched, see
Note 7: The CS
the converter in a reset mode and the start of conversion is initiated by the low to high transition of the WR
Note 8: None of these A/Ds requires a zero adjust (see section 2.5.1). To obtain zero code at other analog input voltages see section 2.5 and
Note 9: The V
ADC0805, and in the ADC0804LCJ, each resistor is typically 16 kX. In all versions of the ADC0804 except the ADC0804LCJ, each resistor is typically 2.2 kX.
Note 10: Human body model, 100 pF discharged through a 1.5 kX resistor.
(b)tVIN(a) the digital output code will be 0000 0000. Two on-chip diodes are tied to each analog input (see block diagram) which will forward
IN
CLK
input is assumed to bracket the WR strobe input and therefore timing is dependent on the WR pulse width. An arbitrarily wide pulse width will hold
/2 pin is the center point of a two-resistor divider connected from VCCto ground. In all versions of the ADC0801, ADC0802, ADC0803, and
REF
Figure 2
to Gnd and has a typical breakdown voltage of 7 VDC.
CC
to5VDCinput voltage range will therefore require a minimum supply voltage of 4.950 VDCover temperature
DC
e
640 kHz. At higher clock frequencies accuracy can degrade. For lower clock frequencies, the duty cycle limits can be
and section 2.0.
3
Typical Performance Characteristics
Delay From Falling Edge of
Logic Input Threshold Voltage
vs. Supply Voltage
RD
to Output Data Valid
vs. Load Capacitance
CLK IN Schmitt Trip Levels
vs. Supply Voltage
f
vs. Clock Capacitor
CLK
Output Current vs
Temperature
Full-Scale Error vs
Conversion Time
Power Supply Current
vs Temperature (Note 9)
Effect of Unadjusted Offset Error
vs. V
/2 Voltage
REF
Linearity Error at Low
/2 Voltages
V
REF
TL/H/5671– 2
4
TRI-STATE Test Circuits and Waveforms
t
1H
e
t
20 ns
r
t1H,C
e
10 pF
L
t
Timing Diagrams (All timing is measured from the 50% voltage points)
e
t0H,C
0H
e
t
20 ns
r
L
10 pF
TL/H/5671– 3
Output Enable and Reset INTR
Note: Read strobe must occur 8 clock periods (8/f
) after assertion of interrupt to guarantee reset of INTR.
CLK
5
TL/H/5671– 4
Typical Applications (Continued)
6800 InterfaceRatiometric with Full-Scale Adjust
Absolute with a 2.500V Reference
*For low power, see also LM385-2.5
Zero-Shift and Span Adjust: 2V
Note: before using caps at VINor V
see section 2.3.2 Input Bypass Capacitors.
Absolute with a 5V Reference
s
s
V
5VSpan Adjust: 0VsV
IN
REF
/2,
s
3V
IN
TL/H/5671– 5
6
Typical Applications (Continued)
Directly Converting a Low-Level Signal
1 mV Resolution with mP Controlled Range
V
/2e128 mV
REF
e
1 LSB
1mV
s
s
V
DAC
a
V
(V
DAC
256 mV)
IN
V
REF
/2e256 mV
A mP Interfaced Comparator
For: VIN(a)lVIN(b)
e
Output
FF
Output
HEX
e
00
HEX
For: VIN(a)kVIN(b)
Digitizing a Current Flow
7
TL/H/5671– 6
Typical Applications (Continued)
Self-Clocking Multiple A/Ds
External Clocking
*Use a large R value
to reduce loading
at CLK R output.
Self-Clocking in Free-Running Mode
*After power-up, a momentary grounding
input is needed to guarantee operation.
of the WR
Operating with ‘‘Automotive’’ Ratiometric Transducers
CLK
s
1460 kHz
100 kHzsf
mP Interface for Free-Running A/D
Ratiometric with V
/2 Forced
REF
*VIN(b)e0.15 V
15% of V
s
CC
CC
s
V
85% of V
XDR
CC
TL/H/5671– 7
8
Typical Applications (Continued)
mP Compatible Differential-Input Comparator with Pre-Set V
**Can calibrate each sensor to allow easy replacement, then
A/D can be calibrated with a pre-set input voltage.
a
128§C
A
TL/H/5671– 8
9
Typical Applications (Continued)
Handling
g
5V Analog Inputs
Read-Only Interface
*Beckman InstrumentsÝ694-3-R10K resistor array
TL/H/5671– 33
mP Interfaced Comparator with Hysteresis
TL/H/5671– 35
Analog Self-Test for a System
TL/H/5671– 34
Protecting the Input
Diodes are 1N914
TL/H/5671– 9
A Low-Cost, 3-Decade Logarithmic Converter
TL/H/5671– 36
*LM389 transistors
e
A, B, C, D
10
TL/H/5671– 37
LM324A quad op amp
Typical Applications (Continued)
3-Decade Logarithmic A/D Converter
Noise Filtering the Analog Input
e
f
20 Hz
C
Uses Chebyshev implementation for steeper roll-off
unity-gain, 2nd order, low-pass filter
Adding a separate filter for each channel increases
system response time if an analog multiplexer
is used
Output Buffers with A/D Data Enabled
Multiplexing Differential Inputs
Increasing Bus Drive and/or Reducing Time on Bus
*A/D output data is updated 1 CLK period
prior to assertion of INTR
TL/H/5671– 10
*Allows output data to set-up at falling edge of CS
11
Typical Applications (Continued)
Note 1: Oversample whenever possible[keep fsl2f(b60)]to eliminate input frequency folding
(aliasing) and to allow for the skirt response of the filter.
Note 2: Consider the amplitude errors which are introduced within the passband of the filter.
Sampling an AC Input Signal
70% Power Savings by Clock Gating
(Complete shutdown takes&30 seconds.)
Power Savings by A/D and V
*Use ADC0801, 02, 03 or 05 for lowest power consumption.
Note: Logic inputs can be driven to V
Buffer prevents data bus from overdriving output of A/D when in shutdown mode.
with A/D supply at zero volts.
CC
Shutdown
REF
12
TL/H/5671– 11
Functional Description
1.0 UNDERSTANDING A/D ERROR SPECS
A perfect A/D transfer characteristic (staircase waveform) is
shown in
voltage and the particular points labeled are in steps of 1
LSB (19.53 mV with 2.5V tied to the V
output codes that correspond to these inputs are shown as
D
value (A
rect output ditigal codes, but also each riser (the transitions
between adjacent output codes) will be located
away from each center-value. As shown, the risers are ideal
and have no width. Correct digital output codes will be provided for a range of analog input voltages that extend
LSB from the ideal center-values. Each tread (the range of
analog input voltage that provides the same digital output
code) is therefore 1 LSB wide.
Figure 1b
All center-valued inputs are guaranteed to produce the correct output codes and the adjacent risers are guaranteed to
be no closer to the center-value points than
Figure 1a
b
1, D, and Da1. For the perfect A/D, not only will center-
b
1, A, Aa1,....)analog inputs produce the cor-
. The horizontal scale is analog input
/2 pin). The digital
REF
g
(/2 LSB
shows a worst case error plot for the ADC0801.
g
(/4 LSB. In
Transfer Function
g
other words, if we apply an analog input equal to the center-
g
value
(/4 LSB,
we guarantee
that the A/D will produce the
correct digital code. The maximum range of the position of
the code transition is indicated by the horizontal arrow and it
is guaranteed to be no more than (/2 LSB.
The error curve of
Figure 1c
shows a worst case error plot
for the ADC0802. Here we guarantee that if we apply an
analog input equal to the LSB analog voltage center-value
the A/D will produce the correct digital code.
Next to each transfer function is shown the corresponding
error plot. Many people may be more familiar with error plots
than transfer functions. The analog input voltage to the A/D
(/2
is provided by either a linear ramp or by the discrete output
steps of a high resolution DAC. Notice that the error is continuously displayed and includes the quantization uncertainty of the A/D. For example the error at point 1 of
Figure 1a
isa(/2 LSB because the digital code appeared (/2 LSB in
advance of the center-value of the tread. The error plots
always have a constant negative slope and the abrupt upside steps are always 1 LSB in magnitude.
Error Plot
e
a) Accuracy
g
0 LSB: A Perfect A/D
Transfer FunctionError Plot
e
g
b) Accuracy
(/4 LSB
Transfer FunctionError Plot
e
c) Accuracy
g
(/2 LSBTL/H/5671– 12
FIGURE 1. Clarifying the Error Specs of an A/D Converter
13
Functional Description (Continued)
2.0 FUNCTIONAL DESCRIPTION
The ADC0801 series contains a circuit equivalent of the
256R network. Analog switches are sequenced by successive approximation logic to match the analog difference input voltage[V
the R network. The most significant bit is tested first and
after 8 comparisons (64 clock cycles) a digital 8-bit binary
code (1111 1111
latch and then an interrupt is asserted (INTR
to-low transition). A conversion in process can be interrupted by issuing a second start command. The device may be
operated in the free-running mode by connecting INTR
the WR
sible conditions, an external WR
first power-up cycle.
On the high-to-low transition of the WR
SAR latches and the shift register stages are reset. As long
as the CS
main in a reset state.
periods after at least one of these inputs makes a low-tohigh transition
(a)bVIN(b)]to a corresponding tap on
IN
e
full-scale) is transferred to an output
makes a high-
input with CSe0. To ensure start-up under all pos-
pulse is required during the
input the internal
input and WR input remain low, the A/D will re-
Conversion will start from 1 to 8 clock
.
A functional diagram of the A/D converter is shown in
ure 2
. All of the package pinouts are shown and the major
logic control paths are drawn in heavier weight lines.
The converter is started by having CS
neously low. This sets the start flip-flop (F/F) and the resulting ‘‘1’’ level resets the 8-bit shift register, resets the Interrupt (INTR) F/F and inputs a ‘‘1’’ to the D flop, F/F1, which
is at the input end of the 8-bit shift register. Internal clock
signals then transfer this ‘‘1’’ to the Q output of F/F1. The
AND gate, G1, combines this ‘‘1’’ output with a clock signal
to provide a reset signal to the start F/F. If the set signal is
no longer present (either WR
to
reset and the 8-bit shift register then can have the ‘‘1’’
or CS is a ‘‘1’’) the start F/F is
clocked in, which starts the conversion process. If the set
signal were to still be present, this reset pulse would have
no effect (both outputs of the start F/F would momentarily
be at a ‘‘1’’ level) and the 8-bit shift register would continue
to be held in the reset mode. This logic therefore allows for
wide CS
and WR signals and the converter will start after at
least one of these signals returns high and the internal
clocks again provide a reset signal for the start F/F.
Fig-
and WR simulta-
Note 1: CS shown twice for clarity.
Note 2: SAR
e
Successive Approximation Register.
TL/H/5671– 13
FIGURE 2. Block Diagram
14
Functional Description (Continued)
After the ‘‘1’’ is clocked through the 8-bit shift register
(which completes the SAR search) it appears as the input to
the D-type latch, LATCH 1. As soon as this ‘‘1’’ is output
from the shift register, the AND gate, G2, causes the new
digital word to transfer to the TRI-STATE output latches.
When LATCH 1 is subsequently enabled, the Q output
makes a high-to-low transition which causes the INTR F/F
to set. An inverting buffer then supplies the INTR
nal.
Note that this SET
control of the INTR F/F remains low for
8 of the external clock periods (as the internal clocks run at
(/8 of the frequency of the external clock). If the data output
is continuously enabled (CS
INTR
output will still signal the end of conversion (by a high-
to-low transition), because the SET
and RD both held low), the
input can control the Q
output of the INTR F/F even though the RESET input is
constantly at a ‘‘1’’ level in this operating mode. This INTR
output will therefore stay low for the duration of the SET
signal, which is 8 periods of the external clock frequency
(assuming the A/D is not started during this interval).
When operating in the free-running or continuous conversion mode (INTR
pin tied to WR and CS wired lowÐsee
also section 2.8), the START F/F is SET by the high-to-low
transition of the INTR
signal. This resets the SHIFT REGISTER which causes the input to the D-type latch, LATCH 1,
to go low. As the latch enable input is still present, the Q
output will go high, which then allows the INTR F/F to be
RESET. This reduces the width of the resulting INTR
pulse to only a few propagation delays (approximately 300
ns).
When data is to be read, the combination of both CS
RD
being low will cause the INTR F/F to be reset and the
TRI-STATE output latches will be enabled to provide the 8bit digital outputs.
2.1 Digital Control Inputs
The digital control inputs (CS
2
T
L logic voltage levels. These signals have been renamed
,RD, and WR) meet standard
when compared to the standard A/D Start and Output Enable labels. In addition, these inputs are active low to allow
an easy interface to microprocessor control busses. For
non-microprocessor based applications, the CS
can be grounded and the standard A/D Start function is
obtained by an active low pulse applied at the WR
3) and the Output Enable function is caused by an active
low pulse at the RD
input (pin 2).
2.2 Analog Differential Voltage Inputs and
Common-Mode Rejection
This A/D has additional applications flexibility due to the
analog differential voltage input. The V
can be used to automatically subtract a fixed voltage value
IN
from the input reading (tare correction). This is also useful in
4 mA –20 mA current loop conversion. In addition, commonmode noise can be reduced by use of the differential input.
The time interval between sampling V
(/2 clock periods. The maximum error voltage due to this
(a) and VIN(b)is4-
IN
input sig-
output
and
input (pin 1)
input (pin
(b) input (pin 7)
slight time difference between the input voltage samples is
given by:
DV
(MAX)e(VP)(2qfcm)
e
4.5
,
f
#
J
CLK
where:
is the error voltage due to sampling delay
DV
e
VPis the peak value of the common-mode voltage
fcmis the common-mode frequency
As an example, to keep this error to (/4 LSB (E5 mV) when
operating with a 60 Hz common-mode frequency, f
using a 640 kHz A/D clock, f
of the common-mode voltage, V
[
DV
e(MAX)(fCLK
e
V
P
(2qfcm) (4.5)
, would allow a peak value
CLK
, which is given by:
P
]
)
cm
, and
or
b
(5c10
e
V
P
3
) (640c103)
(6.28) (60) (4.5)
which gives
j
1.9V.
V
P
The allowed range of analog input voltages usually places
more severe restrictions on input common-mode noise levels.
An analog input voltage with a reduced span and a relatively
large zero offset can be handled easily by making use of the
differential input (see section 2.4 Reference Voltage).
2.3 Analog Inputs
2.3.1 Input Current
Normal Mode
Due to the internal switching action, displacement currents
will flow at the analog inputs. This is due to on-chip stray
capacitance to ground as shown in
rONof SW 1 and SW 2j5kX
e
r
rONC
STRAY
j
5kX
Figure 3
c
12 pFe60 ns
.
TL/H/5671– 14
FIGURE 3. Analog Input Impedance
15
Functional Description (Continued)
The voltage on this capacitance is switched and will result in
currents entering the V
V
(b) input which will depend on the analog differential
IN
input voltage levels. These current transients occur at the
leading edge of the internal clocks. They rapidly decay and
do not cause errors
the end of the clock period.
Fault Mode
If the voltage source applied to the V
exceeds the allowed operating range of V
input currents can flow through a parasitic diode to the V
pin. If these currents can exceed the 1 mA max allowed
spec, an external diode (1N914) should be added to bypass
this current to the V
this diode, the voltage at the V
V
voltage by the forward voltage of this diode).
CC
2.3.2 Input Bypass Capacitors
Bypass capacitors at the inputs will average these charges
and cause a DC current to flow through the output resistances of the analog signal sources. This charge pumping
action is worse for continuous conversions with the V
input voltage at full-scale. For continuous conversions with
a 640 kHz clock frequency with the V
DC current is at a maximum of approximately 5 mA. Therefore,
bypass capacitors should not be used at the analog
inputs or the V
kX). If input bypass capacitors are necessary for noise filter-
REF
ing and high source resistance is desirable to minimize capacitor size, the detrimental effects of the voltage drop
across this input resistance, which is due to the average
value of the input current, can be eliminated with a full-scale
adjustment while the given source resistor and input bypass
capacitor are both in place. This is possible because the
average value of the input current is a precise linear function of the differential input voltage.
2.3.3 Input Source Resistance
Large values of source resistance where an input bypass
capacitor is not used,
rents settle out prior to the comparison time. If a low pass
filter is required in the system, use a low valued series resis-
s
tor (
1kX) for a passive RC section or add an op amp RC
active low pass filter. For low source resistance applica-
s
tions, (
1kX), a 0.1 mF bypass capacitor at the inputs will
prevent noise pickup due to series lead inductance of a long
wire. A 100X series resistor can be used to isolate this capacitorÐboth the R and C are placed outside the feedback
loopÐfrom the output of an op amp, if used.
2.3.4 Noise
The leads to the analog inputs (pin 6 and 7) should be kept
as short as possible to minimize input noise coupling. Both
noise and undesired digital clock coupling to these inputs
can cause system errors. The source resistance for these
inputs should, in general, be kept below 5 kX. Larger values
of source resistance can cause undesired system noise
pickup. Input bypass capacitors, placed from the analog inputs to ground, will eliminate system noise pickup but can
create analog scale errors as these capacitors will average
the transient input switching currents of the A/D (see section 2.3.1.). This scale error depends on both a large source
(a) input pin and leaving the
IN
as the on-chip comparator is strobed at
(a)orVIN(b) pin
IN
a
50 mV, large
CC
pin (with the current bypassed with
CC
/2 pin
will not cause errors
(a) pin can exceed the
IN
IN
(a) input at 5V, this
IN
for high resistance sources (l1
as the input cur-
(a)
CC
resistance and the use of an input bypass capacitor. This
error can be eliminated by doing a full-scale adjustment of
the A/D (adjust V
section 2.5.2 on Full-Scale Adjustment) with the source re-
/2 for a proper full-scale readingÐsee
REF
sistance and input bypass capacitor in place.
2.4 Reference Voltage
2.4.1 Span Adjust
For maximum applications flexibility, these A/Ds have been
designed to accommodatea5V
voltage reference. This has been achieved in the design of
the IC as shown in
FIGURE 4. The V
Figure 4
REFERENCE
, 2.5 VDCor an adjusted
DC
.
Design on the IC
TL/H/5671– 15
Notice that the reference voltage for the IC is either (/2 of
the voltage applied to the V
voltage that is externally forced at the V
lows for a ratiometric voltage reference using the V
ply, a 5 V
supply or a voltage less than 2.5 VDCcan be applied to the
V
REF
nal gain to the V
ential input voltage twice the voltage at pin 9.
reference voltage can be used for the V
DC
/2 input for increased application flexibility. The inter-
/2 input is 2, making the full-scale differ-
REF
supply pin, or is equal to the
CC
/2 pin. This al-
REF
CC
sup-
CC
An example of the use of an adjusted reference voltage is to
accommodate a reduced spanÐor dynamic voltage range
of the analog input voltage. If the analog input voltage were
to range from 0.5 V
the span would be 3V as shown in
applied to the VIN(b) pin to absorb the offset, the reference
voltage can be made equal to (/2 of the 3V span or 1.5 V
The A/D now will encode the V
V with the 0.5V input corresponding to zero and the 3.5 V
input corresponding to full-scale. The full 8 bits of resolution
to 3.5 VDC, instead of 0V to 5 VDC,
DC
Figure 5
. With 0.5 V
(a) signal from 0.5V to 3.5
IN
DC
DC
DC
are therefore applied over this reduced analog input voltage
range.
.
16
Functional Description (Continued)
*Add if V
/2s1VDCwith LM358
REF
to draw 3 mA to ground.
a) Analog Input Signal Exampleb) Accommodating an Analog Input from
FIGURE 5. Adapting the A/D Analog Input Voltages to Match an Arbitrary Input Signal Range
2.4.2 Reference Accuracy Requirements
The converter can be operated in a ratiometric mode or an
absolute mode. In ratiometric converter applications, the
magnitude of the reference voltage is a factor in both the
output of the source transducer and the output of the A/D
converter and therefore cancels out in the final digital output
code. The ADC0805 is specified particularly for use in ratiometric applications with no adjustments required. In absolute conversion applications, both the initial value and the
temperature stability of the reference voltage are important
factors in the accuracy of the A/D converter. For V
voltages of 2.4 V
mV
will cause conversion errors ofg1 LSB due to the
DC
gain of 2 of the V
the initial value and the stability of the V
become even more important. For example, if the span is
nominal value, initial errors ofg10
DC
/2 input. In reduced span applications,
REF
/2 input voltage
REF
REF
reduced to 2.5V, the analog input LSB voltage value is correspondingly reduced from 20 mV (5V span) to 10 mV and
1 LSB at the V
this reduces the allowed initial tolerance of the reference
/2 input becomes 5 mV. As can be seen,
REF
voltage and requires correspondingly less absolute change
with temperature variations. Note that spans smaller than
2.5V place even tighter requirements on the initial accuracy
and stability of the reference source.
In general, the magnitude of the reference voltage will require an initial adjustment. Errors due to an improper value
of reference voltage appear as full-scale errors in the A/D
transfer function. IC voltage regulators may be used for references if the ambient temperature changes are not excessive. The LM336B 2.5V IC reference diode (from National
Semiconductor) has a temperature stability of 1.8 mV typ
(6 mV max) over 0
range parts are also available.
CsT
§
s
a
70§C. Other temperature
A
TL/H/5671– 16
0.5V (Digital Out
(Digital Out
ee
00
) to 3.5V
HEX
e
FF
)
HEX
2.5 Errors and Reference Voltage Adjustments
2.5.1 Zero Error
The zero of the A/D does not require adjustment. If the
minimum analog input voltage value, V
a zero offset can be done. The converter can be made to
IN(MIN)
, is not ground,
output 0000 0000 digital code for this minimum input voltage
by biasing the A/D V
Applications section). This utilizes the differential mode op-
(b) input at this V
IN
IN(MIN)
value (see
eration of the A/D.
/2
The zero error of the A/D converter relates to the location
of the first riser of the transfer function and can be measured by grounding the V
magnitude positive voltage to the V
is the difference between the actual DC input voltage that is
(b) input and applying a small
IN
(a) input. Zero error
IN
necessary to just cause an output digital code transition
from 0000 0000 to 0000 0001 and the ideal (/2 LSB value
e
((/2 LSB
9.8 mV for V
/2e2.500 VDC).
REF
2.5.2 Full-Scale
The full-scale adjustment can be made by applying a differential input voltage that is 1(/2 LSB less than the desired
analog full-scale voltage range and then adjusting the magnitude of the V
not used) for a digital output code that is just changing from
/2 input (pin 9 or the VCCsupply if pin 9 is
REF
1111 1110 to 1111 1111.
17
Functional Description (Continued)
2.5.3 Adjusting for an Arbitrary Analog Input Voltage
Range
If the analog zero voltage of the A/D is shifted away from
ground (for example, to accommodate an analog input signal that does not go to ground) this new zero reference
should be properly adjusted first. A V
equals this desired zero reference plus (/2 LSB (where the
LSB is calculated for the desired analog span, 1 LSB
log span/256) is applied to pin 6 and the zero reference
voltage at pin 7 should then be adjusted to just obtain the
00
to 01
HEX
The full-scale adjustment should then be made (with the
proper V
V
(a) input which is given by:
IN
(a)fsadjeV
V
IN
where:
V
MAX
and
V
MIN
(Both are ground referenced.)
The V
REF
code change from FE
justment procedure.
2.6 Clocking Option
The clock for the A/D can be derived from the CPU clock or
an external RC can be added to provide self-clocking. The
CLK IN (pin 4) makes use of a Schmitt trigger as shown in
Figure 6
Heavy capacitive or DC loading of the clock R pin should be
avoided as this will disturb normal converter operation.
Loads less than 50 pF, such as driving up to 7 A/D converter clock inputs from a single clock R pin of 1 converter, are
allowed. For larger clock line loading, a CMOS or low power
TTL buffer or PNP input logic should be used to minimize
the loading on the clock R pin (do not use a standard TTL
buffer).
2.7 Restart During a Conversion
If the A/D is restarted (CS
during a conversion, the converter is reset and a new conversion is started. The output data latch is not updated if the
code transition.
HEX
(b) voltage applied) by forcing a voltage to the
IN
b
1.5
MAX
e
The high end of the analog input range
e
the low end (the offset zero) of the analog range.
/2 (or VCC) voltage is then adjusted to provide a
.
FIGURE 6. Self-Clocking the A/D
Ð
to FF
HEX
HEX
and WR go low and return high)
(a) voltage that
IN
b
(V
V
256
f
Rj10 kX
MIN
CLK
)
,
(
j
1.1 RC
TL/H/5671– 17
MAX
. This completes the ad-
e
ana-
1
conversion in process is not allowed to be completed, therefore the data of the previous conversion remains in this
latch. The INTR
2.8 Continuous Conversions
For operation in the free-running mode an initializing pulse
should be used, following power-up, to ensure circuit operation. In this application, the CS
WR
input is tied to the INTR output. This WR and INTR
node should be momentarily forced to logic low following a
power-up cycle to guarantee operation.
2.9 Driving the Data Bus
This MOS A/D, like MOS microprocessors and memories,
will require a bus driver when the total capacitance of the
data bus gets large. Other circuitry, which is tied to the data
bus, will add to the total capacitive loading, even in TRISTATE (high impedance mode). Backplane bussing also
greatly adds to the stray capacitance of the data bus.
There are some alternatives available to the designer to
handle this problem. Basically, the capacitive loading of the
data bus slows down the response time, even though DC
specifications are still met. For systems operating with a
relatively slow CPU clock frequency, more time is available
in which to establish proper logic levels on the bus and
therefore higher capacitive loads can be driven (see typical
characteristics curves).
At higher CPU clock frequencies time can be extended for
I/O reads (and/or writes) by inserting wait states (8080) or
using clock extending circuits (6800).
Finally, if time is short and capacitive loading is high, external bus drivers must be used. These can be TRI-STATE
buffers (low power Schottky such as the DM74LS240 series
is recommended) or special higher drive current products
which are designed as bus drivers. High current bipolar bus
drivers with PNP inputs are recommended.
2.10 Power Supplies
Noise spikes on the V
errors as the comparator will respond to this noise. A low
inductance tantalum filter capacitor should be used close to
the converter V
recommended. If an unregulated voltage is available in the
system, a separate LM340LAZ-5.0, TO-92, 5V voltage regulator for the converter (and other analog circuitry) will greatly
reduce digital noise on the V
2.11 Wiring and Hook-Up Precautions
Standard digital wire wrap sockets are not satisfactory for
breadboarding this A/D converter. Sockets on PC boards
can be used and all logic signal wires and leads should be
grouped and kept as far away as possible from the analog
signal leads. Exposed leads to the analog inputs can cause
undesired digital noise and hum pickup, therefore shielded
leads may be necessary in many applications.
output simply remains at the ‘‘1’’ level.
input is grounded and the
supply line can cause conversion
CC
pin and values of 1 mF or greater are
CC
supply.
CC
18
Functional Description (Continued)
A single point analog ground that is separate from the logic
ground points should be used. The power supply bypass
capacitor and the self-clocking capacitor (if used) should
both be returned to digital ground. Any V
pacitors, analog input filter capacitors, or input signal shielding should be returned to the analog ground point. A test for
proper grounding is to measure the zero error of the A/D
converter. Zero errors in excess of (/4 LSB can usually be
traced to improper board layout and wiring (see section
2.5.1 for measuring the zero error).
3.0 TESTING THE A/D CONVERTER
There are many degrees of complexity associated with testing an A/D converter. One of the simplest tests is to apply a
known analog input voltage to the converter and use LEDs
to display the resulting digital output code as shown in
ure 7
.
For ease of testing, the V
with 2.560 V
should be used. This provides an LSB value of 20 mV.
If a full-scale adjustment is to be made, an analog input
voltage of 5.090 V
the V
(a) pin with the VIN(b) pin grounded. The value of
IN
the V
REF
digital output code is just changing from 1111 1110 to 1111
1111. This value of V
tests.
The digital output LED display can be decoded by dividing
the 8 bits into 2 hex characters, the 4 most significant (MS)
and the 4 least significant (LS). Table I shows the fractional
binary equivalent of these two 4-bit groups. By adding the
voltages obtained from the ‘‘VMS’’ and ‘‘VLS’’ columns in
Table I, the nominal value of the digital display (when
andaVCCsupply voltage of 5.12 V
DC
DC
/2 input voltage should then be adjusted until the
/2 (pin 9) should be supplied
REF
(5.120–1(/2 LSB) should be applied to
/2 should then be used for all the
REF
/2 bypass ca-
REF
Fig-
DC
V
/2e2.560V) can be determined. For example, for an
REF
output LED display of 1011 0110 or B6 (in hex), the voltage
values from the table are 3.520
These voltage values represent the center-values of a perfect A/D converter. The effects of quantization error have to
be accounted for in the interpretation of the test results.
For a higher speed test system, or to obtain plotted data, a
digital-to-analog converter is needed for the test set-up. An
accurate 10-bit DAC can serve as the precision voltage
source for the A/D. Errors of the A/D under test can be
expressed as either analog voltages or differences in 2 digital words.
A basic A/D tester that uses a DAC and provides the error
as an analog output voltage is shown in
amps can be eliminated if a lab DVM with a numerical subtraction feature is available to read the difference voltage,
‘‘A–C’’, directly. The analog input voltage can be supplied
by a low frequency ramp generator and an X-Y plotter can
be used to provide analog error (Y axis) versus analog input
(X axis).
For operation with a microprocessor or a computer-based
test system, it is more convenient to present the errors digitally. This can be done with the circuit of
output code transitions can be detected as the 10-bit DAC is
incremented. This provides (/4 LSB steps for the 8-bit A/D
under test. If the results of this test are automatically plotted
with the analog input on the X axis and the error (in LSB’s)
as the Y axis, a useful transfer function of the A/D under
test results. For acceptance testing, the plot is not necessary and the testing speed can be increased by establishing
internal limits on the allowed error for each code.
4.0 MICROPROCESSOR INTERFACING
To dicuss the interface with 8080A and 6800 microprocessors, a common sample subroutine structure is used. The
microprocessor starts the A/D, reads and stores the results
of 16 successive conversions, then returns to the user’s
program. The 16 data bytes are stored in 16 successive
memory locations. All Data and Addresses will be given in
hexadecimal form. Software and hardware details are provided separately for each type of microprocessor.
This converter has been designed to directly interface with
derivatives of the 8080 microprocessor. The A/D can be
mapped into memory space (using standard memory address decoding for CS
or it can be controlled as an I/O device by using the I/O R
and I/O W strobes and decoding the address bits A0
A7 (or address bits A8
same 8-bit address information) to obtain the CS
ing the I/O space provides 256 additional addresses and
may allow a simpler 8-bit address decoder but the data can
only be input to the accumulator. To make use of the additional memory reference instructions, the A/D should be
mapped into memory space. An example of an A/D in I/O
space is shown in
Note 1: *Pin numbers for the DP8228 system controller, others are INS8080A.
Note 2: Pin 23 of the INS8228 must be tied to
instruction when an interrupt is acknowledged as required by the accompanying sample program.
FIGURE 10. ADC0801–INS8080A CPU Interface
a
12V througha1kXresistor to generate the RST 7
TL/H/5671– 20
0038C3 00 03RST 7:JMPLD DATA
SAMPLE PROGRAM FOR
FIGURE 10
ADC0801–INS8080A CPU INTERFACE
###
###
010021 00 02START:LXI H 0200H; HL pair will point to
010331 00 04RETURN:LXI SP 0400H; Initialize stack pointer (Note 1)
01067DMOV A, L; Test # of bytes entered
0107FE OFCPI OF H; If #416. JMP to
0109CA 13 01JZ CONT; user program
010CD3 E0OUT E0 H; Start A/D
010EFBEI; Enable interrupt
010F00LOOP:NOP; Loop until end of
0110C3 OF 01JMP LOOP; conversion
0113
CONT:
#
#
; data storage locations
####
##
##
(User program to
process data)
#
#
####
####
0300DB E0LD DATA:IN E0 H; Load data into accumulator
030277MOV M, A; Store data
030323INX H; Increment storage pointer
0304C3 03 01JMP RETURN
Note 1: The stack pointer must be dimensioned because a RST 7 instruction pushes the PC onto the stack.
Note 2: All address used were arbitrarily chosen.
21
Functional Description (Continued)
The standard control bus signals of the 8080 CS
WR
) can be directly wired to the digital control inputs of the
A/D and the bus timing requirements are met to allow both
starting the converter and outputting the data onto the data
bus. A bus driver should be used for larger microprocessor
systems where the data bus leaves the PC board and/or
must drive capacitive loads larger than 100 pF.
4.1.1 Sample 8080A CPU Interfacing Circuitry and
Program
The following sample program and associated hardware
shown in
converter to the INS8080A CPU chip set (comprised of the
INS8080A microprocessor, the INS8228 system controller
and the INS8224 clock generator). For simplicity, the A/D is
controlled as an I/O device, specifically an 8-bit bi-directional port located at an arbitrarily chosen port address, E0. The
TRI-STATE output capability of the A/D eliminates the need
for a peripheral interface device, however address decoding
is still required to generate the appropriate CS
verter.
Figure 10
may be used to input data from the
,RDand
for the con-
It is important to note that in systems where the A/D converter is 1-of-8 or less I/O mapped devices, no address
decoding circuitry is necessary. Each of the 8 address bits
(A0 to A7) can be directly used as CS
I/O device.
4.1.2 INS8048 Interface
The INS8048 interface technique with the ADC0801 series
(see
Figure 11
There are 24 I/O lines and three test input lines in the 8048.
With these extra I/O lines available, one of the I/O lines (bit
0 of port 1) is used as the chip select signal to the A/D, thus
eliminating the use of an external address decoder. Bus
control signals RD
to the A/D. The 16 converted data words are stored at onchip RAM locations from 20 to 2F (Hex). The RD
signals are generated by reading from and writing into a
dummy address, respectively. A sample interface program
is shown below.
) is simpler than the 8080A CPU interface.
,WRand INT of the 8048 are tied directly
inputsÐone for each
and WR
SAMPLE PROGRAM FOR
04 10JMP10H: Program starts at addr 10
04 50JMP50H; Interrupt jump vector
99 FEANLP1, #0FEH; Chip select
81MOVXA, @R1; Read in the 1st data
89 01START:ORLP1,
B8 20MOVR0, #20H; Data address
B9 FFMOVR1, #0FFH; Dummy address
BA 10MOVR2, #10H; Counter for 16 bytes
23 FFAGAIN:MOVA, #0FFH; Set ACC for intr loop
99 FEANLP1, #0FEH; Send CS (bit 0 of P1)
91MOVX@R1, A; Send WR out
05ENI; Enable interrupt
96 21LOOP:JNZLOOP; Wait for interrupt
EA 1BDJNZR2, AGAIN; If 16 bytes are read
00NOP; go to user’s program
00NOP
81INDATA:MOVXA, @R1; Input data, CS still low
A0MOV@R0, A; Store in memory
18INCR0; Increment storage counter
89 01ORLP1, #1; Reset CS signal
27CLRA; Clear ACC to get out of
93RETR; the interrupt loop
FIGURE 11. INS8048 Interface
ORG3H
ORG10H; Main program
ORG50H
FIGURE 11
22
INS8048 INTERFACE
Ý
1; Set port pin high
; to reset the intr
TL/H/5671– 21
Functional Description (Continued)
4.2 Interfacing the Z-80
The Z-80 control bus is slightly different from that of the
8080. General RD
rate memory request, MREQ
nals are used which have to be combined with the generalized strobes to provide the equivalent 8080 signals. An advantage of operating the A/D in I/O space with the Z-80 is
that the CPU will automatically insert one wait state (the RD
and WR strobes are extended one clock period) to allow
more time for the I/O devices to respond. Logic to map the
A/D in I/O space is shown in
FIGURE 13. Mapping the A/D as an I/O Device
Additional I/O advantages exist as software DMA routines
are available and use can be made of the output data transfer which exists on the upper 8 address lines (A8 to A15)
during I/O input instructions. For example, MUX channel
selection for the A/D can be accomplished with this operating mode.
The control bus for the 6800 microprocessor derivatives
does not use the RD
ploys a single R/W
be derived fom the w2 clock. All I/O devices are memory
mapped in the 6800 system, and a special signal, VMA,
indicates that the current address is valid.
an interface schematic where the A/D is memory mapped in
the 6800 system. For simplicity, the CS
using (/2 DM8092. Note that in many 6800 systems, an al-
and WR strobes are provided and sepa-
, and I/O request, IORQ, sig-
Figure 13
.
TL/H/5671– 23
for Use with the Z-80 CPU
and WR strobe signals. Instead it em-
line and additional timing, if needed, can
Figure 14
decoding is shown
shows
ready decoded 4/5
pin 21. This can be tied directly to the CS
line is brought out to the common bus at
pin of the A/D,
provided that no other devices are addressed at HX ADDR:
4XXX or 5XXX.
The following subroutine performs essentially the same
function as in the case of the 8080A interface and it can be
called from anywhere in the user’s program.
In
Figure 15
the ADC0801 series is interfaced to the M6800
microprocessor through (the arbitrarily chosen) Port B of the
MC6820 or MC6821 Peripheral Interface Adapter, (PIA).
Here the CS
pin of the A/D is grounded since the PIA is
already memory mapped in the M6800 system and no CS
decoding is necessary. Also notice that the A/D output data
lines are connected to the microprocessor bus under program control through the PIA and therefore the A/D RD
pin
can be grounded.
A sample interface program equivalent to the previous one
is shown below
Figure 15
. The PIA Data and Control Registers of Port B are located at HEX addresses 8006 and 8007,
respectively.
5.0 GENERAL APPLICATIONS
The following applications show some interesting uses for
the A/D. The fact that one particular microprocessor is used
is not meant to be restrictive. Each of these application circuits would have its counterpart using any microprocessor
that is desired.
5.1 Multiple ADC0801 Series to MC6800 CPU Interface
To transfer analog data from several channels to a single
microprocessor system, a multiple converter scheme presents several advantages over the conventional multiplexer
single-converter approach. With the ADC0801 series, the
differential inputs allow individual span adjustment for each
channel. Furthermore, all analog input channels are sensed
simultaneously, which essentially divides the microprocessor’s total system servicing time by the number of channels,
since all conversions occur simultaneously. This scheme is
shown in
Figure 16
.
Note 1: Numbers in parentheses refer to MC6800 CPU pin out.
Note 2: Number or letters in brackets refer to standard M6800 system common bus code.
FIGURE 14. ADC0801-MC6800 CPU Interface
23
TL/H/5671– 24
Functional Description (Continued)
0010DF 36DATAINSTXTEMP2; Save contents of X
SAMPLE PROGRAM FOR
0012CE 00 2CLDX#$002C; Upon IRQ
0015FF FF F8STX$FFF8; jumps to 002C
0018B7 50 00STAA$5000; Start ADC0801
001B0ECLI
001C3ECONVRTWAI; Wait for interrupt
001DDE 34LDXTEMP1
001F8C 02 0FCPX#$020F; Is final data stored?
002227 14BEQENDP
0024B7 50 00STAA$5000; Restarts ADC0801
002708INX
0028DF 34STXTEMP1
002A20 F0BRACONVRT
002CDE 34INTRPTLDXTEMP1
002EB6 50 00LDAA$5000; Read data
0031A7 00STAAX; Store it at X
00333BRTI
003402 00TEMP1FDB$0200; Starting address for
Note 1: In order for the microprocessor to service subroutines and interrupts, the stack pointer must be dimensioned in the user’s program.
FIGURE 14
ADC0801-MC6800 CPU INTERFACE
low CPU
; data storage
; To user’s program
FIGURE 15. ADC0801–MC6820 PIA Interface
24
TL/H/5671– 25
Functional Description (Continued)
SAMPLE PROGRAM FOR
0010CE 00 38DATAINLDX#$0038; Upon IRQ
0013FF FF F8STX$FFF8; jumps to 0038
0016B6 80 06LDAAPIAORB; Clear possible IRQ
00194FCLRA
001AB7 80 07STAAPIACRB
001DB7 80 06STAAPIAORB; Set Port B as input
00200ECLI
0021C6 34LDAB#$34
002386 3DLDAA#$3D
0025F7 80 07CONVRTSTABPIACRB; Starts ADC0801
0028B7 80 07STAAPIACRB
002B3EWAI; Wait for interrupt
002CDE 40LDXTEMP1
002E8C 02 0FCPX#$020F; Is final data stored?
003127 0FBEQENDP
003308INX
0034DF 40STXTEMP1
003620 EDBRACONVRT
0038DE 40INTRPTLDXTEMP1
003AB6 80 06LDAAPIAORB; Read data in
003DA7 00STAAX; Store it at X
003F3BRTI
004002 00TEMP1FDB$0200; Starting address for
The following schematic and sample subroutine (DATA IN)
may be used to interface (up to) 8 ADC0801’s directly to the
MC6800 CPU. This scheme can easily be extended to allow
the interface of more converters. In this configuration the
converters are (arbitrarily) located at HEX address 5000 in
the MC6800 memory space. To save components, the
clock signal is derived from just one RC pair on the first
converter. This output drives the other A/Ds.
All the converters are started simultaneously with a STORE
instruction at HEX address 5000. Note that any other HEX
address of the form 5XXX will be decoded by the circuit,
pulling all the CS
using a more definitive address decoding scheme. All the
interrupts are ORed together to insure that all A/Ds have
completed their conversion before the microprocessor is interrupted.
The subroutine, DATA IN, may be called from anywhere in
the user’s program. Once called, this routine initializes the
inputs low. This can easily be avoided by
CPU, starts all the converters simultaneously and waits for
the interrupt signal. Upon receiving the interrupt, it reads the
converters (from HEX addresses 5000 through 5007) and
stores the data successively at (arbitrarily chosen) HEX addresses 0200 to 0207, before returning to the user’s program. All CPU registers then recover the original data they
had before servicing DATA IN.
5.2 Auto-Zeroed Differential Transducer Amplifier
and A/D Converter
The differential inputs of the ADC0801 series eliminate the
need to perform a differential to single ended conversion for
a differential transducer. Thus, one op amp can be eliminated since the differential to single ended conversion is provided by the differential input of the ADC0801 series. In general, a transducer preamp is required to take advantage of
the full A/D converter input dynamic range.
25
Functional Description (Continued)
Note 1: Numbers in parentheses refer to MC6800 CPU pin out.
Note 2: Numbers of letters in brackets refer to standard M6800 system common bus code.
FIGURE 16. Interfacing Multiple A/Ds in an MC6800 System
SAMPLE PROGRAM FOR
ADDRESSHEX CODEMNEMONICSCOMMENTS
0010DF 44DATAINSTXTEMP; Save Contents of X
0012CE 00 2ALDX#$002A; Upon IRQ
0015FF FF F8STX$FFF8; Jumps to 002A
0018B7 50 00STAA$5000; Starts all A/D’s
001B0ECLI
001C3EWAI; Wait for interrupt
001DCE 50 00LDX#$5000
0020DF 40STXINDEX1; Reset both INDEX
0022CE 02 00LDX#$0200; 1 and 2 to starting
0025DF 42STXINDEX2; addresses
0027DE 44LDXTEMP
002939RTS; Return from subroutine
002ADE 40INTRPTLDXINDEX1; INDEX1
002CA6 00LDAAX; Read data in from A/D at X
002E08INX; Increment X by one
002FDF 40STXINDEX1; X
0031DE 42LDXINDEX2; INDEX2
FIGURE 16
INTERFACING MULTIPLE A/Ds IN AN MC6800 SYSTEM
LOW CPU
x
x
INDEX1
x
26
TL/H/5671– 26
X
X
Functional Description (Continued)
SAMPLE PROGRAM FOR
ADDRESSHEX CODEMNEMONICSCOMMENTS
0033A7 00STAAX; Store data at X
00358C 02 07CPX#$0207; Have all A/D’s been read?
003827 05BEQRETURN; Yes: branch to RETURN
003A08INX; No: increment X by one
003BDF 42STXINDEX2; X
003D20 EBBRAINTRPT; Branch to 002A
003F3BRETURNRTI
004050 00INDEX1FDB$5000; Starting address for A/D
004202 00INDEX2FDB$0200; Starting address for data storage
004400 00TEMPFDB$0000
Note 1: In order for the microprocessor to service subroutines and interrupts, the stack pointer must be dimensioned in the user’s program.
FIGURE 16
INTERFACING MULTIPLE A/Ds IN AN MC6800 SYSTEM
x
INDEX2
For amplification of DC input signals, a major system error is
the input offset voltage of the amplifiers used for the
preamp.
Figure 17
whose offset voltage errors will be cancelled by a zeroing
subroutine which is performed by the INS8080A microprocessor system. The total allowable input offset voltage error
for this preamp is only 50 mV for (/4 LSB error. This would
obviously require very precise amplifiers. The expression for
the differential output voltage of the preamp is:
V
is a gain of 100 differential preamp
e
O
[
V
(a)bVIN(b)
IN
]
1
Ð
2R2
a
a
R1
(
XäYXä Y
SIGNALGAIN
b
b
(V
V
OS
OS
2
1
g
V
IXRX)#1
OS
3
2R2
a
R1
J
XäYX ä Y
DC ERROR TERMGAIN
where IXis the current through resistor RX. All of the offset
error terms can be cancelled by making
b
V
scheme.
The INS8080A uses the 3 I/O ports of an INS8255 Programable Peripheral Interface (PPI) to control the auto zeroing and input data from the ADC0801 as shown in
The PPI is programmed for basic I/O operation (mode 0)
with Port A being an input port and Ports B and C being
output ports. Two bits of Port C are used to alternately open
or close the 2 switches at the input of the preamp. Switch
OS3
V
. This is the principle of this auto-zeroing
OS2
e
g
IXR
V
X
OS1
Figure 18
SW1 is closed to force the preamp’s differential input to be
zero during the zeroing subroutine and then opened and
SW2 is then closed for conversion of the actual differential
input signal. Using 2 switches in this manner eliminates concern for the ON resistance of the switches as they must
conduct only the input bias current of the input amplifiers.
Output Port B is used as a successive approximation register by the 8080 and the binary scaled resistors in series with
each output bit create a D/A converter. During the zeroing
subroutine, the voltage at V
quired to make the differential output voltage equal to zero.
This is accomplished by ensuring that the voltage at the
output of A1 is approximately 2.5V so that a logic ‘‘1’’ (5V)
on any output of Port B will source current into node V
raising the voltage at V
more negative. Conversely, a logic ‘‘0’’ (0V) will pull current
out of node V
ential output to become more positive. For the resistor values shown, V
mV, which will null the offset error term to (/4 LSB of full-
scale for the ADC0801. It is important that the voltage levels
a
that drive the auto-zero resistors be constant. Also, for symmetry, a logic swing of 0V to 5V is convenient. To achieve
this, a CMOS buffer is used for the logic output signals of
Port B and this CMOS package is powered with a stable 5V
source. Buffer amplifier A1 is necessary so that it can
source or sink the D/A output current.
.
and decrease the voltage, causing the differ-
X
can moveg12 mV with a resolution of 50
X
increases or decreases as re-
x
and making the output differential
X
thus
X
27
Functional Description (Continued)
Note 1: R2e49.5 R1
Note 2: Switches are LMC13334 CMOS analog switches.
Note 3: The 9 resistors used in the auto-zero section can be
FIGURE 17. Gain of 100 Differential Transducer Preamp
g
5% tolerance.
FIGURE 18. Microprocessor Interface Circuitry for Differential Preamp
28
TL/H/5671– 27
A flow chart for the zeroing subroutine is shown in
19
. It must be noted that the ADC0801 series will output an
all zero code when it converts a negative input[V
VIN(a)]. Also, a logic inversion exists as all of the I/O ports
Figure
(b)
IN
are buffered with inverting gates.
Basically, if the data read is zero, the differential output voltage is negative, so a bit in Port B is cleared to pull V
negative which will make the output more positive for the
X
more
next conversion. If the data read is not zero, the output voltage is positive so a bit in Port B is set to make V
positive and the output more negative. This continues for 8
X
more
approximations and the differential output eventually converges to within 5 mV of zero.
The actual program is given in
Figure 20
. All addresses
used are compatible with the BLC 80/10 microcomputer
system. In particular:
Port A and the ADC0801 are at port address E4
Port B is at port address E5
Port C is at port address E6
PPI control word port is at port address E7
Program Counter automatically goes to ADDR:3C3D upon
acknowledgement of an interrupt from the ADC0801
5.3 Multiple A/D Converters in a Z-80 Interrupt
Driven Mode
In data acquisition systems where more than one A/D converter (or other peripheral device) will be interrupting program execution of a microprocessor, there is obviously a
need for the CPU to determine which device requires servicing.
Figure 21
and the accompanying software is a method
of determining which of 7 ADC0801 converters has completed a conversion (INTR
asserted) and is requesting an
interrupt. This circuit allows starting the A/D converters in
any sequence, but will input and store valid data from the
converters with a priority sequence of A/D 1 being read first,
A/D 2 second, etc., through A/D 7 which would have the
lowest priority for data being read. Only the converters
whose INT is asserted will be read.
The key to decoding circuitry is the DM74LS373, 8-bit D
type flip-flop. When the Z-80 acknowledges the interrupt,
the program is vectored to a data input Z-80 subroutine.
This subroutine will read a peripheral status word from the
DM74LS373 which contains the logic state of the INTR
outputs of all the converters. Each converter which initiates an
interrupt will place a logic ‘‘0’’ in a unique bit position in the
status word and the subroutine will determine the identity of
the converter and execute a data read. An identifier word
(which indicates which A/D the data came from) is stored in
the next sequential memory location above the location of
the data so the program can keep track of the identity of the
data entered.
t
FIGURE 19. Flow Chart for Auto-Zero Routine
TL/H/5671– 28
29
3D003E90MVI 90
3D02D3E7Out Control Port; Program PPI
3D042601MVI H 01Auto-Zero Subroutine
3D067CMOV A,H
3D07D3E6OUT C; Close SW1 open SW2
3D090680MVI B 80; Initialize SAR bit pointer
3D0B3E7FMVI A 7F; Initialize SAR code
3D0D4FMOV C,AReturn
3D0ED3E5OUT B; Port B 4 SAR code
3D1031AA3DLXI SP 3DAAStart; Dimension stack pointer
3D13D3E4OUT A; Start A/D
3D15FBIE
3D1600NOPLoop; Loop until INT
3D17C3163DJMP Loop
3D1A7AMOV A,DAuto-Zero
3D1BC600ADI 00
3D1DCA2D3DJZ Set C; Test A/D output data for zero
3D2078MOV A,BShift B
3D21F600ORI 00; Clear carry
3D231FRAR; Shift ‘1‘ in B right one place
3D24FE00CPI 00; Is B zero? If yes last
3D26CA373DJZ Done; approximation has been made
3D2947MOV B,A
3D2AC3333DJMP New C
3D2D79MOV A,CSet C
3D2EB0ORA B; Set bit in C that is in same
3D2F4FMOV C,A; position as ‘1‘ in B
3D30C3203DJMP Shift B
3D33A9XRA CNew C; Clear bit in C that is in
3D34C30D3DJMP Return; same position as ‘1‘ in B
3D3747MOV B,ADone; then output new SAR code.
3D387CMOV A,H; Open SW1, close SW2 then
3D39EE03XRI 03; proceed with program. Preamp
3D3BD3E6OUT C; is now zeroed.
3D3D
#
Normal
asserted
#
#
Program for processing
3C3DDBE4IN ARead A/D Subroutine; Read A/D data
3C3FEEFFXRI FF; Invert data
3C4157MOV D,A
3C4278MOV A,B; Is B Reg 4 0? If not stay
3C43E6FFANI FF; in auto zero subroutine
3C45C21A3DJNZ Auto-Zero
3C48C33D3DJMP Normal
Note: All numerical values are hexadecimal representations.
5.3 Multiple A/D Converters in a Z-80ÉInterrupt Driven
Mode (Continued)
The following notes apply:
1) It is assumed that the CPU automatically performs a RST
7 instruction when a valid interrupt is acknowledged (CPU
is in interrupt mode 1). Hence, the subroutine starting address of X0038.
2) The address bus from the Z-80 and the data bus to the Z-
80 are assumed to be inverted by bus drivers.
3) A/D data and identifying words will be stored in sequen-
tial memory locations starting at the arbitrarily chosen address X 3E00.
4) The stack pointer must be dimensioned in the main pro-
gram as the RST 7 instruction automatically pushes the
PC onto the stack and the subroutine uses an additional
6 stack addresses.
proper data values
FIGURE 20. Software for Auto-Zeroed Differential A/D
5) The peripherals of concern are mapped into I/O space
with the following port assignments:
This port address also serves as the A/D identifying word in
the program.
30
FIGURE 21. Multiple A/Ds with Z-80 Type Microprocessor
TL/H/5671– 29
INTERRUPT SERVICING SUBROUTINE
LOCOBJ CODESTATEMENTCOMMENT
0038E5PUSH HL; Save contents of all registers affected by
0039C5PUSH BC; this subroutine.
003AF5PUSH AF; Assumed INT mode 1 earlier set.
003B21 00 3ELD (HL),X3E00; Initialize memory pointer where data will be stored.
003E0E 01LD C, X01; C register will be port ADDR of A/D converters.
0040D300OUT X00, A; Load peripheral status word into 8-bit latch.
0042DB00IN A, X00; Load status word into accumulator.
004447LD B,A; Save the status word.
004579TESTLD A,C; Test to see if the status of all A/D’s have
0046FE 08CP, X08; been checked. If so, exit subroutine
0048CA 60 00JPZ, DONE
004B78LD A,B; Test a single bit in status word by looking for
004C1FRRA; a ‘1‘ to be rotated into the CARRY (an INT
004D47LD B,A; is loaded as a ‘1‘). If CARRY is set then load
004EDA 5500JPC, LOAD; contents of A/D at port ADDR in C register.
00510CNEXTINC C; If CARRY is not set, increment C register to point
0052C3 4500JP,TEST; to next A/D, then test next bit in status word.
0055ED 78LOADIN A, (C); Read data from interrupting A/D and invert
0057EE FFXOR FF; the data.
005977LD (HL),A; Store the data
005A2CINC L
005B71LD (HL),C; Store A/D identifier (A/D port ADDR).
005C2CINC L
005DC3 51 00JP,NEXT; Test next bit in status word.
0060F1DONEPOP AF; Re-establish all registers as they were
0061C1POP BC; before the interrupt.
0062E1POP HL
0063C9RET; Return to original program
NATIONAL’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT
DEVICES OR SYSTEMS WITHOUT THE EXPRESS WRITTEN APPROVAL OF THE PRESIDENT OF NATIONAL
SEMICONDUCTOR CORPORATION. As used herein:
1. Life support devices or systems are devices or2. A critical component is any component of a life
systems which, (a) are intended for surgical implantsupport device or system whose failure to perform can
into the body, or (b) support or sustain life, and whosebe reasonably expected to cause the failure of the life
failure to perform, when properly used in accordancesupport device or system, or to affect its safety or
with instructions for use provided in the labeling, caneffectiveness.
be reasonably expected to result in a significant injury
to the user.
National SemiconductorNational SemiconductorNational SemiconductorNational Semiconductor
CorporationEuropeHong Kong Ltd.Japan Ltd.
1111 West Bardin RoadFax: (
Arlington, TX 76017Email: cnjwge@tevm2.nsc.comOcean Centre, 5 Canton Rd.Fax: 81-043-299-2408
Tel: 1(800) 272-9959Deutsch Tel: (
Fax: 1(800) 737-7018English Tel: (
National does not assume any responsibility for use of any circuitry described, no circuit patent licenses are implied and National reserves the right at any time without notice to change said circuitry and specifications.