Port 9 Data Direction Register (P9DDR)—H’FFC0
P9DDR is an 8-bit register that selects the direction of each pin in port 9. A pin functions as an
output pin if the corresponding bit in P9DDR is set to “1,” and as in input pin if the bit is cleared to
“0.”
Port 9 Data Register (P9DR)—H’FFC1
P9DR is an 8-bit register containing the data for pins P9
7
to P9
0
. When the CPU reads P9DR, for
output pins (P9DDR = "1") it reads the value in the P9DR latch, but for input pins (P9DDR = "0"),
it obtains the logic level directly from the pin, bypassing the P9DR latch. This also applies to pins
used for interrupt input, A/D trigger input, clock output, and control signal input or output.
MOS Pull-Ups:
Are available for input pins, including pins used for input of interrupt request
signals, the A/D trigger signal, and control signals. Software can turn the MOS pull-up on by
writing a “1” in P9DR, and turn it off by writing a “0.”
Pins P9
0
, P9
1
, and P9
2
:
Can be used for general-purpose input or output, interrupt request input,
or A/D trigger input. See Table 5-18. If a pin is used for interrupt or A/D trigger input, its data
direction bit should be cleared to "0," so that the output from P9DR will not generate an interrupt
request or A/D trigger signal.
Pins P9
3
and P9
4
:
In modes 1 and 2 (the expanded modes), these pins are used for output of the
RD and WR bus control signals. They are unaffected by the values in P9DDR and P9DR, and their
Bit
7
6
5
4
3
2
1
0
P9
7
DDR P9
6
DDR P9
5
DDR P9
4
DDR P9
3
DDR P9
2
DDR P9
1
DDR P9
0
DDR
Modes 1 and 2
Initial value
Read/Write
Mode 3
Initial value
Read/Write
0
W
1
0
W
0
W
0
W
0
W
0
W
0
W
—
0
W
0
W
0
W
0
W
0
W
0
W
0
W
0
W
Bit
7
6
5
4
3
2
1
0
P9
7
0
R/W
P9
6
0
R/W
P9
5
0
R/W
P9
4
0
R/W
P9
3
0
R/W
P9
2
0
R/W
P9
1
0
R/W
P9
0
0
R/W
Initial value
Read/Write
115