REJ03B0166-0113 Rev.1.13
Aug 21, 2009
3803 Group (Spec.H QzROM version)
NOTES ON PERIPHERAL FUNCTIONS
Notes on Input and Output Ports
1. Use in Stand-By State
When using the MCU in stand-by state*1 for low-power
consumption, do not leave the input level of an I/O port
undefined. Be especially careful to the I/O ports for the N-
channel open-drain.
In this case, pull-up (connect to Vcc) or pull-down (connect to
Vss) these ports through a resistor.
When determining a resistance value, note the following:
External circuit
Variation in the output level during ordinary operation
When using a built-in pull-up resistor, note variations in current
values:
When setting as an input port: Fix the input level
When setting as an output port: Prevent current from
flowing out externally.
<Reason>
Even if a port is set to output by the direction register, when the
content of the port latch is “1”, the transistor becomes the OFF
state, which allows the port to be in the high-impedance state.
This may cause the level to be undefined depending on external
circuits.
As described above, if the input level of an I/O port is left
undefined, the power source current may flow because the
potential applied to the input buffer in the MCU will be unstable.
*1 Stand-by state: Stop mode by executing the STP instruction
Wait mode by executing the WIT instruction
2. Modifying Output Data with Bit Handling Instruction
When the port latch of an I/O port is modified with the bit
handling instruction*1, the value of an unspecified bit may
change.
<Reason>
I/O ports can be set to input mode or output mode in byte units.
When the port register is read or written, the following will be
operated:
Port as input mode
Read: Read the pin level
Write: Write to the port latch
Port as output mode
Read: Read the port latch or peripheral function output
(specifications vary depending on the port)
Write: Write to the port latch (output the content of the port
latch from the pin)
Meanwhile, the bit handling instructions are the read-modify-
write instructions*2. Executing the bit handling instruction to the
port register allows reading and writing a bit unspecified with the
instruction at the same time.
If an unspecified bit is set to input mode, the pin level is read and
the value is written to the port latch. At this time, if the original
content of the port latch and the pin level do not match, the
content of the port latch changes.
If an unspecified bit is set to output mode, the port latch is
normally read, but the peripheral function output is read in some
ports and the value is written to the port latch. At this time, if the
original content of the port latch and the peripheral function
output do not match, the content of the port latch changes.
*1 Bit handling instructions: CLB, SEB
*2 Read-modify-write instruction: Reads 1-byte of data from
memory, modifies the data, and writes 1-byte of the data to
the original memory.
3. Direction Registers
The values of the port direction registers cannot be read. This
means, it is impossible to use the LDA instruction, memory
operation instruction when the T flag is “1”, addressing mode
using direction register values as qualifiers, and bit test
instructions such as BBC and BBS. It is also impossible to use bit
operation instructions such as CLB and SEB, and read-modify-
write instructions to direction registers, including calculations
such as ROR. To set the direction registers, use instructions such
as LDM or STA.
Termination of Unused Pins
1. Terminate unused pins
(1) Output ports: Open
(2) I/O ports:
Set the ports to input mode and connect each pin to VCC or VSS
through a resistor of 1 k to 10 k
. An internal pull-up resistor
can also be used for the port where the internal pull-up resister is
selectable.
To set the ports to output mode, leave open at “L” or “H” output.
When setting the ports to output mode and leave open, input
mode in the initial state remains until the mode of the ports are
switched to output mode by a program after a reset. This may
cause the voltage level of the pins to be undefined and the
power source current to increase while the ports remains in
input mode. For any effects on the system, careful system
evaluations should be implemented on the user side.
The direction registers may be changed due to a program
runaway or noise, so reset the registers periodically by a
program to increase the program reliability.
(3) The AVSS pin when not using the A/D converter:
When not using the A/D converter, handle a power source pin
for the A/D converter, AVSS pin as follows:
AVSS: Connect to the VSS pin.
2. Termination remarks
(1) When setting I/O ports to input mode
[1] Do not leave open
<Reason>
The power source current may increase depending on the
first-stage circuit.
The ports are more likely affected by noise when compared
with the termination shown on the above “1. (2) I/O ports”
[2] Do not connect to VCC or VSS directly
<Reason>
If the direction registers are changed to output mode due to a
program runaway or noise, a short circuit may occur.
[3] Do not connect multiple ports in a lump to VCC or VSS
through a resistor.
<Reason>
If the direction registers are changed to output mode due to a
program runaway or noise, a short circuit may occur between the
ports.