
16
EPSON
S1C60N04 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
4.5 I/O Ports (P00–P03)
4.5.1 Configuration of I/O port
The S1C60N04 has a 4-bit general-purpose I/O port. Figure 4.5.1.1 shows the configuration of the I/O
port. The four bits of the I/O port P00–P03 can be set to either input mode or output mode. The mode can
be set by writing data to the I/O control register (IOC).
Address
Register
Input
control
I/O control
register
(IOC)
Data
bus
P0x
Vss
Fig. 4.5.1.1 Configuration of I/O port
4.5.2 I/O control register and I/O mode
Input or output mode can be set for the four bits of I/O port P00–P03 by writing data into I/O control
register IOC.
To set the input mode, 0 is written to the I/O control register. When an I/O port is set to input mode, its
impedance becomes high and it works as an input port. However, the input line is pulled down when
input data is read.
The output mode is set when 1 is written to the I/O control register (IOC). When an I/O port set to
output mode works as an output port, it outputs a high signal (VDD) when the port output data is 1, and
a low signal (VSS) when the port output data is 0.
After an initial reset, the I/O control register is set to 0, and the I/O port enters the input mode.
4.5.3 Mask option
The output specification during output mode (IOC = 1) of the I/O port can be set with the mask option
for either complementary output or Pch open drain output. This setting can be performed for each bit of
the I/O port. However, when Pch open drain output has been selected, voltage in excess of the supply
voltage must not be applied to the port.
4.5.4 I/O memory of I/O port
Table 4.5.4.1 lists the I/O port control bits and their addresses.
Table 4.5.4.1 I/O port control bits
Address
Comment
D3
D2
Register
D1
D0
Name
Init 1
10
0FCH
000
IOC
RR/W
0 3
IOC
– 2
0
–
Output
–
Input
Unused
I/O port I/O control
0F6H
P03
P02
P01
P00
R/W
P03
P02
P01
P00
– 2
High
Low
P0 I/O port data
1
2
Initial value at initial reset
Not set in the circuit
3
4
Always "0" being read
Reset (0) immediately after being read