English
Language : 

M16C26A Datasheet, PDF (233/352 Pages) Renesas Technology Corp – 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/Tiny SERIES
M16C/26A Group (M16C/26A, M16C/26B, M16C/26T)
16. Programmable I/O Ports
16. Programmable I/O Ports
Note
P60 to P63, P92 and P93 are not available in the 42-pin package.
The programmable input/output ports (hereafter referred to simply as “I/O ports”) consist of 39 lines P15 to
P17, P6, P7, P8, P90 to P93, P10 for the 48-pin package, or 33 lines P15 to P17, P64 to P67, P7, P8, P90 to
P91, P10 for the 42-pin package. Each port can be set for input or output every line by using a direction
register, and can also be chosen to be or not be pulled high in sets of 4 lines.
Figures 16.1 to 16.4 show the I/O ports. Figure 16.5 shows the I/O pins.
Each pin functions as an I/O port, a peripheral function input/output.
For details on how to set peripheral functions, refer to each functional description in this manual. If any pin
is used as a peripheral function input, set the direction bit for that pin to “0” (input mode). Any pin used as an
output pin for peripheral functions is directed for output no matter how the corresponding direction bit is set.
16.1 Port Pi Direction Register (PDi Register, i = 1, 6 to 10)
Figure 16.1.1 shows the direction registers.
This register selects whether the I/O port is to be used for input or output. The bits in this register corre-
spond one for one to each port.
16.2 Port Pi Register (Pi Register, i = 1, 6 to 10)
Figure 16.2.1 shows the Pi registers.
Data input/output to and from external devices are accomplished by reading and writing to the Pi register.
The Pi register consists of a port latch to hold the output data and a circuit to read the pin status. For ports
set for input mode, the input level of the pin can be read by reading the corresponding Pi register, and data
can be written to the port latch by writing to the Pi register.
For ports set for output mode, the port latch can be read by reading the corresponding Pi register, and data
can be written to the port latch by writing to the Pi register. The data written to the port latch is output from
the pin. The bits in the Pi register correspond one for one to each port.
16.3 Pull-up Control Register 0 to Pull-up Control Register 2 (PUR0 to PUR2 Registers)
Figure 16.3.1 shows the PUR0 to PUR2 registers.
The PUR0 to PUR2 registers select whether the ports, divided into groups of four ports, are pulled up or not.
The ports, selected by setting the bits in registers PUR2 to PUR0 to “1” (pull-up), are pulled up when the
direction registers are set to “0” (input mode). The ports are pulled up regardless of their function.
Rev. 2.00 Feb.15, 2007 page 216 of 329
REJ09B0202-0200