GMS81C1102 / GMS81C1202
13.2 RB and RBIO registers
RB is a 5-bit bidirectional I/O port (address C2H). Each
pin can be set individually as input and output through the
RBIO register (address C3H).
Pull-up Selection Register
PUPSEL
RB Data Register
ADDRESS : CCH
RESET VALUE : ------00
ADDRESS : C2H
RESET VALUE : Undefined
RB
PUP1
PUP0
-
-
-
-
RB4 RB3 RB2 RB1 RB0
RB3 / INT1 Pull-up
0 : No Pull-up
INPUT / OUTPUT DATA
RB2 / INT0 Pull-up
0 : No Pull-up
1 : With Pull-up
RB Direction Register
1 : With Pull-up
ADDRESS : C3H
RESET VALUE : ---00000
RBIO
Interrupt Edge Selection Register
IEDS
ADDRESS : E6H
RESET VALUE : ----0000
RB4 RB3 RB2 RB1 RB0
-
-
-
IED1H IED1L
INT1
IED0H
IED0L
DIRECTION SELECT
0 : INPUT PORT
1 : OUTPUT PORT
INT0
External Interrupt Edge Select
RB Function Selection Register
RBFUNC
00 : Normal I/O port
ADDRESS : CBH
RESET VALUE : ---00000
01 : Falling ( 1-to-0 transition )
10 : Rising ( 0-to-1 transition )
11 : Both ( Rising & Falling )
PWMO
INT1I
INT0I
BUZO AVREFS
0 : RB0 when ANSEL0 = 0, AN0 when ANSEL0 = 1
1 : AVref
0 : RB3 0 : RB2
1 : INT1 1 : INT0
0 : RB4
1 : PWM0 Output or
Compare Output
0 : RB1
1 : BUZ Output
The shaded areas are only related with in GMS81C1202.
So in GMS81C1102, this area must be written to “0”.
Figure 13-3 Registers of Port RB
In addition, Port RB is multiplexed with various special
features. The control register RBFUNC (address CBH)
controls to select alternate function. After reset, this value
is "0", port may be used as general I/O ports. To select al-
ternate function such as External interrupt or Timer com-
pare output, write "1" to the corresponding bit of
RBFUNC.
PORT
RBFUNC.4~0
Description
0
RB4 ( Normal I/O Port )
RB4/
PWM0/
COMP0
PWM0 Output /
Timer1 Compare Output
1
0
1
0
1
0
1
RB3 ( Normal I/O Port )
External Interrupt Input 1
RB2 ( Normal I/O Port )
External Interrupt Input 0
RB1 ( Normal I/O Port )
Buzzer Output
RB3/INT1
RB2/INT0
RB1/BUZ
Regardless of the direction register RBIO, RBFUNC is se-
lected to use as alternate functions, port pin can be used as
a corresponding alternate features.
RB0 ( Normal I/O Port ) /
AN0 (ANSEL0=1)
01
12
RB0/AN0/
AVref
External Analog Reference
Voltage
1. When ANSEL0 = "0", this port is defined for normal I/O port
( RB0 ).
When ANSEL0 = "1" and ADS2~0 = " 000", this port
can be used Analog Input Port ( AN0 ).
2. When this bit set to "1", this port defined for AVref , so it can
not be used Analog Input Port AN0 and Normal I/O
Port RB0.
Jan. 2002 ver 2.0
39