![Epson E0C6006 Скачать руководство пользователя страница 26](http://html.mh-extra.com/html/epson/e0c6006/e0c6006_technical-manual_106885026.webp)
22
EPSON
E0C6006 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (I/O Ports)
4.6 I/O Ports (P00–P03)
4.6.1 Configuration of I/O port
The E0C6006 has 4 bits of general-purpose I/O ports. Figure 4.6.1.1 shows the configuration of the I/O
ports. The I/O ports P00–P03 can be set to either input mode or output mode by writing data to the I/O
control register (IOC).
Data bus
P0x
Address
Data register
Address
I/O control
register
V
DD
Input control
Fig. 4.6.1.1 Configuration of I/O port
4.6.2 I/O control register and I/O mode
Input or output mode can be set for the I/O ports P00–P03 by writing data to the I/O control register
IOC.
To set the input mode, write "0" to the I/O control register (IOC). When the I/O ports are set to the input
mode, the terminals become high impedance and they work as input ports. The input line is pulled up
during read operation.
The output mode is set when "1" is written to the I/O control register (IOC). When the I/O ports are set
to the output mode, they work as output ports and output a high signal (V
DD
) when the port output data
is "1", and a low signal (V
SS
) 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 register is set to "0", and the I/O ports enter the input mode.
4.6.3 I/O memory of I/O port
Table 4.6.3.1 shows the I/O addresses and the control bits for the I/O port.
Table 4.6.3.1 Control bits of I/O port
Address
Comment
D3
D2
Register
D1
D0
Name
Init
∗
1
1
0
0FFH
0
0
IOC
0
R/W
R
R
0
∗
3
0
∗
3
IOC
0
∗
3
–
∗
2
–
∗
2
0
–
∗
2
–
–
Output
–
–
–
Input
–
Unused
Unused
I/O port I/O control
Unused
0FEH
P03
P02
P01
P00
R/W
P03
P02
P01
P00
–
∗
2
–
∗
2
–
∗
2
–
∗
2
High
High
High
High
Low
Low
Low
Low
P0 I/O port data
∗
1
∗
2
Initial value at initial reset
Not set in the circuit
∗
5 Undefined
∗
3
∗
4
Always "0" being read
Reset (0) immediately after being read