GMS81C5108
9.2 I/O Ports Configuration
R0 Ports
.
R0 is an 8-bit CMOS bidirectional I/O port (address
0C0H). Each I/O pin can independently used as an input or
an output through the R0DR register (address 0C8H).
Alternate Function
INT0 (External Interrupt 0)
INT1 (External Interrupt 1)
INT2 (External Interrupt 2)
EC0 (Timer0 Event Input)
BUZ (Buzzer Output)
Port Pin
R00
R01
R02
R03
R04
R31
R0 has internal pull-ups that is independently connected or
disconnected by R0PU. The control registers for R0 are
shown below.
PWM (PWM Output)
ADDRESS : 0C0
RESET VALUE : 00
H
R0 Data Register
H
R1 Ports
R07 R06 R05 R04 R03 R02 R01 R00
R0
R1 is an 8-bit CMOS bidirectional I/O port (address
0C1H). Each I/O pin can independently used as an input or
an output through the R1DR register (address 0C9H).
ADDRESS : 0C8
RESET VALUE : 00
H
R0 Direction Register
H
R0DR
R1 has internal pull-ups that is independently connected or
disconnected by register R1PU. If the key scan function is
used, these pin can input the key switch signal without ex-
ternal pull-up registers. For more details refer to "18. KEY
SCAN" on page 70.
Port Direction
0: Input
1: Output
R0 Pull-up
Selection Register
ADDRESS :0D0
RESET VALUE : 00
H
H
The control registers for R1 are shown below.
R0PU
Pull-up select
0: Without pull-up
1: With pull-up
ADDRESS : 0C1
RESET VALUE : 00
H
R1 Data Register
H
R0 Open Drain
Selection Register
ADDRESS :0D4
RESET VALUE : 00
H
R17 R16 R15 R14 R13 R12 R11 R10
R1
H
R0CR
ADDRESS : 0C9
RESET VALUE : 00
H
R1 Direction Register
Open Drain select
0: No Open Drain
1: Open Drain
H
R1DR
Port Direction
0: Input
1: Output
ADDRESS :0D9
RESET VALUE : -0-00000
H
Port Mode Register
B
-
PWMO
-
BUZ EC0 INT2 INT1 INT0
PMR
R1 Pull-up
ADDRESS : 0D1
RESET VALUE : 00
H
PWMO (PWM Output)
0: R31 Port
1: PWM
BUZ (Buzzer Output)
0: R04 Port
1: BUZ
Selection Register
H
R1PU
Pull-up select
0: Without pull-up
1: With pull-up
EC0 (Timer0 Event Input)
0: R03 Port
1: EC0
INT2 (External Interrupt)
0: R02 Port
1: INT2
R1 Open Drain
Selection Register
INT1 (External Interrupt)
0: R01 Port
1: INT1
INT0 (External Interrupt)
0: R00 Port
1: INT0
ADDRESS :0D5
RESET VALUE : 00
H
H
R1CR
Open Drain select
0: No Open Drain
1: Open Drain
In addition, Port R0 and R3 are multiplexed with various
special features. The control register PMR (address 0D9H)
controls the selection of alternate function. After reset, this
value is “0”, port may be used as normal I/O port.
To use alternate function such as External Interrupt rather
than normal I/O, write “1” in the corresponding bit of
PMR0.
ADDRESS :0F0
H
KEY SCAN Mode Register
RESET VALUE : 00
H
KSMR
KEY Input select
0: Port selection
1: KS selection
32
JUNE 2001 Ver 1.0