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

16-bit single-chip microcomputer m16c family / m16c/tiny series
Hide thumbs Also See for M16C/26A Series:
Table of Contents

Advertisement

M
1
6
C
2 /
6
A
G
o r
u
p
(
M
1
6

16. Programmable I/O Ports

Note
P6
to P6
, P9
and P9
0
3
2
The programmable input/output ports (hereafter referred to simply as "I/O ports") consist of 39 lines P1
P1
, P6, P7, P8, P9
7
P9
, P10 for the 42-pin package. Each port can be set for input or output every line by using a direction
1
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.
R
e
. v
2
0 .
0
F
e
b
1 .
, 5
2
0
0
7
R
E
J
0
9
B
0
2
0
2
0 -
2
0
0
C
2 /
6
, A
M
1
6
C
2 /
6
, B
M
1
6
are not available in the 42-pin package.
3
to P9
, P10 for the 48-pin package, or 33 lines P1
0
3
page 216
f o
3
2
9
C
2 /
6
) T
16. Programmable I/O Ports
to P1
, P6
to P6
, P7, P8, P9
5
7
4
7
to
5
to
0

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/26aM16c/26bM16c/26t

Table of Contents