
Pin Functions in Modes 2 and 4:
In modes 2 and 4, (expanded modes in which the on-chip
ROM is used), software can select whether to use port 5 for general-purpose input, or for output
of bits A
15
– A
8
of the address bus.
If a bit in P5DDR is set to 1, the corresponding pin is used for address output. If the bit is cleared
to 0, the pin is used for input. A reset clears all P5DDR bits to 0, so before the address bus is
used, all necessary bits in P5DDR must be set to 1.
Figure 9-13 shows the pin functions in modes 2 and 4.
Pin Functions in Single-Chip Mode:
In the single-chip mode (mode 7), each of the port 5 pins
can be designated as an input pin or an output pin, as indicated in figure 9-14, by setting the
corresponding bit in P5DDR to 1 for output or clearing it to 0 for input.
When P5DDR
Bit is Set to “1”
A
15
(output)
A
14
(output)
A
13
(output)
A
12
(output)
A
11
(output)
A
10
(output)
A
9
(output)
A
8
(output)
When P5DDR Bit
is Cleared to “0”
P5
7
(input)
P5
6
(input)
P5
5
(input)
P5
4
(input)
P5
3
(input)
P5
2
(input)
P5
1
(input)
P5
0
(input)
Port
5
P5
7
(input/output)
P5
6
(input/output)
P5
5
(input/output)
P5
4
(input/output)
P5
3
(input/output)
P5
2
(input/output)
P5
1
(input/output)
P5
0
(input/output)
Port
5
Figure 9-13 Port 5 Pin Functions in Modes 2 and 4
Figure 9-14 Port 5 Pin Functions in Single-Chip Mode
162