CHAPTER 4 PORT FUNCTIONS
User’s Manual U17446EJ3V1UD
53
4.2.2 Port
2
Port 2 is a 4-bit I/O port with an output latch. Each bit of this port can be set to the input or output mode by using
port mode register 2 (PM2). When the P20 to P23 pins are used as an input port, an on-chip pull-up resistor can be
connected in 1-bit units by using pull-up resistor option register 2 (PU2).
This port is also used as the analog input pins of the internal A/D converter.
Generation of reset signal sets port 2 to the input mode.
Figure 4-2 shows the block diagram of port 2.
Figure 4-3. Block Diagram of P20 to P23
P20/ANI0 to P23/ANI3
WR
PU
RD
PU20 to PU23
WR
PM
PM20 to PM23
V
DD
P-ch
PU2
PMC2
PM2
WR
PORT
Output latch
(P20 to P23)
PMC20 to PMC23
A/D converter
Internal bus
Selector
WR
PMC
P2
PU2:
Pull-up resistor option register 2
P2:
Port register 2
PM2:
Port mode register 2
PMC2: Port mode control register 2
RD:
Read signal
WR
××
: Write signal