Page 140 - Understanding Automotive Electronics
P. 140
2735 | CH 4 Page 127 Tuesday, March 10, 1998 11:06 AM
MICROCOMPUTER INSTRUMENTATION AND CONTROL 4
retained after the microcomputer has finished writing data into it. This
permits the CPU to go on to other tasks while the external system reads and
uses the output data. This is different from the parallel input, in which the
states could change between samples.
Digital-to-Analog Converter
A DAC converts binary The parallel input and output interfaces are used to examine and control
signals from the micro- external digital signals. The microcomputer can also be used to examine and
computer to analog volt- control analog signals through the use of special interfaces. The microcomputer
ages that are can produce an analog voltage by using a digital-to-analog converter (DAC). A
proportional to the DAC accepts inputs of a certain number of binary bits and produces an output
number encoded in the voltage level that is proportional to the input number. DACs come in many
input signals. different versions with different numbers of input bits and output ranges. A
common microcomputer DAC has 8-bit inputs and a 0 to 5 volt output range.
A simple 8-bit DAC is shown in Figure 4.17. This type of DAC uses a
parallel input interface and two operational amplifiers. The 8 bits are written
into the parallel interface and stored in data latches. The output of each latch is
a digital signal that is 0 volts if the bit is low and 5 volts if the bit is high. The
first op amp is a summing amplifier and has a gain of –(R /R ). The second op
f
i
amp has a gain of –1; thus, it is only an inverter. The effect of the two amplifiers
is to scale each bit of the parallel interface by a specially chosen factor and add
the resultant voltages together. For instance, if only bit 0 is high and all the
others are low,
1
1 1 1
V out = 51 --------- + 0 --------- + 0 ------ + … + 0 ---
256 128 64 2
5
= ---------
256
= 0.0195 V
If only bits 0 and 7 are high:
1
1
1
1
V out = 51 --------- + 0 --------- + 0 ------ + … + 1 ---
256 128 64 2
= 645
---------
256
= 2.5195 V
UNDERSTANDING AUTOMOTIVE ELECTRONICS 127