Hyundai Micro Electronics
GMS81C2020/GMS81C2120
12. I/O PORTS
The GMS81C2020 has eight ports, R0, R1, R2, R3, R4,
R5, R6 and R7. The GMS81C2120 has five ports, R0,
port can directly drive a vacuum fluorescent display. R03
port is multiplexed with Buzzer Output Port(BUZO), R02
port is multiplexed with Event Counter Input Port (EC0),
and R01~R00 are multiplexed with External Interrupt In-
put Port(INT1, INT0).
R2, R3, R5 and R6.
These ports pins may be multiplexed
with an alternate function for the peripheral features on the
device. In general, when a initial reset state, all ports are
used as a general purpose input port.
ADDRESS : C0H
R0 Data Register
RESET VALUE : Undefined
All pins have data direction registers which can set these
ports as output or input. A "1" in the port direction register
defines the corresponding port pin as output. Conversely,
write "0" to the corresponding bit to specify as an 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 C1H (R0 direction register) during initial setting
as shown in Figure 12-1 .
R0
R07 R06 R05 R04 R03 R02 R01 R00
INPUT / OUTPUT DATA
ADDRESS : C1H
R0 Direction Register
R0IO
RESET VALUE : 00000000
Reading data register reads the status of the pins whereas
writing to it will write to the port latch..
DIRECTION SELECT
0 : INPUT PORT
1 : OUTPUT PORT
WRITE "55H" TO PORT RA DIRECTION REGISTER
R0 Function Selection Register
R0FUNC
ADDRESS : F4H
RESET VALUE : ----0000
0
7
1
6
0
5
1
4
0
3
1
2
0
1
1
0
C0H
C1H
C2H
C3H
R0 DATA
R0 DIRECTION
R1 DATA
-
-
-
-
EC0
INT1
INT0
BUZO
BIT
0 : R03
1 : BUZO
0 : R00
1 : INT0
I
O
6
I
O
4
I
O
2
I
O
0 : R02
1 : EC0
0 : R01
1 : INT1
R1 DIRECTION
7
5
3
1
0 PORT
I : INPUT PORT
O : OUTPUT PORT
Figure 12-2 Registers of Port R0
Figure 12-1 Example of port I/O assignment
The control register R0FUNC (address F4H) controls to se-
lect alternate function. After reset, this value is "0", port
may be used as general I/O ports. To select alternate func-
tion such as Buzzer Output, External Event Counter Input
and External Interrupt Input, write "1" to the correspond-
ing bit of R0FUNC. Regardless of the direction register
R0IO, R0FUNC is selected to use as alternate functions,
port pin can be used as a corresponding alternate features
(BUZO, EC0, INT1, INT0)
12.1 RA(Vdisp) register
RA is one-bit high-voltage input only port pin. In addition,
RA serves the functions of the Vdisp special features. Vdisp
is used as a high-voltage input power supply pin when se-
lected by the mask option..
ADDRESS : FBH
RA Data Register
RESET VALUE : Undefined
R0FUNC
[3:0]
PORT
Description
RA
-
-
-
-
-
-
-
RA0
0
1
0
1
0
R00 (Normal I/O Port)
R03/
BUZO
INPUT DATA
BUZO (Buzzer Output Port)
R01 (Normal I/O Port)
R02/
EC0
Port pin
RA
Alternate function
disp (High-voltage input power supply)
EC0 (Event Counter Input Port)
R01 (Normal I/O Port)
V
R01/
INT1
INT1 (External interrupt 1 Input
Port)
12.2 R0 and R0IO registers
1
R0 is an 8-bit high-voltage CMOS bidirectional I/O port
(address C0H). Each port can be set individually as input
and output through the R0IO register (address C1H). Each
Nov. 1999 Ver 0.0
preliminary
43