2-8
38B5 Group User’s Manual
APPLICATION
2.1 I/O port
(3)
Modifying port latch of I/O port with bit managing instruction
When the port latch of an I/O port is modified with the bit managing instruction
V2, the value of the
unspecified bit may be changed.
q 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 port latch of an
I/O port, the following is executed to all bits of the port latch.
As for bit which is set for input port:
The pin state is read in the CPU, and is written to this bit after bit managing.
As for bit which is set for output port:
The bit value is read in the CPU, and is written to this bit after bit managing.
Note the following:
Even when a port which is set as an output port is changed for an input port, its port latch holds
the output data.
As 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 port latch contents.
V2 Bit managing instructions: SEB and CLB instructions
(4)
Pull-up control
When each port which has built-in pull-up resistor (P5, P61–P65, P7, P84–P87, P9) is set to output
port, pull-up control of corresponding port become invalid. (Pull-up cannot be set.)
q Reason
Pull-up control is valid only when each direction register is set to the input mode.
2.1.5 Termination of unused pins
(1)
Terminate unused pins
Output ports : Open
Input ports :
Connect each pin to VCC or VSS through each resistor of 1 k
to 10 k.
As for pins whose potential affects to operation modes such as pin INT or others, select the VCC
pin or the VSS pin according to their operation mode.
I/O ports :
Set the I/O ports for the input mode and connect them to VCC or VSS through each resistor of
1 k
to 10 k.
Ports that permit the selecting of a built-in pull-up resistor can also use this resistor. Set the
I/O ports for the output mode and open them at “L” or “H”.
When opening them in the output mode, the input mode of the initial status remains until the
mode of the ports is switched over to the output mode by the program after reset. Thus, the
potential at these pins is undefined and the power source current may increase in the input
mode. With regard to an effects on the system, thoroughly perform system evaluation on the user
side.
Since the direction register setup may be changed because of a program runaway or noise, set
direction registers by program periodically to increase the reliability of program.