8.2
Port 2
Port 2 is an 8-bit I/O port. Port 2 pins also functions as PWM output pins. Port 2 has a built-in
input pull-up MOS that can be controlled by software. Port 2 has the following registers.
• Port 2 data direction register (P2DDR)
• Port 2 data register (P2DR)
• Port 2 pull-up MOS control register (P2PCR)
8.2.1
Port 2 Data Direction Register (P2DDR)
The individual bits of P2DDR specify input or output for the pins of port 2.
Bit
Bit Name
7
P27DDR
6
P26DDR
5
P25DDR
4
P24DDR
3
P23DDR
2
P22DDR
1
P21DDR
0
P20DDR
Initial Value
R/W
0
W
0
W
0
W
0
W
0
W
0
W
0
W
0
W
Description
The corresponding port 2 pins are output ports or
PWM outputs when the P2DDR bits are set to 1,
and input ports when cleared to 0.
Rev. 3.00 Jul. 14, 2005 Page 167 of 986
Section 8 I/O Ports
REJ09B0098-0300