CHAPTER 2 PIN FUNCTIONS
User’s Manual U16898EJ3V0UD
23
2.2 Pin Functions
2.2.1 P20 to P23 (Port 2)
P20 to P23 constitute a 4-bit I/O port, port 2. In addition to I/O port pins, these pins also have a function to input
analog signals to the A/D converter. 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 as the analog input pins (ANI0 to ANI3) of the A/D converter. When using these pins as
analog input pins, refer to
10.6 Cautions for A/D converter (5) ANI0/P20 to ANI3/P23
.
2.2.2 P30, P31, and P34 (Port 3)
P30 and P31 constitute a 2-bit I/O port, port 3. In addition to I/O port pins, these pins also have functions to
input/output a timer signal, and input an external interrupt request signal.
P34 is a 1-bit input-only port. This pin is also used as a RESET pin, and when the power is turned on, this is the
reset function.
For the setting method for pin functions, see
CHAPTER 17 OPTION BYTE
.
When P34 is used as an input port pin, connect the pull-up resistor.
P30, P31 and P34 can be set to the following operation modes in 1-bit units.
(1) Port
mode
P30 and P31 function as a 2-bit I/O port. Each bit of this port can be set to the input or output mode by using
port mode register 3 (PM3). In addition, an on-chip pull-up resistor can be connected to the port by using pull-
up resistor option register 3 (PU3).
P34 functions as a 1-bit input-only port.
(2) Control
mode
P30 and P31 function to input/output signals to/from internal timers, and to input an external interrupt request
signal.
(a) INTP0 and INTP2
These are external interrupt request input pins for which the valid edge (rising edge, falling edge, or both
rising and falling edges) can be specified.
(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.