Regarding the change of names mentioned in the document, such as Hitachi
Electric and Hitachi XX, to Renesas Technology Corp.
The semiconductor operations of Mitsubishi Electric and Hitachi were transferred to Renesas
Technology Corporation on April 1st 2003. These operations include microcomputer, logic, analog
and discrete devices, and memory chips other than DRAMs (flash memory, SRAMs etc.)
Accordingly, although Hitachi, Hitachi, Ltd., Hitachi Semiconductors, and other Hitachi brand
names are mentioned in the document, these names have in fact all been changed to Renesas
Technology Corp. Thank you for your understanding. Except for our corporate trademark, logo and
corporate statement, no changes whatsoever have been made to the contents of the document, and
these changes do not constitute any alteration to the contents of the document itself.
Renesas Technology Home Page: http://www.renesas.com
Renesas Technology Corp.
Customer Support Dept.
April 1, 2003
Page 2
Cautions
Keep safety first in your circuit designs!
1. Renesas Technology Corporation puts the maximum effort into making semiconductor products better and more reliabl e, but
there is always the possibility that trouble may occur with them. Trouble with semicondu ctors may lead to personal injury , fire
or propert y da mage.
Remember to give due consideration to safety when making your circuit designs, with appropriate measu res such as (i)
placement of substitutive, auxiliar y circuits, (ii) use of nonflammable material or (iii) preve n tion ag ain st any malf u nc tio n or
mishap.
Notes regar ding these ma terials
1. These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corporation
product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any
other rights, belonging to Renesas Technology Corporation or a third party.
2. Renesas Technology Corporation assumes no responsibility for any damage, or infringement of any third-party 's rights,
originating in th e u se of any product data, diagrams, charts, programs, algorithms, or circuit applicatio n examples contained in
these materials.
3. All information contained in these materials, including product data, diag rams, charts, programs and algorithms represents
information on products at the time of publication of these materials, and are subject to change by Renesas Technology
Corporation without notice due to product improvements or other reasons. It is therefore recommended that customers contact
Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor for the latest product
informati o n be fore purcha si ng a product lis ted herein.
The informa tion described here may contain technic a l inaccuracie s or typograph ical errors.
Renesas Technology Corp oration assumes no responsibility for any damage, liability, or other loss rising from these
inaccuracies or errors.
Please also pay attention to information published by Renesas Technology Corporation by various means, including the
Renesas Technology Corporation Semiconductor home page (http://www.renesas .com).
4. When usi ng any or all of the inf ormation contained in thes e m aterials, inc l ud i ng product data, diagrams, ch ar t s , programs, and
algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of
the information and products. Renesas Technology Corporation assumes no responsibi lity for any damage, liability or other
loss resulting from th e information contained herein.
5. Renesas Technology Corporation semiconductors are not designed or manufactured for use in a device or system that is used
under circumstances in which human life is potentially at stake. Please contact Renesas Technology Corporation or an
authorized Renesas Te chnology Corporation product dis tributor when considering the use of a product contained herein for
any specific purposes, such as apparat us or system s for tra nsp or ta tio n, veh icul ar, medica l, aer o space, nucle ar, or unders ea
repeater use.
6. The prior written approval of Renesas Technology Corporation is necessary to reprint or reproduce in whole or in part these
materials.
7. If these products o r technologies are sub ject to the Japanese exp ort contro l restrictions, they must be exported under a l i cense
from the Japanese govern ment and cannot be imported into a country other than the approved destination.
Any diversion or reexport contrary to the export contro l laws and regulations of Japan and/or the country of destination is
prohibited.
8. Please contact Renesas Technology Corporation for further details on these materials or the products contained the rein.
Page 3
Hitachi Single-Chip Microcomputer
The revision list can be viewed directly by
clicking the title page.
The revision list summarizes the locations of
revisions and additions. Details should always
be checked by referring to the relevant text.
1. Hitachi neither warrants nor grants licenses of any rights of Hitachi’s or any third party’s
patent, copyright, trademark, or other intellectual property rights for information contained in
this document. Hitachi bears no responsibility for problems that may arise with third party’s
rights, including intellectual property rights, in connection with use of the information
contained in this document.
2. Products and product specifications may be subject to change without notice. Confirm that you
have received the latest product standards or specifications before final design, purchase or
use.
3. Hitachi makes every attempt to ensure that its products are of high quality and reliability.
However, contact Hitachi’s sales office before using the product in an application that
demands especially high quality and reliability or where its failure or malfunction may directly
threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear
power, combustion control, transportation, traffic, safety equipment or medical equipment for
life support.
4. Design your application so that the product is used within the ranges guaranteed by Hitachi
particularly for maximum rating, operating supply voltage range, heat radiation characteristics,
installation conditions and other characteristics. Hitachi bears no responsibility for failure or
damage when used beyond the guaranteed ranges. Even within the guaranteed ranges,
consider normally foreseeable failure rates or failure modes in semiconductor devices and
employ systemic measures such as fail-safes, so that the equipment incorporating Hitachi
product does not cause bodily injury, fire or other consequential damage due to operation of
the Hitachi product.
5. This product is not designed to be radiation resistant.
6. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without written approval from Hitachi.
7. Contact Hitachi’s sales office for any questions regarding this document or Hitachi
semiconductor products.
Page 5
Preface
The H8/3062 Series is a high-performance single-chip microcomputer that integrates peripheral
functions necessary for system configuration with an H8/300H CPU featuring a 32-bit internal
architecture as its core.
The on-chip peripheral functions include ROM, RAM, 16-bit timers, 8-bit timers, a programmable
timing pattern controller (TPC), a watchdog timer (WDT), a serial communication interface (SCI),
a D/A converter, an A/D converter, and I/O ports, providing an ideal configuration as a
microcomputer for embedding in sophisticated control systems. Flash memory (F-ZTAT™*) and
mask ROM are available as on-chip ROM, enabling users to respond quickly and flexibly to
changing application specifications and the demands of the transition from initial to full-fledged
volume production.
Note: * F-ZTAT is a trademark of Hitachi, Ltd.
Intended Readership: This manual is intended for users undertaking the design of an application
system using the H8/3062 Series. Readers using this manual require a basic
knowledge of electrical circuits, logic circuits, and microcomputers.
Purpose: The purpose of this manual is to give users an understanding of the hardware
functions and electrical characteristics of the H8/3062 Series. Details of
execution instructions can be found in the H8/300H Series Programming
Manual, which should be read in conjunction with the present manual.
Using this Manual:
• For an overall understanding of the H8/3062 Series's functions
Follow the Table of Contents. This manual is broadly divided into sections on the CPU, system
control functions, peripheral functions, and electrical characteristics.
• For a detailed understanding of CPU functions
Refer to the separate publication H8/300H Series Programming Manual.
Note on bit notation: Bits are shown in high-to-low order from left to right.
Related Material: The latest information is available at our Web Site. Please make sure that
you have the most up-to-date information available.
(http://www.hitachisemiconductor.com/)
Page 6
User's Manuals on the H8/3062:
Manual TitleADE No.
H8/3062 Hardware ManualThis manual
H8/300H Series Programming ManualADE-602-053
H8/300H for CPU Application NoteADE-502-033
H8/300H On-Chip Supporting Modules Application NoteADE-502-035
H8/300H Technical Q&AADE-502-038
Page 7
Comparison of H8/3062 Series Product Specifications
There are 11 members of the H8/3062 Series: the H8/3062F-ZTAT, H8/3062F-ZTAT R-mask
version, H8/3062F-ZTAT B-mask version, and H8/3064F-ZTAT B-mask version (all with on-chip
flash memory), and the H8/3062 mask ROM version, H8/3061 mask ROM version, H8/3060 mask
ROM version, H8/3064 mask ROM B-mask version, H8/3062 mask ROM B-mask version,
H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask version.
The specifications of these products are compared below.
H8/3064 Mask ROM
H8/3062 Mask
H8/3062F-ZTAT H8/3062F-ZTAT
Product
specifications
Product
code
Pin arrangement
RAM size4 kbytesH8/3062:
On-chip singlepower-supply
flash memory
HD64F3062HD64F3062RHD6433062
See figures 1.2 and 1.3, Pin Arrangement, in section 1 H8/3064F-ZTAT
R-Mask Version
H8/3062F-ZTAT
version with
address output
functions added
ROM Version,
H8/3061 Mask
ROM Version,
H8/3060 Mask
ROM Version
See figures 1.4
and 1.5, Pin
Arrangement, in
section 1
8 kbytes4 kbytesH8/3064B:
H8/3062F-ZTAT
B-Mask Version
H8/3062F-ZTAT
high-speed
operation version
H8/3062F-ZTAT
B-mask version
has V
pin, and
CL
requires
connection of
external
capacitor
See figures 1.4
and 1.5, Pin
Arrangement, in
section 1
B-Mask Version,
H8/3062 Mask ROM
B-Mask Version,
H8/3061 Mask ROM
B-Mask Version,
H8/3060 Mask ROM
B-Mask Version
Mask ROM version
HD6433062B
HD6433061B
HD6433060B
H8/3064 mask ROM
B-mask version,
H8/3062 mask ROM
B-mask version,
H8/3061 mask ROM
B-mask version, and
H8/3060 mask ROM
B-mask version have
V
pin, and require
CL
connection of
external capacitor
See figures 1.4
and 1.5, Pin
Arrangement, in
section 1
8 kbytes
H8/3062B:
4 kbytes
H8/3061B:
4 kbytes
H8/3060B:
2 kbytes
Page 8
H8/3062F-ZTAT H8/3062F-ZTAT
ROM size128 kbytesH8/3062:
Address
output
functions
Flash
memory
Mask ROM ——See section 17,
Electrical
characteristics
(operating
frequency)
Compatible with
previous
H8/300H Series
See section 17, ROM—See 18.1.1,
See table 22.1, Comparison of H8/3062 Series Electrical Characteristics, in section 22
R-Mask Version
Address update mode 1 or 2 selectable
See 6.3.5, Address Output Method, in section 6
1 to 20 MHz2 to 25 MHz
H8/3062 Mask
ROM Version,
H8/3061 Mask
ROM Version,
H8/3060 Mask
ROM Version
128 kbytes
H8/3061:
96 kbytes
H8/3060:
64 kbytes
ROM
H8/3064 Mask ROM
B-Mask Version,
H8/3062 Mask ROM
H8/3064F-ZTAT
B-Mask Version
256 kbytes128 kbytesH8/3064B:
Differences
between
H8/3062F-ZTAT
and
H8/3062F-ZTAT
R-Mask Version,
in section 18
——Mask ROM B-mask
H8/3062F-ZTAT
B-Mask Version
See 19.1.1,
Differences
between
H8/3062F-ZTAT
and
H8/3062F-ZTAT
R-Mask Version,
in section 19
B-Mask Version,
H8/3061 Mask ROM
B-Mask Version,
H8/3060 Mask ROM
B-Mask Version
256 kbytes
H8/3062B:
128 kbytes
H8/3061B:
96 kbytes
H8/3060B:
64 kbytes
—
version of H8/3064:
see section 18.
Mask ROM B-mask
versions of H8/3062,
H8/3061, and
H8/3060: see section
19.
Page 9
H8/3062 Mask
H8/3062F-ZTAT H8/3062F-ZTAT
RegistersSee table B.1, Comparison of H8/3062 Series Internal I/O Register Specifications,
Usage
notes
in appendix B
See appendix
B.1, Address List
See 1.4, H8/3062F-ZTAT R-Mask Version Usage
Note, in section 1
R-Mask Version
See appendix
B.1, Address List
ROM Version,
H8/3061 Mask
ROM Version,
H8/3060 Mask
ROM Version
See appendix
B.1, Address List
H8/3064F-ZTAT
B-Mask Version
See appendix
B.2, Address List
See 1.5, H8/3064F-ZTAT B-Mask Version, and
H8/3062F-ZTAT B-Mask Version Usage Note, in section 1
H8/3062F-ZTAT
B-Mask Version
See appendix
B.3, Address List
H8/3064 Mask ROM
B-Mask Version,
H8/3062 Mask ROM
B-Mask Version,
H8/3061 Mask ROM
B-Mask Version,
H8/3060 Mask ROM
B-Mask Version
Mask ROM B-mask
version of H8/3064:
see appendix B.2,
Address List.
Mask ROM B-mask
versions of H8/3062,
H8/3061, and
H8/3060: see
appendix B.3,
Address List.
Page 10
Page 11
List of Items Revised or Added for This Version
Description
SectionPageItem
All—AllThe H8/3064 mask ROM
1. Overview181.3.3 Pin Assignments in
Each Mode
251.5.2 Product Type
Names and Markings
271.5.4 Notes on
Changeover to Mask
ROM Version or Mask
ROM B-Mask Version
6. Bus Controller1396.3.1 Area Division
(See Manual for Details)
B-mask version, H8/3062 mask
ROM B-mask version, H8/3061
mask ROM B-mask version,
and H8/3060 mask ROM Bmask version are added to the
product line-up.
Table 1.4 Pin Assignments in
Each Mode (FP-100B or
TFP-100B, FP-100A)
• (V
)*4 is added to modes 2
CL
to 7 in the first row.
Table 1.7 Differences in
H8/3062F-ZTAT R-Mask
Version, H8/3062F-ZTAT
B-Mask Version, H8/3064FZTAT, and H8/3064F-ZTAT
B-Mask Version Markings
• The marking examples of
H8/3062F-ZTAT B-mask
version and H8/3064FZTAT B-mask version are
amended.
• Title is amended.
• Note (2) is added.
• Figure 6.3 Memory Map in
16-Mbyte Mode (H8/3060
Mask ROM Version,
H8/3060 Mask ROM
B-Mask Version) (2) is
added.
• The Memory Map in 16Mbyte Mode (H8/3064FZTAT B-Mask Version,
H8/3064 Mask ROM
B-Mask Version) is moved
from figure 6.3 (2) to figure
Figure 1.2Pin Arrangement of H8/3062F-ZTAT, H8/3062F-ZTAT R-Mask Version,
H8/3062 Mask ROM Version, H8/3061 Mask ROM Version, and
H8/3060 Mask ROM Version (FP-100B or TFP-100B Package, Top View)....9
Figure 1.3Pin Arrangement of H8/3062F-ZTAT, H8/3062F-ZTAT R-Mask Version,
H8/3062 Mask ROM Version, H8/3061 Mask ROM Version, and
H8/3060 Mask ROM Version (FP-100A Package, Top View).......................... 10
Figure 1.4Pin Arrangement of H8/3064F-ZTAT B-Mask Version,
H8/3062F-ZTAT B-Mask Version, H8/3064 Mask ROM B-Mask Version,
H8/3062 Mask ROM B-Mask Version, H8/3061 Mask ROM B-Mask Version,
and H8/3060 Mask ROM B-Mask Version (FP-100B or TFP-100B Package,
Top View) .......................................................................................................... 11
Figure 1.5Pin Arrangement of H8/3064F-ZTAT B-Mask Version,
H8/3062F-ZTAT B-Mask Version, H8/3064 Mask ROM B-Mask Version,
H8/3062 Mask ROM B-Mask Version, H8/3061 Mask ROM B-Mask Version,
and H8/3060 Mask ROM B-Mask Version (FP-100A Package, Top View)..... 12
Figure 1.6H8/3062F-ZTAT B-Mask Version, H8/3064F-ZTAT B-Mask Version, and
On-Chip Mask ROM B-Mask Versions............................................................. 26
Figure 1.7Example of Board Pattern Providing for External Capacitor............................. 27
Figure 12.4Sample Flowchart for SCI Initialization ............................................................ 394
Figure 12.5Sample Flowchart for Transmitting Serial Data ................................................ 395
Figure 12.6Example of SCI Transmit Operation in Asynchronous Mode
(8-Bit Data with Parity and One Stop Bit) ......................................................... 396
Figure 12.7Sample Flowchart for Receiving Serial Data ..................................................... 397
Figure 12.8Example of SCI Receive Operation (8-Bit Data with Parity and One Stop Bit) 400
Figure 12.9Example of Communication among Processors using Multiprocessor Format
(Sending Data H'AA to Receiving Processor A)................................................ 401
xxi
Page 38
Figure 12.10Sample Flowchart for Transmitting Multiprocessor Serial Data ....................... 402
Figure 12.11Example of SCI Transmit Operation (8-Bit Data with Multiprocessor Bit and
One Stop Bit)...................................................................................................... 403
Figure 12.12Sample Flowchart for Receiving Multiprocessor Serial Data............................ 404
Figure 12.13Example of SCI Receive Operation (8-Bit Data with Multiprocessor Bit and
One Stop Bit)...................................................................................................... 406
Figure 12.14Data Format in Synchronous Communication................................................... 407
Figure 12.15Sample Flowchart for SCI Initialization ............................................................ 408
Figure 12.16Sample Flowchart for Serial Transmitting......................................................... 409
Figure 12.17Example of SCI Transmit Operation.................................................................. 410
Figure 12.18Sample Flowchart for Serial Receiving.............................................................. 411
Figure 12.19Example of SCI Receive Operation ................................................................... 413
Figure 12.20Sample Flowchart for Simultaneous Serial Transmitting and Receiving .......... 414
Figure 12.21Receive Data Sampling Timing in Asynchronous Mode................................... 417
Figure 12.22Example of Synchronous Transmission............................................................. 418
Figure 12.23Operation when Switching from SCK Pin Function to Port Pin Function......... 419
Figure 12.24Operation when Switching from SCK Pin Function to Port Pin Function
(Example of Preventing Low-Level Output)...................................................... 420
Figure 13.1Block Diagram of Smart Card Interface ............................................................ 422
Table A.3 Number of States per Cycle.................................................................................. 782
Table A.4 Number of Cycles per Instruction ........................................................................ 783
Table B.1 Comparison of H8/3062 Series Internal I/O Register Specifications .................. 790
Table D.1 Port States............................................................................................................. 926
Table F.1 H8/3062 Series ..................................................................................................... 934
Table H.1 Pin Arrangement of Each Product (FP-100B, TFP-100B)................................... 942
xxxii
Page 49
Section 1 Overview
1.1Overview
The H8/3062 Series is a series of microcontrollers (MCUs) that integrate system supporting
functions together with an H8/300H CPU core having an original Hitachi architecture.
The H8/300H CPU has a 32-bit internal architecture with sixteen 16-bit general registers, and a
concise, optimized instruction set designed for speed. It can address a 16-Mbyte linear address
space. Its instruction set is upward-compatible at the object-code level with the H8/300 CPU,
enabling easy porting of software from the H8/300 Series.
The on-chip system supporting functions include ROM, RAM, a 16-bit timer, an 8-bit timer, a
programmable timing pattern controller (TPC), a watchdog timer (WDT), a serial communication
interface (SCI), an A/D converter, a D/A converter, I/O ports, and other facilities.
The 11 members of the H8/3062 Series are the H8/3062F-ZTAT, H8/3062F-ZTAT R-mask
version, H8/3062 (mask ROM version), H8/3061 (mask ROM version), H8/3060 (mask ROM
version), H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, H8/3064 mask
ROM B-mask version, H8/3062 mask ROM B-mask version, H8/3061 mask ROM B-mask
version, and H8/3060 mask ROM B-mask version.
Seven MCU operating modes offer a choice of bus width and address space size. The modes
(modes 1 to 7) include two single-chip modes and five expanded modes.
In addition to its mask ROM versions, the H8/3062 Series has F-ZTAT™* versions with on-chip
flash memory that allows programs to be freely rewritten by the user. This version enables users to
respond quickly and flexibly to changing application specifications, growing production volumes,
and other conditions.
Table 1.1 summarizes the features of the H8/3062 Series.
Note: * F-ZTATTM (Flexible ZTAT) is a trademark of Hitachi, Ltd.
1
Page 50
Table 1.1Features
FeatureDescription
CPUUpward-compatible with the H8/300 CPU at the object-code level
General-register machine
• Sixteen 16-bit general registers
(also usable as sixteen 8-bit registers plus eight 16-bit registers, or as eight
32-bit registers)
High-speed operation
H8/3062F-ZTAT
H8/3062F-ZTAT R-Mask version
H8/3062 (mask ROM version)
H8/3061 (mask ROM version)
H8/3060 (mask ROM version)
H8/3064F-ZTAT B-mask version
H8/3062F-ZTAT B-mask version
H8/3064 mask ROM B-mask version
H8/3062 mask ROM B-mask version
H8/3061 mask ROM B-mask version
H8/3060 mask ROM B-mask version
Maximum
clock rate
20 MHz100 ns700 ns
25 MHz80 ns560 ns
Add/
subtract
Multiply/
divide
16-Mbyte address space
Instruction features
• 8/16/32-bit data transfer, arithmetic, and logic instructions
• Signed and unsigned multiply instructions (8 bits x 8 bits, 16 bits x 16 bits)
• Signed and unsigned divide instructions (16 bits ÷ 8 bits, 32 bits ÷ 16 bits)
• Bit accumulator function
• Bit manipulation instructions with register-indirect specification of bit positions
2
Page 51
FeatureDescription
MemoryROMRAM
H8/3062F-ZTAT
128 kbytes4 kbytes
H8/3062F-ZTAT R-mask version
H8/3062F-ZTAT B-mask version
H8/3062 (mask ROM version)
H8/3062 mask ROM B-mask version
H8/3061 (mask ROM version)
96 kbytes4 kbytes
H8/3061 mask ROM B-mask version
H8/3060 (mask ROM version)
64 kbytes2 kbytes
H8/3060 mask ROM B-mask version
H8/3064F-ZTAT B-mask version
256 kbytes8 kbytes
H8/3064 mask ROM B-mask version
Interrupt
controller
Bus controller
16-bit timer,
3 channels
• Seven external interrupt pins: NMI, IRQ
to IRQ
0
5
• 27 internal interrupts
• Three selectable interrupt priority levels
• Address space can be partitioned into eight areas, with independent bus
specifications in each area
• Chip select output available for areas 0 to 7
• 8-bit access or 16-bit access selectable for each area
• Two-state or three-state access selectable for each area
• Selection of two wait modes
• Number of program wait states selectable for each area
• Bus arbitration function
• Two address update modes (not available in the H8/3062F-ZTAT)
• Three 16-bit timer channels, capable of processing up to six pulse outputs or
six pulse inputs
• 16-bit timer counter (channels 0 to 2)
• Two multiplexed output compare/input capture pins (channels 0 to 2)
Notes: *1 Functions as RESO in the on-chip mask ROM versions, and as FWE in the on-chip flash memory versions.
*2 The H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, H8/3064 mask ROM B-mask version,
H8/3062 mask ROM B-mask version, H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask
version have a V
pin, and require the connection of an external capacitor.
CL
Figure 1.1 Block Diagram
7
Page 56
1.3Pin Description
1.3.1Pin Arrangement
The pin arrangement of the H8/3062 Series is shown in figures 1.2 to 1.5. Differences in the
H8/3062 Series pin arrangements are shown in table 1.2. The H8/3064F-ZTAT B-mask version,
H8/3062F-ZTAT B-mask version, H8/3064 mask ROM B-mask version, H8/3062 mask ROM
B-mask version, H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask version
have a VCL pin. See section 1.5, Notes on H8/3064F-ZTAT B-Mask Version, H8/3062F-ZTAT
B-Mask Version, H8/3064 mask ROM B-mask version, H8/3062 mask ROM B-mask version,
H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask version. Except for the
differences shown in table 1.2, the pin arrangements are the same.
Table 1.2Comparison of H8/3062 Series Pin Arrangements
Figure 1.5 Pin Arrangement of H8/3064F-ZTAT B-Mask Version, H8/3062F-ZTAT
B-Mask Version, H8/3064 Mask ROM B-Mask Version, H8/3062 Mask ROM B-Mask
Version, H8/3061 Mask ROM B-Mask Version, and H8/3060 Mask ROM B-Mask Version
(FP-100A Package, Top View)
12
Page 61
1.3.2Pin Functions
Table 1.3 summarizes the pin functions. The H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT
B-mask version, H8/3064 mask ROM B-mask version, H8/3062 mask ROM B-mask version,
H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask version have a VCL pin,
and require the connection of an external capacitor.
Table 1.3Pin Functions
Pin No.
FP-100B
TypeSymbol
PowerV
Internal
step-down
CC
V
SS
V
CL
pin
ClockXTAL6769InputFor connection to a crystal resonator.
EXTAL6668InputFor connection to a crystal resonator or input
φ6163Output System clock: Supplies the system clock to
TFP-100B FP-100A I/OName and Function
1
*
1
, 35,683
1
*
, 37,70InputPower: For connection to the power supply.
Connect all V
pins to the system power
CC
supply.
11, 22,
44, 57,
65, 92
2
*
1
13, 24,
46, 59,
67, 94
2
*
3
InputGround: For connection to ground (0 V).
Connect all V
pins to the 0-V system power
SS
supply.
Output Connect an external capacitor between this
pin and GND (0 V).
V
CL
0.1 µF
For examples of crystal resonator and external
clock input, see section 20, Clock Pulse
Generator.
of an external clock signal. For examples of
crystal resonator and external clock input, see
section 20, Clock Pulse Generator.
external devices.
Do not connect to V
.
CC
13
Page 62
TypeSymbol
Operating
mode
MD2 to
MD
0
control
Pin No.
FP-100B
TFP-100B FP-100A I/OName and Function
75 to 7377 to 75 InputMode 2 to mode 0: For setting the operating
mode, as follows. Inputs at these pins must
not be changed during operation.
Notes: *1 In modes 1, 3, and 5 the P40 to P47 functions of pins P40/D0 to P47/D7 are selected after
a reset, but they can be changed by software.
*2 In modes 2 and 4 the D
to D7 functions of pins P40/D0 to P47/D7 are selected after a
0
reset, but they can be changed by software.
*3 Functions as RESO in the on-chip mask ROM versions, and as FWE in the on-chip
flash memory versions. Functions as the programming control signal in modes 5 and 7.
*4 Functions as V
in the H8/3062F-ZTAT, H8/3062F-ZTAT R-mask version, H8/3062
CC
mask ROM version, H8/3061 mask ROM version, and H8/3060 mask ROM version. In
the H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, H8/3064 mask
ROM B-mask version, H8/3062 mask ROM B-mask version, H8/3061 mask ROM
B-mask version, and H8/3060 mask ROM B-mask version, this pin functions as V
.
CL
21
Page 70
1.4Notes on H8/3062F-ZTAT R-Mask Version
There are two models with on-chip flash memory in the H8/3062 Series: the H8/3062F-ZTAT and
the H8/3062F-ZTAT R-mask version. Points to be noted when using the H8/3062F-ZTAT R-mask
version are given below.
1.4.1Pin Arrangement
The H8/3062F-ZTAT R-mask version has the same pin arrangement as the H8/3062F-ZTAT and
the H8/3062 mask ROM version, H8/3061 mask ROM version, and H8/3060 mask ROM version.
Except for the VCL pin, it also has the same pin arrangement as the H8/3062F-ZTAT B-mask
version, H8/3064F-ZTAT B-mask version, H8/3064 mask ROM B-mask version, H8/3062 mask
ROM B-mask version, H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask
version.
22
Page 71
1.4.2Product Type Names and Markings
Table 1.5 shows the product type names and differences in sample markings for the H8/3062FZTAT and the H8/3062F-ZTAT R-mask version.
Table 1.5 Differences in H8/3062F-ZTAT and H8/3062F-ZTAT R-Mask Version
Markings
H8/3062F-ZTATH8/3062F-ZTAT R-Mask Version
TFP-100 Product type nameHD64F3062TEHD64F3062RTE
Sample markings
FP-100B Product type nameHD64F3062FHD64F3062RF
Sample markings
H8/3062
HD
64F3062TE20
JAPAN
H8/3062
HD
64F3062F20
JAPAN
H8/3062
R
HD
64F3062TE20
JAPAN
“R” is printed above the type name.
H8/3062
R
HD
64F3062F20
JAPAN
“R” is printed above the type name.
FP-100A Product type nameHD64F3062FPHD64F3062RFP
Sample markings
H8/3062
HD
64F3062FP20
JAPAN
H8/3062
R
HD
64F3062FP20
JAPAN
“R” is printed above the type name.
1.4.3Differences between H8/3062F-ZTAT and H8/3062F-ZTAT R-Mask Version
Table 1.6 shows the differences between the H8/3062F-ZTAT, the H8/3062F-ZTAT R-mask
version, and the on-chip mask ROM versions.
23
Page 72
Table 1.6Differences between H8/3062F-ZTAT, H8/3062F-ZTAT R-Mask Version, and
On-Chip Mask ROM Versions
On-Chip Flash Memory VersionsOn-Chip Mask ROM Versions
Choice of address update mode 1 (compatible with previous
H8/300H Series) or address update mode 2
See the section on the bus controller for details.
7
—
6
—
5
—
4
—
See the section on the bus controller for the bit function.
96 kbytes
mask ROM
3
—
64 kbytes
mask ROM
2
—
1
—
0
ADRCTL
The address output functions and ADRCR register specification of the H8/3064F-ZTAT B-mask
version, H8/3062F-ZTAT B-mask version, H8/3064 mask ROM B-mask version, H8/3062 mask
ROM B-mask version, H8/3061 mask ROM B-mask version, and H8/3060 mask ROM B-mask
version are the same as for the H8/3062F-ZTAT R-mask version.
1.5Notes on H8/3064F-ZTAT B-Mask Version, H8/3062F-ZTAT
B-Mask Version, H8/3064 Mask ROM B-Mask Version, H8/3062
Mask ROM B-Mask Version, H8/3061 Mask ROM B-Mask Version,
and H8/3060 Mask ROM B-Mask Version
The H8/3062 Series includes one model with 128-kbyte on-chip flash memory, the H8/3062FZTAT B-mask version developed on the basis of the H8/3062F-ZTAT R-mask version, and one
model with 256-kbyte large-capacity on-chip flash memory, the H8/3064F-ZTAT B-mask version.
The H8/3062F-ZTAT B-mask version and H8/3064F-ZTAT B-mask version have the following
features:
1. Low power consumption
2. Functional compatibility with the H8/3062F-ZTAT R-mask version
3. Pin arrangement compatibility (except for the VCL pin)
Points to be noted when using the H8/3062F-ZTAT B-mask version or H8/3064F-ZTAT B-mask
version are given below.
24
Page 73
1.5.1Pin Arrangement
Except for the VCL pin, the H8/3062F-ZTAT and the H8/3062F-ZTAT R-mask version have the
same pin arrangement as the H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version,
H8/3064 mask ROM B-mask version, H8/3062 mask ROM B-mask version, H8/3061 mask ROM
B-mask version, and H8/3060 mask ROM B-mask version.
1.5.2Product Type Names and Markings
Table 1.7 shows the product type names and differences in sample markings for the H8/3062FZTAT R-mask version, H8/3062F-ZTAT B-mask version, and H8/3064F-ZTAT B-mask version.
Table 1.7Differences in H8/3062F-ZTAT R-Mask Version, H8/3062F-ZTAT B-Mask
Version, and H8/3064F-ZTAT B-Mask Version Markings
TFP-100 Product
type name
Sample
markings
FP-100B Product
type name
Sample
markings
FP-100A Product
type name
Sample
markings
H8/3062F-ZTAT
R-Mask Version
H8/3062F-ZTAT
B-Mask Version
H8/3064F-ZTAT
B-Mask Version
HD64F3062RTEHD64F3062BTEHD64F3064BTE
H8/3062
R
HD
64F3062TE20
JAPAN
H8/3062
B
HD
64F3062TE25
JAPAN
“B” is printed above
the type name.
H8/3064
B
HD
64F3064TE25
JAPAN
“B” is printed above
the type name.
HD64F3062RFHD64F3062BFHD64F3064BF
H8/3062
R
HD
64F3062F20
JAPAN
H8/3062
B
HD
64F3062F25
JAPAN
“B” is printed above
the type name.
H8/3064
B
HD
64F3064F25
JAPAN
“B” is printed above
the type name.
HD64F3062RFPHD64F3062BFPHD64F3064BFP
H8/3062
R
HD
64F3062FP20
JAPAN
H8/3062
B
HD
64F3062FP25
JAPAN
H8/3064
B
HD
64F3064FP25
JAPAN
“B” is printed above
the type name.
“B” is printed above
the type name.
25
Page 74
1.5.3VCL Pin
The H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, and on-chip mask ROM
B-mask versions have a VCL (internal step-down) pin, to which a 0.1 µF internal voltage
stabilization capacitor must be connected.
The method of connecting the external capacitor is shown in figure 1.6.
Do not connect the V
power supply to the V
CC
pin (Connect the VCC power supply to other V
CL
pins as usual). Note that the VCL output pin occupies the same location as a VCC pin in the
H8/3062F-ZTAT R-mask version and on-chip mask ROM versions.
VCC power
supply
External
capacitor
0.1 µF
V
CL
H8/3062F-ZTAT,
H8/3062F-ZTAT B-mask version,
H8/3064F-ZTAT B-mask version,
H8/3064 mask ROM B-mask version,
H8/3062 mask ROM B-mask version,
V
CC
H8/3062F-ZTAT R-mask
version,
H8/3062 mask ROM version,
H8/3061 mask ROM version,
H8/3060 mask ROM version
H8/3061 mask ROM B-mask version,
H8/3060 mask ROM B-mask version
(5 V model)
Do not connect the VCC power supply to the
V
pin (Connect the VCC power supply to
CL
other V
pins as usual).
CC
Place the capacitor close to the pin.
These versions have a V
pin in the same pin position as a V
the H8/3062F-ZTAT B-mask version and
H8/3064F-ZTAT B-mask version.
Figure 1.6 H8/3062F-ZTAT B-Mask Version, H8/3064F-ZTAT B-Mask Version, and
On-Chip Mask ROM B-Mask Versions
power supply
CC
CC
CC
pin in
26
Page 75
1.5.4Notes on Changeover to On-Chip Mask ROM Versions and On-Chip Mask ROM
B-Mask Versions
(1) Care is required when changing from the H8/3062F-ZTAT B-mask version with on-chip flash
memory to a model with on-chip mask ROM.
An external capacitor must be connected to the VCL pin of the H8/3062F-ZTAT B-mask
version (5 V model). This VCL pin occupies the same location as a VCC pin in the on-chip mask
ROM versions. Changeover to a mask ROM version must therefore be taken into account
when undertaking pattern design, etc., in the board design stage.
(2) When changing from the H8/3062F-ZTAT B-mask version with on-chip flash memory to the
on-chip mask ROM B-mask version, note (1) above does not need to be considered because
the VCL pin is assigned to the same location in both versions. It does not need to be considered
either when changing from the H8/3064F-ZTAT B-mask version to the on-chip mask ROM
B-mask version.
power
V
CC
H8/3062 Series chip
V
CC
pin
supply
← Land pattern for on-chip mask ROM versions
V
pin
CL
(0 Ω resistance mounted)
← Land pattern for H8/3062F-ZTAT B-mask version
(0.1 µF capacitor mounted)
Figure 1.7 Example of Board Pattern Providing for External Capacitor
27
Page 76
1.6Setting Oscillation Settling Wait Time
When software standby mode is used, after exiting software standby mode a wait period must be
provided to allow the clock to stabilize. Select the length of time for which the CPU and peripheral
functions are to wait by setting bits STS2 to STS0 in the system control register (SYSCR) and bits
DIV1 and DIV0 in the division ratio control register (DIVCR) according to the operating
frequency of the chip.
For the H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, and on-chip mask
ROM B-mask versions ensure that the oscillation settling wait time is at least 0.1 ms when
operating on an external clock.
For setting details, see section 21.4.3, Selection of Waiting Time for Exit from Software Standby
Mode.
1.7Caution on Crystal Resonator Connection
The H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, and on-chip mask ROM
B-mask versions support an operating frequency of up to 25 MHz. If a crystal resonator with a
frequency higher than 20 MHz is connected, attention must be paid to circuit constants such as
external load capacitance values. For details see section 20.2.1, Connecting a Crystal Resonator.
28
Page 77
Section 2 CPU
2.1Overview
The H8/300H CPU is a high-speed central processing unit with an internal 32-bit architecture that
is upward-compatible with the H8/300 CPU. The H8/300H CPU has sixteen 16-bit general
registers, can address a 16-Mbyte linear address space, and is ideal for realtime control.
2.1.1Features
The H8/300H CPU has the following features.
• Upward compatibility with H8/300 CPU
Can execute H8/300 Series object programs.
• General-register architecture
Sixteen 16-bit general registers (also usable as sixteen 8-bit registers or eight 32-bit registers)
• 64 basic instructions
8/16/32-bit arithmetic and logic instructions
Multiply and divide instructions
Powerful bit-manipulation instructions
• Eight addressing modes
Register direct [Rn]
Register indirect [@ERn]
Register indirect with displacement [@(d:16, ERn) or @(d:24, ERn)]
Register indirect with post-increment or pre-decrement [@ERn+ or @–ERn]
Absolute address [@aa:8, @aa:16, or @aa:24]
Immediate [#xx:8, #xx:16, or #xx:32]
Program-counter relative [@(d:8, PC) or @(d:16, PC)]
Memory indirect [@@aa:8]
• 16-Mbyte linear address space
• High-speed operation
All frequently-used instructions execute in two to four states
Maximum clock frequency:
20 MHz (H8/3062F-ZTAT, H8/3062F-ZTAT R-mask version, H8/3062 mask ROM
version, H8/3061 mask ROM version, H8/3060 mask ROM version)
25 MHz (H8/3064F-ZTAT B-mask version, H8/3062F-ZTAT B-mask version, H8/3064
mask ROM B-mask version, H8/3062 mask ROM B-mask version, H8/3061 mask ROM
B-mask version, and H8/3060 mask ROM B-mask version)
• Two CPU operating modes
Normal mode
Advanced mode
• Low-power mode
Transition to power-down state by SLEEP instruction
2.1.2Differences from H8/300 CPU
In comparison to the H8/300 CPU, the H8/300H has the following enhancements.
• More general registers
Eight 16-bit registers have been added.
• Expanded address space
Advanced mode supports a maximum 16-Mbyte address space.
Normal mode supports the same 64-kbyte address space as the H8/300 CPU.
• Enhanced addressing
The addressing modes have been enhanced to make effective use of the 16-Mbyte address
space.
• Enhanced instructions
Data transfer, arithmetic, and logic instructions can operate on 32-bit data.
Signed multiply/divide instructions and other instructions have been added.
30
Page 79
2.2CPU Operating Modes
The H8/300H CPU has two operating modes: normal and advanced. Normal mode supports a
maximum 64-kbyte address space. Advanced mode supports up to 16 Mbytes.
Normal mode
CPU operating modes
Advanced mode
Maximum 64 kbytes, program
and data areas combined.
Maximum 16 Mbytes, program
and data areas combined.
Figure 2.1 CPU Operating Modes
2.3Address Space
Figure 2.2 shows a simple memory map for the H8/3062 Series. The H8/300H CPU can address a
linear address space with a maximum size of 64 kbytes in normal mode, and 16 Mbytes in
advanced mode. For further details see section 3.6, Memory Map in Each Operating Mode.
The 1-Mbyte operating modes use 20-bit addressing. The upper 4 bits of effective addresses are
ignored.
H'0000
H'FFFF
H'00000
H'000000
H'FFFFF
a. 1-Mbyte modeb. 16-Mbyte mode
Figure 2.2 Memory Map
H'FFFFFF
Advanced modeNormal mode
31
Page 80
2.4Register Configuration
2.4.1Overview
The H8/300H CPU has the internal registers shown in figure 2.3. There are two types of registers:
general registers and control registers.
General Registers (ERn)
0707015
ER0
ER1
ER2
ER3
ER4
ER5
ER6
ER7
Control Registers (CR)
PC
E0
E1
E2
E3
E4
E5
E6
E7
230
(SP)
R0H
R1H
R2H
R3H
R4H
R5H
R6H
R7H
R0L
R1L
R2L
R3L
R4L
R5L
R6L
R7L
32
Legend:
Stack pointer
SP :
Program counter
PC :
Condition code register
CCR :
Interrupt mask bit
I:
User bit or interrupt mask bit
UI:
Half-carry flag
H:
User bit
U:
Negative flag
N:
Zero flag
Z:
Overflow flag
V:
Carry flag
C:
Figure 2.3 CPU Registers
7
6543210
IUIHUNZVC
CCR
Page 81
2.4.2 General Registers
The H8/300H CPU has eight 32-bit general registers. These general registers are all functionally
alike and can be used without distinction between data registers and address registers. When a
general register is used as a data register, it can be accessed as a 32-bit, 16-bit, or 8-bit register.
When the general registers are used as 32-bit registers or as address registers, they are designated
by the letters ER (ER0 to ER7).
The ER registers divide into 16-bit general registers designated by the letters E (E0 to E7) and R
(R0 to R7). These registers are functionally equivalent, providing a maximum sixteen 16-bit
registers. The E registers (E0 to E7) are also referred to as extended registers.
The R registers divide into 8-bit general registers designated by the letters RH (R0H to R7H) and
RL (R0L to R7L). These registers are functionally equivalent, providing a maximum sixteen 8-bit
registers.
Figure 2.4 illustrates the usage of the general registers. The usage of each register can be selected
independently.
• Address registers
• 32-bit registers• 16-bit registers• 8-bit registers
E registers
(extended registers)
E0 to E7
ER registers
ER0 to ER7
R registers
R0 to R7
RH registers
R0H to R7H
RL registers
R0L to R7L
Figure 2.4 Usage of General Registers
General register ER7 has the function of stack pointer (SP) in addition to its general-register
function, and is used implicitly in exception handling and subroutine calls. Figure 2.5 shows the
stack.
33
Page 82
Free area
SP (ER7)
Stack area
Figure 2.5 Stack
2.4.3Control Registers
The control registers are the 24-bit program counter (PC) and the 8-bit condition code register
(CCR).
Program Counter (PC): This 24-bit counter indicates the address of the next instruction the CPU
will execute. The length of all CPU instructions is 2 bytes (one word), so the least significant PC
bit is ignored. When an instruction is fetched, the least significant PC bit is regarded as 0.
Condition Code Register (CCR): This 8-bit register contains internal CPU status information,
including the interrupt mask bit (I) and half-carry (H), negative (N), zero (Z), overflow (V), and
carry (C) flags.
Bit 7—Interrupt Mask Bit (I): Masks interrupts other than NMI when set to 1. NMI is accepted
regardless of the I bit setting. The I bit is set to 1 at the start of an exception-handling sequence.
Bit 6—User Bit or Interrupt Mask Bit (UI): Can be written and read by software using the
LDC, STC, ANDC, ORC, and XORC instructions. This bit can also be used as an interrupt mask
bit. For details see section 5, Interrupt Controller.
Bit 5—Half-Carry Flag (H): When the ADD.B, ADDX.B, SUB.B, SUBX.B, CMP.B, or NEG.B
instruction is executed, this flag is set to 1 if there is a carry or borrow at bit 3, and cleared to 0
otherwise. When the ADD.W, SUB.W, CMP.W, or NEG.W instruction is executed, the H flag is
set to 1 if there is a carry or borrow at bit 11, and cleared to 0 otherwise. When the ADD.L,
SUB.L, CMP.L, or NEG.L instruction is executed, the H flag is set to 1 if there is a carry or
borrow at bit 27, and cleared to 0 otherwise.
Bit 4—User Bit (U): Can be written and read by software using the LDC, STC, ANDC, ORC, and
XORC instructions.
Bit 3—Negative Flag (N): Stores the value of the most significant bit of data, regarded as the
sign bit.
Bit 2—Zero Flag (Z): Set to 1 to indicate zero data, and cleared to 0 to indicate non-zero data.
34
Page 83
Bit 1—Overflow Flag (V): Set to 1 when an arithmetic overflow occurs, and cleared to 0 at other
times.
Bit 0—Carry Flag (C): Set to 1 when a carry is generated by execution of an operation, and
cleared to 0 otherwise. Used by:
• Add instructions, to indicate a carry
• Subtract instructions, to indicate a borrow
• Shift and rotate instructions
The carry flag is also used as a bit accumulator by bit manipulation instructions.
Some instructions leave flag bits unchanged. Operations can be performed on CCR by the LDC,
STC, ANDC, ORC, and XORC instructions. The N, Z, V, and C flags are used by conditional
branch (Bcc) instructions.
For the action of each instruction on the flag bits, see appendix A.1, Instruction List. For the I and
UI bits, see section 5, Interrupt Controller.
2.4.4Initial CPU Register Values
In reset exception handling, PC is initialized to a value loaded from the vector table, and the I bit
in CCR is set to 1. The other CCR bits and the general registers are not initialized. In particular,
the initial value of the stack pointer (ER7) is also undefined. The stack pointer (ER7) must
therefore be initialized by an MOV.L instruction executed immediately after a reset.
35
Page 84
2.5Data Formats
The H8/300H CPU can process 1-bit, 4-bit (BCD), 8-bit (byte), 16-bit (word), and 32-bit
(longword) data. Bit-manipulation instructions operate on 1-bit data by accessing bit n (n = 0, 1,
2, …, 7) of byte operand data. The DAA and DAS decimal-adjust instructions treat byte data as
two digits of 4-bit BCD data.
2.5.1General Register Data Formats
Figures 2.6 and 2.7 show the data formats in general registers.
Data TypeData Format
1-bit data
1-bit data
4-bit BCD data
4-bit BCD data
Byte data
Byte data
Legend:
RnH : General register RH
RnL : General register RL
General
Register
RnH
RnL
RnH
RnL
RnH
RnL
70
7
6543210
Don’t care
43
70
Lower digitUpper digit
Don’t care
70
MSBLSB
Don’t care
Don’t care
70
76543210
Don’t care
43
7
Don’t care
70
MSBLSB
0
Lower digitUpper digit
36
Figure 2.6 General Register Data Formats
Page 85
General
RegisterData TypeData Format
150
Word data
Word data
Longword data
Legend:
ERn :
General register
En :
General register E
Rn :
General register R
MSB :
Most significant bit
LSB :
Least significant bit
Rn
En
ERn
150
MSBLSB
3116
MSB
MSBLSB
150
LSB
Figure 2.7 General Register Data Formats
2.5.2Memory Data Formats
Figure 2.8 shows the data formats on memory. The H8/300H CPU can access word data and
longword data on memory, but word or longword data must begin at an even address. If an attempt
is made to access word or longword data at an odd address, no address error occurs but the least
significant bit of the address is regarded as 0, so the access starts at the preceding address. This
also applies to instruction fetches.
37
Page 86
1-bit data
AddressData TypeData Format
70
76543210Address L
Byte data
Word data
Longword data
Address L
Address 2M
Address 2M + 1
Address 2N
Address 2N + 1
MSBLSB
MSB
LSB
MSB
Address 2N + 2
Address 2N + 3
LSB
Figure 2.8 Memory Data Formats
When ER7 (SP) is used as an address register to access the stack, the operand size should be word
size or longword size.
38
Page 87
2.6Instruction Set
2.6.1Instruction Set Overview
The H8/300H CPU has 64 types of instructions, which are classified in table 2.1.
2.6.3Tables of Instructions Classified by Function
Tables 2.3 to 2.10 summarize the instructions in each functional category. The operation notation
used in these tables is defined next.
Operation Notation
RdGeneral register (destination)*
RsGeneral register (source)*
RnGeneral register*
ERnGeneral register (32-bit register or address register)*
(EAd)Destination operand
(EAs)Source operand
CCRCondition code register
NN (negative) flag of CCR
ZZ (zero) flag of CCR
VV (overflow) flag of CCR
CC (carry) flag of CCR
PCProgram counter
SPStack pointer
#IMMImmediate data
dispDisplacement
+Addition
–Subtraction
×Multiplication
÷Division
∧AND logical
∨OR logical
⊕Exclusive OR logical
→Move
¬NOT (logical complement)
:3/:8/:16/:243-, 8-, 16-, or 24-bit length
Note: *General registers include 8-bit registers (R0H to R7H, R0L to R7L), 16-bit registers (R0 to
R7, E0 to E7), and 32-bit data or address registers (ER0 to ER7).
41
Page 90
Table 2.3Data Transfer Instructions
Instruction Size*Function
MOVB/W/L(EAs) → Rd, Rs → (EAd)
Moves data between two general registers or between a general register and
memory, or moves immediate data to a general register.
MOVFPEB(EAs) → Rd
Cannot be used in the H8/3062 Series.
MOVTPEBRs → (EAs)
Cannot be used in the H8/3062 Series.
POPW/L@SP+ → Rn
Pops a general register from the stack. POP.W Rn is identical to MOV.W
@SP+, Rn. Similarly, POP.L ERn is identical to MOV.L @SP+, ERn.
PUSHW/LRn → @–SP
Pushes a general register onto the stack. PUSH.W Rn is identical to MOV.W
Rn, @–SP. Similarly, PUSH.L ERn is identical to MOV.L ERn, @–SP.
Note: *Size refers to the operand size.
B : Byte
W: Word
L : Longword
42
Page 91
Table 2.4Arithmetic Operation Instructions
Instruction Size*Function
ADD,SUBB/W/LRd ± Rs → Rd, Rd ± #IMM → Rd
Performs addition or subtraction on data in two general registers, or on
immediate data and data in a general register. (Immediate byte data cannot
be subtracted from data in a general register. Use the SUBX or ADD
instruction.)
ADDX,
SUBX
INC,
DEC
ADDS,
SUBS
DAA,
DAS
MULXUB/WRd × Rs → Rd
MULXSB/WRd × Rs → Rd
BRd ± Rs ± C → Rd, Rd ± #IMM ± C → Rd
Performs addition or subtraction with carry or borrow on data in two general
registers, or on immediate data and data in a general register.
B/W/LRd ± 1 → Rd, Rd ± 2 → Rd
Increments or decrements a general register by 1 or 2. (Byte operands can
be incremented or decremented by 1 only.)
LRd ± 1 → Rd, Rd ± 2 → Rd, Rd ± 4 → Rd
Adds or subtracts the value 1, 2, or 4 to or from data in a 32-bit register.
BRd decimal adjust → Rd
Decimal-adjusts an addition or subtraction result in a general register by
referring to CCR to produce 4-bit BCD data.
Performs unsigned multiplication on data in two general registers:
either 8 bits × 8 bits → 16 bits or 16 bits × 16 bits → 32 bits.
Performs signed multiplication on data in two general registers:
either 8 bits × 8 bits → 16 bits or 16 bits × 16 bits → 32 bits.
43
Page 92
Instruction Size*Function
DIVXUB/WRd ÷ Rs → Rd
Performs unsigned division on data in two general registers: either 16 bits ÷ 8
bits → 8-bit quotient and 8-bit remainder or 32 bits ÷ 16 bits → 16-bit quotient
and 16-bit remainder
DIVXSB/WRd ÷ Rs → Rd
Performs signed division on data in two general registers: either 16 bits ÷ 8
bits → 8-bit quotient and 8-bit remainder, or 32 bits ÷ 16 bits → 16-bit
quotient and 16-bit remainder
CMPB/W/LRd – Rs, Rd – #IMM
Compares data in a general register with data in another general register or
with immediate data, and sets CCR according to the result.
NEGB/W/L0 – Rd → Rd
Takes the two’s complement (arithmetic complement) of data in a general
register.
EXTSW/LRd (sign extension) → Rd
Extends byte data in the lower 8 bits of a 16-bit register to word data, or
extends word data in the lower 16 bits of a 32-bit register to longword data,
by extending the sign bit.
EXTUW/LRd (zero extension) → Rd
Extends byte data in the lower 8 bits of a 16-bit register to word data, or
extends word data in the lower 16 bits of a 32-bit register to longword data,
by padding with zeros.
Note: *Size refers to the operand size.
B : Byte
W: Word
L : Longword
44
Page 93
Table 2.5Logic Operation Instructions
Instruction Size*Function
ANDB/W/LRd ∧ Rs → Rd, Rd ∧ #IMM → Rd
Performs a logical AND operation on a general register and another general
register or immediate data.
ORB/W/LRd ∨ Rs → Rd, Rd ∨ #IMM → Rd
Performs a logical OR operation on a general register and another general
register or immediate data.
XORB/W/LRd ⊕ Rs → Rd, Rd ⊕ #IMM → Rd
Performs a logical exclusive OR operation on a general register and another
general register or immediate data.
NOTB/W/L¬ Rd → Rd
Takes the one’s complement (logical complement) of general register
contents.
Note: *Size refers to the operand size.
B : Byte
W: Word
L : Longword
Table 2.6Shift Instructions
Instruction Size*Function
SHAL,
SHAR
SHLL,
SHLR
ROTL,
ROTR
ROTXL,
ROTXR
Note: *Size refers to the operand size.
B/W/LRd (shift) → Rd
Performs an arithmetic shift on general register contents.
B/W/LRd (shift) → Rd
Performs a logical shift on general register contents.
B/W/LRd (rotate) → Rd
Rotates general register contents.
B/W/LRd (rotate) → Rd
Rotates general register contents, including the carry bit.
B : Byte
W: Word
L : Longword
45
Page 94
Table 2.7Bit Manipulation Instructions
Instruction Size*Function
BSETB1 → (<bit-No.> of <EAd>)
Sets a specified bit in a general register or memory operand to 1. The bit
number is specified by 3-bit immediate data or the lower 3 bits of a general
register.
BCLRB0 → (<bit-No.> of <EAd>)
Clears a specified bit in a general register or memory operand to 0. The bit
number is specified by 3-bit immediate data or the lower 3 bits of a general
register.
BNOTB¬ (<bit-No.> of <EAd>) → (<bit-No.> of <EAd>)
Inverts a specified bit in a general register or memory operand. The bit
number is specified by 3-bit immediate data or the lower 3 bits of a general
register.
BTSTB¬ (<bit-No.> of <EAd>) → Z
Tests a specified bit in a general register or memory operand and sets or
clears the Z flag accordingly. The bit number is specified by 3-bit immediate
data or the lower 3 bits of a general register.
BANDBC ∧ (<bit-No.> of <EAd>) → C
ANDs the carry flag with a specified bit in a general register or memory
operand and stores the result in the carry flag.
The bit number is specified by 3-bit immediate data.
BIANDBC ∧ [¬ (<bit-No.> of <EAd>)] → C
ANDs the carry flag with the inverse of a specified bit in a general register or
memory operand and stores the result in the carry flag.
The bit number is specified by 3-bit immediate data.
46
Page 95
Instruction Size*Function
BORBC ∨ (<bit-No.> of <EAd>) → C
ORs the carry flag with a specified bit in a general register or memory
operand and stores the result in the carry flag.
The bit number is specified by 3-bit immediate data.
BIORBC ∨ [¬ (<bit-No.> of <EAd>)] → C
ORs the carry flag with the inverse of a specified bit in a general register or
memory operand and stores the result in the carry flag.
The bit number is specified by 3-bit immediate data.
BXORBC ⊕ (<bit-No.> of <EAd>) → C
Exclusive-ORs the carry flag with a specified bit in a general register or
memory operand and stores the result in the carry flag.
The bit number is specified by 3-bit immediate data.
BIXORBC ⊕ [¬ (<bit-No.> of <EAd>)] → C
Exclusive-ORs the carry flag with the inverse of a specified bit in a general
register or memory operand and stores the result in the carry flag.
The bit number is specified by 3-bit immediate data.
BLDB(<bit-No.> of <EAd>) → C
Transfers a specified bit in a general register or memory operand to the carry
flag.
The bit number is specified by 3-bit immediate data.
BILDB¬ (<bit-No.> of <EAd>) → C
Transfers the inverse of a specified bit in a general register or memory
operand to the carry flag.
The bit number is specified by 3-bit immediate data.
BSTBC → (<bit-No.> of <EAd>)
Transfers the carry flag value to a specified bit in a general register or
memory operand.
The bit number is specified by 3-bit immediate data.
BISTBC →¬ (<bit-No.> of <EAd>)
Transfers the inverse of the carry flag value to a specified bit in a general
register or memory operand.
The bit number is specified by 3-bit immediate data.
Note: *Size refers to the operand size.
B : Byte
47
Page 96
Table 2.8Branching Instructions
Instruction SizeFunction
Bcc—Branches to a specified address if address specified condition is met. The
branching conditions are listed below.
MnemonicDescriptionCondition
BRA (BT)Always (true)Always
BRN (BF)Never (false)Never
BHIHighC ∨ Z = 0
BLSLow or sameC ∨ Z = 1
Bcc (BHS)Carry clear (high or same) C = 0
BCS (BLO)Carry set (low)C = 1
BNENot equalZ = 0
BEQEqualZ = 1
BVCOverflow clearV = 0
BVSOverflow setV = 1
BPLPlusN = 0
BMIMinusN = 1
BGEGreater or equalN ⊕ V = 0
BLTLess thanN ⊕ V = 1
BGTGreater thanZ ∨ (N ⊕ V) = 0
BLELess or equalZ ∨ (N ⊕ V) = 1
JMP—Branches unconditionally to a specified address.
BSR—Branches to a subroutine at a specified address.
JSR—Branches to a subroutine at a specified address.
RTS—Returns from a subroutine.
48
Page 97
Table 2.9System Control Instructions
Instruction Size*Function
TRAPA—Starts trap-instruction exception handling.
RTE—Returns from an exception-handling routine.
SLEEP—Causes a transition to the power-down state.
LDCB/W(EAs) → CCR
Moves the source operand contents to the condition code register. The
condition code register size is one byte, but in transfer from memory, data is
read by word access.
STCB/WCCR → (EAd)
Transfers the CCR contents to a destination location. The condition code
register size is one byte, but in transfer to memory, data is written by word
access.
ANDCBCCR ∧ #IMM → CCR
Logically ANDs the condition code register with immediate data.
ORCBCCR ∨ #IMM → CCR
Logically ORs the condition code register with immediate data.
XORCBCCR ⊕ #IMM → CCR
Logically exclusive-ORs the condition code register with immediate data.
Block transfer instruction. This instruction transfers the number of data bytes
specified by R4L or R4, starting from the address indicated by ER5, to the
location starting at the address indicated by ER6. At the end of the transfer,
the next instruction is executed.
2.6.4Basic Instruction Formats
The H8/300H instructions consist of 2-byte (word) units. An instruction consists of an operation
field (OP field), a register field (r field), an effective address extension (EA field), and a condition
field (cc).
Operation Field: Indicates the function of the instruction, the addressing mode, and the operation
to be carried out on the operand. The operation field always includes the first 4 bits of the
instruction. Some instructions have two operation fields.
Register Field: Specifies a general register. Address registers are specified by 3 bits, data registers
by 3 bits or 4 bits. Some instructions have two register fields. Some have no register field.
Effective Address Extension: 8, 16, or 32 bits specifying immediate data, an absolute address, or
a displacement. A 24-bit address or displacement is treated as 32-bit data in which the first 8 bits
are 0 (H'00).
Condition Field: Specifies the branching condition of Bcc instructions.
Figure 2.9 shows examples of instruction formats.
50
Page 99
Operation field only
op
Operation field and register fields
oprnrm
Operation field, register fields, and effective address extension
oprnrm
EA (disp)
Operation field, effective address extension, and condition field
opccEA (disp)
NOP, RTS, etc.
ADD.B Rn, Rm, etc.
MOV.B @(d:16, Rn), Rm
BRA d:8
Figure 2.9 Instruction Formats
2.6.5Notes on Use of Bit Manipulation Instructions
The BSET, BCLR, BNOT, BST, and BIST instructions read a byte of data, modify a bit in the
byte, then write the byte back. Care is required when these instructions are used to access registers
with write-only bits, or to access ports.
StepDescription
1ReadRead one data byte at the specified address
2ModifyModify one bit in the data byte
3WriteWrite the modified data byte back to the specified address
Example 1: BCLR is executed to clear bit 0 in the port 4 data direction register (P4DDR) under
the following conditions.
P47, P46:Input pins
P45 – P40: Output pins
The intended purpose of this BCLR instruction is to switch P40 from output to input.
Explanation: To execute the BCLR instruction, the CPU begins by reading P4DDR. Since
P4DDR is a write-only register, it is read as H'FF, even though its true value is H'3F.
Next the CPU clears bit 0 of the read data, changing the value to H'FE.
Finally, the CPU writes this value (H'FE) back to P4DDR to complete the BCLR instruction.
As a result, P40DDR is cleared to 0, making P40 an input pin. In addition, P47DDR and P46DDR
are set to 1, making P47 and P46 output pins.
The BCLR instruction can be used to clear flags in the on-chip registers to 0. In the case of the
IRQ status register (ISR), for example, a flag must be read as a condition for clearing it, but when
using the BCLR instruction, if it is known that a flag has been set to 1 in an interrupt-handling
routine, for instance, it is not necessary to read the flag ahead of time.
52
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.