
S1C8F626 TECHNICAL MANUAL
EPSON
43
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (I/O Ports)
5.6 I/O Ports (P ports)
5.6.1 Configuration of I/O ports
The S1C8F626 is equipped with 24 bits of I/O ports
(P00–P07, P10–P17, P20–P27).
Figure 5.6.1.1 shows the structure of an I/O port.
VDD
VSS
Pxx
Pull-up control
register
Input
control
Data
bus
Data
register
I/O control
register
*1
*2
*1:
*2:
During output mode
During input mode
Fig. 5.6.1.1 Structure of I/O port
I/O port can be set for input or output mode in one
bit unit. These settings are performed by writing
data to the I/O control registers.
I/O port terminals P10–P13 and P20–P23 are shared
with input/output terminals of serial interface Ch.
0 and Ch.1, respectively. The function of each
terminal is switchable in software. With respect to
serial interface see "5.7 Serial Interface".
The data registers and I/O control registers of I/O
ports set for serial interface output terminals use
are usable as general purpose registers with read/
write capabilities which do not affect I/O activities
of the terminal.
The same as above, the I/O control register of I/O
port set for serial interface input terminal use is
usable as general purpose register.
In addition to the general-purpose DC output,
special output can be selected for the I/O ports
P14–P17 with the software.
5.6.2 I/O control registers and I/O mode
I/O ports are set either to input or output modes by
writing data to the I/O control registers IOCxx
which correspond to each bit.
To set an I/O port to input mode, write "0" to the I/
O control register.
An I/O port which is set to input mode will shift to
a high impedance state and functions as an input
port.
Readout in input mode consists simply of a direct
readout of the input terminal state: the data being
"1" when the input terminal is at HIGH (VDD) level
and "0" when it is at LOW (VSS) level.
When the built-in pull-up resistor is enabled with
the software, the port terminal will be pulled-up to
high during input mode.
Even in input mode, data can be written to the data
registers without affecting the terminal state.
To set an I/O port to output mode, write "1" to the
I/O control register. An I/O port which is set to
output mode functions as an output port.
When port output data is "1", a HIGH (VDD) level is
output and when it is "0", a LOW (VSS) level is
output. Readout in output mode consists of the
contents of the data register.
At initial reset, I/O control registers are set to "0"
(I/O ports are set to input mode).
5.6.3 Input interface level
The I/O ports P10–P17 and P20–P27 allow software
to select an input interface level. When the input I/
F level select register IFLPxx is set to "0", the
corresponding port is configured with a CMOS
level input interface. When IFLPxx is set to "1", the
port is configured with a CMOS Schmitt level input
interface. At initial reset, all the ports are
configured with a CMOS level interface.