CHAPTER 4 PORT FUNCTIONS
86
User’s Manual U11302EJ4V0UM
4.2.3 Port 2
Port 2 is an 8-bit I/O port with an output latch. The P20 to P27 pins can be set to input mode/output mode in
1-bit units using port mode register 2 (PM2). When the P20 to P27 pins are used as input port pins, on-chip pull-
up resistors can be connected to them in 8-bit units using the pull-up resistor option register (PUO).
Alternate functions include serial interface data I/O, clock I/O, automatic transmit/receive busy input, and strobe
output.
RESET input sets port 2 to input mode.
Figures 4-5 and 4-6 show block diagrams of port 2.
Cautions 1. If used as serial interface pins, set the I/O and output latch according to each function. Refer
to Figure 13-3 Format of Serial Operating Mode Register 0 and Figure 14-3 Format of Serial
Operating Mode Register 1 for the settings.
2. When reading the pin state in SBI mode, set the PM2n bit of PM2 to 1 (n = 5, 6) (refer to the
description of (10) Judging busy status of slave in 13.4.3 SBI mode operation).
Figure 4-5. Block Diagram of P20, P21, P23 to P26
PUO: Pull-up resistor option register
PM:
Port mode register
RD:
Port 2 read signal
WR:
Port 2 write signal
P-ch
WR
PM
WR
PORT
RD
WR
PUO
V
DD
P20/SI1,
P21/SO1,
P23/STB,
P24/BUSY,
P25/SI0/SB0,
P26/SO0/SB1
Selector
PUO2
Output latch
(P20, P21, P23 to P26)
PM20, PM21,
PM23 to PM26
Alternate function
Internal bus