9 i/O PORTS (P)
9-2
Seiko epson Corporation
S1C17153 TeChniCal Manual
(Rev. 1.0)
input/Output Pin Function Selection (Port MuX)
9.2
The I/O port pins share peripheral module input/output pins. Each pin can be configured for use as an I/O port or
for a peripheral module function via the corresponding port function-select bits. Pins not used for peripheral mod-
ules can be used as general-purpose I/O ports.
2.1 Input/Output Pin Function Selection
Table 9.
Pin function 1
P
xy
MuX[1:0] = 0x0
Pin function 2
P
xy
MuX[1:0] = 0x1
Pin function 3
P
xy
MuX[1:0] = 0x2
Pin function 4
P
xy
MuX[1:0] = 0x3
Port function select bits
P00
SIN0 (UART)
–
–
P00MUX[1:0]/P00_03PMUX register
P01
SOUT0 (UART)
–
–
P01MUX[1:0]/P00_03PMUX register
P02
SCLK0 (UART)
FOUTA (CLG)
–
P02MUX[1:0]/P00_03PMUX register
P03
EXCL0 (T16A2)
–
LFRO (LCD)
P03MUX[1:0]/P00_03PMUX register
P04
TOUTA0/CAPA0 (T16A2)
–
–
P04MUX[1:0]/P04_07PMUX register
P05
TOUTB0/CAPB0 (T16A2) #SPISS0 (SPI)
–
P05MUX[1:0]/P04_07PMUX register
P06
BZ (SND)
SDI0 (SPI)
–
P06MUX[1:0]/P04_07PMUX register
P07
#BZ (SND)
SDO0 (SPI)
–
P07MUX[1:0]/P04_07PMUX register
P10
FOUTB (CLG)
SPICLK0 (SPI)
–
P10MUX[1:0]/P10_13PMUX register
–
P11
BZ (SND)
–
P11MUX[1:0]/P10_13PMUX register
–
P12
#BZ (SND)
–
P12MUX[1:0]/P10_13PMUX register
–
P13
–
–
P13MUX[1:0]/P10_13PMUX register
At initial reset, each I/O port pin (P
xy
) is initialized for the default function (“Pin function 1” in Table 9.2.1).
For information on functions other than the I/O ports, see the descriptions of the peripheral modules indicated in
parentheses. The sections below describe port functions with the pins set as general-purpose I/O ports.
Data input/Output
9.3
Data input/output control
The I/O ports allow selection of the data input/output direction for each bit using P
x
OEN
y
/P
x
_OEN register and
P
x
IEN
y
/P
x
_IEN register. P
x
OEN
y
enables and disables data output, while P
x
IEN
y
enables and disables data
input.
3.1 Data Input/Output Status
Table 9.
P
x
Oen
y
output control
P
x
ien
y
input control
P
x
Pu
y
pull-up control
Port status
0
1
0
Functions as an input port (pull-up off).
The port pin (external input signal) value can be read out from
P
x
IN
y
(input data). Output is disabled.
0
1
1
Functions as an input port (pull-up on). (Default)
The port pin (external input signal) value can be read out from
P
x
IN
y
(input data). Output is disabled.
1
0
1 or 0
Functions as an output port (pull-up off).
Input is disabled. The value read from P
x
IN
y
(input data) is 0.
1
1
1 or 0
Functions as an output port (pull-up off).
Input is also enabled. The port pin value (output value) can be
read out from P
x
IN
y
(input data).
0
0
0
The pin is placed into high-impedance status (pull-up off).
Output and input are both disabled. The value read from P
x
IN
y
(input data) is 0.
0
0
1
The pin is placed into high-impedance status (pull-up on).
Output and input are both disabled. The value read from P
x
IN
y
(input data) is 0.
The input/output direction of ports with a peripheral module function selected is controlled by the peripheral
module. P
x
OEN
y
and P
x
IEN
y
settings are ignored.