1 port 2 data register (pdr2), Port 2 data register (pdr2) – FUJITSU Semiconductor Controller MB89950/950A User Manual

Page 98

Advertising
background image

84

CHAPTER 4 I/O PORTS

4.4.1

Port 2 Data Register (PDR2)

This section describes the port 2 data register.

Port 2 data register functions

Port 2 data register (PDR2)

The PDR2 register holds the pin states. Therefore, a bit corresponding to a pin set as an output port can be

read as the same state ("0" or "1") as the output latch, but when it is an input port, it cannot be read as the

output latch state.

Reference:

For SETB and CLRB bit operation instructions, since the state of output latch (not the pin) is read, the

output latch states of bits other than those being operated on are not changed.

Settings as an LCD segment driver output

To use pins as LCD segment driver outputs, segment driver output must be selected by the mask option.

Furthermore, the segment driver output select register must be set to the same as the mask option, so that

the CMOS input port can be protected.

Table 4.4-3 "Port 2 data register function" lists the functions of the port 2 data register.

Table 4.4-3 Port 2 data register function

Register

Data

Read

Write

Read/

Write

Address

Initial value

Port 2 data
register (PDR2)

0

Pin state is the
"L" level.

Outputs an "L" level to the pin.
(Sets "0" to the output latch and
turn the output transistor "ON".)

R/W

0004

H

--111111

B

1

Pin state is the
"H" level.

Sets the pin to the high-
impedance state.
(Sets "1" to the output latch and
turn the output transistor "OFF".)

R/W: Readable and writable
-: Unused bit

Advertising