0% found this document useful (0 votes)
17 views

ADC_DAC Interfacing Lec.4

The document discusses the functions and interfacing of Analog to Digital Converters (ADC) and Digital to Analog Converters (DAC) in microprocessor systems. It details the ADC's conversion process, interfacing with the microprocessor using PPI 8255, and provides examples of interfacing circuits and assembly language programs. Additionally, it explains the DAC's operation, including the calculation of output voltage based on binary inputs and reference current.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

ADC_DAC Interfacing Lec.4

The document discusses the functions and interfacing of Analog to Digital Converters (ADC) and Digital to Analog Converters (DAC) in microprocessor systems. It details the ADC's conversion process, interfacing with the microprocessor using PPI 8255, and provides examples of interfacing circuits and assembly language programs. Additionally, it explains the DAC's operation, including the calculation of output voltage based on binary inputs and reference current.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

MICROPROCESSOR II BY: Dr. MUDHAFAR H.

ALI

Analog to Digital Converter (ADC) and Digital to Analog


convertor (DAC)
The analog to digital convertor ADC is a circuit used to convert analog signal
such as voltage or current to its equivalent binary sequence, while the digital to
analog converter DAC converts binary numbers into its analog equivalent
voltage or current as shown below.

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

Interfacing Analog to Digital Convertor ADC


 In most of the cases, the PPI 8255 is used for interfacing the analog to digital
converters with a microprocessor.
 The ADC is treated as an input device by the microprocessor.
 The process of analog to digital conversion is a slow process, and the
microprocessor as to wait for the digital data till the conversion is over.
 After the conversion is over, the ADC sends end of conversion EOC signal
to inform the microprocessor about it and the result is ready at the output
buffer of the ADC.
 The time taken by the ADC from the active edge of SOC pulse till the active
edge of EOC signal is called as the conversion delay of the ADC.
 The selection of ADC for a particular application is done, keeping in mind
the required speed, resolution and the cost factor.

General algorithm for ADC interfacing contains the following steps.


1. Ensure the stability of analog input, applied to the ADC.
2. start of conversion SOC pulse has to be sent to the ADC.
3. Read end of conversion EOC signal to mark the end of conversion
process.
4. Read digital data output of the ADC as equivalent digital output.
5. Sample & hold circuit which sample the analog signal and holds it
constant for specified time duration.

Block Diagram of ADC 0808/0809:

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

 I/P0 - I/P7 : Analog inputs


 A, B, and C : Address lines for
selecting analog inputs
 O7 - O0 : Digital 8-bit output
 SOC: Start of conversion signal pin
 EOC: End of conversion signal pin
 OE: Output enable pin, if high
enables output.
 CLK: Clock input for ADC.
 Vcc, GND: Supply pins +5V and
GND.
 Vref+ and Vref- : Reference positive voltage (+5 Volts max.) and
reference negative voltage (0V minimum).

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

The required ALP is given as follows:


MOV AL , 98H ; Initializing the control word of 8255
OUT 83H , AL

4
MICROPROCESSOR II BY: Dr. MUDHAFAR H. ALI

MOV AL , 02H ; Select I/P2 as analog input.


OUT 81H , AL
MOV AL , 01H ; Give start of conversion pulse to the ADC
OUT 82H , AL
WAIT: IN AL , Port C ; Check for EOC by reading port C upper
ROL AL , 1 ; and rotate through carry
JNC WAIT
IN AL , 80H ; If EOC, read digital equivalent in AL
HLT ; Stop

Interfacing Digital to Analog Converter DAC

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

𝐼𝑟𝑒𝑓 is generally set to 2 mA.


By connecting a resistor to the output pin we convert the result to voltage. The
figure below shows how to interface the DAC through the 8255 PPI device.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy