Datasheet

Section 8 I/O Ports
Rev. 3.00 Mar 21, 2006 page 172 of 788
REJ09B0300-0300
8.2 Port 1
Port 1 is an 8-bit I/O port. Port 1 pins also function as an address bus and PWM output pins. Port 1
functions change according to the operating mode. Port 1 has an on-chip input pull-up MOS
function that can be controlled by software. Port 1 has the following registers.
Port 1 data direction register (P1DDR)
Port 1 data register (P1DR)
Port 1 pull-up MOS control register (P1PCR)
8.2.1 Port 1 Data Direction Register (P1DDR)
P1DDR specifies input or output for the pins of port 1 on a bit-by-bit basis.
Bit Bit Name Initial Value R/W Description
7 P17DDR 0 W
6 P16DDR 0 W
5 P15DDR 0 W
4 P14DDR 0 W
3 P13DDR 0 W
2 P12DDR 0 W
1 P11DDR 0 W
0 P10DDR 0 W
In mode 1:
Each pin of port 1 is address output regardless of
the set value of P1DDR.
In modes 2 and 3 (EXPE=1):
The corresponding port 1 pins are address output
or PWM output ports when P1DDR bits are set to
1, and input ports when cleared to 0.
In modes 2 and 3 (EXPE=0):
The corresponding port 1 pins are output ports or
PWM outputs when the P1DDR bits are set to 1,
and input ports when cleared to 0.