
Chapter 4
I/O Ports
IV - 4
Overview
4-1-3
Control Registers
Ports 0 to 8, port A are controlled by the data output register (PnOUT), the data input register (PnIN), the
I/O direction control register (PnDIR), the pull-up resistor control register (PnPLU) or the pull-up / pull-
down resistor control resister (PnPLUD) and registers that control special function pin (P10MD, P4SYO,
P4IMD, P5OMD, PAIMD, FLOAT, LCDMD2, LCCTR1, LCCTR2).
Table 4-1-2 shows the registers to control ports 0 to 8, and port A ;
Table 4-1-2
I/O Port Control Registers List (1/2)
Register
Address
R/W
Function
Page
Port 0
P0OUT
x'03F10'
R/W Port 0 output register
IV-7
P0IN
x'03F20'
R
Port 0 input register
IV-7
P0DIR
x'03F30'
R/W Port 0 direction control register
IV-7
P0PLUD
x'03F40'
R/W Port 0 pull-up / pull-down resistor control register
IV-7
Port 1
P1OUT
x'03F11'
R/W Port 1 output register
IV-14
P1IN
x'03F21'
R
Port 1 input register
IV-14
P1DIR
x'03F31'
R/W Port 1 direction control register
IV-14
P1PLUD
x'03F41'
R/W Port 1 pull-up / pull-down resistor control register
IV-14
P1OMD
x'03F2F'
R/W Port 1 output mode register
IV-15
Port 2
P2OUT
x'03F12'
R/W Port 2 output register
IV-19
P2IN
x'03F22'
R
Port 2 input register
IV-19
P2PLU
x'03F42'
R/W Port 2 pull-up resistor control register
IV-19
Port 3
P3OUT
x'03F13'
R/W Port 3 output register
IV-22
P3IN
x'03F23'
R
Port 3 input register
IV-22
P3DIR
x'03F33'
R/W Port 3 direction control register
IV-22
P3PLU
x'03F43'
R/W Port 3 pull-up resistor control register
IV-22
Port 4
P4OUT
x'03F14'
R/W Port 4 output register
IV-26
P4IN
x'03F24'
R
Port 4 input register
IV-26
P4DIR
x'03F34'
R/W Port 4 direction control register
IV-26
P4PLU
x'03F44'
R/W Port 4 pull-up resistor control register
IV-26
P4SYO
x'03F1E'
R/W Port 4 synchronous output control register
IV-27
P4IMD
x'03F3E'
R/W Port 4 key input interrupt control register
III-43