deveopmen
Programmable I/O Port
Preliminary Specifications REV.B
Specifications in this manual are tentative and subject to change.
Mitsubishi microcomputers
M16C/80 (144-pin version) group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
186
Programmable I/O Ports
There are 123 programmable I/O ports: P0 to P15 (excluding P8
5
). Each port can be set independently for
input or output using the direction register. A pull-up resistance for each block of 4 ports can be set. P8
5
is
an input-only port and has no built-in pull-up resistance.
Figures 1.26.1 to 1.26.3 show the programmable I/O ports.
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 con-
verter), set the corresponding function select registers A, B and C. When pins are to be used as the outputs
for the D-A converter, set the function select register of each pin to I/O port, and set the direction registers
to input mode.
Table 1.26.1 lists each port and peripheral function.
See the descriptions of the respective functions for how to set up the built-in peripheral devices.
(1) Direction registers
Figures 1.26.4 and 1.26.5 shows the direction registers.
These registers are used to choose the direction of the programmable I/O ports. Each bit in these regis-
ters corresponds one for one to each I/O pin.
In memory expansion and microprocessor mode, the contents of corresponding direction register for
setting of bus control such as address bus and data bus is not changed.
Note: There is no direction register bit for P8
5
.
(2) Port registers
Figures 1.26.6 and 1.26.7 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.
In memory expansion and microprocessor mode, the contents of corresponding port register for setting of
bus control such as address bus and data bus is not changed.
(3) Function select register A
Figures 1.26.8 and 1.26.9 show the function select registers A.
The register is used to select port output and peripheral function output when the port functions for both
port output and peripheral function output.
Each bit of this register corresponds to each pin that functions for both port output and peripheral function
output.