E0C6006 TECHNICAL MANUAL
EPSON
23
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
P00–P03: I/O port data register (0FEH)
I/O port data can be read and output data can be written through this register.
• Writing
When "1" is written: High level
When "0" is written: Low level
When the I/O port is set to the output mode, the written data is output from the I/O port terminal
unchanged. When "1" is written as the port data, the port terminal goes high (V
DD
), and when "0" is
written, the level goes low (V
SS
). Port data can also be written in the input mode.
• Reading
When "1" is read: High level
When "0" is read: Low level
The terminal 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 terminal can be read; in the output mode the output voltage level can be
read. When the terminal voltage is high (V
DD
) the port data read is "1", and when the terminal voltage is
low (V
SS
) the data is "0".
When the port data is read, the built-in pull-up resistors go on and the I/O port terminals are pulled up.
IOC: I/O control register (0FFH•D1)
The input or output mode can be set with this register.
When "1" is written: Output mode
When "0" is written: Input mode
Reading: Valid
When "1" is written to the I/O control register, the I/O ports enter the output mode, and when "0" is
written, the I/O ports enter the input mode.
At initial reset, this register is set to "0".
4.6.4 Programming notes
(1) When the I/O port is set to the output mode and a low-impedance load is connected to the port
terminal, the data written to the register may differ from the data read.
(2) When the I/O port is set to the input mode and the input level changed from low (V
SS
) to high (V
DD
)
through the built-in pull-up resistor, an erroneous input results if the time constant of the capacitive
load of the input line and the built-in pull-up resistor is greater than the read-out time. When the
input data is being read, the time that the input line is pulled up is equivalent to 0.5 cycles of the CPU
system clock. Hence, the electric potential of the terminals must settle within 0.5 cycles. If this condi-
tion cannot be met, some measure must be devised, such as arranging a pull-up resistor externally, or
performing multiple read-outs.