- Asked 2/20
- 2078 Bhadra · 8 marks
- 2069 Chaitra · 5 marks
Interfacing 8-bit ADC using interrupt
Short answer
Start conversion via OUT 80H, then use RST7.5 interrupt driven by ADC’s EOC. The ISR reads the ADC with IN 80H, stores data, sets a flag, and returns, avoiding polling delays (e.g., 100 µs for ADC0809).
Explain the principle involved while interfacing an 8-bit ADC using interrupt; including suitable block diagram, process flow diagram and necessary ALP subroutine.
In interrupt-driven ADC interfacing, the CPU starts the conversion and continues other work. When the ADC finishes it raises its EOC (end of conversion) output, which interrupts the 8085, and the interrupt service routine reads the result. This avoids waiting or polling during the conversion time (100 us for ADC0809).
Block diagram (ADC0809, I/O mapped at 80H)
Analog inputs IN0-IN7
|
+--------------+ OUT 80H pulse (IOW' + decode) -> START and ALE
| ADC 0809 | channel number on D0-D2 -> ADD A, B, C
| | IN 80H (IOR' + decode) -> OE
| D0-D7 out |--------------------> AD0-AD7 (data bus of 8085)
| EOC -------|-------------------> RST 7.5 (8085 interrupt input)
| CLK <- 640 kHz (from CLK OUT divided)
+--------------+ Vref+ = 5 V, Vref- = 0
RST 7.5 is edge triggered (rising edge) and has the vector 003CH. EOC goes high at the end of conversion and stays high until a new conversion starts. If it were connected to the level-sensitive RST 5.5, it would interrupt again and again after every EI. The rising edge on RST 7.5 is latched, so the CPU is interrupted only once per conversion.
Process flow
MAIN ISR (vector 003CH)
Set stack, enable RST 7.5 Save registers
EI IN 80H (OE = 1, read data)
Clear flag Store data in memory
Select channel, OUT 80H Set flag
(start conversion) Restore registers
Do other work / wait flag EI, RET
Use stored data
ALP
ORG 003CH
JMP ADCISR ; RST 7.5 vector
ORG 2000H
START: LXI SP,27FFH
MVI A,1BH ; SIM: reset 7.5 latch, MSE=1, mask 6.5 and 5.5, enable 7.5
SIM
EI
XRA A
STA 2051H ; clear flag
MVI A,00H ; channel 0
OUT 80H ; ALE and START: conversion begins
HERE: LDA 2051H ; flag set by ISR
ORA A
JZ HERE ; main program can do other work here
LDA 2050H ; converted data available
HLT
ADCISR: PUSH PSW
IN 80H ; read ADC output (OE active)
STA 2050H ; store result
MVI A,01H
STA 2051H ; set flag
POP PSW
EI
RET
Reading the converted value takes only a few microseconds, and the CPU is free during the whole conversion.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- Interfacing 8-channel 8-bit ADC with 8085 · Instrumentation II, chapter 4
- 8-channel ADC interface with 8255 and 8085 · Instrumentation II, chapter 4
- Interfacing 10-bit DAC with 8085 · Instrumentation II, chapter 4 · asked 2×
- ADC at 80H with 8255A: display on port B LEDs · Instrumentation II, chapter 2
- 10-bit DAC triangular wave at 500 Hz · Instrumentation II, chapter 4
- Data logger block diagram and operation · Instrumentation II, chapter 5 · asked 6×
- Dual slope ADC block diagram; integral linearity · Advanced Electronics, chapter 3
- n-bit full adder block diagram · Digital Logic, chapter 5
- Signal flow graph of G1–G3, H1–H3 block diagram · Control Systems, chapter 3
- Interrupt and fixed ISR flow of actions · Embedded System, chapter 5