CHAPTER 2 PIN FUNCTIONS
User’s Manual U12978EJ3V0UD
30
2.2 Pin Functions
2.2.1
P00 to P07 (Port 0)
These pins constitute an 8-bit I/O port and can be set to the input or output port mode in 1-bit units by using port
mode register 0 (PM0). When these pins are used as an input port, an on-chip pull-up resistor can be used by
setting pull-up resistor option register 0 (PU0). When these pins are used as an output port, CMOS output or N-ch
open-drain output can be specified in 8-bit units by setting port output mode register 0 (POM0).
2.2.2
P10 to P17 (Port 1)
These pins constitute an 8-bit I/O port. Port 1 can be set to the input or output mode in 1-bit units by using port
mode register 1 (PM1). When the port is used as an input port, an on-chip pull-up resistor can be used by setting
pull-up resistor option register 0 (PU0). When these pins are used as an output port, CMOS output or N-ch open-
drain output can be specified in 8-bit units by setting port output mode register 0 (POM0).
2.2.3
P20 to P26 (Port 2)
These pins constitute a 7-bit I/O port. In addition, these pins function as data I/O, and clock I/O to and from the
serial interface, external interrupt input, and timer I/O.
Port 2 can be specified in the following operation modes in 1-bit units.
(1) Port mode
In the port mode, P20 to P26 function as a 7-bit I/O port. Port 2 can be set to the input or output mode in 1-bit
units by using port mode register 2 (PM2). When the port is used as an input port, an on-chip pull-up resistor
can be used by setting pull-up resistor option register 0 (PU0). When P25 or P26 is used as an output port,
CMOS output or N-ch open-drain output can be specified by setting in 1-bit units port output mode register 1
(POM1).
(2) Control mode
In this mode, P20 to P26 function as the data I/O and the clock I/O to and from the serial interface.
(a) SI10, SO10
These are the serial data I/O pins of the serial interface.
(b) SCK10
This is the serial clock I/O pin of the serial interface.
(c) TI01
This is the external clock input pin for the 8-bit timer/event counter.
(d) TO01
This is the output pin of the 8-bit timer.
(e) INTP0
This is an external interrupt input pin for which the valid edge (rising edge, falling edge, or both rising and
falling edges) can be specified.
Caution
When using P20 to P26 as serial interface pins, the I/O mode and output latch must be set
according to the functions to be used. For setting details, see Table 9-2.