á
PRELIMINARY
DS3 UNI FOR ATM
XRT7245
REV. 1.03
125
Port 2 (P2.0–P2.7)
Port 2 (Pins 21–28) is a dual-purpose port that can
function as general purpose I/O, or as the high byte
of the address bus for designs with external code
memory of more than 256 bytes of external data
memory (A8–A15).
Port 3
Port 3 is a dual purpose port on pins 10–17. In addi-
tion to functioning as general purpose I/O, these pins
have multiple functions. Each of these pins have an
alternate purpose, as listed in Table 8, below.
The 8051 also has numerous additional pins which
are relevant to interfacing to the XRT7245 DS3 UNI
or other peripherals. These pins are:
ALE—Address Latch Enable
If Port 0 is used in its alternate mode—as the data
bus and the lower byte of the address bus—ALE is
the signal that latches the address into an external
register during the first half of a memory cycle. Once
this is done Port 0 lines are then available for data in-
put or output during the second half of the memory
cycle, when the data transfer takes place.
INT0* (P3.2) and INT1* (P3.3)
INT0* and INT1* are external interrupt request inputs
to the 8051 μC. Each of these interrupt pins support
“direct interrupt” processing. In this case, the term
“direct” means that if one of these inputs are assert-
ed, then program control will automatically branch to a
specific (fixed) location in code memory. This location
is determined by the circuit design of the 8051 μC IC
and cannot be changed. Table 9 presents the loca-
tion (in code memory) where the program control will
branch to, if either of these inputs are asserted.
Therefore, if the user is using either one of these inputs
as an interrupt request input, then the user must insure
that the appropriate interrupt service routine or un-
conditional branch instruction (to the interrupt service
routine) is located at one of these address locations.
If the 8051 μC is required to interface to external
components in the data memory space of sizes
greater than 256 bytes, then both Port 0 and Port 2
must be used as the address and data lines. Port 0
will function as a multiplexed address/data bus. During
the first half of a memory cycle, Port 0 will operate as
the lower address byte. During the second half of the
memory cycle, Port 0 will operate as the bi-directional
data bus. Port 2 will be used as the upper address
byte. ALE and the use of a 74HC373 transparent
latch device can be used to demultiplex the Address
and Data bus signals.
Figure 21 presents a schematic illustrating how the
XRT7245 DS3 UNI can be interfaced to the 8051 μC.
T
ABLE
8: A
LTERNATE
F
UNCTIONS
OF
P
ORT
3 P
INS
B
IT
N
AME
A
LTERNATE
F
UNCTION
P3.0
RXD
Receive Data for Serial Port
P3.1
TXD
Transmit Data for Serial Port
P3.2
INT0*
External Interrupt 0
P3.3
INT1*
External Interrupt 1
P3.4
T0
Timer/Counter 0 External Input
P3.5
T1
Timer/Counter 1 External Input
P3.6
WR*
External Data Memory Write Strobe
P3.7
RD*
External Data Memory Read Strobe
T
ABLE
9: I
NTERRUPT
S
ERVICE
R
OUTINE
L
OCATIONS
(
IN
C
ODE
M
EMORY
)
FOR
INT0*
AND
INT1*
I
NTERRUPT
L
OCATION
INT0*
0003H
INT1*
0013H