English
Language : 

M30222 Datasheet, PDF (171/237 Pages) Mitsubishi Electric Semiconductor – SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
deUvnedlSoeppr meceniftications in this manual are tentative and subject to change
MITSUBISHI MICROCOMPUTERS
M30222 Group
Rev. G
I/O Ports
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Ports
There are 55 programmable I/O ports: P3 to P10 (excluding P5, P83 and P87). Each port can be set indepen-
dently for input or output using the direction register. A pull-up resistance for each block of 4 ports can be set.
P83 is an input-only port and has no built-in pull-up resistance. P70 and P71 do not have pull up resistors.
Figures 1.141 to 1.143 show the programmable I/O ports. Figure 1.144 shows the I/O pins. Each pin functions
as a programmable I/O port and as the I/O for the built-in peripheral devices.
To use the pins as the inputs for the built-in peripheral devices, set the direction register of each pin to input
mode. When the pins are used as the outputs for the built-in peripheral devices (other than the D-A converter),
they function as outputs regardless of the contents of the direction registers. When pins are to be used as the
outputs for the D-A converter, do not set the direction registers to output mode. See the descriptions of the
respective functions for how to set up the built-in peripheral devices.
(1) Direction registers
Figure 1.145 shows the direction registers.
These registers are used to choose the direction of the programmable I/O ports. Each bit in these registers
corresponds one for one to each I/O pin.
(2) Port registers
Figure 1.146 shows the port registers.
These registers are used to write and read data for input and output to and from an external device. A port
register consists of a port latch to hold output data and a circuit to read the status of a pin. Each bit in port
registers corresponds one for one to each I/O pin.
(3) Pull-up control registers
Figure 1.147 shows the pull-up control registers.
The pull-up control register can be set to apply a pull-up resistance to each block of 4 ports. When ports are
set to have a pull-up resistance, the pull-up resistance is connected only when the direction register is set for
input.
1-172