English
Language : 

MC80F0204 Datasheet, PDF (37/126 Pages) List of Unclassifed Manufacturers – 8-BIT SINGLE-CHIP MICROCONTROLLERS
Preliminary
MC80F0104/0204
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 “55H” to address 0C1H (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,
9.1 R0 and R0IO register
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 R0IO register (address 0C1H). 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
R0 Data Register
ADDRESS: 0C0H
RESET VALUE: 00H
R0
R07 R06 R05 R04 R03 R02 R01 R00
R0 Direction Register
R0IO
Input / Output data
ADDRESS: 0C1H
RESET VALUE: 00H
R0 Pull-up
Selection Register
PU0
Port Direction
0: Input
1: Output
ADDRESS: 0FCH
RESET VALUE: 00H
R0 Open Drain
Selection Register
R0OD
Pull-up Resister Selection
0: Disable
1: Enable
ADDRESS: 0C8H
RESET VALUE: 00H
Open Drain Resister Selection
0: Disable
1: Enable
its initial status is input.
WRITE “55H” TO PORT R0 DIRECTION REGISTER
0C0H
0C1H
0C2H
0C3H
R0 data
R0 direction
R1 data
R1 direction
0 1 0 1 0 1 0 1 BIT
76543210
I O I O I O I O PORT
76543210
I: INPUT PORT
O: OUTPUT PORT
Figure 9-1 Example of port I/O assignment
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).
ADDRESS: 0F8H
RESET VALUE: 0000 0000B
PSR0 PWM3OE PWM1OE EC1E EC0E INT3E INT2E INT1E INT0E
Port / INT Selection
0: R11, R12, R03, R00
1: INT0, INT1,INT2, INT3
Port / EC Selection
0: R04, R07
1: EC0, EC1
Port / PWM Selection
0: R10, R11
1: PWM1O, PWM3O
ADDRESS: 0F9H
RESET VALUE: ---- 0000B
PSR1 -
-
-
- AVREFS BUZOE T2OE T0OE
Port / TO Selection
0: R04, R07
1: EC0, EC1
R12/BUZO Selection
0: R12 port (Turn off buzzer)
1: BUZO port (Turn on buzzer)
R10 / AVREF Selection
0: R10 port
1: AVREF port
Mar. 2005 Ver 0.2
33