
S1C621C0 TECHNICAL MANUAL
EPSON
27
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
4.6 I/O Ports (P00–P03)
4.6.1 Configuration of I/O ports
The S1C621C0 has 4 bits general-purpose I/O ports. Figure 4.6.1.1 shows the configuration of the I/O port.
The 4 bits of the I/O ports P00–P03 can be set to either input mode or output mode. Modes can be set by
writing data to the I/O control register.
Moreover, pull up resistor which is turned ON during input mode can be controlled by the software.
Data
bus
Pxx
Address
Pull up
control register
VDD
Address
I/O control
register
Address
Data register
Input selector
Address
*1
*2
*1: During output mode
*2: During input mode
Fig. 4.6.1.1 Configuration of I/O port
4.6.2 I/O control registers and input/output mode
Input or output mode can be set for the 4 bits of I/O ports P00–P03 by writing data into the corresponding
I/O control registers IOC00–IOC03.
To set the input mode, write "0" to the I/O control register. When an I/O port is set to input mode, it
becomes high impedance status and works as an input port.
However, when the pull up explained in the following section has been set by software, the input line is
pulled up only during this input mode.
The output mode is set when "1" is written to the I/O control register. When an I/O port set to output
mode works as an output port, it outputs a high level (VDD) when the port output data is "1", and a low
level (VSS) when the port output data is "0".
If perform the read out in each mode; when output mode, the register value is read out, and when input
mode, the port value is read out.
At initial reset, the I/O control registers are set to "0", and the I/O port enters the input mode.
4.6.3 Pull up during input mode
A pull up resistor that operates during the input mode is built into the I/O ports of the S1C621C0. Software
can set the use or non-use of this pull up. The pull up resistor becomes effective by writing "1" into the pull
up control registers PUL00–PUL03 that correspond to each of P00–P03, and the input line is pulled up
during the input mode. When "0" has been written, no pull up is done.
At initial reset, the pull up control registers are set to "1".