English
Language : 

M16C6K9 Datasheet, PDF (224/292 Pages) Renesas Technology Corp – SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
M16C/6K9 Group
Port
Programmable I/O Ports
There are 129 programmable I/O ports: P0 to P16 (excluding P85). Each port can be set independently for
input or output using the direction register. Pull-up resistances can be set in 4-port unit. (except for P10 and
P14). The N channel open drain ports P60 to P63, P70 to P77, P80 to P84, P130 to P137 and P85 (input only
port) do not build internal pull-up resistance.
Fig.UA-1 to UA-6 show the configurations of 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), they function as outputs regardless of the contents of the direction registers. When pins are 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
Fig.UA-7 shows the configurations of 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.
Note: There is no direction register bit for P85.
(2) Port registers
Fig.UA-8 shows the configurations of port registers.
These registers are used to write and read data for input and output to and from exterior. 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
Fig.UA-9 and UA-10, UA-11 shows the configurations of pull-up control registers.
The pull-up control register can be set to apply a pull-up resistance to each block of 4 ports (except for P10
and P14). 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.
Pull-up resistance can be set to each pin of P10 and P14.
(4) Port control register
Fig.UA-12 shows the configurations of port control register 0, 1. Fig.UA-13 shows the configuraitons of port
control register 2, 3. The bit 0 of port control register 0 is used to read port P1 as follows:
0 : When port P1 is input port, port input level is read.
When port P1 is output port , the contents of port P1 register is read.
1 : The contents of port P1 register is read always. (neither input port nor output port)
Rev.1.00 Jun 06, 2003 page 224 of 290