![](http://datasheet.mmic.net.cn/280000/M37902F8CHP_datasheet_16084061/M37902F8CHP_86.png)
M37902FCCHP, M37902FGCHP, M37902FJCHP
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
86
INPUT/OUTPUT PINS
Ports P0 to P8, P10, P11 all have the direction register, and each bit
can be programmed for input or output. A pin becomes an output pin
when the corresponding bit of direction register is
“
1
”
, and an input
pin when it is
“
0
”
.
When a pin is programmed for output, the data is written to its port
latch and it is output to the output pin. When a pin is programmed for
output, the contents of the port latch is read instead of the value of
the pin. Accordingly, a previously output value can be read correctly
even when the output
“
H
”
voltage is lowered or the output
“
L
”
voltage
is raised owing to an external load, etc.
A pin programmed as an input pin is in the flooting state, and the
value input to the pin can be read. When a pin is programmed as an
input pin, the data is written only in the port latch and the pin remains
floating.
Each of Figures 89 and 90 shows the block diagram for each port pin
and pin NMI. Figure 91 shows the bit configuration of the port func-
tion control register.
Bit 3 of the port function control register serves as the port P0 input
level select bit, which selects the V
IH
/V
IL
level under the condition
that port P0 is used as an input port.
Bit 4 of the port function control register serves as the P4
4
–
P4
7
pullup connection select bit. This bit determines whether port pins
P4
4
–
P4
7
,
which are multiplexed with chip select pins, are to be
pulled up or not. At reset, this bit 4 =
“
0
”
and P
4
–
P4
7
are pulled up.
The pullup function is valid only when the corresponding port is used
an input port.
Bit 7 of the port function control register serves as the NMI pullup
connection select bit. At reset, this bit 7 =
“
0
”
and pin NMI is pulled
up. The pullup function is valid only when the corresponding port is
used as an input port.
When using port pins P5
4
–
P5
7
as the key input interrupt input pins
(KI
0
to KI
3
), the pullup function can be selected, also. For details,
refer to the section on interrupts.
When using a port pin as an internal peripheral device
’
s input pin,
clear the corresponding port direction register
’
s bit to
“
0
”
. When us-
ing a port pin as an internal peripheral device
’
s output pin, the port
direction register
’
s bit may be
“
0
”
or
“
1
”
.
In the memory expansion or microprocessor mode, port pins of P0 to
P4, P10, P11 become I/O pins, and the their functions as I/O port
pins are invalid. Note that, however, some port pins can function as
port pins by the special setting. For details, refer to the section on the
processor modes.
Fig. 91 Bit configuration of port function control register
Notes 1:
For the M37902FxM (power source voltage = 3.3 V
±
0.3 V), V
IH
= 0.5V
CC
.
2:
When MD1 = V
CC
and MD0 = V
CC
(flash memory parallel I/O mode), pins P4
4
to P4
7
and NMI are
not pulled up, regardless of these bits
’
contents.
3:
When MD1 = V
SS
and MD0 = V
CC
(microprocessor mode), pin CS
0
(P4
) is not pulled up, regardless of the bit
’
s contents.
7
6
0
5
0
4
3
2
1
0
Port function control register
Port P0 input level select bit
0 : V
IH
= 0.7V
CC
, V
IL
= 0.2V
CC
1 : V
IH
= 0.43V
CC
(Note 1)
, V
IL
= 0.16V
CC
Address/Port switch bits
000 : A
0
to A
23
(16 Mbytes)
001 : A
0
to A
21
, P0
6
, P0
7
(4 Mbytes)
010 : A
0
to A
19
, P0
4
to P0
7
(1 Mbytes)
011 : A
0
to A
17
, P0
2
to P0
7
(256 Kbytes)
100 : A
0
to A
15
, P0
0
to P0
7
(64 Kbytes)
101 : Do not select.
110 : A
0
to A
11
, P0
0
to P0
7
, P11
4
to P11
7
(4 Kbytes)
111 : A
0
to A
7
, P0
0
to P0
7
, P11
0
to P11
7
(256 bytes)
Pins P4
4
–
P4
7
pullup connection select bit
(Notes 2 and 3)
0 : Pins P4
4
–
P4
7
are pulled up.
1 : Pins P4
4
–
P4
7
are not pulled up.
Address
92
16
Pin NMI pullup connection select bit
(Note 2)
0 : Pin NMI is pulled up.
1 : Pin NMI is not pulled up.
Fix these bits to
“
0
”
.
At reset
00
16