CHAPTER 5 PORT FUNCTIONS
98
5.3 PORT 1
Port 1 is an 8-bit input/output port with an output latch. Input/output can be specified bit-wise by means of the port 1 mode
register (PM1). Each pin incorporates a programmable pull-up resistor. This port has direct LED drive capability.
In addition to their input/output port function, P10 to P14 also have an alternate function as PWM output pins and serial
interface pins. The operating mode can be specified bit-wise by means of the PWM control register (PWMC) and the port 1 mode
control register (PMC1), as shown in Table 5-3. The level of any pin can be read and tested at any time irrespective of the
alternate-function pin operation.
When RESET is input, port 1 is set as an input port (output high-impedance state), and the output latch contents are undefined.
Table 5-3 Port 1 Operating Modes
Pin Name
Port Mode
Control Signal I/O Mode
Operation to Operate Control Pin
P10
I/O port
PWM0 output
Setting of EN0 bit of PWMC to 1
P11
PWM1 output
Setting of EN1 bit of PWMC to 1
P12
ASCK2 I/O/SCK2 I/O
Setting PMC12 bit of PMC1 to 1
P13
RxD2 input/SI2 input
Setting PMC13 bit of PMC1 to 1
P14
TxD2 output/SO2 output
Setting PMC14 bit of PMC1 to 1
P15 to P17
—
—
(a) Port mode
P10 and P11 operate as port mode pins when the EN0 and EN1 bits of the PWM control (PWMC) register are cleared
(to 0), and P12 to P14 do the same when the relevant bits of the port 1 mode control (PMC1) register are cleared (to
0), and P15 to P17 always operate as port mode pins. Input/output can be specified bit-wise by means of the port 1
mode register (PM1).
(b) Control signal input/output mode
P10 and P11 operate as PWM signal output pins when the EN0 and EN1 bits, respectively, of the PWM control (PWMC)
register are set (to 1).
P12 to P14 can be set as control pins bit-wise by setting the port 1 mode control (PMC1) register.
(i)
PWM0, PWM1
PWM0 and PWM1 are PWM output pins.
(ii) ASCK2/SCK2
ASCK2 is the asynchronous serial interface baud rate clock input pin.
SCK2 is the serial clock input/output pin (in 3-wire serial I/O2 mode).
(iii) RxD2/SI2
RxD2 is the asynchronous serial interface serial data input pin.
SI2 is the serial data input pin (in 3-wire serial I/O2 mode).
(iv) TxD2/SO2
TxD2 is the asynchronous serial interface serial data output pin.
SO2 is the serial data output pin (in 3-wire serial I/O2 mode).