English
Language : 

GMS81C2020 Datasheet, PDF (43/92 Pages) Hynix Semiconductor – CMOS Single-Chip 8-Bit Microcontroller with A/D Converter & VFD Driver
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,
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.
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 .
Reading data register reads the status of the pins whereas
writing to it will write to the port latch..
WRITE "55H" TO PORT RA DIRECTION REGISTER
C0H
C1H
C2H
C3H
R0 DATA
R0 DIRECTION
R1 DATA
R1 DIRECTION
01010101
7 6 5 4 3 2 1 0 BIT
IOIOIOIO
7 6 5 4 3 2 1 0 PORT
I : INPUT PORT
O : OUTPUT PORT
Figure 12-1 Example of port I/O assignment
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..
RA Data Register
ADDRESS : FBH
RESET VALUE : Undefined
RA
- - - - - - - RA0
INPUT DATA
Port pin
RA
Alternate function
Vdisp (High-voltage input power supply)
12.2 R0 and R0IO registers
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
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).
R0 Data Register
ADDRESS : C0H
RESET VALUE : Undefined
R0
R07 R06 R05 R04 R03 R02 R01 R00
R0 Direction Register
R0IO
INPUT / OUTPUT DATA
ADDRESS : C1H
RESET VALUE : 00000000
DIRECTION SELECT
0 : INPUT PORT
1 : OUTPUT PORT
R0 Function Selection Register
R0FUNC
ADDRESS : F4H
RESET VALUE : ----0000
-
-
-
-
BUZO EC0 INT1 INT0
0 : R03
1 : BUZO
0 : R02
1 : EC0
0 : R00
1 : INT0
0 : R01
1 : INT1
Figure 12-2 Registers of Port R0
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)
PORT
R03/
BUZO
R02/
EC0
R01/
INT1
R0FUNC
[3:0]
0
1
0
1
0
1
Description
R00 (Normal I/O Port)
BUZO (Buzzer Output Port)
R01 (Normal I/O Port)
EC0 (Event Counter Input Port)
R01 (Normal I/O Port)
INT1 (External interrupt 1 Input
Port)
Nov. 1999 Ver 0.0
preliminary
43