
Preliminary
MC80F0104/0204
Mar. 2005 Ver 0.2
33
9. I/O PORTS
The MC80F0104/0204 has three ports (R0, R1 and R3).
These ports pins may be multiplexed with an alternate
function for the peripheral features on the device. All port
can drive maximum 20mA of high current in output low
state, so it can directly drive LED device.
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 “55
H
” to address 0C1
H
(R0 port direction reg-
ister) during initial setting as shown in Figure 9-1 .
All the port direction registers in the MC80F0104/0204
have 0 written to them by reset function. On the other hand,
its initial status is input.
Figure 9-1 Example of port I/O assignment
9.1 R0 and R0IO register
R0 is an 8-bit CMOS bidirectional I/O port (address
0C0
H
). Each I/O pin can independently used as an input or
an output through the R0IO register (address 0C1
H
). When
R00 through R07 pins are used as input ports, an on-chip
pull-up resistor can be connected to them in 1-bit units
with a pull-up selection register 0 (PU0). Each I/O pin of
R0 port can be used to open drain output port by setting the
corresponding bit of the open drain selection register 0
(R0OD).
I: INPUT PORT
WRITE “55
H
” TO PORT R0 DIRECTION REGISTER
0 1 0 1 0 1 0 1
I O I O I O I O
R0 data
R1 data
R0 direction
R1 direction
0C0
H
0C1
H
0C2
H
0C3
H
7 6 5 4 3 2 1 0
BIT
7 6 5 4 3 2 1 0
PORT
O: OUTPUT PORT
R0 Data Register
R0
ADDRESS: 0C0
H
RESET VALUE: 00
H
R07 R06 R05 R04 R03 R02 R01 R00
Port Direction
R0 Direction Register
R0IO
ADDRESS: 0C1
H
RESET VALUE: 00
H
0: Input
1: Output
Input / Output data
R0 Pull-up
PU0
ADDRESS: 0FC
H
RESET VALUE: 00
H
Selection Register
0: Disable
1: Enable
Pull-up Resister Selection
R0 Open Drain
R0OD
ADDRESS: 0C8
H
RESET VALUE: 00
H
Selection Register
0: Disable
1: Enable
Open Drain Resister Selection
PSR0
ADDRESS: 0F8
H
RESET VALUE: 0000 0000
B
INT2E
Port / INT Selection
0: R11, R12, R03, R00
1: INT0, INT1,INT2, INT3
INT0E
INT1E
INT3E
PWM3OE
EC0E
EC1E
Port / EC Selection
0: R04, R07
1: EC0, EC1
Port / PWM Selection
0: R10, R11
1: PWM1O, PWM3O
PWM1OE
PSR1
ADDRESS: 0F9
H
RESET VALUE: ---- 0000
B
BUZOE
R12/BUZO Selection
0: R12 port (Turn off buzzer)
1: BUZO port (Turn on buzzer)
T0OE
T2OE
AVREFS
-
-
-
-
Port / TO Selection
0: R04, R07
1: EC0, EC1
R10 / AV
REF
Selection
0: R10 port
1: AV
REF
port
Содержание MC80F0104
Страница 108: ...MC80F0104 0204 Preliminary 104 Mar 2005 Ver 0 2 25 Emulator EVA Board Setting...
Страница 115: ...APPENDIX...
Страница 116: ......
Страница 124: ...viii Mar 2005 Ver 0 2 MC80F0104 0204 Preliminary...