
S1C60N04 TECHNICAL MANUAL
EPSON
17
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
P00–P03: I/O port data (0F6H)
I/O port data can be read and output data can be written through the port.
When writing data
When 1 is written: High level
When 0 is written: Low level
When an I/O port is set to the output mode, the written data is output from the I/O port pin unchanged.
When 1 is written as the port data, the port pin goes high (VDD), and when 0 is written, the level goes low
(VSS). Port data can also be written in the input mode.
When reading data
When 1 is read: High level
When 0 is read: Low level
The pin voltage level of the I/O port is read. When the I/O port is in the input mode the voltage level
being input to the port pin can be read; in the output mode the output voltage level can be read. When
the pin voltage is high (VDD) the port data read is 1, and when the pin voltage is low (VSS) the data is 0.
Also, the built-in pull-down resistor functions during reading, so the I/O port pin is pulled down.
IOC: I/O control register (0FCHD0)
The input or output I/O port mode can be set with this register.
When 1 is written: Output mode
When 0 is written: Input mode
Reading: Valid
The input or output mode of the I/O port is set in units of four bits. For instance, IOC sets the mode for
P00–P03.
Writing 1 to the I/O control register makes the I/O port enter the output mode, and writing 0, the input
mode.
After an initial reset, the IOC register is set to 0, so the I/O port is in the input mode.
4.5.5 Programming note
When in the input mode, I/O ports are changed from high to low by pull-down resistor, the fall of the
waveform is delayed on account of the time constant of the pull-down resistor and input gate capaci-
tance. Hence, when fetching input ports, 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.
10
× C × R
C: terminal capacitance 5 pF + parasitic capacitance ? pF
R: pull-down resistance 60 k