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
Cautions
Keep safety first in your circuit designs!
1. Renesas Technology Corporation puts the maximum effort into making semiconductor products better
and more reliable, but there is al ways the possibility that t rouble may occur with them. Trouble with
semiconductors may lead to personal injury, fire or property damage.
Remember to give due consideration to safety when making your circuit designs, with appropriate
measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or
(iii) prevention against any malfunction or mishap.
Notes regarding these materials
1. These materials are intended as a reference to assist our customers in th e sel ection 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 the use of any product data, diagrams, charts, programs, algorithms, or
circuit application examples contained in these materi als.
3. All information contained in these materials, including product data, diagrams, 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 information
before purchasing a product listed herein.
The information described here may contain technical i naccuracies or typographical errors.
Renesas Technology Corporation 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 using any or all of the information contained in these materials, including product data, diagrams,
charts, programs, and algorithms, please be sure to evaluat e al l information as a total system before
making a final decision on the applicability of the information and products. Renesas Technology
Corporation assumes no responsibility for any damage, liability or other loss resulting from the
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 po t entially at stake. P l ease contact
Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor
when considering the use of a product contained herein for any specific purposes, such as apparatus or
systems for transportation, vehicular, medical, aerospace, n uclear, or undersea 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 or technologies are subject to the Japanese export control restrictions, they must be
exported under a license from the Japanese government and cannot be imported into a country other
than the approved destination.
Any diversion or reexport contrary to the export control 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 therein.
When using this document, keep the following in mind:
1. This document may, wholly or partially, be subject to change without notice.
2. All rights are reserved: No one is permitted to reproduce or duplicate, in any form, the whole
or part of this document without Hitachi’s permission.
3. Hitachi will not be held responsible for any damage to the user that may result from accidents
or any other reasons during operation of the user’s unit according to this document.
4. Circuitry and other examples described herein are meant merely to indicate the characteristics
and performance of Hitachi’s semiconductor products. Hitachi assumes no responsibility for
any intellectual property claims or other problems that may result from applications based on
the examples described herein.
5. No license is granted by implication or otherwise under any patents or other rights of any third
party or Hitachi, Ltd.
6. MEDICAL APPLICATIONS: Hitachi’s products are not authorized for use in MEDICAL
APPLICATIONS without the written consent of the appropriate officer of Hitachi’s sales
company. Such use includes, but is not limited to, use in life support systems. Buyers of
Hitachi’s products are requested to notify the relevant Hitachi sales offices when planning to
use the products in MEDICAL APPLICATIONS.
Preface
The H8S/2350 Series is a series of high-performance microcontrollers with a 32-bit H8S/2000
CPU core, and a set of on-chip supporting functions required for system configuration.
The H8S/2000 CPU can execute basic instructions in one state, and is provided with sixteen 16-bit
general registers with a 32-bit internal configuration, and a concise and optimized instruction set.
The CPU can handle a 16 Mbyte linear address space (architecturally 4 Gbytes). Programs based
on the high-level language C can also be run efficiently.
The address space is divided into eight areas. The data bus width and access states can be selected
for each of these areas, and various kinds of memory can be connected fast and easily.
On-chip memory consists of large-capacity ROM (H8S/2351 only) and RAM.
On-chip supporting functions include a 16-bit timer pulse unit (TPU), programmable pulse
generator (PPG), watchdog timer (WDT), serial communication interface (SCI), A/D converter,
D/A converter, and I/O ports.
In addition, an on-chip DMA controller (DMAC) and data transfer controller (DTC) are provided,
enabling high-speed data transfer without CPU intervention.
Use of the H8S/2350 Series enables easy implementation of compact, high-performance systems
capable of processing large volumes of data.
This manual describes the hardware of the H8S/2350 Series. Refer to the H8S/2600 Series and
H8S/2000 Series Programming Manual for a detailed description of the instruction set.
Appendix G Product Code Lineup.................................................................................. 965
Appendix H Package Dimensions................................................................................... 966
xiv
Section 1 Overview
1.1Overview
The H8S/2350 Series is a series of microcomputers (MCUs: microcomputer units), built around
the H8S/2000 CPU, employing Hitachi's proprietary architecture, and equipped with peripheral
functions on-chip.
The H8S/2000 CPU has an internal 32-bit architecture, is provided with sixteen 16-bit general
registers and a concise, optimized instruction set designed for high-speed operation, and can
address a 16-Mbyte linear address space. The instruction set is upward-compatible with H8/300
and H8/300H CPU instructions at the object-code level, facilitating migration from the H8/300,
H8/300L, or H8/300H Series.
On-chip peripheral functions required for system configuration include DMA controller (DMAC)
and data transfer controller (DTC) bus masters, ROM (H8S/2351 only) and RAM memory, a16-bit
timer-pulse unit (TPU), programmable pulse generator (PPG), watchdog timer (WDT), serial
communication interface (SCI), A/D converter, D/A converter, and I/O ports.
The H8S/2351 has on-chip mask ROM.
The H8S/2351 supports seven operating modes (modes 1 to 7), while the H8S/2350 supports three
operating modes (modes 1, 4, and 5). There is a choice of address space and single-chip mode or
expansion mode.
The features of the H8S/2350 Series are shown in Table 1-1.
1
Table 1-1Overview
ItemSpecification
CPU• General-register machine
Sixteen 16-bit general registers (also usable as sixteen 8-bit registers
or eight 32-bit registers)
• High-speed operation suitable for realtime control
Maximum clock rate: 20 MHz
High-speed arithmetic operations
See section 19, Clock Pulse
Generator, for typical connection
diagrams for a crystal oscillator and
external clock input.
The EXTAL pin can also input an
external clock.
See section 19, Clock Pulse
Generator, for typical connection
diagrams for a crystal oscillator and
external clock input.
clock to an external device.
13
Table 1-3Pin Functions (cont)
Pin No.
TypeSymbolTFP-120 FP-128I/OName and Function
Operating mode
control
System controlRES7381InputReset input: When this pin is driven
MD2 to
MD
0
115 to
113
125 to
123
InputMode pins: These pins set the
operating mode.
The relation between the settings of
pins MD
to MD0 and the operating
2
mode is shown below. These pins
should not be changed while the
H8S/2350 Series is operating.
Operating
MD2MD1MD0
Mode
000—
1Mode 1
10Mode 2*
1Mode 3*
100Mode 4
1Mode 5
10Mode 6*
1Mode 7*
Note: *Only applies to the H8S/2351.
low, the chip is reset. The type of
reset can be selected according to
the NMI input level. At power-on, the
NMI pin input level should be set
high.
STBY7583InputStandby: When this pin is driven low,
a transition is made to hardware
standby mode.
BREQ8896InputBus request: Used by an external bus
master to issue a bus request to the
H8S/2350 Series.
BREQO8694Output Bus request output: The external bus
request signal used when an internal
bus master accesses external space
in the external bus-released state.
BACK8795Output Bus request acknowledge: Indicates
that the bus has been released to an
external bus master.
14
Table 1-3Pin Functions (cont)
Pin No.
TypeSymbolTFP-120 FP-128I/OName and Function
InterruptsNMI7482InputNonmaskable interrupt: Requests a
nonmaskable interrupt. When this pin
is not used, it should be fixed high.
IRQ7 to
IRQ0
Address busA23 to
A
0
Data busD15 to
D
0
Bus controlCS7 to
CS0
AS8290Output Address strobe: When this pin is low,
67, 6675, 74I/OInput capture/ output compare match
A4 and B4: The TGR4A and TGR4B
input capture input or output compare
output, or PWM output pins.
65, 6473, 72I/OInput capture/ output compare match
A5 and B5: The TGR5A and TGR5B
input capture input or output compare
output, or PWM output pins.
105 to
112,
64 to 71
54, 5360, 59Output Transmit data (channel 0, 1):
56, 5562, 61InputReceive data (channel 0, 1):
58, 5764, 63I/OSerial clock (channel 0, 1):
102 to95112 to
115 to
122,
72 to 79
105
Output Pulse output 15 to 0: Pulse output
pins.
counter overflows signal output pin in
watchdog timer mode.
Data output pins.
Data input pins.
Clock I/O pins.
InputAnalog 7 to 0: Analog input pins.
Pin for input of an external trigger to
start A/D conversion.
output pins.
17
Table 1-3Pin Functions (cont)
Pin No.
TypeSymbolTFP-120 FP-128I/OName and Function
A/D converter
and D/A
converter
I/O portsP17 to
AV
CC
AV
SS
V
ref
P1
0
P27 to
P2
0
P35 to
P3
0
P47 to
P4
0
P53 to
P5
0
93103InputThis is the power supply pin for the
A/D converter and D/A converter.
When the A/D converter and D/A
converter are not used, this pin
should be connected to the system
power supply (+5 V).
103113InputThis is the ground pin for the A/D
converter and D/A converter.
This pin should be connected to the
system power supply (0 V).
94104InputThis is the reference voltage input pin
for the A/D converter and D/A
converter.
When the A/D converter and D/A
converter are not used, this pin
should be connected to the system
power supply (+5 V).
105 to
112
115 to
122
I/OPort 1: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port 1 data direction
register (P1DDR).
64 to 7172 to 79I/OPort 2: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port 2 data direction
register (P2DDR).
58 to 5364 to 59I/OPort 3: A 6-bit I/O port. Input or
output can be designated for each bit
by means of the port 3 data direction
register (P3DDR).
102 to
95
92 to 89102, 101,
112 to
105
98, 97
InputPort 4: An 8-bit input port.
I/OPort 5: A 4-bit I/O port. Input or
output can be designated for each bit
by means of the port 5 data direction
register (P5DDR).
18
Table 1-3Pin Functions (cont)
Pin No.
TypeSymbolTFP-120 FP-128I/OName and Function
I/O portsP67 to
P6
0
PA7 to
PA
0
PB7 to
PB
0
PC7 to
PC
0
PD7 to
PD
0
PE7 to
PE
0
PF7 to
PF
0
PG4 to
PG
0
29 to 32,
63 to 60
28 to 25,
23 to 20
19 to 16,
14 to 11
10 to 7,
5 to 2
51 to 48,
46 to 43
42 to 39,
37 to 34
80,
82 to 88
120 to
116
Note: *Only applies to the H8S/2351.
33, 34,
37, 38,
71 to 69,
66
32 to 29,
27 to 24
23 to 20,
18 to 15
14 to 11,
9 to 6
57 to 54,
52 to 49
48 to 45,
43 to 40
88,
90 to 96
2, 1,
128 to
126
I/OPort 6: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port 6 data direction
register (P6DDR).
I/OPort A: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port A data direction
register (PADDR).
I/OPort B*: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port B data direction
register (PBDDR).
I/OPort C*: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port C data direction
register (PCDDR).
I/OPort D*: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port D data direction
register (PDDDR).
I/OPort E: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port E data direction
register (PEDDR).
I/OPort F: An 8-bit I/O port. Input or
output can be designated for each bit
by means of the port F data direction
register (PFDDR).
I/OPort G: A 5-bit I/O port. Input or
output can be designated for each bit
by means of the port G data direction
register (PGDDR).
19
20
Section 2 CPU
2.1Overview
The H8S/2000 CPU is a high-speed central processing unit with an internal 32-bit architecture that
is upward-compatible with the H8/300 and H8/300H CPUs. The H8S/2000 CPU has sixteen 16-bit
general registers, can address a 16-Mbyte (architecturally 4-Gbyte) linear address space, and is
ideal for realtime control.
2.1.1Features
The H8S/2000 CPU has the following features.
• Upward-compatible with H8/300 and H8/300H CPUs
Can execute H8/300 and H8/300H object programs
• General-register architecture
Sixteen 16-bit general registers (also usable as sixteen 8-bit registers or eight 32-bit
registers)
• Sixty-five 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:32,ERn)]
Register indirect with post-increment or pre-decrement [@ERn+ or @–ERn]
Absolute address [@aa:8, @aa:16, @aa:24, or @aa:32]
Immediate [#xx:8, #xx:16, or #xx:32]
Program-counter relative [@(d:8,PC) or @(d:16,PC)]
Memory indirect [@@aa:8]
• High-speed operation
All frequently-used instructions execute in one or two states
Maximum clock rate: 20 MHz
8/16/32-bit register-register add/subtract : 50 ns
8 × 8-bit register-register multiply: 600 ns
16 ÷ 8-bit register-register divide: 600 ns
16 × 16-bit register-register multiply: 1000 ns
32 ÷ 16-bit register-register divide: 1000 ns
• Two CPU operating modes
Normal mode
Advanced mode
• Power-down state
Transition to power-down state by SLEEP instruction
CPU clock speed selection
2.1.2Differences between H8S/2600 CPU and H8S/2000 CPU
The differences between the H8S/2600 CPU and the H8S/2000 CPU are as shown below.
• Register configuration
The MAC register is supported only by the H8S/2600 CPU.
• Basic instructions
The four instructions MAC, CLRMAC, LDMAC, and STMAC are supported only by the
H8S/2600 CPU.
• Number of execution states
The number of exection states of the MULXU and MULXS instructions.
Internal Operation
InstructionMnemonicH8S/2600H8S/2000
MULXUMULXU.B Rs, Rd312
MULXU.W Rs, ERd420
MULXSMULXS.B Rs, Rd413
MULXS.W Rs, ERd521
There are also differences in the address space, CCR and EXR functions, power-down state, etc.,
depending on the product.
22
2.1.3Differences from H8/300 CPU
In comparison to the H8/300 CPU, the H8S/2000 CPU has the following enhancements.
• More general registers and control registers
Eight 16-bit expanded registers, and one 8-bit control register, have been added.
• Expanded address space
Normal mode supports the same 64-kbyte address space as the H8/300 CPU.
Advanced mode supports a maximum 16-Mbyte address space.
• Enhanced addressing
The addressing modes have been enhanced to make effective use of the 16-Mbyte address
space.
• Enhanced instructions
Addressing modes of bit-manipulation instructions have been enhanced.
Signed multiply and divide instructions have been added.
Two-bit shift instructions have been added.
Instructions for saving and restoring multiple registers have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions execute twice as fast.
2.1.4Differences from H8/300H CPU
In comparison to the H8/300H CPU, the H8S/2000 CPU has the following enhancements.
• Additional control register
One 8-bit control register has been added.
• Enhanced instructions
Addressing modes of bit-manipulation instructions have been enhanced.
Two-bit shift instructions have been added.
Instructions for saving and restoring multiple registers have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions execute twice as fast.
23
2.2CPU Operating Modes
The H8S/2000 CPU has two operating modes: normal and advanced. Normal mode supports a
maximum 64-kbyte address space. Advanced mode supports a maximum 16-Mbyte total address
space (architecturally a maximum 16-Mbyte program area and a maximum of 4 Gbytes for
program and data areas combined). The mode is selected by the mode pins of the microcontroller.
Normal mode
CPU operating modes
Advanced mode
Maximum 64 kbytes, program
and data areas combined
Maximum 16-Mbytes for
program and data areas
combined
Figure 2-1 CPU Operating Modes
(1) Normal Mode
The exception vector table and stack have the same structure as in the H8/300 CPU.
Address Space: A maximum address space of 64 kbytes can be accessed.
Extended Registers (En): The extended registers (E0 to E7) can be used as 16-bit registers, or as
the upper 16-bit segments of 32-bit registers. When En is used as a 16-bit register it can contain
any value, even when the corresponding general register (Rn) is used as an address register. If the
general register is referenced in the register indirect addressing mode with pre-decrement (@–Rn)
or post-increment (@Rn+) and a carry or borrow occurs, however, the value in the corresponding
extended register (En) will be affected.
Instruction Set: All instructions and addressing modes can be used. Only the lower 16 bits of
effective addresses (EA) are valid.
24
Exception Vector Table and Memory Indirect Branch Addresses: In normal mode the top area
starting at H'0000 is allocated to the exception vector table. One branch address is stored per 16
bits. The configuration of the exception vector table in normal mode is shown in figure 2-2. For
details of the exception vector table, see section 4, Exception Handling.
The memory indirect addressing mode (@@aa:8) employed in the JMP and JSR instructions uses
an 8-bit absolute address included in the instruction code to specify a memory operand that
contains a branch address. In normal mode the operand is a 16-bit word operand, providing a 16bit branch address. Branch addresses can be stored in the top area from H'0000 to H'00FF. Note
that this area is also used for the exception vector table.
25
Stack Structure: When the program counter (PC) is pushed onto the stack in a subroutine call,
and the PC, condition-code register (CCR), and extended control register (EXR) are pushed onto
the stack in exception handling, they are stored as shown in figure 2-3. When EXR is invalid, it is
not pushed onto the stack. For details, see section 4, Exception Handling.
SP
Notes: 1.
PC
(16 bits)
(a) Subroutine Branch(b) Exception Handling
When EXR is not used it is not stored on the stack.
2.
SP when EXR is not used.
3.
Ignored when returning.
SP
*2
(SP )
Reserved
*1
EXR
CCR
*3
CCR
PC
(16 bits)
*1,*3
Figure 2-3 Stack Structure in Normal Mode
(2) Advanced Mode
Address Space: Linear access is provided to a 16-Mbyte maximum address space (architecturally
a maximum 16-Mbyte program area and a maximum 4-Gbyte data area, with a maximum of 4
Gbytes for program and data areas combined).
Extended Registers (En): The extended registers (E0 to E7) can be used as 16-bit registers, or as
the upper 16-bit segments of 32-bit registers or address registers.
Instruction Set: All instructions and addressing modes can be used.
26
Exception Vector Table and Memory Indirect Branch Addresses: In advanced mode the top
area starting at H'00000000 is allocated to the exception vector table in units of 32 bits. In each 32
bits, the upper 8 bits are ignored and a branch address is stored in the lower 24 bits (figure 2-4).
For details of the exception vector table, see section 4, Exception Handling.
H'00000000
H'00000003
H'00000004
H'00000007
H'00000008
H'0000000B
H'0000000C
H'00000010
Reserved
Power-on reset exception vector
Reserved
Manual reset exception vector
Exception vector table
(Reserved for system use)
Reserved
Exception vector 1
Figure 2-4 Exception Vector Table (Advanced Mode)
The memory indirect addressing mode (@@aa:8) employed in the JMP and JSR instructions uses
an 8-bit absolute address included in the instruction code to specify a memory operand that
contains a branch address. In advanced mode the operand is a 32-bit longword operand, providing
a 32-bit branch address. The upper 8 bits of these 32 bits are a reserved area that is regarded as
H'00. Branch addresses can be stored in the area from H'00000000 to H'000000FF. Note that the
first part of this range is also the exception vector table.
27
Stack Structure: In advanced mode, when the program counter (PC) is pushed onto the stack in a
subroutine call, and the PC, condition-code register (CCR), and extended control register (EXR)
are pushed onto the stack in exception handling, they are stored as shown in figure 2-5. When
EXR is invalid, it is not pushed onto the stack. For details, see section 4, Exception Handling.
SP
Notes: 1.
EXR
CCR
PC
*1
*1,*3
Reserved
PC
(24 bits)
SP
*2
(SP )
Reserved
(24 bits)
(a) Subroutine Branch(b) Exception Handling
When EXR is not used it is not stored on the stack.
2.
SP when EXR is not used.
3.
Ignored when returning.
Figure 2-5 Stack Structure in Advanced Mode
28
2.3Address Space
Figure 2-6 shows a memory map of the H8S/2000 CPU. The H8S/2000 CPU provides linear
access to a maximum 64-kbyte address space in normal mode, and a maximum 16-Mbyte
(architecturally 4-Gbyte) address space in advanced mode.
H'0000
H'FFFF
(a) Normal Mode
H'00000000
H'00FFFFFF
Cannot be
used by the
H8S/2350
Series
H'FFFFFFFF
(b) Advanced Mode
Figure 2-6 Memory Map
Program area
Data area
29
2.4Register Configuration
2.4.1Overview
The CPU has the internal registers shown in figure 2-7. There are two types of registers: general
registers and control registers.
General Registers (Rn) and Extended Registers (En)
1507070
ER0
ER1
ER2
ER3
ER4
ER5
ER6
ER7 (SP)
Control Registers (CR)
E0
E1
E2
E3
E4
E5
E6
E7
230
R0H
R1H
R2H
R3H
R4H
R5H
R6H
R7H
PC
R0L
R1L
R2L
R3L
R4L
R5L
R6L
R7L
Legend
SP:
PC:
EXR:
T:
I2 to I0:
CCR:
I:
UI:
Note: * In the H8S/2350 Series, this bit cannot be used as an interrupt mask.
Stack pointer
Program counter
Extended control register
Trace bit
Interrupt mask bits
Condition-code register
Interrupt mask bit
User bit or interrupt mask bit*
H:
U:
N:
Z:
V:
C:
Half-carry flag
User bit
Negative flag
Zero flag
Overflow flag
Carry flag
Figure 2-7 CPU Registers
30
76543210
T
————
76543210
IUIHUNZVCCCR
I2 I1 I0EXR
2.4.2General Registers
The CPU has eight 32-bit general registers. These general registers are all functionally alike and
can be used as both address registers and data 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 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-8 illustrates the usage of the general registers. The usage of each register can be selected
independently.
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-9 shows the
stack.
Free area
SP (ER7)
Stack area
Figure 2-9 Stack
2.4.3Control Registers
The control registers are the 24-bit program counter (PC), 8-bit extended control register (EXR),
and 8-bit condition-code register (CCR).
(1) 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.)
(2) Extended Control Register (EXR): This 8-bit register contains the trace bit (T) and three
interrupt mask bits (I2 to I0).
Bit 7—Trace Bit (T): Selects trace mode. When this bit is cleared to 0, instructions are executed
in sequence. When this bit is set to 1, a trace exception is generated each time an instruction is
executed.
Bits 6 to 3—Reserved: These bits are reserved. They are always read as 1.
32
Bits 2 to 0—Interrupt Mask Bits (I2 to I0): These bits designate the interrupt mask level (0 to
7). For details, refer to section 5, Interrupt Controller.
Operations can be performed on the EXR bits by the LDC, STC, ANDC, ORC, and XORC
instructions. All interrupts, including NMI, are disabled for three states after one of these
instructions is executed, except for STC.
(3) Condition-Code Register (CCR): This 8-bit register contains internal CPU status
information, including an 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 by hardware at the start of an exceptionhandling sequence. For details, refer to section 5, Interrupt Controller.
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. With the H8S/2350 Series, this bit cannot be
used as an interrupt mask bit.
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 (sign bit) of data.
Bit 2—Zero Flag (Z): Set to 1 to indicate zero data, and cleared to 0 to indicate non-zero data.
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 occurs, and cleared to 0 otherwise. Used by:
• Add instructions, to indicate a carry
• Subtract instructions, to indicate a borrow
• Shift and rotate instructions, to store the value shifted out of the end bit
The carry flag is also used as a bit accumulator by bit manipulation instructions.
33
Some instructions leave some or all of the flag bits unchanged. For the action of each instruction
on the flag bits, refer to Appendix A.1, List of Instructions.
Operations can be performed on the CCR bits by the LDC, STC, ANDC, ORC, and XORC
instructions. The N, Z, V, and C flags are used as branching conditions for conditional branch
(Bcc) instructions.
2.4.4Initial Register Values
Reset exception handling loads the CPU's program counter (PC) from the vector table, clears the
trace bit in EXR to 0, and sets the interrupt mask bits in CCR and EXR to 1. The other CCR bits
and the general registers are not initialized. In particular, the stack pointer (ER7) is not initialized.
The stack pointer should therefore be initialized by an MOV.L instruction executed immediately
after a reset.
34
2.5Data Formats
The 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
Figure 2-10 shows the data formats in general registers.
Data TypeRegister NumberData Format
1-bit data
1-bit data
4-bit BCD data
4-bit BCD data
Byte data
Byte data
RnH
RnL
RnH
RnL
RnH
RnL
70
76543210Don’t care
Don’t care76543210
70
70
MSBLSB
43
Don’t care
Don’t care
MSB
Figure 2-10 General Register Data Formats
70
Don’t careUpperLower
Upper
Don’t care
43
Lower
LSB
70
70
35
Data TypeRegister NumberData Format
Word data
Word data
15
MSBLSB
Longword data
31
MSB
Legend
ERn:
General register ER
En:
General register E
Rn:
General register R
RnH:
General register RH
RnL:
General register RL
MSB:
Most significant bit
LSB:
Least significant bit
Rn
En
ERn
16
EnRn
15
MSBLSB
0
15
0
0
LSB
36
Figure 2-10 General Register Data Formats (cont)
2.5.2Memory Data Formats
Figure 2-11 shows the data formats in memory. The CPU can access word data and longword data
in 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.
BIAND, BOR, BIOR, BXOR, BIXOR
BranchBcc*2, JMP, BSR, JSR, RTS—5
System controlTRAPA, RTE, SLEEP, LDC, STC, ANDC, ORC, XORC, NOP —9
Block data transfer EEPMOV—1
Notes: B-byte size; W-word size; L-longword size.
1. POP.W Rn and PUSH.W Rn are identical to MOV.W @SP+, Rn and MOV.W Rn, @SP. POP.L ERn and PUSH.L ERn are identical to MOV.L @SP+, ERn and MOV.L ERn,
@-SP.
2. Bcc is the general name for conditional branch instructions.
3. Cannot be used in the H8S/2350 Series.
1
3
WL
B
B14
38
2.6.2Instructions and Addressing Modes
Table 2-2 indicates the combinations of instructions and addressing modes that the H8S/2600 CPU
can use.
—
@@aa:8
@(d:16,PC)
@(d:8,PC)
@aa:32
@aa:24
@aa:16
@aa:8
Addressing Modes
Table 2-2 Combinations of Instructions and Addressing Modes
Instruction
Function
@–ERn/@ERn+
@(d:32,ERn)
@(d:16,ERn)
@ERn
Rn
#xx
MOVBWLBWLBWLBWLBWLBWLBBWL—BWL————
POP, PUSH—————— ——— ————WL
LDM, STM—————————— ———L
Data
transfer
ADD, CMPBWLBWL———— ——— —————
SUB WLBWL——————— — ————
MOVFPE,———————B— —————
MOVTPE*
ADDX, SUBXBB——————— — ————
Arithmetic
operations
MULXU, —BW——————— — ————
DAA, DAS—B———— ——— —————
DIVXU
ADDS, SUBS—L——————— —————
INC, DEC—BWL——————— — ————
MULXS,—BW———— ——— —————
DIVXS
NEG—BWL———————— ————
EXTU, EXTS—WL———————— ————
TAS —— B —————— — ————
Note: * Cannot be used in the H8S/2350 Series.
39
—
@@aa:8
@(d:16,PC)
@(d:8,PC)
@aa:32
@aa:24
@aa:16
@aa:8
Addressing Modes
Table 2-2 Combinations of Instructions and Addressing Modes (Cont)
Instruction
Function
@–ERn/@ERn+
@(d:32,ERn)
@(d:16,ERn)
@ERn
Rn
#xx
AND, OR,BWLBWL———— ——— — ————
XOR
NOT—BWL——————— — ————
Logic
operations
—BWL——————— — ————
—B B ———BB— B ————
Bcc, BSR—————— ——— ———
JMP, JSR————————— ———
RTS —— ———————— ———
Shift
Bit manipulation
Branch
TRAPA—————— ——— ————
RTE —— ———————— ———
System
control
SLEEP—————————— ———
LDC BB WWWW—W—W————
ANDC,B———————— —————
ORC, XORC
STC —B WWWW —W—W————
NOP—— ———————————
—— ———————— ———BW
Block data transfer
Legend
B: Byte
W: Word
L: Longword
40
2.6.3 Table of Instructions Classified by Function
Table 2-3 summarizes the instructions in each functional category. The notation used in table 2-3
is defined below.
Operation Notation
RdGeneral register (destination)*
RsGeneral register (source)*
RnGeneral register*
ERnGeneral register (32-bit register)
(EAd)Destination operand
(EAs)Source operand
EXRExtended control register
CCRCondition-code register
NN (negative) flag in CCR
ZZ (zero) flag in CCR
VV (overflow) flag in CCR
CC (carry) flag in CCR
PCProgram counter
SPStack pointer
#IMMImmediate data
dispDisplacement
+Addition
–Subtraction
×Multiplication
÷Division
∧Logical AND
∨Logical OR
⊕Logical exclusive OR
→Move
¬NOT (logical complement)
:8/:16/:24/:328-, 16-, 24-, or 32-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 registers (ER0 to ER7).
41
Table 2-3Instructions Classified by Function
TypeInstructionSize*Function
Data transferMOVB/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.
MOVFPEBCannot be used in the H8S/2350 Series.
MOVTPEBCannot be used in the H8S/2350 Series.
POPW/L@SP+ → Rn
Pops a register from the stack. POP.W Rn is identical to
MOV.W @SP+, Rn. POP.L ERn is identical to MOV.L
@SP+, ERn.
PUSHW/LRn → @–SP
Pushes a register onto the stack. PUSH.W Rn is
identical to MOV.W Rn, @–SP. PUSH.L ERn is identical
to MOV.L ERn, @–SP.
LDML@SP+ → Rn (register list)
Pops two or more general registers from the stack.
STMLRn (register list) → @–SP
Pushes two or more general registers onto the stack.
Note: *Size refers to the operand size.
B:Byte
W: Word
L:Longword
42
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Arithmetic
operations
Note: *Size refers to the operand size.
B:Byte
W: Word
L:Longword
ADD
SUB
ADDX
SUBX
INC
DEC
ADDS
SUBS
DAA
DAS
MULXUB/WRd × Rs → Rd
MULXSB/WRd × Rs → Rd
DIVXUB/WRd ÷ Rs → Rd
B/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
byte data in a general register. Use the SUBX or ADD
instruction.)
BRd ± Rs ± C → Rd, Rd ± #IMM ± C → Rd
Performs addition or subtraction with carry or borrow on
byte 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 the 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.
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 16bit remainder.
43
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Arithmetic
operations
Note: *Size refers to the operand size.
B:Byte
W: Word
L:Longword
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
bits according to the result.
NEGB/W/L0 – Rd → Rd
Takes the two's complement (arithmetic complement) of
data in a general register.
EXTUW/LRd (zero extension) → Rd
Extends the lower 8 bits of a 16-bit register to word size,
or the lower 16 bits of a 32-bit register to longword size,
by padding with zeros on the left.
EXTSW/LRd (sign extension) → Rd
Extends the lower 8 bits of a 16-bit register to word size,
or the lower 16 bits of a 32-bit register to longword size,
by extending the sign bit.
TASB@ERd – 0, 1 → (<bit 7> of @Erd)
Tests memory contents, and sets the most significant bit
(bit 7) to 1.
44
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Logic
operations
Shift
operations
Note: *Size refers to the operand size.
B:Byte
W: Word
L:Longword
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 of general register
contents.
SHAL
SHAR
SHLL
SHLR
ROTL
ROTR
ROTXL
ROTXR
B/W/LRd (shift) → Rd
Performs an arithmetic shift on general register contents.
1-bit or 2-bit shift is possible.
B/W/LRd (shift) → Rd
Performs a logical shift on general register contents.
1-bit or 2-bit shift is possible.
B/W/LRd (rotate) → Rd
Rotates general register contents.
1-bit or 2-bit rotation is possible.
B/W/LRd (rotate) → Rd
Rotates general register contents through the carry flag.
1-bit or 2-bit rotation is possible.
45
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Bitmanipulation
instructions
Note: *Size refers to the operand size.
B:Byte
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 three 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 three 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 three 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 three bits of a general register.
BAND
BIAND
BOR
BIOR
B
B
B
B
C ∧ (<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.
C ∧ ¬ (<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.
C ∨ (<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.
C ∨ ¬ (<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.
46
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Bitmanipulation
instructions
Note: *Size refers to the operand size.
B:Byte
BXOR
BIXOR
BLD
BILD
BST
BIST
B
B
B
B
B
B
C ⊕ (<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.
C ⊕ ¬ (<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.
(<bit-No.> of <EAd>) → C
Transfers a specified bit in a general register or memory
operand to the carry flag.
¬ (<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.
C → (<bit-No.> of <EAd>)
Transfers the carry flag value to a specified bit in a
general register or memory operand.
¬ C → (<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.
47
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Branch
instructions
Bcc—Branches to a specified address if a specified condition
is true. 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 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
(high or same)
48
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
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
System control TRAPA—Starts trap-instruction exception handling.
instructions
Note: *Size refers to the operand size.
B:Byte
W: Word
RTE—Returns from an exception-handling routine.
SLEEP—Causes a transition to a power-down state.
LDCB/W(EAs) → CCR, (EAs) → EXR
Moves the source operand contents or immediate data
to CCR or EXR. Although CCR and EXR are 8-bit
registers, word-size transfers are performed between
them and memory. The upper 8 bits are valid.
STCB/WCCR → (EAd), EXR → (EAd)
Transfers CCR or EXR contents to a general register or
memory. Although CCR and EXR are 8-bit registers,
word-size transfers are performed between them and
memory. The upper 8 bits are valid.
ANDCBCCR ∧ #IMM → CCR, EXR ∧ #IMM → EXR
Logically ANDs the CCR or EXR contents with
immediate data.
ORCBCCR ∨ #IMM → CCR, EXR ∨ #IMM → EXR
Logically ORs the CCR or EXR contents with immediate
data.
XORCBCCR ⊕ #IMM → CCR, EXR ⊕ #IMM → EXR
Logically exclusive-ORs the CCR or EXR contents with
immediate data.
NOP—PC + 2 → PC
Only increments the program counter.
49
Table 2-3Instructions Classified by Function (cont)
TypeInstructionSize*Function
Block data
transfer
instruction
EEPMOV.B
EEPMOV.W——
if R4L ≠ 0 then
Repeat @ER5+ → @ER6+
R4L–1 → R4L
Until R4L = 0
else next;
if R4 ≠ 0 then
Repeat @ER5+ → @ER6+
R4–1 → R4
Until R4 = 0
else next;
Transfers a data block according to parameters set in
general registers R4L or R4, ER5, and ER6.
R4L or R4: size of block (bytes)
ER5: starting source address
ER6: starting destination address
Execution of the next instruction begins as soon as the
transfer is completed.
50
2.6.4Basic Instruction Formats
The CPU instructions consist of 2-byte (1-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).
Figure 2-12 shows examples of instruction formats.
(1) Operation field only
op
(2) Operation field and register fields
op
(3) Operation field, register fields, and effective address extension
op
EA (disp)
(4) Operation field, effective address extension, and condition field
opccEA (disp)BRA d:16, etc
rn
rnrm
rm
NOP, RTS, etc.
ADD.B Rn, Rm, etc.
MOV.B @(d:16, Rn), Rm, etc.
Figure 2-12 Instruction Formats (Examples)
(1) 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 four bits of
the instruction. Some instructions have two operation fields.
(2) 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.
(3) Effective Address Extension: Eight, 16, or 32 bits specifying immediate data, an absolute
address, or a displacement.
(4) Condition Field: Specifies the branching condition of Bcc instructions.
51
2.7Addressing Modes and Effective Address Calculation
2.7.1Addressing Mode
The CPU supports the eight addressing modes listed in table 2-4. 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 program-counter
relative and memory indirect. Bit manipulation instructions use register direct, register indirect, or
absolute 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-4Addressing Modes
No.Addressing ModeSymbol
1Register directRn
2Register indirect@ERn
3Register indirect with displacement@(d:16,ERn)/@(d:32,ERn)
4Register indirect with post-increment
(1) Register Direct—Rn: The register field of the instruction specifies an 8-, 16-, or 32-bit
general 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) which contains the address of the operand on memory. If the address is a program
instruction address, the lower 24 bits are valid and the upper 8 bits are all assumed to be 0 (H'00).
(3) Register Indirect with Displacement—@(d:16, ERn) or @(d:32, ERn): A 16-bit or 32-bit
displacement contained in the instruction is added to an address register (ERn) specified by the
register field of the instruction, and the sum gives the address of a memory operand. A 16-bit
displacement is sign-extended when added.
52
(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) which contains the
address of a memory operand. After the operand is accessed, 1, 2, or 4 is added to the address
register contents and the sum is stored in the address register. The value added is 1 for byte
access, 2 for word transfer instruction, or 4 for longword transfer instruction. For word or
longword transfer instruction, 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 result becomes 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 transfer
instruction, or 4 for longword transfer instruction. For word or longword transfer instruction,
the register value should be even.
(5) Absolute Address—@aa:8, @aa:16, @aa:24, or @aa:32: 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), 24 bits long (@aa:24), or 32 bits long (@aa:32).
To access data, the absolute address should be 8 bits (@aa:8), 16 bits (@aa:16), or 32 bits
(@aa:32) long. For an 8-bit absolute address, the upper 24 bits are all assumed to be 1 (H'FFFF).
For a 16-bit absolute address the upper 16 bits are a sign extension. A 32-bit absolute address can
access the entire address space.
A 24-bit absolute address (@aa:24) indicates the address of a program instruction. The upper 8
bits are all assumed to be 0 (H'00).
Table 2-5 indicates the accessible absolute address ranges.
Table 2-5Absolute Address Access Ranges
Absolute AddressNormal ModeAdvanced Mode
Data address8 bits (@aa:8)H'FF00 to H'FFFFH'FFFF00 to H'FFFFFF
16 bits (@aa:16)H'0000 to H'FFFFH'000000 to H'007FFF,
H'FF8000 to H'FFFFFF
32 bits (@aa:32)H'000000 to H'FFFFFF
Program instruction
address
24 bits (@aa:24)
53
(6) Immediate—#xx:8, #xx:16, or #xx:32: The instruction contains 8-bit (#xx:8), 16-bit
(a)
(b)
(#xx:16), or 32-bit (#xx:32) immediate data as an operand.
The ADDS, SUBS, INC, and DEC instructions contain immediate data implicitly. Some bit
manipulation instructions contain 3-bit immediate data in the instruction code, specifying a bit
number. The TRAPA instruction contains 2-bit immediate data in its instruction code, 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 is sign-extended and
added to the 24-bit PC contents to generate a branch address. Only the lower 24 bits of this branch
address are valid; the upper 8 bits are all assumed to be 0 (H'00). 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 upper bits of the absolute address are all assumed to be 0,
so the address range is 0 to 255 (H'0000 to H'00FF in normal mode, H'000000 to H'0000FF in
advanced mode). In normal mode the memory operand is a word operand and the branch address
is 16 bits long. In advanced mode the memory operand is a longword operand, the first byte of
which is assumed to be all 0 (H'00).
Note that the first part of the address range is also the exception vector area. For further details,
refer to section 4, Exception Handling.
Specified
by @aa:8
Branch address
Normal Mode
Specified
by @aa:8
Reserved
Branch address
Advanced Mode
Figure 2-13 Branch Address Specification in Memory Indirect Mode
54
If an odd address is specified in word or longword memory access, or as a branch address, the
least significant bit is regarded as 0, causing data to be accessed or instruction code to be fetched
at the address preceding the specified address. (For further information, see section 2.5.2, Memory
Data Formats.)
2.7.2Effective Address Calculation
Table 2-6 indicates how effective addresses are calculated in each addressing mode. In normal
mode the upper 8 bits of the effective address are ignored in order to generate a 16-bit address.
55
24 23
Effective Address (EA)
24 23
24 23
24 23
Don’t care
310
Operand is general register contents.
Effective Address Calculation
General register contents
310
rop
Don’t care
310
disp
General register contents
Sign extension
310
310
disp
Don’t care
310
1, 2, or 4
General register contents
310
r
Don’t care
310
1, 2, or 4
124
General register contents
Byte
310
Operand Size Value added
r
Word
Longword
oprm rn
Register indirect with displacement
Register indirect (@ERn)2
1Register direct (Rn)
No.Addressing Mode and Instruction Format
Table 2-6 Effective Address Calculation
@(d:16, ERn) or @(d:32, ERn)
3
56
opr
Register indirect with post-increment or
pre-decrement
4
op
• Register indirect with post-increment @ERn+
• Register indirect with pre-decrement @–ERn
op
H'FFFF
Effective Address (EA)
24 23
16 15
Sign extension
24 23
24 23
24 23
Don’t care
3108 7
Effective Address Calculation
opabs
@aa:8
Absolute address
310
@aa:16
Don’t care
abs
op
Don’t care
310
@aa:24
abs
op
op
@aa:32
310
Don’t care
abs
Operand is immediate data.
IMM
op
Immediate #xx:8/#xx:16/#xx:32
5
No.Addressing Mode and Instruction Format
Table 2-6 Effective Address Calculation (cont)
6
57
Effective Address (EA)
24 23
16 15
24 23
H'00
24 23
Don’t care
310
0
PC contents
23
Effective Address Calculation
Program-counter relative
0
disp
Sign
extension
23
disp
op
@(d:8, PC)/@(d:16, PC)8Memory indirect @@aa:8
opabs
• Normal mode
0
318 7
Don’t care
310
abs
H'000000
0
0
Memory contents
15
• Advanced mode
opabs
0
318 7
abs
H'000000
Don’t care
310
0
Memory contents
31
7
No.Addressing Mode and Instruction Format
Table 2-6 Effective Address Calculation (cont)
58
2.8Processing States
2.8.1Overview
The CPU has five main processing states: the reset state, exception handling state, program
execution state, bus-released state, and power-down state. Figure 2-14 shows a diagram of the
processing states. Figure 2-15 indicates the state transitions.
Reset state
The CPU and all on-chip supporting modules have been
initialized and are stopped.
Exception-handling
state
A transient state in which the CPU changes the normal
processing flow in response to a reset, interrupt, or trap
instruction.
Processing
states
Note: *The power-down state also includes a medium-speed mode, module stop mode etc.
Program execution
state
The CPU executes program instructions in sequence.
Bus-released state
The external bus has been released in response to a bus
request signal from a bus master other than the CPU.
Sleep mode
Power-down state
CPU operation is stopped
to conserve power.*
Software standby
mode
Hardware standby
mode
Figure 2-14 Processing States
59
y
End of bus
request
Bus-released state
End of
exception
handling
Exception-handling state
RES = high
Program execution
Bus
request
Request for
exception
handling
External interrupt
End of bus request
Bus request
state
Interrupt
request
SLEEP
instruction
with
SSBY = 1
SLEEP
instruction
with
SSBY = 0
Sleep mode
Software standby mode
Reset state
Notes: 1.2.From any state except hardware standby mode, a transition to the reset state occurs whenever RES
goes low. A transition can also be made to the reset state when the watchdog timer overflows.
From an
*1
state, a transition to hardware standby mode occurs when STBY goes low.
STBY = high, RES = low
Hardware standby mode
Power-down state
*2
Figure 2-15 State Transitions
2.8.2Reset State
When the RES input goes low all current processing stops and the CPU enters the reset state. The
CPU enters the power-on reset state when the NMI pin is high, or the manual reset state when the
NMI pin is low. 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, refer to section 12,
Watchdog Timer.
60
2.8.3Exception-Handling State
The exception-handling state is a transient state that occurs when the CPU alters the normal
processing flow due to a reset, interrupt, or trap instruction. The CPU fetches a start address
(vector) from the exception vector table and branches to that address.
(1) Types of Exception Handling and Their Priority
Exception handling is performed for traces, resets, interrupts, and trap instructions. Table 2-7
indicates the types of exception handling and their priority. Trap instruction exception handling is
always accepted, in the program execution state.
Exception handling and the stack structure depend on the interrupt control mode set in SYSCR.
Table 2-7Exception Handling Types and Priority
PriorityType of ExceptionDetection TimingStart of Exception Handling
HighResetSynchronized with clockException handling starts
immediately after a low-to-high
transition at the RES pin, or
when the watchdog timer
overflows.
TraceEnd of instruction
execution or end of
exception-handling
sequence*
1
InterruptEnd of instruction
execution or end of
exception-handling
sequence*
2
Trap instructionWhen TRAPA instruction
is executed
Low
Notes: 1. Traces are enabled only in interrupt control mode 2. Trace exception-handling is not
executed at the end of the RTE instruction.
2. Interrupts are not detected at the end of the ANDC, ORC, XORC, and LDC instructions,
or immediately after reset exception handling.
3. Trap instruction exception handling is always accepted, in the program execution state.
When the trace (T) bit is set to
1, the trace starts at the end of
the current instruction or current
exception-handling sequence
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*
3
61
(2) Reset Exception Handling
After the RES pin has gone low and the reset state has been entered, when RES goes high again,
reset exception handling starts. The CPU enters the power-on reset state when the NMI pin is high,
or the manual reset state when the NMI pin is low. When reset exception handling starts the CPU
fetches a start address (vector) from the exception vector table and starts program execution from
that address. All interrupts, including NMI, are disabled during reset exception handling and after
it ends.
(3) Traces
Traces are enabled only in interrupt control mode 2. Trace mode is entered when the T bit of EXR
is set to 1. When trace mode is established, trace exception handling starts at the end of each
instruction.
At the end of a trace exception-handling sequence, the T bit of EXR is cleared to 0 and trace mode
is cleared. Interrupt masks are not affected.
The T bit saved on the stack retains its value of 1, and when the RTE instruction is executed to
return from the trace exception-handling routine, trace mode is entered again. Trace exceptionhandling is not executed at the end of the RTE instruction.
Trace mode is not entered in interrupt control mode 0, regardless of the state of the T bit.
(4) Interrupt Exception Handling and Trap Instruction Exception Handling
When interrupt or trap-instruction exception handling begins, the CPU references the stack pointer
(ER7) and pushes the program counter and other control registers onto the stack. Next, the CPU
alters the settings of the interrupt mask bits in the control registers. Then the CPU fetches a start
address (vector) from the exception vector table and program execution starts from that start
address.
Figure 2-16 shows the stack after exception handling ends.
62
Normal mode
SP
(a) Interrupt control mode 0 (b) Interrupt control mode 2
Advanced mode
SP
CCR
CCR*
PC
(16 bits)
CCR
PC
(24 bits)
SP
SP
EXR
Reserved*
CCR
CCR*
PC
(16 bits)
EXR
Reserved*
CCR
PC
(24 bits)
(c) Interrupt control mode 0 (d) Interrupt control mode 2
Note: *Ignored when returning.
Figure 2-16 Stack Structure after Exception Handling (Examples)
63
2.8.4Program Execution State
In this state the CPU executes program instructions in sequence.
2.8.5Bus-Released State
This is a state in which the bus has been released in response to a bus request from a bus master
other than the CPU. While the bus is released, the CPU halts.
There is one other bus master in addition to the CPU: the data transfer controller (DTC).
For further details, refer to section 6, Bus Controller.
2.8.6Power-Down State
The power-down state includes both modes in which the CPU stops operating and modes in which
the CPU does not stop. There are three modes in which the CPU stops operating: sleep mode,
software standby mode, and hardware standby mode. There are also two other power-down
modes: medium-speed mode, and module stop mode. In medium-speed mode the CPU and other
bus masters operate on a medium-speed clock. Module stop mode permits halting of the operation
of individual modules, other than the CPU. For details, refer to section 20, Power-Down State.
(1) Sleep Mode: A transition to sleep mode is made if the SLEEP instruction is executed while
the software standby bit (SSBY) in the standby control register (SBYCR) is cleared to 0. In sleep
mode, CPU operations stop immediately after execution of the SLEEP instruction. The contents of
CPU registers are retained.
(2) Software Standby Mode: A transition to software standby mode is made if the SLEEP
instruction is executed while the SSBY bit in SBYCR is set to 1. In software standby mode, the
CPU and clock halt and all MCU operations stop. 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.
(3) Hardware Standby Mode: A transition to hardware standby mode is made when the STBY
pin goes low. In hardware standby mode, the CPU and clock halt and all MCU operations stop.
The on-chip supporting modules are reset, but as long as a specified voltage is supplied, on-chip
RAM contents are retained.
64
2.9Basic Timing
2.9.1Overview
The CPU is driven by a system clock, denoted by the symbol ø. The period from one rising edge
of ø to the next is referred to as a "state." The memory cycle or bus cycle consists of one, two, or
three states. Different methods are used to access on-chip memory, on-chip supporting modules,
and the external address space.
2.9.2On-Chip Memory (ROM, RAM)
On-chip memory is accessed in one state. The data bus is 16 bits wide, permitting both byte and
word transfer instruction. Figure 2-17 shows the on-chip memory access cycle. Figure 2-18 shows
the pin states.
Bus cycle
T1
ø
Internal address bus
Read
access
Write
access
Internal read signal
Internal data bus
Internal write signal
Internal data bus
Figure 2-17 On-Chip Memory Access Cycle
Address
Read data
Write data
65
Bus cycle
g
T1
ø
UnchangedAddress bus
AS
RD
HWR, LWR
Data bus
Hi
High
High
High
h-impedance state
Figure 2-18 Pin States during On-Chip Memory Access
66
2.9.3On-Chip Supporting Module Access Timing
The on-chip supporting modules are accessed in two states. The data bus is either 8 bits or 16 bits
wide, depending on the particular internal I/O register being accessed. Figure 2-19 shows the
access timing for the on-chip supporting modules. Figure 2-20 shows the pin states.
Figure 2-20 Pin States during On-Chip Supporting Module Access
2.9.4External Address Space Access Timing
The external address space is accessed with an 8-bit or 16-bit data bus width in a two-state or
three-state bus cycle. In three-state access, wait states can be inserted. For further details, refer to
section 6, Bus Controller.
68
Section 3 MCU Operating Modes
3.1Overview
3.1.1H8S/2350 Operating Mode Selection
The H8S/2350 has three operating modes (modes 1, 4, and 5). These modes are determined by the
mode pin (MD2 to MD0) settings. The CPU operating mode and initial bus width can be selected
as shown in table 3-1.
The CPU's architecture allows for 4 Gbytes of address space, but the H8S/2350 actually accesses a
maximum of 16 Mbytes.
Modes 1, 4, and 5 are externally expanded modes that allow access to external memory and
peripheral devices.
The external expansion modes allow switching between 8-bit and 16-bit bus modes. After program
execution starts, an 8-bit or 16-bit address space can be set for each area, depending on the bus
controller setting. If 16-bit access is selected for any one area, 16-bit bus mode is set; if 8-bit
access is selected for all areas, 8-bit bus mode is set.
Note that the functions of each pin depend on the operating mode.
69
The H8S/2350 can be used only in modes 1, 4, and 5. This means that the mode pins must be set
to select one of these modes. Do not change the inputs at the mode pins during operation.
3.1.2H8S/2351 Operating Mode Selection
The H8S/2351 has seven operating modes (modes 1 to 7). These modes enable selection of the
CPU operating mode, enabling/disabling of on-chip ROM, and the initial bus width setting, by
setting the mode pins (MD2 to MD0).
Table 3-2 lists the MCU operating modes.
Table 3-2MCU Operating Mode Selection (H8S/2351)
MCUCPU
Operating
ModeMD
0000————
11NormalOn-chip ROM disabled,
210On-chip ROM enabled,
31Single-chip mode—
4100Advanced On-chip ROM disabled, Disabled 16 bits16 bits
51
610On-chip ROM enabled,
71Single-chip mode—
MD1MD
2
Operating
ModeDescription
0
expanded mode
expanded mode
expanded mode
expanded mode
On-Chip
ROM
Disabled 8 bits16 bits
Enabled 8 bits16 bits
Enabled 8 bits16 bits
External Data Bus
Initial
Width
8 bits16 bits
Max.
Width
The CPU's architecture allows for 4 Gbytes of address space, but the H8S/2351 actually accesses a
maximum of 16 Mbytes.
Modes 1, 2, and 4 to 6 are externally expanded modes that allow access to external memory and
peripheral devices.
The external expansion modes allow switching between 8-bit and 16-bit bus modes. After program
execution starts, an 8-bit or 16-bit address space can be set for each area, depending on the bus
controller setting. If 16-bit access is selected for any one area, 16-bit bus mode is set; if 8-bit
access is selected for all areas, 8-bit bus mode is set.
Note that the functions of each pin depend on the operating mode.
70
The H8S/2351 can be used only in modes 1 to 7. This means that the mode pins must be set to
select one of these modes. Do not change the inputs at the mode pins during operation.
3.1.3Register Configuration
The H8S/2350 Series has a mode control register (MDCR) that indicates the inputs at the mode
pins (MD2 to MD0), and a system control register (SYSCR) that controls the operation of the
H8S/2350 Series. Table 3-3 summarizes these registers.
Table 3-3MCU Registers
NameAbbreviationR/WInitial ValueAddress*
Mode control registerMDCRRUndeterminedH'FF3B
System control registerSYSCRR/WH'01H'FF39
Note: * Lower 16 bits of the address.
3.2Register Descriptions
3.2.1Mode Control Register (MDCR)
Bit
Initial value
R/W
Note: * Determined by pins MD
7
:
—
1
:
—
:
6
—
0
—
to MD0.
2
—
—
5
0
—
—
4
0
—
—
3
0
2
MDS2
—*
R
1
MDS1
—*
R
0
MDS0
—*
R
MDCR is an 8-bit read-only register that indicates the current operating mode of the H8S/2350
Series.
Bit 7—Reserved: Read-only bit, always read as 1.
Bits 6 to 3—Reserved: Read-only bits, always read as 0.
Bits 2 to 0—Mode Select 2 to 0 (MDS2 to MDS0): These bits indicate the input levels at pins
MD2 to MD0 (the current operating mode). Bits MDS2 to MDS0 correspond to MD2 to MD0.
MDS2 to MDS0 are read-only bits, they cannot be written to. The mode pin (MD2 to MD0) input
levels are latched into these bits when MDCR is read. These latches are canceled by a power-on
reset, but are retained after a manual reset.
71
3.2.2System Control Register (SYSCR)
Bit
Initial value
R/W
7
:
—
0
:
R/W
:
—
—
6
0
5
INTM1
0
R/W
4
INTM0
0
R/W
3
NMIEG
0
R/W
—
—
2
0
1
—
0
R/W
0
RAME
1
R/W
Bit 7—Reserved: Only 0 should be written to this bit.
Bit 6—Reserved: Read-only bit, always read as 0.
Bits 5 and 4—Interrupt Control Mode 1 and 0 (INTM1, INTM0): These bits select the control
mode of the interrupt controller. For details of the interrupt control modes, see section 5.4.1,
Interrupt Control Modes and Interrupt Operation.
Bit 5
INTM1
000Control of interrupts by I bit (Initial value)
102Control of interrupts by I2 to I0 bits and IPR
Bit 4
INTM0
1—Setting prohibited
1—Setting prohibited
Interrupt Control
ModeDescription
Bit 3—NMI Edge Select (NMIEG): Selects the valid edge of the NMI interrupt input.
Bit 3
NMIEGDescription
0An interrupt is requested at the falling edge of NMI input (Initial value)
1An interrupt is requested at the rising edge of NMI input
Bit 2—Reserved: Read-only bit, always read as 0.
Bit 1—Reserved: Only 0 should be written to this bit.
Bit 0—RAM Enable (RAME): Enables or disables the on-chip RAM. The RAME bit is
initialized when the reset status is released. It is not initialized in software standby mode.
Bit 0
RAMEDescription
0On-chip RAM is disabled
1On-chip RAM is enabled (Initial value)
72
3.3Operating Mode Descriptions
3.3.1Mode 1
The CPU can access a 64-kbyte address space in normal mode. The on-chip ROM is disabled, and
8-bit bus mode is set, immediately after a reset.
Ports B and C function as an address bus, port D functions as a data bus, and part of port F carries
bus control signals. However, note that if 16-bit access is designated by the bus controller, the bus
mode switches to 16 bits and port E becomes a data bus.
3.3.2Mode 2 (H8S/2351 Only)
The CPU can access a 64-kbyte address space in normal mode. The on-chip ROM is enabled, and
8-bit bus mode is set. immediately after a reset.
Ports B and C function as input ports immediately after a reset. They can each be set to output
addresses by setting the corresponding bits in the data direction register (DDR) to 1. Port D
functions as a data bus, and part of port F carries bus control signals. However, note that if 16-bit
access is designated by the bus controller, the bus mode switches to 16 bits and port E becomes a
data bus.
The amount of on-chip ROM that can be used is limited to 56 kbytes.
3.3.3Mode 3 (H8S/2351 Only)
The CPU can access a 64-kbyte address space in normal mode. The on-chip ROM is enabled, but
external addresses cannot be accessed.
All I/O ports are available for use as input-output ports.
The amount of on-chip ROM that can be used is limited to 56 kbytes.
3.3.4Mode 4
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is disabled.
Ports A, B and C function as an address bus, ports D and E function as a data bus, and part of port
F carries bus control signals.
The initial bus mode after a reset is 16 bits, with 16-bit access to all areas. However, note that if
8-bit access is designated by the bus controller for all areas, the bus mode switches to 8 bits.
73
3.3.5Mode 5
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is disabled.
Ports A, B and C function as an address bus, port D function as a data bus, and part of port F
carries bus control signals.
The initial bus mode after a reset is 8 bits, with 8-bit access to all areas. However, note that if at
least one area is designated for 16-bit access by the bus controller, the bus mode switches to 16
bits and port E becomes a data bus.
3.3.6Mode 6 (H8S/2351 Only)
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled.
Ports A, B and C function as input ports immediately after a reset. They can each be set to output
addresses by setting the corresponding bits in the data direction register (DDR) to 1. Port D
functions as a data bus, and part of port F carries bus control signals.
The initial bus mode after a reset is 8 bits, with 8-bit access to all areas. However, note that if at
least one area is designated for 16 bit access by the bus controller, the bus mode switches to 16
bits and port E becomes a data bus.
3.3.7Mode 7 (H8S/2351 Only)
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled,
but external addresses cannot be accessed.
All I/O ports are available for use as input-output ports.
74
3.4Pin Functions in Each Operating Mode
The pin functions of ports A to F vary depending on the operating mode. Table 3-4 shows their
functions in each operating mode.
1.
External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
2.
Figure 3-1 Memory Map in Each Operating Mode (cont)
77
78
Section 4 Exception Handling
4.1Overview
4.1.1Exception Handling Types and Priority
As table 4-1 indicates, exception handling may be caused by a reset, trap instruction, or interrupt.
Exception handling is prioritized as shown in table 4-1. If two or more exceptions occur
simultaneously, they are accepted and processed in order of priority. Trap instruction exceptions
are accepted at all times, in the program execution state.
Exception handling sources, the stack structure, and the operation of the CPU vary depending on
the interrupt control mode set by the INTM0 and INTM1 bits of SYSCR.
Table 4-1Exception Types and Priority
PriorityException TypeStart of Exception Handling
HighResetStarts immediately after a low-to-high transition at the RES
pin, or when the watchdog timer overflows. The CPU enters
the power-on reset state when the NMI pin is high, or the
manual reset state when the NMI pin is low.
1
Trace*
InterruptStarts when execution of the current instruction or exception
LowTrap instruction (TRAPA)*3Started by execution of a trap instruction (TRAPA)
Notes: 1. Traces are enabled only in interrupt control mode 2. Trace exception handling is not
executed after execution of an RTE instruction.
2. Interrupt detection is not performed on completion of ANDC, ORC, XORC, or LDC
instruction execution, or on completion of reset exception handling.
3. Trap instruction exception handling requests are accepted at all times in program
execution state.
Starts when execution of the current instruction or exception
handling ends, if the trace (T) bit is set to 1
handling ends, if an interrupt request has been issued*
2
79
4.1.2Exception Handling Operation
Exceptions originate from various sources. Trap instructions and interrupts are handled as
follows:
1. The program counter (PC), condition code register (CCR), and extended register (EXR) are
pushed onto the stack.
2. The interrupt mask bits are updated. The T bit is cleared to 0.
3. A vector address corresponding to the exception source is generated, and program execution
starts from that address.
For a reset exception, steps 2 and 3 above are carried out.
4.1.3Exception Vector Table
The exception sources are classified as shown in figure 4-1. Different vector addresses are
assigned to different exception sources.
Table 4-2 lists the exception sources and their vector addresses.
Power-on reset
Manual reset
External interrupts: NMI, IRQ7 to IRQ0
Internal interrupts: 42 interrupt sources in
on-chip supporting modules
Exception
sources
Reset
Trace
Interrupts
Trap instruction
Figure 4-1 Exception Sources
In modes 6 and 7 in the H8S/2351, the on-chip ROM available for use after a power-on reset is the
64-kbyte area comprising addresses H'000000 to H'00FFFF. Care is required when setting vector
addresses.
80
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.