Professional Documents
Culture Documents
Interfacing and A-D Converter
Interfacing and A-D Converter
3
Interfacing an 8-Bit ADC using Status Check
•
4
•
5
Subroutine:
OUT 82H ; start conversion
TEST: IN 80H ; Read data ready status
RAR ; get D0 into carry
JC TEST ; if D0=1, conversion is
not complete and go back
IN 81H ; Read output and save in
accumulator
RET
6
Interfacing an 8-bit ADC using Interrupt
•
7
8
•
9
• The main program should initialize the stack,
enable the interrupts (EI), unmask RST 6.5 and
initiate conversion by writing to port 8000H
• In addition the main program should also
include initialization of memory pointer for
storing data and the counter to count reading
• At the end of conversion the microprocessor is
interrupted by using RST 6.5 which transfer
the program control to 0034H.
10
•
11