2.3 Parallel Ports
67
2.3.3 Detailed Register Descriptions
(1) PDR 0, 1, 2, 3, 4, 5, 6 (Port data registers)
s Register Allocation
[CAUTION]
Port 3 bits 15 to 12 have no register bit.
Port 6 bit 7 has no register bit.
Port 4 bits 7 to 4 are read-only.
s Register Description
All ports other than ports 0, 1 and 5 are provided with individual direction registers that can be used to
set their individual signal pins to input or output when the corresponding peripheral resource is set not
to use an output pin. When in input mode, reading the data registers allows the pin signal levels to be
read, while in output mode, reading the data registers allows the latched data register values to be read.
The same is true when using read-modify-write instructions.
When data registers are read for use as control output, the values read will be the values used for control
output regardless of the setting of the direction registers.
[CAUTION]
When the above registers are accessed using read-modify-write instructions (such as bit
set instructions), the target bit will be set to the designated value, however for any other
bits set for input the designated input value of the signal pin will be overwritten with the
contents of the corresponding output register. For this reason, whenever pins used for
input are switched to output, it is first necessary to write the desired values in the PDR
register before setting the DDR register to switch to output.
PDx7 PDx6 PDx5 PDx4 PDx3 PDx2 PDx1 PDx0
Port data register
Address : PDR1 000001H
Bit no.
Read/write
(R/W) (R/W) (R/W) (R/W) (R/W) (R/W) (R/W) (R/W)
Initial value
(X)
PDR3 000003H
15
14
13
12
11
10
9
8
PDRx
PDx7 PDx6 PDx5 PDx4 PDx3 PDx2 PDx1 PDx0
Bit no.
Read/write
(R/W) (R/W) (R/W) (R/W) (R/W) (R/W) (R/W) (R/W)
Initial value
(X)
Port data register
Address : PDR0 000000H
PDR2 000002H
PDR6 000006H
7
6
5
4
3
2
1
0
PDRx
RD57 RD56 RD55 RD54 RD53 RD52 RD51 RD50
Port data register
Address : 000005H
Bit no.
Read/write
(R/W) (R/W) (R/W) (R/W) (R/W) (R/W) (R/W) (R/W)
Initial value
(1)
15
14
13
12
11
10
9
8
RD47 RD46 RD45 RD44 RD43 RD42 RD41 RD40
Bit no.
Read/write
(R)
(R/W) (R/W) (R/W) (R/W)
Initial value
(X)
Port data register
Address : 000004H
7
6
5
4
3
2
1
0
PDR4
PDR5