17
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
3850 Group (Spec. H)
I/O PORTS
The I/O ports have direction registers which determine the input/
output direction of each individual pin. Each bit in a direction
register corresponds to one pin, and each pin can be set to be
input port or output port.
When
“
0
”
is written to the bit corresponding to a pin, that pin
becomes an input pin. When
“
1
”
is written to that bit, that pin
becomes an output pin.
If data is read from a pin which is set to output, the value of the
port output latch is read, not the value of the pin itself. Pins set to
input are floating. If a pin set to input is written to, only the port
output latch is written to and the pin remains floating.
Pin
Name
Input/Output
I/O Structure
Non-Port Function
Table 8 I/O port function (spec. H)
Related SFRs
Port P0
Port P1
Port P2
P0
0
/S
IN2
P0
1
/S
OUT2
P0
2
/S
CLK2
P0
3
/S
RDY2
P0
4
–
P0
7
P1
0
–
P1
7
P2
0
/X
COUT
P2
1
/X
CIN
P2
2
P2
3
P2
4
/RxD
P2
5
/TxD
P2
6
/S
CLK
P2
7
/CNTR
0
/S
RDY1
P3
0
/AN
0
–
P3
4
/AN
4
P4
0
/CNTR
1
P4
1
/INT
0
P4
2
/INT
1
P4
3
/INT
2
/S
CMP2
CMOS compatible
input level
CMOS 3-state output
Serial I/O2 function I/O
Serial I/O2 control register
Sub-clock generating
circuit
CPU mode register
CMOS compatible
input level
CMOS 3-state output
Input/output,
individual
bits
Interrupt edge selection
register
PWM control register
External interrupt input
PWM output
Ref.No.
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(17)
CMOS compatible
input level
N-channel open-drain
output
Serial I/O1 control register
Serial I/O1 function I/O
Serial I/O1 function I/O
Timer X function I/O
Serial I/O1 control register
Timer XY mode register
(12)
Timer Y function I/O
A-D conversion input
A-D control register
Timer XY mode register
(13)
(14)
(15)
(16)
Interrupt edge selection
register
External interrupt input
External interrupt input
S
CMP2
output
Interrupt edge selection
register
Serial I/O2 control register
P4
4
/INT
3
/PWM
Port P3
Port P4