CHAPTER 4 PORT FUNCTIONS
User’s Manual U16898EJ3V0UD
60
4.2.5 Port
13
This is a 1-bit output-only port.
Figure 4-12 shows the block diagram of port 13.
Figure 4-12. Block Diagram of P130
RD
Output latch
(P130)
WR
PORT
P130
Internal bus
P13
P13:
Port register 13
RD:
Read signal
WR
××
: Write signal
Remark
When a reset is input, P130 outputs a low level. If P130 outputs a high level immediately after
reset is released, the output signal of P130 can be used as a dummy CPU reset signal.
4.3 Registers Controlling Port Functions
The ports are controlled by the following four types of registers.
•
Port mode registers (PM2, PM3, PM4, PM12)
•
Port registers (P2, P3, P4, P12, P13)
•
Port mode control register 2 (PMC2)
•
Pull-up resistor option registers (PU2, PU3, PU4, PU12)
(1) Port mode registers (PM2, PM3, PM4, PM12)
These registers are used to set the corresponding port to the input or output mode in 1-bit units.
Each port mode register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
When a port pin is used as an alternate-function pin, set its port mode register and output latch as shown in
Table 4-3.
Caution Because P30, P31, and P43 are also used as external interrupt pins, the corresponding
interrupt request flag is set if each of these pins is set to the output mode and its output level
is changed. To use the port pin in the output mode, therefore, set the corresponding
interrupt mask flag to 1 in advance.