English
Language : 

GMS81C5108 Datasheet, PDF (34/102 Pages) Hynix Semiconductor – HYNIX SEMICONDUCTOR INC. 8-BIT SINGLE-CHIP MICROCONTROLLERS
GMS81C5108
9. I/O PORTS
The GMS81C5108 has seven ports (R0, R1, R2 and R3),
and LCD segment port (SEG0~SEG36), and LCD com-
mon port (COM0~COM3).
9.1 Registers for Port
Port Data Registers
The Port Data Registers (R0, R1, R2, R3) are represented
as a D-Type flip-flop, which will clock in a value from the
internal bus in response to a “write to data register” signal
from the CPU. The Q output of the flip-flop is placed on
the internal bus in response to a “read data register” signal
from the CPU. The level of the port pin itself is placed on
the internal bus in response to “read data register” signal
from the CPU. Some instructions that read a port activating
the “read register” signal, and others activating 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 0C8H (R0 port direction reg-
ister) during initial setting as shown in Figure 9-1.
All the port direction registers in the GMS81C5108 have 0
written to them by reset function. On the other hand, its in-
itial status is input.
WRITE “55H” TO PORT R0 DIRECTION REGISTER
0C0H
R0 DATA
0C1H
~~
R1 DATA
~~
0C8H R0 DIRECTION
0C9H R1 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
Pull-up Control Registers
The R0, R1,R2 and R3 ports have internal pull-up resis-
tors. Figure 9-2 shows a functional diagram of a typical
These ports pins may be multiplexed with an alternate
function for the peripheral features on the device.
pull-up port. It is connected or disconnected by Pull-up
Control register (RnPU). The value of that resistor is typi-
cally 100kΩ. Refer to DC characteristics for more details.
When a port is used as key input, input logic is firmly ei-
ther low or high, therefore external pull-down or pull-up
resisters are required practically. The GMS81C5108 has
internal pull-up, it can be logic high by pull-up that can be
able to configure either connect or disconnect individually
by pull-up control registers RnPU.
When ports are configured as inputs and pull-up resistor is
selected by software, they are pulled to high.
VDD
VDD
PULL-UP RESISTOR
PORT PIN
GND
Pull-up control bit
0: Disconnect
1: Connect
Figure 9-2 Pull-up Port Structure
Open drain port Registers
The R0, R1, R2 and R3 ports have open drain port resistors
R0CR~R3CR.
Figure 9-3 shows an open drain port configuration by control reg-
ister. It is selected as either push-pull port or open-drain port by
R0CR, R1CR, R2CR and R3CR.
PORT PIN
Open drain port selection bit
GND
0: Push-pull
1: Open drain
Figure 9-3 Open-drain Port Structure
JUNE 2001 Ver 1.0
31