GMS82512/16/24
9. I/O PORTS
HYUNDAI MicroElectronics
R2 and R2DD register:
The GMS825xx has six ports (R0, R2, R3, R4, R5, and
R6).These ports pins may be multiplexed with an alternate
function for the peripheral features on the device.
R2 is an 8-bit CMOS bidirection-
al I/O port (address 0C4H). Each I/O pin can independently
used as an input or an output through the R2DD register
(address 0C5H).
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.
ADDRESS: 0C4
H
R2 Data Register
RESET VALUE: Undefined
R27 R26 R25 R24 R23 R22 R21 R20
R2
Input / Output data
ADDRESS: 0C5
RESET VALUE: 00
H
R2 Direction Register
R2DD
All the port direction registers in the GMS825xx have 0
written to them by reset function. On the other hand, its in-
itial status is input.
H
Port Direction
0: Input
1: Output
WRITE “55 ” TO PORT R0 DIRECTION REGISTER
H
0C0
0C1
0C2
0C3
BIT
R0 data
R0 direction
R1 data
0
7
1 0 1 0 1 0 1
H
H
H
H
R3 and R3DD register:
R3 is an 8-bit CMOS bidirection-
6
5
4
3
2
1
0
al I/O port (address 0C6H). Each I/O pin can independently
used as an input or an output through the R3DD register
(address 0C7H).
R1 direction
I
7
O
6
I
5
O
4
I
O
I
1
O PORT
0
3 2
I: INPUT PORT
O: OUTPUT PORT
ADDRESS: 0C6
RESET VALUE: Undefined
H
R3 Data Register
R37 R36 R35 R34 R33 R32 R31 R30
R3
Figure 9-1 Example of port I/O assignment
Input / Output data
R0 and R0DD register:
R0 is an 8-bit CMOS bidirection-
al I/O port (address 0C0H). Each I/O pin can independently
used as an input or an output through the R0DD register
(address 0C1H).
ADDRESS: 0C7
RESET VALUE: 00
H
R3 Direction Register
R3DD
H
Port Direction
0: Input
1: Output
ADDRESS: 0C0
RESET VALUE: Undefined
H
R0 Data Register
R07 R06 R05 R04 R03 R02 R01 R00
R0
Input / Output data
ADDRESS: 0C1
RESET VALUE: 00
H
R0 Direction Register
R0DD
H
Port Direction
0: Input
1: Output
28
FEB. 2000 Ver 1.00