HYUNDAI MicroElectronics
9. I/O PORTS
GMS81C2012/GMS81C2020
The GMS81C20xx has eight ports (R0, R1, R2, R4, R5, R6
and R7).These ports pins may be multiplexed with an alter-
nate function for the peripheral features on the device.
R0 and R0IO register: R0 is an 8-bit high-voltage CMOS
bidirectional I/O port (address 0C0H). Each port can be set
individually as input and output through the R0IO register
(address 0C1H). Each port can directly drive a vacuum flu-
orescent display. R03 port is multiplexed with Buzzer Out-
put Port(BUZO), R02 port is multiplexed with Event
Counter Input Port (EC0), and R01~R00 are multiplexed
with External Interrupt Input Port(INT1, INT0)
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.
Alternate Function
Port Pin
R00
R01
R02
R03
INT0 (External interrupt 0 Input Port)
INT1 (External interrupt 1 Input Port)
EC0 (Event Counter Input Port)
BUZO (Buzzer Output Port)
All the port direction registers in the GMS81C2020 have 0
written to them by reset function. On the other hand, its in-
itial status is input.
.The control register R0FUNC (address F4H) controls to
select 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)
WRITE "55H" TO PORT R0 DIRECTION REGISTER
0C0H
BIT
R0 data
R0 direction
R1 data
0 1 0 1 0 1 0 1
7
6 5 4 3 2 1 0
0C1H
0C2H
0C3H R1 direction
I
O
I O I O I O PORT
7 6 5 4 3 2 1 0
I : INPUT PORT
O : OUTPUT PORT
ADDRESS: 0C0H
RESET VALUE: Undefined
R0 Data Register
R07 R06 R05 R04 R03 R02 R01 R00
R0
Figure 9-1 Example of Port I/O Assignment
Input / Output data
RA(Vdisp) register: RA is one-bit high-voltage input
only port pin. In addition, RA serves the functions of the
V
disp special features. Vdisp is used as a high-voltage input
ADDRESS : 0C1H
RESET VALUE : 00H
power supply pin when selected by the mask option.
R0 Direction Register
R0IO
ADDRESS: 0FBH
RA Data Register
RESET VALUE: Undefined
Port Direction
0: Input
RA0
RA
1: Output
Input data
ADDRESS : 0F4H
RESET VALUE : ----0000B
R0 Function Selection Register
-
-
-
-
3
2
1
0
R0FUNC
Port pin
Alternate function
0: R02
1: BUZO
0: R00
1: INT0
V
disp (High-voltage input power supply)
RA
0: R03
1: EC0
0: R01
1: INT1
MAR. 2000 Ver 1.00
39