6 port p5 (p57 to p50), Toshiba – Toshiba TMP87CP24AF User Manual
Page 59
Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

TOSHIBA
TMP87CM24A/P24A
2.2.6 Port P5 (P57 to P50)
Port
P5
is
a
general-purpose
8
-bit
I/O
port
that
can be
specified
bitwise.
It
is
also used
for
analog
input.
Specify input or output using the P5 I/O control register (P5CR) and AINDS (bit 4 of ADCCR). During reset,
because P5CR and AINDS are initialized to "0", P50 port is specified for analog input and P51 to P57 ports
are
specified
for
port
input.
At
reset,
the
output
latch
of
port
P5
is
initialized
to
"0".
The
P5CR
is
write-
only register. The pins of port P5 not
specified for analog
input can be used
as an I/O port; to maintain
accuracy,
do
not
use
them
for
output
instructions
during
AD
conversion.
While
the
AD
converter
is
operating, if a read instruction is executed for port P5, read data of port selected to analog input is "1".
P5
(0005
h
)
R/W
P5CR
(OOOD
h
)
7
6
5
4
3
2
1
0
P57
P56
P55
P54
P53
P52
P51
P50
AIN7
AIN6
AIN5
AIN4
AIN3
AIN2
AIN1
AINO
7
6
5
4
3
2
1
0
(Initial value:
0000 0000)
(Initial value:
0000 0000)
P5CR
I/O control for port P5
0: Input mode
Write-
(Set for each bit individually)
1: Output mode
only
Note 1: P5CR is a write-only register and must not be used with any of the read-modify-write instruction.
Note 2: Unused analog input pins cannot be configured as output mode when AINDS = 0.
Figure 2-8. Port P5
Note 1: Ports set to the input mode read the pin states. When input pin and output pin exist in port P5
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.
Note 2: The P5CR is a write-only register. It can not be operated by the read-modify-write instruction
(Bit manipulation instructions of SET, CLR, etc. and Arithmetic instructions of AND, OR, etc.)
3
-
24-59
2002
-
10-03