118
Chapter 4
Port Functions
User’s Manual U16702EE3V2UD00
4.3.4 Port
1
Port 1 is a 3-bit port for which I/O settings can be controlled in 1-bit units.
(1)
Port 1 functions
•
3-bit I/O port
•
Port input/output specifiable in 1-bit units by port mode register 1 (PM1)
•
Port mode/control mode specifiable in 1-bit units by port mode control register 1 (PMC1)
•
Control mode 1, 2/control mode 3 specifiable in 1-bit units by port function control register 1
(PFC1, PFCE1)
•
On-chip pull-up resistor specifiable in 1-bit units by pull-up resistor option register 1 (PU1)
•
On-chip pull-down resistor specifiable in 1-bit units by pull-down resistor option register 1 (PD1)
•
Valid edge of external interrupts specifiable in 1-bit units by external interrupt falling edge
specification register 0 (INTF1) and external interrupt rising edge specification register 0
(INTR1).
See Table 4-8, “Port Type,” on page 170 for alternate functions.
(2)
Registers
(a) Port register 1 (P1)
Port register 1 (P1) is an 8-bit register that controls pin level read, output level write. It can be read
and written in 8-bit or 1-bit units.
Figure 4-11:
Port Register 1 (P1) Format
Remarks: 1.
Input mode:
When port 1 (P1) is read, the pin levels at this time are read. During
write, the data written to P1 is written. This does not affect the input
pins.
Output mode:
When port 1 (P1) is read, the value of P1 is read. During write, the
value is written to P1 and the written value is immediately output.
2.
An undefined value (pin input level) is read for the value after reset when P1 is read in
the input mode. When P1 is read in the output mode, 00H (output latch value) is output.
Symbol
7
6
5
4
3
2
1
0
Address
After reset
P1
0
0
0
0
0
P12
P11
P10
FFFFF402H undefined
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
P1n
Output data control (in output mode) (n = 0 to 2)
0
Outputs 0
1
Outputs 1
electronic components distributor