Programmable I/O Ports; Port Pi Direction Register (Pdi Register, I = 0 To 3, 6 To 10); Port Pi Register (Pi Register, I = 0 To 3, 6 To 10); Pull-Up Control Register 0 To Pull-Up Control Register 2 (Pur0 To Pur2 Registers) - Renesas M16C/29 Series Hardware Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C/29 Series:
Table of Contents

Advertisement

M16C/29 Group

19. Programmable I/O Ports

The programmable input/output ports (hereafter referred to simply as "I/O ports") consist of 71 lines P0,
P1,P2, P3, P6, P7, P8, P9, P10 (except P9
P3
to P3
, P6, P7, P8, P9
0
3
line by using a direction register, and can also be chosen to be or not be pulled high in sets of 4 lines.
Figures 19.1 to 19.5 show the I/O ports. Figure 19.6 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.

19.1 Port Pi Direction Register (PDi Register, i = 0 to 3, 6 to 10)

Figure 19.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.

19.2 Port Pi Register (Pi Register, i = 0 to 3, 6 to 10)

Figure 19.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.
19.3 Pull-up Control Register 0 to Pull-up Control Register 2 (PUR0 to PUR2 Regis-
ters)
Figure 19.3.1 shows the PUR0 to PUR2 registers.
The PUR0 to PUR2 register bits can be used to select whether or not to pull the corresponding port high
in 4 bit units. The port chosen to be pulled high has a pull-up resistor connected to it when the direction bit
is set for input mode.

19.4 Port Control Register

Figure 19.4.1 shows the port control register.
When the P1 register is read after setting the PCR register's PCR0 bit to "1", the corresponding port latch
can be read no matter how the PD1 register is set.
Rev.1.00 Nov 01,2004
REJ09B0101-0100Z
to P9
, P10 for the 64-pin version. Each port can be set for input or output every
0
3
page 309 of 402
) for the 80-pin version, or 55 lines P0
4
19. Programmable I/O Ports
to P0
, P1
to P1
, P2,
0
3
5
7

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c seriesM16c/tiny series

Table of Contents