![](http://datasheet.mmic.net.cn/380000/-PD789830_datasheet_16744982/-PD789830_36.png)
CHAPTER 2 PIN FUNCTIONS
36
2.2 Description of Pin Functions (
μ
PD789830)
2.2.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.2.2 P10, P11 (Port 1)
These pins constitute a 2-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.2.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 for which the valid edge (rising edge, falling edge, or both the 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.