English
Language : 

MC80F0224 Datasheet, PDF (40/128 Pages) List of Unclassifed Manufacturers – 8-BIT SINGLE-CHIP MICROCONTROLLERS
MC80F0208/16/24
Preliminary
9. I/O PORTS
The MC80F0208/16/24 has six ports (R0, R1, R3, R4, R5 and
R6). These ports pins may be multiplexed with an alternate func-
tion for the peripheral features on the device. R3 port can drive
maximum 20mA of high current in output low state, so it can di-
rectly 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 num-
bered bits as input ports, write “55H” to address 0C1H (R0 port
direction register) during initial setting as shown in Figure 9-1.
All the port direction registers in the MC80F0208/16/24 have 0
written to them by reset function. On the other hand, its initial sta-
tus 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
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). The
on-chip pull-up resistor can be connected to them in 1-bit units
with a pull-up selection register 0 (PU0).
R0 Data Register
ADDRESS: 0C0H
RESET VALUE: 00H
R0
R07 R06 R05 R04 R03 R02 R01 R00
Input / Output data
R0 Direction Register
R0IO
ADDRESS: 0C1H
RESET VALUE: 00H
Port Direction
0: Input
1: Output
R0 Pull-up
Selection Register
PU0
ADDRESS: 0FCH
RESET VALUE: 00H
Pull-up Resister Selection
0: Disable
1: Enable
R1 and R1IO register: R1 is an 5-bit CMOS bidirectional I/O
port (address 0C2H). Each I/O pin can independently used as an
input or an output through the R1IO register (address 0C3H). The
on-chip pull-up resistor can be connected to them in 1-bit units
with a pull-up selection register 1 (PU1).
In addition, Port R1 is multiplexed with various special features.
The control register PSR0 (address 0F8H) and PSR1 (address
0F9H) 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, event counter
input or timer clock output, write “1” in the corresponding bit of
PSR0 or PSR1. Regardless of the direction register R1IO, PSR0
or PSR1 is selected to use as alternate functions, port pin can be
used as a corresponding alternate features.
Port Pin
R10
R11
R12
R13
R15
Alternate Function
INT0 (External Interrupt 0)
INT1 (External Interrupt 1)
INT2 (External Interrupt 2)
BUZO (Square-wave output for buzzer)
EC0 (Event counter input to Counter 0)
36
MAR. 2005 Ver 0.2