English
Language : 

M16C80 Datasheet, PDF (201/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
26. Programmable I/O Ports
26. Programmable I/O Ports
There are 87 programmable I/O ports for 100-pin version: P0 to P10 (excluding P85). There are 123 pro-
grammable I/O ports for 144-pin version: P0 to P15 (excluding P85). 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. P85 is
an input-only port and has no built-in pull-up resistance.
Figures 26.1 to 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 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 26.4 and 26.5 show 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 of
_____
_______
_______ _______ _____ _________ _______ _______ _______ _____ _____
pins A0 to A22, A23, D0 to D15, MA0 to MA12, CS0 to CS 3, WRL/WR/CASL, WRH/BHE/CASH, RD/DW,
_________
_________
_______
_______
BCLK/ALE/CLKOUT, HLDA/ALE, HOLD, ALE/RAS, and RDY are not changed.
Note: There is no direction register bit for P85.
(2) Port registers
Figures 26.6 and 26.7 show 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 of pins A0 to
______
_______
_______ _______ _____ _________ _______ _______ _______ _____ _____
A22, A23, D0 to D15, MA0 to MA12, CS0 to CS 3, WRL/WR/CASL, WRH/BHE/CASH, RD/DW, BCLK/ALE/
_________
_________
_______
_______
CLKOUT, HLDA/ALE, HOLD, ALE/RAS, and RDY are not changed.
(3) Function select register A
Figures 26.8 and 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.
Rev.1.00 Aug. 02, 2005 Page 190 of 329
REJ09B0187-0100