0% found this document useful (1 vote)
4K views22 pages

8086 - Interfacing Analog To Digital Converters (ADC)

The document discusses interfacing an analog to digital converter (ADC 0808) with an 8086 microprocessor using an 8255 programmable peripheral interface. It describes connecting the ADC's control signals and data outputs to ports on the 8255 and using an assembly program to issue start of conversion pulses, wait for end of conversion, and read the digital output data. The analog input is applied to channel 2 of the ADC by setting the appropriate address pins using port B of the 8255.

Uploaded by

PARIJAAT B MITRA
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 (1 vote)
4K views22 pages

8086 - Interfacing Analog To Digital Converters (ADC)

The document discusses interfacing an analog to digital converter (ADC 0808) with an 8086 microprocessor using an 8255 programmable peripheral interface. It describes connecting the ADC's control signals and data outputs to ports on the 8255 and using an assembly program to issue start of conversion pulses, wait for end of conversion, and read the digital output data. The analog input is applied to channel 2 of the ADC by setting the appropriate address pins using port B of the 8255.

Uploaded by

PARIJAAT B MITRA
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/ 22

8086 – Interfacing Analog to

Digital Converters (ADC)


Basics
• Data Processing (such as arithmetic, signal, image and video
processing, etc.) used to be in analog domain in the early days
of technology development
• Currently, most of the processing happens in the digital
domain
• This requires electronic components such as ADC and DAC, for
data conversion from analog to digital domain.
• Since Microprocessors/Microcontrollers are a critical part of
digital data processing, interfacing ADC/DAC to them is
important.
What is an ADC
ADC – Principle of Operation
ADC Operation (Contd…)
Schematic of a Sample and Hold
Circuit
ADC – Internal Schematic
Interfacing ADC - Operation
• The process of analog to digital conversion is a
slow process, and the microprocessor has to wait
for the digital data till the conversion is over.
• ADC sends End of Conversion (EOC) signal to the
microprocessor to say the result is ready at the
output buffer of the ADC.
• Issuing an SOC pulse to ADC -> Reading EOC
signal from the ADC -> and reading the digital
output of the ADC are carried out by the CPU
using 8255 I/O ports.
• 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.
• It may range any where from a few
microseconds in case of fast ADC to even a
few hundred milliseconds in case of slow
ADCs.
• General algorithm for ADC interfacing contains
the following steps:
1.Ensure the stability of analog input, applied to
the ADC.
2.Issue start of conversion pulse to ADC
3.Read end of conversion signal to mark the end
of conversion processes.
4.Read digital data output of the ADC as
equivalent digital output
• Analog input voltage must be constant at the input of
the ADC right from ‘start of conversion’ to ‘end
conversion’ to get correct results.
• This may be ensured by a sample and hold circuit
which samples the analog signal and holds it constant
for a specific time duration.
• The microprocessor may issue a hold signal to the
sample and hold circuit.
• If the applied input changes before the complete
conversion process is over, the digital equivalent of the
analog input calculated by the ADC may not be correct
Problem
• Interface the A-to-D Converter ADC 0808 with
8086 using 8255. Use Port A of 8255 for
transferring digital data output of ADC to the
CPU and Port C for control signals.
• Assume you are using an 8 channel ADC and
the analog input in present at channel 2. Also,
a Clock input of suitable frequency is applied
to the ADC.
Solution
• The analog signal is applied to the Input 2 of
the 8-channel analog multiplexer
• Therefore, address pins A,B,C should be 0,1,0
respectively to select this specific input. Port B
is used to generate this address.
• The ‘ALE’ (Address Latch Enable) and ‘OE’
(Output Enable) pins should be connected to
+5V supply voltage (logic high) to select the
ADC and enable the outputs.
Solution (contd…)
• Port C (Upper) acts as the Input Port to receive
the ‘EOC’ (End of Conversion) signal while Port
C (Lower) acts as the Output Port to send
‘SOC’ (Start of Conversion) signal to the ADC.
• Port A acts as an 8-bit Input Port to receive
the digital data output from the ADC
• 8255 Control Word?
Assembly Program
MOV AL, 98H
OUT CRG, AL (Configure the Control Reg.)

MOV AL, 02H


OUT PORT B, AL (Address the input 2)
Assembly Program (Cont…)
• Give ‘Start of Conversion’ (SOC) Pulse to the
ADC
MOV AL, 00H
OUT Port C, AL
MOV AL, 01H
OUT Port C, AL
MOV AL, 00H
OUT Port C, AL
Assembly Program
• Check for EOC by reading Port C (Upper) and Rotating
Through Carry (bit of Flag Register)

Wait: IN AL, Port C (Read Port C (Upper))


RCR (Check for EOC)
JNC Wait

• If ‘EOC’, Read digital data into AL


IN AL, Port A
HLT
Alternative…
Wait: IN AL, Port C
AND AL, 80H
JZ Wait

You might also like