English
Language : 

GMS87C4060 Datasheet, PDF (33/102 Pages) Hynix Semiconductor – 8-BIT SINGLE-CHIP MICROCONTROLLERS
PRELIMINARY
GMS81C4040/87C4060
9. I/O PORTS
The GMS81C4040/GMS87C4060 has digital ports (R0,
R1, R2, R4, R5 and R6) and OSD ports (R,G,B).
These ports pins may be multiplexed with an alternate
function for the peripheral features on the device. In gen-
eral, in a initial reset state, R ports are used as a general
purpose digital port.
9.1 Registers for Port
Port Data Registers
The Port Data Registers in I/O buffer in each R ports are
represented as a Type D flip-flop, which will clock in a val-
ue from the internal bus in response to a "write to data reg-
ister" signal from the CPU. The Q output of the flip-flop is
placed on the internal bus in response to a "read data reg-
ister" signal from the CPU. The level of the port pin itself
is placed on the internal bus in response to "read data reg-
ister" signal from the CPU. Some instructions that read a
port activating the "read register" signal, and others acti-
vating the "read pin" signal
Port Direction Registers
All pins have data direction registers which can define
these ports as output or input. A "1" in the port direction
register configure the corresponding port pin as output.
Conversely, write "0" to the corresponding bit to specify it
as input pin. For example, to use the even numbered bit of
R0 as output ports and the odd numbered bits as input
ports, write "55H" to address 0C1H (R0 port direction reg-
ister) during initial setting as shown in Figure 9-1 .
All the port direction registers in the GMS81C4040/
GMS87C4060 have 0 written to them by reset function. On
the other hand, its initial status is input.
WRITE "55H" TO PORT R0 DIRECTION REGISTER
0C0H
R0 DATA
0C1H R0 DIRECTION
~~
~~
0C8H
R4 DATA
0C9H R4 DIRECTION
0 1 0 1 0 1 0 1 BIT
76543210
I O I O I O I O PORT
76543210
I : INPUT PORT
O : OUTPUT PORT
Figure 9-1 Example of port I/O assignment
Nov. 1999 Ver 1.0
PRELIMINARY
29