
125
Chapter 4
Port Functions
User’s Manual U16702EE3V2UD00
(2)
Registers
(a) Port register 3 (P3)
Port register 3 (P3) is a 16-bit register used to control pin level read and output level write.
This register can be read and written in16-bit, 8-bit and 1-bit units.
However, when using the higher 8 bits of the P3 register as the P3H register and the lower 8 bits
as the P3L register, P3 becomes two 8-bit registers for which I/O can be manipulated in 8-bit or
1-bit units.
Figure 4-20:
Port Register 3 (P3) Format
Remarks: 1.
Input mode:
When port 3 (P3) is read, the pin levels at this time are read. During
write, the data written to P3 is written. This does not affect the input
pins.
Output mode:
When port 3 (P3) is read, the value of P3 is read. During write, the
value is written to P3 and the written value is immediately output.
2.
An undefined value (pin input level) is read for the value after reset when P3 is read in
the input mode. When P3 is read in the output mode, 00H (output latch value) is output.
Symbol
15
14
13
12
11
10
9
8
Address
After reset
P3H
0
0
0
0
0
0
0
P38
FFFFF407H undefined
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Symbol
7
6
5
4
3
2
1
0
Address
After reset
P3L
P37
P36
P35
P34
P33
P32
P31
P30
FFFFF406H undefined
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
P3n
Output data control (in output mode) (n = 0 to 9)
0
Outputs 0
1
Outputs 1
electronic components distributor