Datasheets»National Semiconductor (acquired by TI (Texas Instruments))»ADC0801 Datasheet

ADC0801 Datasheet - Page 31

Download or read online National Semiconductor ADC0801 8-Bit Microprocessor Compatible A/D Converters pdf datasheet.
Also see for ADC0801: Datasheet #2 (41 pages)



Page
31 of 36
prevnext
FIGURE 21 Multiple A Ds with Z-80 Type Microprocessor
INTERRUPT SERVICING SUBROUTINE
SOURCE
LOC
OBJ CODE
STATEMENT
0038
E5
PUSH HL
0039
C5
PUSH BC
003A
F5
PUSH AF
003B
21 00 3E
LD (HL) X3E00
003E
0E 01
LD C X01
0040
D300
OUT X00 A
0042
DB00
IN A X00
0044
47
LD B A
0045
79
TEST
LD A C
0046
FE 08
CP X08
0048
CA 60 00
JPZ DONE
004B
78
LD A B
004C
1F
RRA
004D
47
LD B A
004E
DA 5500
JPC LOAD
0051
0C
NEXT
INC C
0052
C3 4500
JP TEST
0055
ED 78
LOAD
IN A (C)
0057
EE FF
XOR FF
0059
77
LD (HL) A
005A
2C
INC L
005B
71
LD (HL) C
005C
2C
INC L
005D
C3 51 00
JP NEXT
0060
F1
DONE
POP AF
0061
C1
POP BC
0062
E1
POP HL
0063
C9
RET
COMMENT
Save contents of all registers affected by
this subroutine
Assumed INT mode 1 earlier set
Initialize memory pointer where data will be stored
C register will be port ADDR of A D converters
Load peripheral status word into 8-bit latch
Load status word into accumulator
Save the status word
Test to see if the status of all A D’s have
been checked If so exit subroutine
Test a single bit in status word by looking for
a ‘1‘ to be rotated into the CARRY (an INT
is loaded as a ‘1‘) If CARRY is set then load
contents of A D at port ADDR in C register
If CARRY is not set increment C register to point
to next A D then test next bit in status word
Read data from interrupting A D and invert
the data
Store the data
Store A D identifier (A D port ADDR)
Test next bit in status word
Re-establish all registers as they were
before the interrupt
Return to original program
31
TL H 5671– 29

Comments to this Datasheet