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 3
Preface
The H8/3062 Series is a series of high-performance single-chip microcontrollers that integrate
system supporting functions together with an H8/300H CPU core.
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.
The on-chip supporting 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), an A/D converter, a D/A converter, I/O ports, and other facilities. The twochannel SCI supports a smart card interface handling ISO/IEC7816-3 character transmission as an
expansion function. Functions have also been added to reduce power consumption in batterypowered applications: individual modules can be placed in standby mode, and the frequency of the
system clock supplied to the chip can be divided under program control.
The address space is divided into eight areas. The data bus width and access cycle length can be
selected independently for each area, simplifying the connection of different types of memory.
Seven MCU operating modes (modes 1 to 7) are provided, offering a choice of initial data bus
width and address space size.
With these features, the H8/3062 Series enables easy implementation of compact, highperformance systems.
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 rewritten after the chip is mounted on a board. This
version offers flexibility in the development of new products to meet fast-changing market needs.
This manual describes the H8/3062 Series hardware. For details of the instruction set, refer to the
H8/300H Series Programming Manual.
Note: * F-ZTAT™ is a trademark of Hitachi, Ltd.
Page 4
List of Items Revised or Added for This Version
PageItemDescription
All—H8/3064F-ZTAT and
H8/3062F-ZTAT A-Mask
Version descriptions added
Product code descriptions
amended
2Table 1.1 FeaturesCPU Description amended
6Figure 1.1 Block DiagramNotes amended
7Table 1.2 Comparison of H8/3062 Series Pin
Arrangements
10Figure 1.4 Pin Arrangement of H8/3064F-ZTAT and
H8/3062F-ZTAT A-Mask Version(FP-100B or TFP100B Package, Top View)
11Figure 1.5 Pin Arrangement of H8/3064F-ZTAT and
H8/3062F-ZTAT A-Mask Version(FP-100A Package,
Top View)
12 to
15
19Table 1.4 Pin Assignments in Each ModeNotes amended
201.4.1 Pin ArrangementDescription added
22Table 1.6 Differences between H8/3062F-ZTAT,
221.5 Notes on H8/3064F-ZTAT and H8/3062F-ZTAT
1.3.2 Pin Functions
Table 1.3 Pin Functions
H8/3062F-ZTAT R-Mask Version, and On-Chip Mask
ROM Versions
A-Mask Version
Added
Added
Added
Description added and
revised
Description added
Added
221.5.1 Pin ArrangementDescription revised
24, 251.5.3 VCL PinDescription added
24Figure 1.6 H8/3062F-ZTAT A-Mask Version and
H8/3064F-ZTAT
25Figure 1.7 Difference between 5 V and 3 V Operation
Models
261.6 Setting Oscillation Settling Wait TimeAdded
261.7 Caution on Crystal Resonator ConnectionDescription added
27, 282.1.1 FeaturesDescription added
372.6.1 Instruction Set OverviewTotal number of instructions
Description amended
Description added
amended
Page 5
PageItemDescription
44, 45Table 2.7 Bit Manipulation InstructionsFunction descriptions added
49, 502.6.5 Notes on Use of Bit Manipulation InstructionsDescription added
54Table 2.13 Effective Address CalculationNo. 1 Addressing Mode and
Instruction Format amended
65Table 3.1 Operating Mode SelectionTable amended
663.1.1 Operating Mode SelectionDescription added
703.4.5 Mode 5Description added
723.6.1 Comparison of H8/3062 Series Memory MapsAdded
80Figure 3.4 H8/3064F-ZTAT Memory Map in Each
Added
Operating Mode
80, 81Figure 3.4 H8/3064F-ZTAT Memory Map in Each
Addresses revised
Operating Mode
1326.2.5 Bus Control Register(BCR)Bit 1
Note added
136,
Figure 6.3 Memory Map in 16-Mbyte ModeDescription added
137
153Figure 6.17 Example of Wait State Insertion TimingAmended
205 to
Table 7.21 Port A Pin Functions (Modes 1 to 7)Description added
207
212,
Table 7.23 Port B Pin Functions (Modes 1 to 5)Description added
213
214,
Table 7.24 Port B Pin Functions (Modes 6 and 7)Description amended
215
217 to
Section 8 16-Bit TimerRegister names amended
279
2428.2.11 Timer Output Level Setting Register C (TOLR)Description added
281 to
Section 9 8-Bit TimersRegister names amended
318
285Table 9.2 8-Bit Timer RegistersInitial value amended
2889.2.3 Time Constant Registers B (TCORB)Note added
290,
9.2.4 Timer Control Register (8TCR)Descriptions of bits 4 to 0
291
292 to
9.2.5 Timer control/status registerDescription added and
296
298Figures 9.5 and 9.7 8TCNT Access OperationsAmended
(8TCSR2)
amended
amended
Page 6
PageItemDescription
302 to
306
9.4.4 Timing of Status Flag Setting
9.4.5 Operation with Cascaded Connection
Description amended
9.4.6 Input Capture Setting
3079.5.1 Interrupt SourcesDescription amended
3089.6 8-Bit Timer Application ExampleAmended
3159.7.7 Contention between 8TCNT Byte Write and
Description amended
Increment in 16-Bit Count Mode (Cascaded
Connection)
Figure 9.24 Contention between 8TCNT Byte Write
and Increment in 16-Bit Count Mode
379Table 12.3 Examples of Bit Rates and BRR Settings in
25 MHz added
Asynchronous Mode
380Table 12.4 Examples of Bit Rates and BRR Settings in
25 MHz added
Synchronous Mode
382Table 12.5 Maximum Bit Rates for Various
25 MHz added
Frequencies (Asynchronous Mode)
383Table 12.6 Maximum Bit Rates with External Clock
25 MHz added
Input (Asynchronous Mode)
384Table 12.7 Maximum Bit Rates with External Clock
25 MHz added
Input (Synchronous Mode)
391Figure 12.5 Sample Flowchart for Transmitting Serial
Description added
Data
41713.1 OverviewDescription amended
430Table 13.5 Bit Rates (bits/s) for Various BRR Settings
Versions
626Table 20.5 Comparison of H8/3062 Series Operating
Revised
Frequency Ranges
63521.4.3 Selection of Waiting Time for Exit from
Software Standby Mode
When Using External Clock
Amendment and addition of 1
and 2
636Table 21.3 Clock Frequency and Waiting Time for
25 MHz added
Clock to Settle
63821.4.6 Cautions on Clearing the software Standby
Mode of F-ZTAT Version
643Table 22.1 Electrical Characteristics of H8/3062
Addition of (3) Comparison of
products in H8/3062 Series
Added
Series Products
650Table 22.3 DC Characteristics (2)Current dissipation typ value
amended
Page 8
PageItemDescription
653Table 22.3 DC Characteristics (3)Current dissipation typ value
amended
658Table 22.6 Control Signal TimingDescription added
669Table 22.12 DC Characteristics (1)Note 4 added
672Table 22.12 DC Characteristics (2)Note 4 added
676Table 22.15 Control Signal TimingDescription added
688 to
22.3 Electrical Characteristics of H8/3064F-ZTATAdded
709
710 to
731
738Figure 22.19 Basic Bus Cycle: Three-State Access
22.4 Electrical Characteristics of H8/3062F-ZTAT AMask Version
Added
Amended
with One Wait State
768Table B.1 Comparison of H8/3062 Series Internal I/O
Table added
Register Specifications
779 to
B.2 Address List (H8/3064F-ZTAT)Table added
788
789 to
B.3 Address List (H8/3062F-ZTAT A-Mask Version)Table added
798
799 to
873
B.4 FunctionsAmendments and additions
Note added
912Table F.1 H8/3062 SeriesH8/3064F-ZTAT and
H8/3062F-ZTAT A-mask
version added
919H.1 Differences between H8/3067 and H8/3062
Series, H8/3048 Series, H8/3007 and H8/3006, and
A/D converter conversion
states added
H8/3002
923Table H.1 Pin Arrangement of Each ProductNote amended
Page 9
Comparison of H8/3062 Series Product Specifications
There are seven members of the H8/3062 Series: the H8/3062F-ZTAT, H8/3062F-ZTAT R-mask
version, H8/3062F-ZTAT A-mask version, and H8/3064F-ZTAT (all with on-chip flash memory),
and the H8/3062 mask ROM version, H8/3061 mask ROM version, and H8/3060 mask ROM
version.
The specifications of these products are compared below.
H8/3062 Mask
ROM Version,
H8/3061 Mask
ROM Version,
H8/3062F-ZTAT
H8/3062F-ZTAT
R-Mask Version
H8/3060 Mask
ROM VersionH8/3064F-ZTAT
H8/3062F-ZTAT
A-Mask Version
Product
specifications
Product
code
Pin
arrangement
RAM size4 kbytes4 kbytesH8/3062:
On-chip singlepower-supply
flash memory
HD64F3062HD64F3062RHD6433062
See figures 1.2
and 1.3, Pin
Arrangement, in
section 1
H8/3062F-ZTAT
version with
address output
functions added
See figures 1.2
and 1.3, Pin
Arrangement, in
section 1
Mask ROM
version
HD6433061
HD6433060
See figures 1.2
and 1.3, Pin
Arrangement, in
section 1
Appendix HComparison of H8/300H Series Product Specifications.................. 917
H.1 Differences between H8/3067 and H8/3062 Series, H8/3048 Series,
H8/3007 and H8/3006, and H8/3002.................................................................................. 917
H.2 Comparison of Pin Functions of 100-Pin Package Products (FP-100B, TFP-100B)......... 920
xv
Page 26
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 seven 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, and H8/3062F-ZTAT A-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 27
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-ZTZT
Maximum
clock rate
20 MHz100 ns700 ns
Add
/subtract
Multiply
/divide
H8/3062F-ZTAT R-Mask version
H8/3062 (mask ROM version)
H8/3061 (mask ROM version)
H8/3060 (mask ROM version)
H8/3064F-ZTAT
25 MHz80 ns560 ns
H8/3062F-ZTAT A-Mask version
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
MemoryROMRAM
H8/3062F-ZTAT
128 kbytes4 kbytes
H8/3062F-ZTAT R-mask version
H8/3062F-ZTAT A-mask version
H8/3062 (mask ROM version)
H8/3061 (mask ROM version)96 kbytes4 kbytes
H8/3060 (mask ROM version)64 kbytes2 kbytes
H8/3064F-ZTAT256 kbytes8 kbytes
Interrupt
controller
• Seven external interrupt pins: NMI, IRQ
• 27 internal interrupts
to IRQ
0
5
• Three selectable interrupt priority levels
2
Page 28
FeatureDescription
Bus controller
16-bit timer,
3 channels
• 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 mask ROM versions, and as FWE in the on-chip flash memory versions.
2. The 5 V operation models of the H8/3064F-ZTAT and the H8/3062F-ZTAT A-mask version have a V
require the connection of an external capacitor.
6
Port A
7
6
5
4
3
3
/PB
11
/TP
3
/TMIO
4
CS
2
/PB
10
/TP
2
/TMO
5
CS
1
/PB
9
/TP
1
/TMIO
6
CS
0
/PB
8
/TP
0
/TMO
7
CS
/PA
/PA
7
6
/TP
/TP
2
2
/TIOCB
/TIOCA
20
21
A
A
/PA
5
/TP
1
/TIOCB
22
A
2
/PA
/PA
/PA
4
3
2
/TP
/TP
/TP
1
0
0
/TIOCA
23
A
TCLKD/TIOCB
TCLKC/TIOCA
1
/PA
1
TCLKB/TP
Figure 1.1 Block Diagram
0
REF
/PA
V
0
TCLKA/TP
CC
AV
AV
Port 7
7
6
5
4
3
2
1
SS
/P7
/P7
/P7
/P7
5
AN
4
AN
/P7
3
AN
7
/AN
1
DA
6
/AN
0
DA
/P7
2
AN
/P7
1
AN
0
/P7
0
AN
pin, and
CL
Page 32
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 5 V operation models of the
H8/3064F-ZTAT and the H8/3062F-ZTAT A-mask version have a VCL pin. See section 1.5, Notes
on H8/3064F-ZTAT and H8/3062F-ZTAT A-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
H8/3062
F-ZTAT
H8/3064
H8/3062F-ZTAT,H8/3062H8/3061H8/3060
F-ZTAT
PinH8/3062F-ZTATMask ROMMask ROM Mask ROMOperation Model
PackageNumber R-Mask VersionVersionVersionVersion5 V3 V5 V3 V
Note: * VCL pin in 5 V operation models, VCC pin in 3 V operation models.
An external capacitor must be connected to the VCL pin.
Figure 1.5 Pin Arrangement of H8/3064F-ZTAT and H8/3062F-ZTAT A-Mask Version
(FP-100A Package, Top View)
11
Page 37
1.3.2Pin Functions
Table 1.3 summarizes the pin functions. The H8/3064F-ZTAT and the H8/3062F-ZTAT A-mask
version 5 V operation models have a VCL pin, and require the connection of an external capacitor.
Table 1.3Pin Functions
Pin No.
FP-100B
TypeSymbol
TFP-100B FP-100A I/OName and Function
PowerV
CC
1*1, 35,
68
3*1, 37,70InputPower: For connection to the power supply.
Connect all V
pins to the system power
CC
supply.
Internal
step-down
pin
V
SS
V
CL
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). Do not connect to V
V
CL
0.1 µF
ClockXTAL6769InputFor connection to a crystal resonator.
For examples of crystal resonator and external
clock input, see section 20, Clock Pulse
Generator.
EXTAL6668InputFor connection to a crystal resonator or input
of an external clock signal. For examples of
crystal resonator and external clock input, see
section 20, Clock Pulse Generator.
CC
.
Operating
mode
control
12
φ6163Output System clock: Supplies the system clock to
external devices.
MD2 to
MD
0
75 to 7377 to 75InputMode 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 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 and the H8/3062F-ZTAT A-mask version, this pin functions as V
CL
in 5 V operation models, and as VCC in 3 V operation models.
19
Page 45
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
(HD64F3062) and the H8/3062F-ZTAT R-mask version (HD64F3062R). 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 A-mask
version and H8/3064F-ZTAT 5 V operation models.
20
Page 46
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-100Product type nameHD64F3062TEHD64F3062RTE
Sample markings
FP-100BProduct type nameHD64F3062FHD64F3062RF
Sample markings
FP-100AProduct type nameHD64F3062FPHD64F3062RFP
Sample markings
H8/3062
HD
64F3062TE20
JAPAN
H8/3062
HD
64F3062F20
JAPAN
H8/3062
HD
64F3062FP20
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
H8/3062
R
HD
64F3062FP20
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.
JAPAN
JAPAN
“R” is printed above the type name
21
Page 47
Table 1.6Differences between H8/3062F-ZTAT, H8/3062F-ZTAT R-Mask Version, and
On-Chip Mask ROM Versions
On-Chip FlashOn-Chip Flash
Memory Version
Item
HD64F3062
ROM128 kbytes flash
memory
Address
output
functions
ADRCR
register
(H'FEE01E)
Compatible with
previous H8/300H
Series
—
Corresponding
address consists of
reserved bits
Memory Version
HD64F3062RHD6433062 HD6433061 HD6433060
128 kbytes flash
memory
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
—
See the section on the bus controller for the bit function.
On-Chip Mask ROM Versions
128 kbytes
mask ROM
4
—
96 kbytes
mask ROM
3
—
2
—
64 kbytes
mask ROM
1
—
The address output functions and ADRCR register specification of the H8/3064F-ZTAT and
H8/3062F-ZTAT A-mask version are the same as for the H8/3062F-ZTAT R-mask version.
0
ADRCTL
1.5Notes on H8/3064F-ZTAT and H8/3062F-ZTAT A-Mask Version
The H8/3062 Series includes one model with 128-kbyte on-chip flash memory, the H8/3062FZTAT A-mask version (HD64F3062A) 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
(HD64F3064).
The H8/3062F-ZTAT A-mask version and H8/3064F-ZTAT have the following features:
1. Low power consumption
2. Low-voltage, high-speed operation
3. Functional compatibility with the H8/3062F-ZTAT R-mask version
4. Pin arrangement compatibility (except for the VCL pin in 5 V operation models)
Points to be noted when using the H8/3062F-ZTAT A-mask version or the H8/3064F-ZTAT are
given below.
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 and H8/3062F-ZTAT A-mask version 5 V
operation models. 3 V operation models have no VCL pin, and so have an identical pin
arrangement.
22
Page 48
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 and the H8/3062F-ZTAT A-mask version and H8/3064F-ZTAT.
Table 1.7Differences in H8/3062F-ZTAT R-Mask Version, H8/3062F-ZTAT A-Mask
Version, and H8/3064F-ZTAT Markings
TFP-100Product type
name
Sample
markings
FP-100BProduct type
name
Sample
markings
H8/3062F-ZTAT
R-Mask Version
HD64F3062RTEHD64F3062ATEHD64F3064TE
H8/3062
R
HD
64F3062TE20
JAPAN
HD64F3062RFHD64F3062AFHD64F3064F
H8/3062
R
HD
64F3062F20
JAPAN
H8/3062F-ZTAT
A-Mask VersionH8/3064F-ZTAT
H8/3062
A
HD
64F3062TE20
JAPAN
“A” is printed above
the type name
H8/3062
A
HD
64F3062F20
JAPAN
H8/3064
HD
64F3064TE20
JAPAN
H8/3064
HD
64F3064F20
JAPAN
FP-100AProduct type
name
Sample
markings
“A” is printed above
the type name
HD64F3062RFPHD64F3062AFPHD64F3064FP
H8/3062
R
HD
64F3062FP20
JAPAN
“A” is printed above
the type name
H8/3062
A
HD
64F3062FP20
JAPAN
H8/3064
HD
64F3064FP20
JAPAN
23
Page 49
1.5.3VCL Pin
The H8/3064F-ZTAT and H8/3062F-ZTAT A-mask version 5 V operation models have a V
(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 models (H8/3062, H8/3061, and
H8/3060).
VCC power
supply
External
capacitor
0.1 µF
V
CL
H8/3062F-ZTAT
A-mask version or
H8/3064F-ZTAT
(5 V operation model)
V
CC
H8/3062F-ZTAT R-mask
version
H8/3062 mask ROM version
H8/3061 mask ROM version
H8/3060 mask ROM version
CL
CC
Do not connect the V
the V
supply to other V
pin. (Connect the VCC power
CL
CC
power supply to
CC
pins as usual.)
Place the capacitor close to the pin.
These versions have a V
pin in the same pin position as a V
power supply
CC
CC
pin in
the H8/3062F-ZTAT A-mask version and
the H8/3064F-ZTAT.
Figure 1.6 H8/3062F-ZTAT A-Mask Version and H8/3064F-ZTAT
The 3 V operation models of the H8/3064F-ZTAT and the H8/3062F-ZTAT A-mask version do
not have a VCL pin. The 3 V operation models have a VCC power supply pin at the location of the
VCL pin in the 5 V operation models. Therefore, 3 V operation models do not require connection of
an external capacitor, and this pin should be connected to the power supply in the same way as
other VCC pins.
24
Page 50
External
capacitor
VCC power
supply
V
CL
V
CC
0.1 µF
5 V operation model
3 V operation model
Figure 1.7 Difference between 5 V and 3 V Operation Models
1.5.4Note on Changeover to Mask ROM Version
Care is required when changing from the H8/3062F-ZTAT A-mask version with on-chip flash
memory to a model with on-chip mask ROM (H8/3062, H8/3061, or H8/3060).
An external capacitor must be connected to the VCL pin of the H8/3062F-ZTAT A-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.
H8/3062 Series chip
V
pin
CC
V
pin
CL
V
CC
supply
power
← Land pattern for mask ROM version
(0 Ω resistance mounted)
← Land pattern for H8/3062F-ZTAT A-mask version
(0.1 µF capacitor mounted)
Figure 1.8 Example of Board Pattern Providing for External Capacitor
25
Page 51
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 and the H8/3062F-ZTAT A-mask version, 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, Setting Oscillation Settling Wait Time after Exiting
Software Standby Mode.
1.7Caution on Crystal Resonator Connection
The H8/3064F-ZTAT and H8/3062F-ZTAT A-mask version 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.
26
Page 52
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-
• 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.
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
Maximum 64 kbytes, program
and data areas combined
CPU operating modes
Figure 2.1 CPU Operating Modes
28
Advanced mode
Maximum 16 Mbytes, program
and data areas combined
Page 54
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'FFFFF
a. 1-Mbyte modeb. 16-Mbyte mode
Figure 2.2 Memory Map
H'000000
H'FFFFFF
Advanced modeNormal mode
29
Page 55
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
Legend:
SP:
PC:
CCR:
I:
UI:
H:
U:
N:
Z:
V:
C:
Stack pointer
Program counter
Condition code register
Interrupt mask bit
User bit or interrupt mask bit
Half-carry flag
User bit
Negative flag
Zero flag
Overflow flag
Carry flag
E0
E1
E2
E3
E4
E5
E6
E7
230
(SP)
R0H
R1H
R2H
R3H
R4H
R5H
R6H
R7H
CCR
7
IUIHUNZVC
R0L
R1L
R2L
R3L
R4L
R5L
R6L
R7L
6543210
30
Figure 2.3 CPU Registers
Page 56
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.
31
Page 57
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.
32
Page 58
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.
33
Page 59
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.
General
Data TypeData Format
1-bit data
1-bit data
Register
RnH
RnL
70
7
6543210
Don’t care
Don’t care
70
76543210
4-bit BCD data
4-bit BCD data
Byte data
Byte data
Legend:
RnH: General register RH
RnL: General register RL
Figure 2.6 General Register Data Formats
RnH
RnL
RnH
RnL
70
70
MSBLSB
43
Lower digitUpper digit
Don’t care
Don’t care
Don’t care
7
70
MSBLSB
43
Don’t care
0
Lower digitUpper digit
34
Page 60
Word data
General
RegisterData TypeData Format
150
Rn
MSBLSB
150
Word data
Longword data
Legend:
ERn:
En:
Rn:
MSB:
LSB:
General register
General register E
General register R
Most significant bit
Least significant bit
En
ERn
MSBLSB
3116
MSB
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.
35
Page 61
AddressData T ypeData Format
70
1-bit data
Byte data
Word data
Longword data
76543210Address L
Address L
Address 2M
MSBLSB
MSB
Address 2M + 1
Address 2N
MSB
Address 2N + 1
Address 2N + 2
Address 2N + 3
Figure 2.8 Memory Data Formats
LSB
LSB
When ER7 (SP) is used as an address register to access the stack, the operand size should be word
size or longword size.
36
Page 62
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).
39
Page 65
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 this LSI.
MOVTPEBRs → (EAs)
Cannot be used in this LSI.
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
40
Page 66
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
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.
INC,
DEC
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.)
ADDS,
SUBS
DAA,
DAS
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.
MULXUB/WRd × Rs → Rd
Performs unsigned multiplication on data in two general registers:
either 8 bits × 8 bits → 16 bits or 16 bits × 16 bits → 32 bits.
MULXSB/WRd × Rs → Rd
Performs signed multiplication on data in two general registers:
either 8 bits × 8 bits → 16 bits or 16 bits × 16 bits → 32 bits.
41
Page 67
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
42
Page 68
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
43
Page 69
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.
44
Page 70
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
45
Page 71
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
46
Page 72
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.4 Basic 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: Eight, 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.
48
Page 74
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)
Figure 2.9 Instruction Formats
2.6.5Notes on Use of Bit Manipulation Instructions
NOP, RTS, etc.
ADD.B Rn, Rm, etc.
MOV.B @(d:16, Rn), Rm
BRA d:8
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.
50
Page 76
2.7 Addressing Modes and Effective Address Calculation
2.7.1Addressing Modes
The H8/300H CPU supports the eight addressing modes listed in table 2.11. Each instruction uses
a subset of these addressing modes. Arithmetic and logic instructions can use the register direct
and immediate modes. Data transfer instructions can use all addressing modes except programcounter relative and memory indirect. Bit manipulation instructions use register direct, register
indirect, or absolute (@aa:8) addressing mode to specify an operand, and register direct (BSET,
BCLR, BNOT, and BTST instructions) or immediate (3-bit) addressing mode to specify a bit
number in the operand.
Table 2.11Addressing Modes
No.Addressing ModeSymbol
1Register directRn
2Register indirect@ERn
3Register indirect with displacement@(d:16, ERn)/@(d:24, ERn)
4Register indirect with post-increment
1 Register Direct—Rn: The register field of the instruction code specifies an 8-, 16-, or 32-bit
register containing the operand. R0H to R7H and R0L to R7L can be specified as 8-bit registers.
R0 to R7 and E0 to E7 can be specified as 16-bit registers. ER0 to ER7 can be specified as 32-bit
registers.
2 Register Indirect—@ERn: The register field of the instruction code specifies an address
register (ERn), the lower 24 bits of which contain the address of the operand.
3 Register Indirect with Displacement—@(d:16, ERn) or @(d:24, ERn): A 16-bit or 24-bit
displacement contained in the instruction code is added to the contents of an address register
(ERn) specified by the register field of the instruction, and the lower 24 bits of the sum specify the
address of a memory operand. A 16-bit displacement is sign-extended when added.
51
Page 77
4 Register Indirect with Post-Increment or Pre-Decrement—@ERn+ or @–ERn:
• Register indirect with post-increment—@ERn+
The register field of the instruction code specifies an address register (ERn) the lower 24 bits
of which contain the address of a memory operand. After the operand is accessed, 1, 2, or 4 is
added to the address register contents (32 bits) and the sum is stored in the address register.
The value added is 1 for byte access, 2 for word access, or 4 for longword access. For word or
longword access, the register value should be even.
• Register indirect with pre-decrement—@–ERn
The value 1, 2, or 4 is subtracted from an address register (ERn) specified by the register field
in the instruction code, and the lower 24 bits of the result become the address of a memory
operand. The result is also stored in the address register. The value subtracted is 1 for byte
access, 2 for word access, or 4 for longword access. For word or longword access, the resulting
register value should be even.
5 Absolute Address—@aa:8, @aa:16, or @aa:24: The instruction code contains the absolute
address of a memory operand. The absolute address may be 8 bits long (@aa:8), 16 bits long
(@aa:16), or 24 bits long (@aa:24). For an 8-bit absolute address, the upper 16 bits are all
assumed to be 1 (H'FFFF). For a 16-bit absolute address the upper 8 bits are a sign extension. A
24-bit absolute address can access the entire address space. Table 2.12 indicates the accessible
address ranges.
Table 2.12Absolute Address Access Ranges
Absolute
Address1-Mbyte Modes16-Mbyte Modes
8 bits (@aa:8)H'FFF00 to H'FFFFF
(1048320 to 1048575)
16 bits (@aa:16)H'00000 to H'07FFF,
H'F8000 to H'FFFFF
(0 to 32767, 1015808 to 1048575)
24 bits (@aa:24)H'00000 to H'FFFFF
(0 to 1048575)
H'FFFF00 to H'FFFFFF
(16776960 to 16777215)
H'000000 to H'007FFF,
H'FF8000 to H'FFFFFF
(0 to 32767, 16744448 to 16777215)
H'000000 to H'FFFFFF
(0 to 16777215)
6 Immediate—#xx:8, #xx:16, or #xx:32: The instruction code contains 8-bit (#xx:8), 16-bit
(#xx:16), or 32-bit (#xx:32) immediate data as an operand.
The instruction codes of the ADDS, SUBS, INC, and DEC instructions contain immediate data
implicitly. The instruction codes of some bit manipulation instructions contain 3-bit immediate
data specifying a bit number. The TRAPA instruction code contains 2-bit immediate data
specifying a vector address.
7 Program-Counter Relative—@(d:8, PC) or @(d:16, PC): This mode is used in the Bcc and
BSR instructions. An 8-bit or 16-bit displacement contained in the instruction code is sign-
52
Page 78
extended to 24 bits and added to the 24-bit PC contents to generate a 24-bit branch address. The
PC value to which the displacement is added is the address of the first byte of the next instruction,
so the possible branching range is –126 to +128 bytes (–63 to +64 words) or –32766 to
+32768 bytes (–16383 to +16384 words) from the branch instruction. The resulting value should
be an even number.
8 Memory Indirect—@@aa:8: This mode can be used by the JMP and JSR instructions. The
instruction code contains an 8-bit absolute address specifying a memory operand. This memory
operand contains a branch address. The memory operand is accessed by longword access. The first
byte of the memory operand is ignored, generating a 24-bit branch address. See figure 2.10. The
upper bits of the 8-bit absolute address are assumed to be 0 (H'0000), so the address range is 0 to
255 (H'000000 to H'0000FF). Note that the first part of this range is also the exception vector area.
For further details see section 5, Interrupt Controller.
When a word-size or longword-size memory operand is specified, or when a branch address is
specified, if the specified memory address is odd, the least significant bit is regarded as 0. The
accessed data or instruction code therefore begins at the preceding address. See section 2.5.2,
Memory Data Formats.
2.7.2Effective Address Calculation
Table 2.13 explains how an effective address is calculated in each addressing mode. In the
1-Mbyte operating modes the upper 4 bits of the calculated address are ignored in order to
generate a 20-bit effective address.
The H8/300H CPU has five processing states: the program execution state, exception-handling
state, power-down state, reset state, and bus-released state. The power-down state includes sleep
mode, software standby mode, and hardware standby mode. Figure 2.11 classifies the processing
states. Figure 2.13 indicates the state transitions.
Processing statesProgram execution state
The CPU executes program instructions in sequence
Exception-handling state
A transient state in which the CPU executes a hardware sequence
(saving PC and CCR, fetching a vector, etc.) in response to a reset,
interrupt, or other exception
Bus-released state
The external bus has been released in response to a bus request
signal from a bus master other than the CPU
Reset state
The CPU and all on-chip supporting modules are initialized and halted
Power-down state
The CPU is halted to conserve power
Figure 2.11 Processing States
2.8.2Program Execution State
Sleep mode
Software standby mode
Hardware standby mode
In this state the CPU executes program instructions in normal sequence.
57
Page 83
2.8.3Exception-Handling State
The exception-handling state is a transient state that occurs when the CPU alters the normal
program flow due to a reset, interrupt, or trap instruction. The CPU fetches a starting address from
the exception vector table and branches to that address. In interrupt and trap exception handling
the CPU references the stack pointer (ER7) and saves the program counter and condition code
register.
Types of Exception Handling and Their Priority: Exception handling is performed for resets,
interrupts, and trap instructions. Table 2.14 indicates the types of exception handling and their
priority. Trap instruction exceptions are accepted at all times in the program execution state.
Table 2.14Exception Handling Types and Priority
PriorityType of ExceptionDetection TimingStart of Exception Handling
HighResetSynchronized with clockException handling starts immediately
when RES changes from low to high
InterruptEnd of instruction
execution or end of
exception handling*
Trap instructionWhen TRAPA instruction
Low
Note: * Interrupts are not detected at the end of the ANDC, ORC, XORC, and LDC instructions,
or immediately after reset exception handling.
is executed
When an interrupt is requested,
exception handling starts at the end of
the current instruction or current
exception-handling sequence
Exception handling starts when a trap
(TRAPA) instruction is executed
Figure 2.12 classifies the exception sources. For further details about exception sources, vector
numbers, and vector addresses, see section 4, Exception Handling, and section 5, Interrupt
Controller.
Notes: 1.2.From any state except hardware standby mode, a transition to the reset state occurs
whenever goes low.
From any state, a transition to hardware standby mode occurs when goes low.
RES
STBY
Figure 2.13 State Transitions
2.8.4Exception Handling Operation
Reset Exception Handling: Reset exception handling has the highest priority. The reset state is
entered when the RES signal goes low. Reset exception handling starts after that, when RES
changes from low to high. When reset exception handling starts the CPU fetches a start address
from the exception vector table and starts program execution from that address. All interrupts,
including NMI, are disabled during the reset exception-handling sequence and immediately after it
ends.
Interrupt Exception Handling and Trap Instruction Exception Handling: When these
exception-handling sequences begin, the CPU references the stack pointer (ER7) and pushes the
program counter and condition code register on the stack. Next, if the UE bit in the system control
register (SYSCR) is set to 1, the CPU sets the I bit in the condition code register to 1. If the UE bit
is cleared to 0, the CPU sets both the I bit and the UI bit in the condition code register to 1. Then
the CPU fetches a start address from the exception vector table and execution branches to that
address.
59
Page 85
Figure 2.14 shows the stack after the exception-handling sequence.
SP–4
SP–3
SP–2
SP–1
SP (ER7)
Legend:
CCR:
SP:
Notes: 1.2.PC is the address of the first instruction executed after the return from the
Condition code register
Stack pointer
exception-handling routine.
Registers must be saved and restored by word access or longword access,
starting at an even address.
Stack area
Before exception
handling starts
SP (ER7)
SP+1
SP+2
SP+3
SP+4
Pushed on stack
CCR
PC
After exception
handling ends
Even
address
Figure 2.14 Stack Structure after Exception Handling
2.8.5Bus-Released State
In this state the bus is released to a bus master other than the CPU, in response to a bus request.
The bus masters other than the CPU is an external bus master. While the bus is released, the CPU
halts except for internal operations. Interrupt requests are not accepted. For details see section 6.6,
Bus Arbiter.
2.8.6Reset State
When the RES input goes low all current processing stops and the CPU enters the reset state. The I
bit in the condition code register is set to 1 by a reset. All interrupts are masked in the reset state.
Reset exception handling starts when the RES signal changes from low to high.
The reset state can also be entered by a watchdog timer overflow. For details see section 11,
Watchdog Timer.
60
Page 86
2.8.7Power-Down State
In the power-down state the CPU stops operating to conserve power. There are three modes: sleep
mode, software standby mode, and hardware standby mode.
Sleep Mode: A transition to sleep mode is made if the SLEEP instruction is executed while the
SSBY bit is cleared to 0 in the system control register (SYSCR). CPU operations stop
immediately after execution of the SLEEP instruction, but the contents of CPU registers are
retained.
Software Standby Mode: A transition to software standby mode is made if the SLEEP
instruction is executed while the SSBY bit is set to 1 in SYSCR. The CPU and clock halt and all
on-chip supporting modules stop operating. The on-chip supporting modules are reset, but as long
as a specified voltage is supplied the contents of CPU registers and on-chip RAM are retained.
The I/O ports also remain in their existing states.
Hardware Standby Mode: A transition to hardware standby mode is made when the STBY input
goes low. As in software standby mode, the CPU and all clocks halt and the on-chip supporting
modules are reset, but as long as a specified voltage is supplied, on-chip RAM contents are
retained.
For further information see section 21, Power-Down State.
2.9Basic Operational Timing
2.9.1Overview
The H8/300H CPU operates according to the system clock (ø). The interval from one rise of the
system clock to the next rise is referred to as a “state.” A memory cycle or bus cycle consists of
two or three states. The CPU uses different methods to access on-chip memory, the on-chip
supporting modules, and the external address space. Access to the external address space can be
controlled by the bus controller.
2.9.2On-Chip Memory Access Timing
On-chip memory is accessed in two states. The data bus is 16 bits wide, permitting both byte and
word access. Figure 2.15 shows the on-chip memory access cycle. Figure 2.16 indicates the pin
states. All H8/3062 Series models except the H8/3062F-ZTAT have a function for changing the
method of outputting addresses from the address pins. For details see section 6.3.5, Address
Output Method.
61
Page 87
Bus cycle
φ
Internal address bus
Internal read signal
Internal data bus
(read access)
Internal write signal
Internal data bus
(write access)
Figure 2.15 On-Chip Memory Access Cycle
T state
1
Address
Read data
Write data
T state
2
T
1
T
2
φ
Address bus
RD HWR LWR
, , ,AS
Address
High
High impedance
D to D
150
Figure 2.16 Pin States during On-Chip Memory Access (Address Update Mode 1)
2.9.3On-Chip Supporting Module Access Timing
The on-chip supporting modules are accessed in three states. The data bus is 8 or 16 bits wide,
depending on the internal I/O register being accessed. Figure 2.17 shows the on-chip supporting
module access timing. Figure 2.18 indicates the pin states.
62
Page 88
Bus cycle
Read
access
Write
access
T state
1
T state
2
φ
Address bus
Address
Internal read signal
Internal data bus
Read data
Internal write signal
Internal data bus
Write data
Figure 2.17 Access Cycle for On-Chip Supporting Modules
T state
3
T
1
T
2
T
3
φ
Address bus
RD HWR LWR
, , ,AS
Address
High
High impedance
D to D
150
Figure 2.18 Pin States during Access to On-Chip Supporting Modules
2.9.4Access to External Address Space
The external address space is divided into eight areas (areas 0 to 7). Bus-controller settings
determine whether each area is accessed via an 8-bit or 16-bit data bus, and whether it is accessed
in two or three states. For details see section 6, Bus Controller.
63
Page 89
Section 3 MCU Operating Modes
3.1Overview
3.1.1Operating Mode Selection
The H8/3062 Series has seven operating modes (modes 1 to 7) that are selected by the mode pins
(MD2 to MD0) as indicated in table 3.1. The input at these pins determines the size of the address
space and the initial bus mode.
Notes: 1. In modes 1 to 5, an 8-bit or 16-bit data bus can be selected on a per-area basis by
settings made in the area bus width control register (ABWCR). For details see
section 6, Bus Controller.
2. If the RAME bit in SYSCR is cleared to 0, these addresses become external addresses.
2
2
2
2
2
For the address space size there are three choices: 64 kbytes, 1 Mbyte, or 16 Mbyte. The external
data bus is either 8 or 16 bits wide depending on ABWCR settings. 8-bit bus mode is used only if
8-bit access is selected for all areas. For details see section 6, Bus Controller.
Modes 1 to 4 are externally expanded modes that enable access to external memory and peripheral
devices and disable access to the on-chip ROM. Modes 1 and 2 support a maximum address space
of 1 Mbyte. Modes 3 and 4 support a maximum address space of 16 Mbytes.
65
Page 90
Mode 5 is an externally expanded mode that enables access to external memory and peripheral
devices and also enables access to the on-chip ROM. Mode 5 supports a maximum address space
of 16 Mbytes.
Modes 6 and 7 are single-chip modes in which the chip operates using only the on-chip ROM,
RAM, and I/O registers. All ports are available in these modes. Mode 6 supports a maximum
address space of 64 kbytes. Mode 7 supports a maximum address space of 1 Mbyte.
The H8/3062 Series can be used only in modes 1 to 7. The inputs at the mode pins must select one
of these seven modes. The inputs at the mode pins must not be changed during operation. Set the
reset state before changing the inputs at these pins.
3.1.2Register Configuration
The H8/3062 Series has a mode control register (MDCR) that indicates the inputs at the mode pins
(MD2 to MD0), and a system control register (SYSCR). Table 3.2 summarizes these registers.
Table 3.2Registers
Address*NameAbbreviationR/WInitial Value
H'EE011Mode control registerMDCRRUndetermined
H'EE012System control registerSYSCRR/WH'09
Note: * Lower 20 bits of the address in advanced mode.
3.2Mode Control Register (MDCR)
MDCR is an 8-bit read-only register that indicates the current operating mode of the
H8/3062 Series.
Bit
Initial value
Read/Write
7
—
1
—
6
—
1
—
Reserved bits
5
—
0
—
4
—
0
—
3
—
0
—
2
MDS2
*
—
R
Mode select 2 to 0
Bits indicating the current
operating mode
1
MDS1
— R**
0
MDS0
—
R
Note: Determined by pins MD to MD .*
66
20
Page 91
Bits 7 and 6—Reserved: These bits can not be modified and are always read as 1.
Bits 5 to 3—Reserved: These bits can not be modified and are always read as 0.
Bits 2 to 0—Mode Select 2 to 0 (MDS2 to MDS0): These bits indicate the logic levels at pins
MD2 to MD0 (the current operating mode). MDS2 to MDS0 correspond to MD2 to MD0. MDS2 to
MDS0 are read-only bits. The mode pin (MD2 to MD0) levels are latched into these bits when
MDCR is read.
Note:The versions with on-chip flash memory have a boot mode in which flash memory can be
programmed. In boot mode, the MDS2 bit value is the inverse of the level at the MD2 pin.
3.3System Control Register (SYSCR)
SYSCR is an 8-bit register that controls the operation of the H8/3062 Series.
Bit
Initial value
Read/Write
7
SSBY
0
R/W
6
STS2
0
R/W
5
STS1
0
R/W
4
STS0
0
R/W
User bit enable
Selects whether to use the UI bit in CCR
as a user bit or an interrupt mask bit
3
UE
1
R/W
2
NMIEG
0
R/W
NMI edge select
Selects the valid edge
of the NMI input
1
SSOE
0
R/W
Software standby
output port enable
Selects the output state
of the address bus and
bus control signals in
software standby mode
0
RAME
1
R/W
RAM enable
Enables or
disables
on-chip RAM
Standby timer select 2 to 0
These bits select the waiting time at
recovery from software standby mode
Software standby
Enables transition to software standby mode
67
Page 92
Bit 7—Software Standby (SSBY): Enables transition to software standby mode. (For further
information about software standby mode see section 21, Power-Down State.)
When software standby mode is exited by an external interrupt, and a transition is made to normal
operation, this bit remains set to 1. To clear this bit, write 0.
Bit 7
SSBYDescription
0SLEEP instruction causes transition to sleep mode(Initial value)
1SLEEP instruction causes transition to software standby mode
Bits 6 to 4—Standby Timer Select 2 to 0 (STS2 to STS0): These bits select the length of time
the CPU and on-chip supporting modules wait for the internal clock oscillator to settle when
software standby mode is exited by an external interrupt.
When using a crystal oscillator, set these bits so that the waiting time will be at least 7 ms at the
system clock rate. When operating on an external clock, care is required in the case of the
H8/3064F-ZTAT and the H8/3062F-ZTAT A-mask version.
For further information about waiting time selection, see section 21.4.3, Selection of Waiting
Time for Exit from Software Standby Mode.
Bit 6
STS2
000Waiting time = 8,192 states(Initial value)
001Waiting time = 16,384 states
010Waiting time = 32,768 states
011Waiting time = 65,536 states
100Waiting time = 131,072 states
101Waiting time = 262,144 states
110Waiting time = 1,024 states
111Illegal setting
Bit 5
STS1
Bit 4
STS0Description
Bit 3—User Bit Enable (UE): Selects whether to use the UI bit in the condition code register as a
user bit or an interrupt mask bit.
Bit 3
UEDescription
0UI bit in CCR is used as an interrupt mask bit
1UI bit in CCR is used as a user bit (Initial value)
68
Page 93
Bit 2—NMI Edge Select (NMIEG): Selects the valid edge of the NMI input.
Bit 2
NMIEGDescription
0An interrupt is requested at the falling edge of NMI (Initial value)
1An interrupt is requested at the rising edge of NMI
Bit 1—Software Standby Output Port Enable (SSOE): Specifies whether the address bus and
bus control signals (CS0 to CS7, AS, RD, HWR, LWR) are kept as outputs or fixed high, or placed
in the high-impedance state in software standby mode.
Bit 1
SSOEDescription
0In software standby mode, the address bus and bus control signals are all high-
impedance (Initial value)
1 In software standby mode, the address bus retains its output state and bus control
signals are fixed high
Bit 0—RAM Enable (RAME): Enables or disables the on-chip RAM. The RAME bit is
initialized by the rising edge of the RES signal. It is not initialized in software standby mode.
Bit 0
RAMEDescription
0On-chip RAM is disabled
1On-chip RAM is enabled(Initial value)
3.4Operating Mode Descriptions
3.4.1Mode 1
Ports 1, 2, and 5 function as address pins A19 to A0, permitting access to a maximum 1-Mbyte
address space. The initial bus mode after a reset is 8 bits, with 8-bit access to all areas. If at least
one area is designated for 16-bit access in ABWCR, the bus mode switches to 16 bits.
3.4.2Mode 2
Ports 1, 2, and 5 function as address pins A19 to A0, permitting access to a maximum 1-Mbyte
address space. The initial bus mode after a reset is 16 bits, with 16-bit access to all areas. If all
areas are designated for 8-bit access in ABWCR, the bus mode switches to 8 bits.
69
Page 94
3.4.3Mode 3
Ports 1, 2, and 5 and part of port A function as address pins A23 to A0, permitting access to a
maximum 16-Mbyte address space. The initial bus mode after a reset is 8 bits, with 8-bit access to
all areas. If at least one area is designated for 16-bit access in ABWCR, the bus mode switches to
16 bits. A23 to A21 are valid when 0 is written in bits 7 to 5 of the bus release control register
(BRCR). (In this mode A20 is always used for address output.)
3.4.4Mode 4
Ports 1, 2, and 5 and part of port A function as address pins A23 to A0, permitting access to a
maximum 16-Mbyte address space. The initial bus mode after a reset is 16 bits, with 16-bit access
to all areas. If all areas are designated for 8-bit access in ABWCR, the bus mode switches to
8 bits. A23 to A21 are valid when 0 is written in bits 7 to 5 of BRCR. (In this mode A20 is always
used for address output.)
3.4.5Mode 5
Ports 1, 2, and 5 and part of port A can function as address pins A23 to A0, permitting access to a
maximum 16-Mbyte address space, but following a reset they are input ports. To use ports 1, 2,
and 5 as an address bus, the corresponding bits in their data direction registers (P1DDR, P2DDR,
and P5DDR) must be set to 1, setting ports 1, 2, and 5 to output mode. For A23 to A20 output, write
0 in bits 7 to 4 of BRCR. The versions with on-chip flash memory support an on-board
programming mode in which the flash memory can be programmed. The initial bus mode after a
reset is 8 bits, with 8-bit access to all areas. If at least one area is designated for 16-bit access in
ABWCR, the bus mode switches to 16 bits.
3.4.6Mode 6
This mode operates using the on-chip ROM, RAM, and registers. All I/O ports are available.
Mode 6 supports a maximum address space of 64 kbytes.
3.4.7Mode 7
This mode operates using the on-chip ROM, RAM, and registers. All I/O ports are available.
Mode 7 supports a 1-Mbyte address space.
The versions with on-chip flash memory support an on-board programming mode in which the
flash memory can be programmed.
70
Page 95
3.5Pin Functions in Each Operating Mode
The pin functions of ports 1 to 5 and port A vary depending on the operating mode. Table 3.3
indicates their functions in each operating mode.
Table 3.3Pin Functions in Each Mode
PortMode 1Mode 2Mode 3Mode 4Mode 5Mode 6Mode 7
Port 1A7 to A
0
Port 2A15 to A
Port 3D15 to D
Port 4P47 to P40*1D7 to D0*
Port 5A19 to A
8
8
16
A7 to A
A15 to A
D15 to D
A19 to A
8
8
1
16
A7 to A
A15 to A
D15 to D
0
8
8
P47 to P40*
A19 to A
16
1
0
A7 to A
0
A15 to A
D15 to D
D7 to D0*
A19 to A
P17 to P10*2P17 to P10P17 to P1
8
8
1
16
P27 to P20*2P27 to P20P27 to P2
D15 to D
P37 to P30P37 to P3
8
P47 to P40*1P47 to P40P47 to P4
P53 to P50*2P53 to P50P53 to P5
Port APA7 to PA4PA7 to PA4PA6 to PA4, A20*3PA6 to PA4, A20*3PA7 to PA4*4PA7 to PA4PA7 to PA
Notes: 1. Initial state. The bus mode can be switched by settings in ABWCR. These pins function
as P4
to P40 in 8-bit bus mode, and as D7 to D0 in 16-bit bus mode.
7
2. Initial state. These pins become address output pins when the corresponding bits in the
data direction registers (P1DDR, P2DDR, P5DDR) are set to 1.
3. Initial state. A
A
output by writing 0 in bits 7 to 5 of BRCR.
21
4. Initial state. PA
is always an address output pin. PA6 to PA4 are switched over to A23 to
20
to PA4 are switched over to A23 to A20 output by writing 0 in bits 7 to 4 of
7
BRCR.
0
0
0
0
0
4
71
Page 96
3.6Memory Map in Each Operating Mode
Figures 3.1 to 3.4 show memory maps of the H8/3062 Series. In the expanded modes, the address
space is divided into eight areas.
The initial bus mode differs between modes 1 and 2, and also between modes 3 and 4.
The address locations of the on-chip RAM and on-chip registers differ between the 64-kbyte mode
(mode 6), the 1-Mbyte modes (modes 1, 2, and 7), and the 16-Mbyte modes (modes 3, 4, and 5).
The address range specifiable by the CPU in the 8- and 16-bit absolute addressing modes (@aa:8
and @aa:16) also differs.
3.6.1Comparison of H8/3062 Series Memory Maps
In the H8/3062 Series, the address maps vary according to the size of the on-chip ROM and RAM.
The internal I/O register space is the same in all models, and the H8/3062F-ZTAT A-mask version
and H8/3062 have the same address map. Table 3.4 shows the various address maps in mode 5.
Table 3.4Address Maps in Mode 5
H8/3062 Mask
ROM Version,
H8/3062F-ZTAT,
H8/3062F-ZTAT
R-Mask Version,
H8/3062F-ZTAT
A-Mask Version
On-chip
ROM
On-chip
RAM
Size128 kbytes96 kbytes64 kbytes256 kbytes
Address
area
Size4 kbytes4 kbytes2 kbytes8 kbytes
Address
area
H'000000 to
H'01FFFF
H'FFEF20 to
H'FFFF1F
H8/3061 Mask
ROM Version
H'000000 to
H'017FFF
H'FFEF20 to
H'FFFF1F
H8/3060 Mask
ROM VersionH8/3064F-ZTAT
H'000000 to
H'00FFFF
H'FFF720 to
H'FFFF1F
H'000000 to
H'03FFFF
H'FFDF20 to
H'FFFF1F
72
Page 97
3.6.2Reserved Areas
The H8/3062 Series memory map includes reserved areas to which access (reading or writing) is
prohibited. Normal operation cannot be guaranteed if the following reserved areas are accessed.
Reserved Area in Internal I/O Register Space: The H8/3062 Series internal I/O register space
includes a reserved area to which access is prohibited. For details see Appendix B, Internal I/O
Registers.
Other Reserved Areas: In mode 5 in the H8/3061 mask ROM version and H8/3060 mask ROM
version there is a reserved area in area 0, as shown in figures 3.2 and 3.3.
In modes 1 to 5 in the H8/3060 mask ROM version there is a reserved area in area 7, as shown in
figure 3.3.