CHAPTER 2 PIN FUNCTIONS
User’s Manual U18172EJ2V0UD
22
2.2 Pin Functions
2.2.1 P20 to P23 (Port 2)
P20 to P23 constitute a 4-bit I/O port. In addition to the function as I/O port pins, these pins also have a function to
input an analog signal to the A/D converter, input/output a timer signal, and input an external interrupt request signal.
P22 and P23 also function as the X2/ANI2 and X1/ANI3, respectively. For the setting method for pin functions, see
CHAPTER 15 OPTION BYTE
.
These pins can be set to the following operation modes in 1-bit units.
(1) Port
mode
P20 to P23 function as a 4-bit I/O port. Each bit of this port can be set to the input or output mode by using
port mode register 2 (PM2). In addition, an on-chip pull-up resistor can be connected to the port by using pull-
up resistor option register 2 (PU2).
(2) Control
mode
P20 to P23 function to input an analog signal to the A/D converter, input/output a timer signal, and input an
external interrupt request signal.
(a) ANI0 to ANI3
These are the analog input pins of the A/D converter. When using these pins as analog input pins, refer
to
9.6 Cautions for A/D converter (5) ANI0/P20 to ANI3/P23
.
(b) TI000
This pin inputs an external count clock to 16-bit timer/event counter 00, or a capture trigger signal to the
capture registers (CR000 and CR010) of 16-bit timer/event counter 00.
(c) TI010
This pin inputs a capture trigger signal to the capture register (CR000) of 16-bit timer/event counter 00.
(d) TO00
This pin outputs a signal from 16-bit timer/event counter 00.
(e) TOH1
This pin outputs a signal from 8-bit timer H1.
(f) INTP0
This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both
rising and falling edges) can be specified.
Caution
The P22/X2/ANI2 and P23/X1/ANI3 pins are pulled down during reset.