Datasheet

Section 8 I/O Ports
Rev. 3.00 Mar 21, 2006 page 182 of 788
REJ09B0300-0300
8.5 Port 4
Port 4 is an 8-bit I/O port. Port 4 pins also function as PWMX output pins, TMR_0 and TMR_1
I/O pins, timer connection I/O pins, SCI_2 I/O pins, IrDA interface I/O pins, XBS output pins, and
the IIC_1 I/O pin. The output type of P42 and SCK2 is NMOS push-pull output. The output type
of SDA1 is NMOS open drain output. Port 4 pin functions are the same in all operating modes.
Port 4 has the following registers.
Port 4 data direction register (P4DDR)
Port 4 data register (P4DR)
8.5.1 Port 4 Data Direction Register (P4DDR)
P4DDR specifies input or output for the pins of port 4 on a bit-by-bit basis.
Bit Bit Name Initial Value R/W Description
7 P47DDR 0 W
6 P46DDR 0 W
5 P45DDR 0 W
4 P44DDR 0 W
3 P43DDR 0 W
2 P42DDR 0 W
1 P41DDR 0 W
0 P40DDR 0 W
When a bit in P4DDR is set to 1, the
corresponding pin functions as an output port, and
when cleared to 0, as an input port.
As 14-bit PWM and SCI_2 are initialized in
software standby mode, the pin states are
determined by the TMR_0, TMR_1, XBS, IIC_1,
P4DDR, and P4DR specifications.