ADC_DAC Interfacing Lec.4
ADC_DAC Interfacing Lec.4
ALI
Together, ADC and DAC are often used in digital systems to provide complete
interface with analog sensors and output devices for control systems.
1
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI
The figure below shows the block diagram and the pin layout of the 0808/0809
ADC, which has the following specifications :
The chips 0808 and 0809 are 8-bit analog to digital converter.
The conversion delay is 100μs at a clock frequency of 640 kHz, which is
quite low as compared to other converters.
This converter internally has a 3:8 analog multiplexer, so that at a time 8
different analog inputs can be connected to the chips.
Out of these 8 inputs only one can be selected for conversion by using 3
address lines A, B, C.
2
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI
3
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI
Example:
Interface ADC 0808 with 8088µP using 8255 ports. Use Port A of 8255 for
transferring digital data output of ADC to the CPU and Port C for control signals
(Port C upper acts as the input port to receive the EOC signal while port C lower
acts as the output port to send SOC to the ADC). Assume that an analog input is
present at I/P2 of the ADC and a clock input of suitable frequency is available
for ADC. Draw the schematic and write required ALP.
Solution:
Figure below shows the interfacing connections of ADC0808 with 8088 using
8255. The analog input I/P2 is used and therefore address pins A, B, C should be
0,1,0 respectively to select I/P2. The OE and ALE pins are already kept at +5V
to select the ADC and enable the outputs.
Port C upper acts as the input port to receive the EOC signal while port C lower
acts as the output port to send SOC to the ADC. Port A acts as a 8-bit input data
port to receive the digital data output from the ADC. The 8255 control word is
written as follows:
D7 D6 D5 D4 D3 D2 Dl D0 Control word
1 0 0 1 1 0 0 0 = 98 H
4
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI
The digital to analog converters convert binary numbers ( digital pulses ) into
their analog equivalent voltages or currents. Two techniques are most widely
for digital to analog conversion.
1. Weighted resistor network.
2. R / 2R ladder network.
The R / 2R ladder method gives much higher degree of precision than the
weighted resistor method. For example the IC MC1408 DAC uses the R / 2R
ladder method. The resolution of the DAC is a function of the number of binary
inputs. The number of the data bits (n) decide the resolution of the DAC. The
number of analog output levels is equal to 2𝑛 . Therefore, the 8-bit DAC such as
MC1408 provides 256 voltage or current output levels (28 = 256).
The total current 𝐼𝑜𝑢𝑡 is a function of the binary numbers at the D7 – D0 inputs of
the DAC and the reference 𝐼𝑟𝑒𝑓 as follows:
𝐷7 𝐷6 𝐷5 𝐷4 𝐷3 𝐷2 𝐷1 𝐷0
𝐼𝑜𝑢𝑡 = 𝐼𝑟𝑒𝑓 ( + + + + + + + )
2 4 8 16 32 64 128 256
5
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI
Example:
Assuming that R=5K and Iref = 2mA, calculate Vout for the following binary
inputs:
a) 10011001 (99H) b) 11001000 (C8H)
Solution :
1 1 1 1
a) 𝐼𝑜𝑢𝑡 = 2𝑚𝐴 ( + + + ) = 1.195 mA
2 16 32 256
𝑉𝑜𝑢𝑡 = 1.195𝑚𝐴 ∗ 5𝐾 = 5.975 𝑣𝑜𝑙𝑡
1 1 1
b) 𝐼𝑜𝑢𝑡 = 2𝑚𝐴 ( + + ) = 1.562 mA
2 4 32
𝑉𝑜𝑢𝑡 = 1.562𝑚𝐴 ∗ 5𝐾 = 7.8125 𝑣𝑜𝑙𝑡
Example:
Draw an interfacing circuit and write the required ALP to generate an output
ramp signal. Assume A7…..A2 = 1110002
Solution:
MOV AL , 80H
OUT 0E3H , AL
XOR AL , AL
BACK : MOV AH , 01H
INT 16H
JNZ END
OUT 0E0H , AL
6
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI
INC AL
JMP BACK
END: HLT
D0 – D7
A0 – A7