CHAPTER 4 PORT FUNCTIONS
User’s Manual U16898EJ3V0UD
58
4.2.4 Port
12
Port 12 is a 3-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 12 (PM12). When the P123 pin is used as an input port, an on-chip pull-up resistor can be
connected by using pull-up resistor option register 12 (PU12).
The P121 and P122 pins are also used as the X1 and X2 pins of the system clock oscillator. The functions of the
P121 and P122 pins differ, therefore, depending on the selected system clock oscillator. The following three system
clock oscillators can be used.
(1) High-speed internal oscillator
The P121 and P122 pins can be used as I/O port pins.
(2) Crystal/ceramic oscillator
The P121 and P122 pins cannot be used as I/O port pins because they are used as the X1 and X2 pins.
(3) External clock input
The P121 pin is used as the X1 pin to input an external clock, and therefore it cannot be used as an I/O port pin.
The P122 pin can be used as an I/O port pin.
The system clock oscillation is selected by the option byte. For details, refer to
CHAPTER 17 OPTION BYTE
.
Reset signal generation sets port 12 to the input mode.
Figures 4-10 and 4-11 show the block diagrams of port 12.
Figure 4-10. Block Diagram of P121 and P122
P121/X1,
P122/X2
RD
WR
PORT
WR
PM
Output latch
(P121, P122)
PM121, PM122
PM12
Internal bus
Selector
P12
P12:
Port register 12
PM12: Port mode register 12
RD:
Read signal
WR
××
: Write signal