English
Language : 

M38203M4 Datasheet, PDF (98/344 Pages) Mitsubishi Electric Semiconductor – 8-BIT SINGLE-CHIP MICROCOMPUTER
APPLICATION
2.1 I/O pins
2.1.4 Notes on use
When using I/O ports, note the following.
(1) Reading the port direction register
The value of the port direction register is not readable. The following cannot be used:
• the data transfer instruction (LDA, etc.)
• the operation instruction when the index X mode flag (T) is “1”
• the addressing mode which uses the value of a direction register as an index
• the bit-test instruction (BBC or BBS, etc.) to a direction register
• the read-modify-write instruction (ROR, CLB, or SEB, etc.) to a direction register
Use instructions such as LDM and STA, etc., to set the port direction registers.
(2) When the data register (port latch) of an I/O port is modified with the bit managing instruction
When the data register (port latch) of an I/O port is modified with the bit managing instructionV1, the
value of the unspecified bit may be changed.
REASON
The bit managing instructions are read-modify-write form instructions for reading and writing data by
a byte unit. Accordingly, when these instructions are executed on a bit of the data register of an I/O
port, the following is executed to all bits of the data register.
qAs for a bit which is set for an input port:
The pin state is read in the CPU, and is written to this bit after bit managing.
qAs for a bit which is set for an output port:
The bit value is read in the CPU, and is written to this bit after bit managing.
Note the following:
qEven when a port which is set as an output port is changed for an input port, its data register holds
the output data.
qAs for a bit of which is set for an input port, its value may be changed even when not specified with
a bit managing instruction in case where the pin state differs from its data register contents
V1 bit managing instructions : SEB and CLB instruction
(3) Pull-up control and pull-down control
To pull-up or pull-down ports by software, note the following.
qWhen ports P0, P1 and P3 are used as segment output pins for LCD, the settings of the pull-down
bits corresponding to these ports of the PULL register A are invalid (pull-down is impossible).
qWhen ports P0–P2, P41–P47 and P5–P7 are set for the output mode, the settings of the bits
corresponding to these ports of the PULL register A and PULL register B are invalid (pull-up or pull-
down are impossible).
2–12
3820 GROUP USER’S MANUAL