![](http://datasheet.mmic.net.cn/370000/UPD703215_datasheet_16743812/UPD703215_94.png)
CHAPTER 4 PORT FUNCTIONS
User’s Manual U16890EJ1V0UD
94
4.3 Port Configuration
Table 4-2. Port Configuration
Item
Configuration
Control registers
Port n register (Pn: n = 0, 1, 3 to 5, 7, 9, CM, CS, CT, DL, DH)
Port n mode register (PMn: n = 0, 1, 3 to 5, 9, CM, CS, CT, DL, DH)
Port n mode control register (PMCn: n = 0, 3 to 5, 9, CM, CS, CT, DL, DH)
Port n function control register (PFCn: n = 3, 5, 9)
Port 3 function control expansion register (PFCE3)
Port n function register (PFn: n = 3 to 5, 9)
Pull-up resistor option register (PUn: n = 0, 1, 3 to 5, 9)
Ports
Input only: 8
I/O: 76
Pull-up resistors
Software control: 40
(1) Port n register (Pn)
Data I/O with external devices is performed by writing to and reading from the Pn register. The Pn register is
configured of a port latch that retains the output data and a circuit that reads the pin status.
Each bit of the Pn register corresponds to one pin of port n and can be read or written in 1-bit units.
Pn7
0 is output
1 is output
Pnm
0
1
Control of output data (in output mode)
Pn6
Pn5
Pn4
Pn3
Pn2
Pn1
Pn0
0
1
2
3
7
5
6
7
Pn
After reset:
00H
Note
(output latch)
R/W
Note
Input-only port pins are undefined.
Writing to and reading from the Pn register is executed as follows independent of the setting of the PMCn register.
Table 4-3. Reading to/Writing from Pn Register
Setting of PMn Register
Writing to Pn Register
Reading from Pn Register
Output mode
(PMnm bit = 0)
Write to the output latch
In the port mode (PMCnm bit = 0), the contents of the
output latch are output from the pin.
Note
.
The value of the output latch is read.
Input mode
(PMnm bit = 1)
Write to the output latch.
The status of the pin is not affected
Note
.
The pin status is read.
Note
The value written to the output latch is retained until a value is next written to the output latch.