
197
8.3.2
Register Configuration
Table 8.5 shows the port 2 register configuration.
Table 8.5
Port 2 Registers
Name
Abbreviation
R/W
Initial Value
Address*
Port 2 data direction register
P2DDR
W
H'00
H'FFB1
Port 2 data register
P2DR
R/W
H'00
H'FFB3
Port 2 MOS pull-up control
register
P2PCR
R/W
H'00
H'FFAD
Note: * Lower 16 bits of the address.
Port 2 Data Direction Register (P2DDR)
7
P27DDR
0
W
6
P26DDR
0
W
5
P25DDR
0
W
4
P24DDR
0
W
3
P23DDR
0
W
0
P20DDR
0
W
2
P22DDR
0
W
1
P21DDR
0
W
Bit
Initial value
Read/Write
P2DDR is an 8-bit write-only register, the individual bits of which specify input or output for the
pins of port 2. P2DDR cannot be read; if it is, an undefined value will be returned.
P2DDR is initialized to H'00 by a reset and in hardware standby mode. It retains its prior state in
software standby mode. The address output pins maintain their output state in a transition to
software standby mode.
Mode 1
The corresponding port 2 pins are address outputs, regardless of the P2DDR setting.
In hardware standby mode, the address outputs go to the high-impedance state.
Modes 2 and 3 (EXPE = 1)
The corresponding port 2 pins are address outputs or PWM outputs when P2DDR bits are set
to 1, and input ports when cleared to 0. P27 to P24 are switched from address outputs to
output ports by setting the IOSE bit to 1.
P27 can be used as an on-chip supporting module output pin regardless of the P27DDR
setting, but to ensure normal access to external space, P27 should not be set as an on-chip
supporting module output pin when port 2 pins are used as address output pins.