Renesas 16-bit single-chip microcomputer Computer Hardware User Manual


 
Rev.1.02 Jul 01, 2005 page 224 of 314
REJ09B0126-0102
M16C/6N Group (M16C/6NL, M16C/6NN) 19. Programmable I/O Ports
Under development
This document is under development and its contents are subject to change.
19.1 PDi Register (100-pin Version: i = 0 to 10, 128-pin Version: i = 0 to 13)
Figure19.7 shows the PDi register.
This register selects whether the I/O port is to be used for input or output. The bits in this register correspond
one for one to each port.
No direction register bit for P8_5 is available.
19.2 Pi Register (100-pin Version: i = 0 to 10, 128-pin Version: i = 0 to 13), PC14 Register
Figure19.8 shows the Pi register.
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 input/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.
About the port P14 (128-pin version), Figure19.8 shows the PC14 register.
19.3 PURj Register (100-pin Version: j = 0 to 2, 128-pin Version: j = 0 to 3)
Figures 19.9 and 19.10 show the PURj register.
The PURj register bits can be used to select whether or not to pull the corresponding port high in 4-bit unit.
The port selected to be pulled high has a pull-up resistor connected to it when the direction bit is set for input
mode.
When using the ports P11 to P14, set the PUR37 bit in the PUR3 register to 1 (P11 to P14 are usable).
19.4 PCR Register
Figure19.11 shows the PCR register.
When the P1 register is read after setting the PCR0 bit in the PCR register to 1, the corresponding port
latch can be read no matter how the PD1 register is set.
Table 19.2 lists an example connection of unused pins. Figure19.12 shows an example connection of
unused pins.