1 port po (p07 to poo), Toshiba – Toshiba TMP87CP24AF User Manual

Page 54

Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

Advertising
background image

TOSHIBA

TMP87CM24A/P24A

2.2.1 Port PO (P07 to POO)

Port PO is an

8

-bit general-purpose input/output port which can be configured as either an input or an

output in one-bit unit under software control. Input/output mode is specified by the corresponding bit

in the port PO input/output control register (POCR). Port PO is configured as an input if its corresponding

POCR bit is cleared to "0", and as an output if its corresponding POCR bit is set to "1

During reset, POCR is initialized to "0", which configures port PO as input. The PO output latches are also

initialized to "

0

".

POi

Output latch

PO

(OOOO

h

)

R/W

POCR

(OOOA

h

)

7

6

5

4

3

2

1

0

P07

P06

P05

P04

P03

P02

POI

POO

7

6

5

4

3

2

1

0

Notel: i = 7to0

Note2 : STOP: bit 7 ofSYSCR 1

Notes : OUTEN: bit 4 ofSYSCR2

(Initial value :

0000 0000)

(Initial value :

0000 0000)

POCR

I/O control for port PO

0 : Input mode

Write

(Set for each bit individually)

1 : Output mode

only

Figure 2-3. Port PO and POCR

Example : Setting the upper 4 bits of port PO as an input port and the lower 4 bits as an output

port (Initial output data are

1010

b

).

LD

(PO), 0000101 OB

; Sets initial data to PO output latches

LD

(POCR), 00001111B

; Sets the port PO input/output mode

Note 1

Note 2

Ports set to the input mode read the pin states. When input pin and output pin exist in port

PO together, the contents of the output latch of ports set to the input mode may be rewritten

by executing the bit manipulation instructions. Pins set to the output mode read a value of

the output latch.

The POCR is a write-only register. It can not be operated by the read-mod ify-write instruction

(Bit manipulation instructions of SET, CLR, etc. and Arithmetic instructions of AND, OR, etc.)

3

-

24-54

2002

-

10-03

Advertising
This manual is related to the following products: