Hardware manual
Rev. 3.0, 09/98, page 88 of 361
6.3 Port 2
Port 2 is an 8-bit input/output port that also provides the high bits of the address bus. The function
of port 2 depends on the MCU mode as indicated in table 6.5.
Table 6.5 Functions of Port 2
Mode 1 Mode 2 Mode 3
Address bus (High)
(A
15
to A
8
)
Input port or Address bus (High)
(A
15
to A
8
)
*
Input/output port
Note: Depending on the bit settings in the data direction register: 0input pin; 1address pin
Pins of port 2 can drive a single TTL load and a 90pF capacitive load when they are used as output
pins. They can also drive light-emitting diodes and a Darlington pair. When they are used as
input pins, they have programmable MOS transistor pull-ups.
Table 6.6 details the port 2 registers.
Table 6.6 Port 2 Registers
Name Abbreviation Read/Write Initial Value Address
Port 2 data direction register P2DDR W H'FF (mode 1)
H'00 (modes 2 and 3)
H'FFB1
Port 2 data register P2DR R/W H'00 H'FFB3
Port 2 input pull-up control register P2PCR R/W H'00 H'FFAD
Port 2 Data Direction Register (P2DDR)H'FFB1
Bit 76543210
P2
7
DDR P2
6
DDR P2
5
DDR P2
4
DDR P2
3
DDR P2
2
DDR P2
1
DDR P2
0
DDR
Mode 1
Initial value 11111111
Read/Write
Modes 2 and 3
Initial value 00000000
Read/Write W W W W W W W W
P2DDR is an 8-bit register that selects the direction of each pin in port 2. A pin functions as an
output pin if the corresponding bit in P2DDR is set to “1,” and as an input pin if the bit is cleared
to “0.”