
S1C621C0 TECHNICAL MANUAL
EPSON
29
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
IOC00–IOC03: I/O control registers (B0H)
The input and output modes of the I/O ports can be set with these registers.
When "1" is written:
Output mode
When "0" is written:
Input mode
Reading:
Valid
The input and output modes of the I/O ports are set in units of one bit. IOC00–IOC03 set the mode for P00–
P03, respectively.
Writing "1" to the I/O control register makes the corresponding I/O port enter the output mode, and
writing "0" induces the input mode.
At initial reset, these registers are set to "0", so the I/O ports are in the input mode.
PUL00–PUL03: Pull up control registers (B1H)
The pull up during the input mode can be set with these registers.
When "1" is written:
Pull up ON
When "0" is written:
Pull up OFF
Reading:
Valid
The built-in pull up resistor which is turned ON during input mode is set to enable in units of one bit.
PUL00–PUL03 set the pull up for P00–P03, respectively.
By writing "1" to the pull up control register, the corresponding I/O ports are pulled up (during input
mode), while writing "0" turns the pull up function OFF.
At initial reset, these registers are set to "1", so the pull up function is set to ON.
4.6.5 Programming note
When input terminals are changed from low to high by pull up resistor, the rise of the waveform is delayed
on account of the time constant of the pull up resistor and input gate capacitance. Hence, when fetching
data during input mode, set an appropriate wait time.
Particular care needs to be taken of the key scan during key matrix configuration.
Make this waiting time the amount of time or more calculated by the following expression.
Waiting time = RIN
× (CIN + load capacitance on board) × 1.6 [sec]
RIN: pull up resistance (Max. value)
CIN: terminal capacitance (Max. value)