Hitachi H8S/2646 Hardware Manual page 265

Hitachi 16-bit single-chip microcomputer h8s/2646 series
Table of Contents

Advertisement

Port 2 Data Direction Register (P2DDR)
Bit
:
7
P27DDR P26DDR P25DDR P24DDR P23DDR P22DDR P21DDR P20DDR
Initial value :
0
R/W
:
W
P2DDR is an 8-bit write-only register that specifies whether individual bits are input or output for
each of the pins in port 2. It is not possible to read it. An undefined value is returned if an attempt
is made to read it.
Setting one of the bits of P2DDR to 1 sets the corresponding pin in port 2 to output, and clearing
the bit to 0 sets the corresponding pin to input.
P2DDR is initialized to H'00 if a reset occurs and in the hardware standby mode. The previous
values are retained by P2DDR in the software standby mode.
Port 2 Data Register (P2DR)
Bit
:
7
P27DR
Initial value :
0
R/W
:
R/W
P2DR is an 8-bit readable/writable register that stores output data for the port 2 pins (P27 to P20).
P2DR is initialized to H'00 if a reset occurs and in the hardware standby mode. The previous
values are retained in the software standby mode.
Port 2 Register (PORT2)
Bit
:
7
P27
Initial value :
—*
R/W
:
R
Note: * Determined by state of pins P27 to P20.
PORT2 is an 8-bit read-only register. It is not possible to write to it. It reflects the states of the
pins. Always write output data from the port 2 pins (P27 to P20) to P2DR.
If P2DDR is set to 1, the value of P2DR is returned when port 2 is read. If P2DDR is cleared to 0,
the pin states are returned when port 2 is read.
6
5
0
0
W
W
6
5
P26DR
P25DR
P24DR
0
0
R/W
R/W
6
5
P26
P25
—*
—*
R
R
4
3
0
0
W
W
4
3
P23DR
P22DR
0
0
R/W
R/W
R/W
4
3
P24
P23
P22
—*
—*
R
R
2
1
0
0
W
W
2
1
P21DR
P20DR
0
0
R/W
R/W
2
1
P21
P20
—*
—*
—*
R
R
0
0
W
0
0
0
R
233

Advertisement

Table of Contents
loading

Table of Contents