
91
CHAPTER 4
PORT FUNCTIONS
User’s Manual U12790EJ2V0UD
4.2 Port Configuration
A port consists of the following hardware.
Table 4-2. Configuration of Port
Item
Configuration
Control register
Port mode register (PMm: m = 0, 2 to 7, 10, 12)
Port
Total: 80 pins (8 input, 8 output, 64 I/O)
4.2.1 Port 0
Port 0 is an 8-bit I/O port with an output latch. The P00 to P07 pins can be set to input mode/output mode in 1-
bit units using port mode register 0 (PM0).
Alternate functions include external interrupt request input.
Reset input sets port 0 to the input mode.
Figure 4-2 shows the block diagram of port 0.
Cautions 1. Because port 0 also serves as an external interrupt request input, when the port function
output mode is specified and the output level is changed, the interrupt request flag is set.
When using the output mode, therefore, preset the interrupt mask flag to 1.
2. When the external interrupt request function is switched to the port function, edge detection
may be performed. Therefore, set bit n (EGPn) of the external interrupt rising edge enable
register (EGP) and bit n (EGNn) of the external interrupt falling edge enable register (EGN)
to 0 before selecting the port mode.
Remark
n = 0 to 7
Figure 4-2. Block Diagram of P00 to P07
PM: Port mode register
RD: Port 0 read signal
WR: Port 0 write signal
WRPM
WRPORT
RD
P00/INTP0
to
P07/INTP7
Selector
Output latch
(P00 to P07)
PM00 to PM07
Internal
bus