Professional Documents
Culture Documents
INPUT/OUTPUT INTERFACE
CIRCUITS AND
LSI PERIPHERAL DEVICE
1
3/29/2015
2
3/29/2015
3
3/29/2015
4
3/29/2015
5
3/29/2015
6
3/29/2015
7
3/29/2015
8
3/29/2015
9
3/29/2015
10
3/29/2015
11
3/29/2015
12
3/29/2015
13
3/29/2015
14
3/29/2015
15
3/29/2015
16
3/29/2015
17
3/29/2015
18
3/29/2015
19
3/29/2015
20
3/29/2015
21
3/29/2015
22
3/29/2015
23
3/29/2015
Combined mode 2 and mode 0 (input) control word and I/O configuration
24
3/29/2015
Combined mode 2 and mode 1 (output) control word and I/O configuration
25
3/29/2015
Mode 1 status information for port C Mode 1 status information for port C
26
3/29/2015
27
3/29/2015
Memory-Mapped Input/Output
Ports
The full 20-bit address is available for
addressing I/O.
Memory-mapped I/O devices can reside anywhere in
the 1Mbyte memory address space of the 8088.
During I/O operations, memory read and write
bus cycles are initiated instead of I/O bus
cycles.
Memory instructions, not input/output instructions, are
used to perform data transfer.
28
3/29/2015
Memory-Mapped Input/Output
Ports
Memory-Mapped Input/Output
Ports
EXAMPLE:
Which I/O port in the previous figure is selected
for operation when the memory address output
on the bus is 0040216?
Solution:
We begin by converting the address to binary
form. This gives
A19…A1A0 = 000000000100000000102
In this address, bits A10 = 1 and A0 = 0.
Therefore, the 74F138 address decoder is
enabled whenever IO/M = 0.
A5A4A3 = 000
This input code switches decoder output O0 to
logic 0 and chip selects PPI 0 for operation.
The address bits applied to the port select inputs
of the PPI are A2A1 = 01. These inputs cause port
B to be accessed. Thus, the address 0040216
selects port B on PPI 0 for memory-map I/O.
29
3/29/2015
Memory-Mapped Input/Output
Ports
EXAMPLE:
Write the sequence of instructions needed to
initialize the control register of PPI 0 in the circuit
of the previous figure so that port A is an output
port, ports B and C are input ports, and all three
ports are configured for mode 0 operation.
Solution:
The control byte required to provide this
configuration is:
Memory-Mapped Input/Output
Ports
From the circuit diagram, the memory address of
the control register for PPI 0 is found to be
000000000100000001102 = 0040616
Since PPI 0 is memory mapped, the following
move instructions can be used to initialized the
control register:
MOV AX, 0 ; Create data segment at 00000H
MOV DS, AX
MOV AL, 8BH ; Load AL with control byte
MOV [406H], AL ; Write control byte to PPI 0
control register
30
3/29/2015
Memory-Mapped Input/Output
Ports
EXAMPLE:
Assume that PPI 0 in the previous figure is configured
as described in the previous example. Write a program
that will input the contents of ports B and C, AND
them together, and output the results to port A.
Solution:
The addresses of the three I/O ports on PPI 0 are:
Port A = 0040016 Port B = 0040216 Port C =
0040416
Now we set up a data segment at 0000016 and the
program is:
AND AX, 0 ; Create data segment at 00000H
MOV DS, AX
MOV BL, [402H] ; Read port B
MOV AL, [404H] ; Read port C
AND AL, BL ; AND data at port B and C
MOV [400H], AL ; Write to port A
Memory-Mapped Input/Output
Ports
Memory-mapped 82C55A
parallel I/O ports in an
8086-based microcomputer
31
3/29/2015
32
3/29/2015
33
3/29/2015
34
3/29/2015
35
3/29/2015
36
3/29/2015
37
3/29/2015
38
3/29/2015
39
3/29/2015
40
3/29/2015
41
3/29/2015
42
3/29/2015
43