
82
EPSON
S1C88409 TECHNICAL MANUAL
CHAPTER 5: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
Table 5.8.5.1(b) I/O port control bits
Address
Function
R/W
Init
0
1
Comment
Name
Bit
00FFE6
–
P23 I/O port data register
P22 I/O port data register
P21 I/O port data register
P20 I/O port data register
–
R/W
–
1
–
Low
–
High
"0" when being read
–
P23D
P22D
P21D
P20D
D7
D6
D5
D4
D3
D2
D1
D0
00FFE7
P37 I/O port data register
P36 I/O port data register
P35 I/O port data register
P34 I/O port data register
P33 I/O port data register
P32 I/O port data register
P31 I/O port data register
P30 I/O port data register
R/W
1
Low
High
P37D
P36D
P35D
P34D
P33D
P32D
P31D
P30D
D7
D6
D5
D4
D3
D2
D1
D0
P00D–P07D: P0 port data register
(00FFE4H)
P10D–P17D: P1 port data register
(00FFE5H)
P20D–P23D: P2 port data register
(00FFE6HD0–D3)
P30D–P37D: P3 port data register
(00FFE7H)
I/O port data can be read and output data can be
set through these registers.
When writing:
When "1" is written: HIGH level
When "0" is written: LOW level
When the I/O port is set in the output mode, the
written data is output from the I/O port terminal.
When "1" is written as the port data, the port
terminal goes high (VDD) level, and when "0" is
written, the terminal goes low (VSS) level.
Port data can be written even in the input mode.
When reading:
When "1" is read: HIGH level ("1")
When "0" is read: LOW level ("0")
When the I/O port is in the input mode, the
voltage level being input to the port terminal can
be read. When the terminal voltage is high (VDD)
level, "1" is read, and "0" is read when it is low
(VSS) level.
In the output mode, the content of the data register
is read.
At initial reset, the data bits are all set to "1"
(HIGH level).
Refer to Section 5.8.2 for the data register of the
ports set in a function other than I/O port.
IOC00–IOC07: P0 port I/O control register
(00FFE0H)
IOC10–IOC17: P1 port I/O control register
(00FFE1H)
IOC20–IOC23: P2 port I/O control register
(00FFE2HD0–D3)
IOC30–IOC37: P3 port I/O control register
(00FFE3H)
Sets the I/O port to the input or output mode.
When "1" is written: Output mode
When "0" is written: Input mode
Reading: Valid
The IOC register is the I/O control register corre-
sponding to each I/O port individually.
When an IOC bit is set to "1", the corresponding
I/O port enters the output mode. When it is set to
"0", the port enters the input mode.
At initial reset, the IOC register is set to "0" (input
mode).
Refer to Section 5.8.2 for the I/O control register of
the ports set in a function other than I/O port.
5.8.6 Programming note
When the port terminal is changed from a low
level to a high level by the built-in pull-up resistor,
the rise of the waveform is delayed on account of
the time constant of the pull-up resistor and load
capacitance of the terminal. So, when reading the
I/O port, it is necessary to wait an appropriate
amount of time. Make this waiting time the
amount of time or more calculated by the follow-
ing expression.
Waiting time = RIN
× (CIN + CL) × 1.6 [sec]
RIN: Pull-up resistance Max. value
CIN: Terminal capacitance Max. value
CL:
Load capacitance on the board