![](http://datasheet.mmic.net.cn/380000/-PD789830_datasheet_16744982/-PD789830_39.png)
CHAPTER 2 PIN FUNCTIONS
39
2.3 Description of Pin Functions (
μ
PD78F9831)
2.3.1 P00 to P07 (Port 0)
These pins constitute an 8-bit I/O port and can be set in 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, whether an on-chip pull-up resistor is to be used
can be specified by pull-up resistor option register 0 (PU0).
2.3.2 P10 to P17 (Port 1)
These pins constitute an 8-bit I/O port and can be set in input or output port mode in 1-bit units by using port
mode register 1 (PM1). When these pins are used as an input port, whether an on-chip pull-up resistor is to be used
can be specified by pull-up resistor option register 0 (PU0).
2.3.3 P20 to P26 (Port 2)
These pins constitute a 7-bit I/O port. In addition, these pins provide a function to perform input to the external
interrupt, to output the buzzer, to output the pulse, and to input/output the data of UART.
Port 2 can be specified in the following operation modes bit-wise.
(1)
Port mode
In port mode, P20 to P26 function as a 7-bit I/O port. Port 2 can be set in input or output mode in 1-bit units
by using port mode register 2 (PM2). P24 is an N-ch open-drain I/O port.
(2)
Control mode
In this mode, P20 to P26 function as the external interrupt input, buzzer output, pulse output, and
input/output of UART data.
(a) INTP0 to INTP2
External interrupt input pins whose valid edge (rising edge, falling edge, or both rising and falling edges)
can be specified.
(b) PCL
Pulse output pin of clock output circuit.
(c) BUZ
Buzzer output pin of clock output circuit.
(d) RxD00, TxD00
Serial data I/O pins of UART.
Caution When using P20 to P26 as data I/O pins of UART, the input/output mode and output latch
must be set according to the functions to be used. For the details of the setting, see (1)
in Section 11.3.
2.3.4 P30 to P34 (Port 3)
These pins constitute a 5-bit I/O port. Port 3 can be set in input or output mode in 1-bit units by using port mode
register 3 (PM3). When this port is used as an input port, an internal pull-up resistor can be connected by using pull-
up resistor option register 0 (PU0). This port can be also used to detect a key return signal in 1-bit units.