1. Renesas Technology Corp. puts the maximum effort into making semiconductor products
better and more reliable, but there is always the possibility that trouble 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 the selection of the
Renesas Technology Corp. 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 Corp. or a third party.
2. Renesas Technology Corp. 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 materials.
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 Corp. without notice due to
product improvements or other reasons. It is therefore recommended that customers contact
Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor for
the latest product information before purchasing a product listed herein.
The information described here may contain technical inaccuracies or typographical errors.
Renesas Technology Corp. 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 Corp. by various
means, including the Renesas Technology Corp. 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 evaluate all information as a total
system before making a final decision on th e applicability of the information and products.
Renesas Technology Corp. assumes no responsibility for any damage, liability or other loss
resulting from the information contained herein.
5. Renesas Technology Corp. semiconductors are not designed or manufactured for use in a
device or system that is used under circumstances in which human life is potentially at stake.
Please contact Renesas Technology Corp. or an authorized Renesas Technology Corp. 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, nuclear, or
undersea repeater use.
6. The prior written approval of Renesas Technology Corp. 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 Corp. for further details on these materials or the products
contained therein.
Rev.1.00, 09/03, page iii of xxxviii
Page 4
General Precautions on Handling of Product
1. Treatment of NC Pins
Note: Do not connect anything to the NC pins.
The NC (not connected) pins are either not connected to any of the internal circuitry or are
used as test pins or to reduce noise. If something is conn ected to the NC pins, the
operation of the LSI is not guaranteed.
2. Treatment of Unused Input Pins
Note: Fix all unused input pins to high or low level.
Generally, the input pins of CMOS products are high-impedance input pins. If unused pins
are in their open states, intermediate levels are induced by noise in the vicinity, a passthrough current flows internally, and a malfunction may occur.
3. Processing before Initialization
Note: When power is first supplied, the product’s state is undefined.
The states of internal circuits are undefined until full power is supplied throughout the
chip and a low level is input on the reset pin. During the period where the states are
undefined, the register settings and the output state of each pin are also undefined. Design
your system so that it does not malfunction because of processing while it is in this
undefined state. For those products which have a reset function, reset the LSI immediately
after the power supply has been turned on.
4. Prohibition of Access to Undefined or Reserved Addresses
Note: Access to undefined or reserved addresses is prohibited.
The undefined or reserved addresses may be used to expand functions, or test registers
may have been be allocated to these addresses. Do not access these registers; the system’s
operation is not guaranteed if they are accessed.
Rev.1.00, 09/03, page iv of xxxviii
Page 5
Configuration of This Manual
This manual comprises the following items:
1. General Precautions on Handling of Product
2. Configuration of This Manual
3. Preface
4. Contents
5. Overview
6. Description of Functional Modules
• CPU and System-Control Modules
• On-Chip Peripheral Modules
The configuration of the functional description of each module differs according to the
module. However, the generic style includes the following items:
i) Feature
ii) Input/Output Pin
iii) Register Description
iv) Operation
v) Usage Note
When designing an application system that includes this LSI, take notes into account. Each section
includes notes in relation to the descriptions given, and usage notes are given, as required, as the
final part of each section.
7. List of Registers
8. Electrical Characteristics
9. Appendix
10. Main Revisions and Additions in this Edition (only for revised versions)
The list of revisions is a summary of points that have been revised or added to earlier versions.
This does not include all of the revised contents. For details, see the actual locations in this
manual.
11. Index
Rev.1.00, 09/03, page v of xxxviii
Page 6
Preface
This LSI is a microcomputer (MCU) made up of the H8S/2600 CPU with Renesas Technologyoriginal architecture as its core, and the peripheral functions required to configure a system.
The H8S/2600 CPU has an internal 32-bit configuration, sixteen 16-bit general registers, and a
simple and optimized instruction set for high-speed operation. The H8S/2600 CPU can handle a
16-Mbyte linear address space. The instruction set of the H8S/2600 CPU maintains upward
compatibility at the object level with the H8/300 and H8/300H CPUs. This allows the transition
from the H8/300, H8/300L, or H8/300H to the H8S/2600 CPU.
This LSI is equipped with the flash memory, RAM, two kinds of PWM timers (PWM and
PWMX), a 16-bit free-running timer (FRT), an 8-bit tim er ( TMR), a 16-bit timer pulse unit (TPU),
a watchdog timer (WDT), a timer connection, a serial communication interface (SCI), an I
interface 3 (IIC3), an A/D converter, and I/O ports as on-chip peripheral modules required for
system configuration.
TM
A flash memory (F-ZTAT
*) version is available for this LSI’s 256-kbyte ROM. The CPU and
the flash memory are connected to a 16-bit bus, enabling byte data and word data to be accessed in
a single state. This improves the instruction fetch and process speeds.
TM
Note: * F-ZTAT
is a trademark of Renesas Technology Corp.
Target Users: This manual was written for users who use th is LSI in the design of application
systems. Target users are expected to understand the fundamentals of electrical
circuits, logic circuits, and microcomputers.
2
C bus
Objective: This manual was written to explain the hardware functions and electrical
characteristics of this LSI to the target users.
Refer to the H8S/2600 Series, H8S/2000 Series Programming Manual for a
detailed description of the instruction set.
Notes on Reading this Manual:
• In order to understand the overall functions of the chip
Read this manual in the order of the table of contents. This manual can be roughly categorized
into the descriptions on the CPU, system control functions, peripheral functions, and electrical
characteristics.
Rev.1.00, 09/03, page vi of xxxviii
Page 7
• In order to understand the details of the CPU's functions
Read the H8S/2600 Series, H8S/2000 Series Programming Manual.
• In order to understand the detailed function of a register whose name is known
Read the index that is the final part of the manual to find the page number of the entry on the
register. The addresses, bits, and initial values of the registers are summarized in section 23,
List of Registers.
Rules: Register name: The following notation is used for cases when the same or a
similar function, e.g., serial communication interface, is
implemented on more than one channel:
XXX_N (XXX is the register name and N is the channel
number)
Bit order: The MSB is on the left and the LSB is on the right.
Number notation: Binary is B’xxxx, hexadecimal is H’xxxx, decimal is xxxx.
Signal notation: An overbar is added to a low-active signal: xxxx
Related Manuals: The latest versions of all related manuals are available from our web site.
Please ensure you have the latest versions of all documents you require.
http://www.renesas.com/eng/
H8S/2437 Group manuals:
Document Title Document No.
H8S/2437 Group Hardware Manual This manual
H8S/2600 Series, H8S/2000 Series Programming Manual ADE-602-083
Table A.1 I/O Port States in Each Pin State...........................................................................695
Rev. 1.00, 09/03, page xxxvii of xxxviii
Page 38
Rev. 1.00, 09/03, page xxxviii of xxxviii
Page 39
Section 1 Overview
1.1 Features
• High-speed H8S/2600 central processing unit with an internal 16-bit architecture
Upward-compatible with H8/300 and H8/300H CPUs on an object level
Sixteen 16-bit general registers
69 basic instructions
Multiply-and-accumulate instruction
• Various peripheral functions
8-bit PWM timer (PWM)
14-bit PWM timer (PWMX)
16-bit free-running timer (FRT)
8-bit timer (TMR)
16-bit timer pulse unit (TPU)
Watchdog timer (WDT)
Timer connection
Duty measurement circuit
Asynchronous or clocked synchronous serial communication interface (SCI)
2
I
C bus interface 3 (IIC3)
10-bit A/D converter
• On-chip memory
ROM Type Model ROM RAM Remarks
Flash memory
version
• General I/O ports
I/O pins: 94
Input-only pins: 16
• Supports various power-down modes
• Compact package
Package Code Body Size Pin Pitch
QFP-128 FP-128B 14.0 × 20.0 mm 0.5 mm
HD64F2437 256 kbytes 16 kbytes
Rev. 1.00, 09/03, page 1 of 704
Page 40
1.2 Internal Block Diagram
Figure 1.1 shows the internal block diagram of the H8S/2437 Group.
φ21 Output Supplies the system clock to external devices.
Operating
mode control
System
control
STBY 37 Input When this pin is low, a transition is made to
FWE 26 Input Pin for use by flash memory.
Address bus A15 to A8
Data bus D15 to D8
data
multiplex
bus
VCC 16, 31,
83, 115
VCL 30 Input External capacitance pin for internal step-down
VSS 13, 29,
34, 53,
86, 118
MD2
MD1
MD0
RES 28 Input Reset pin. When this pin is low, the chip is reset.
A7 to A0
D7 to D0
AD15 to AD8 107 to 114 I/O Upper 8-bit, 16-bit bus Address/
AD7 to AD0 116, 117,
25
24
23
107 to 114,
116, 117,
119 to 124
125 to 4
5 to 12
119 to 124
Input Power supply pins. Connect all these pins to the
system power supply.
power. Connect this pin to Vss through an
external capacitor (that is located near this pin)
to stabilize internal step-down.
Input Ground pins. Connect all these pins to the
system power supply (0V).
For connection to a crystal resonator. An
external clock can be supplied from the EXTAL
pin. For an example of crystal resonator
connection, see section 21, Clock Pulse
Generator.
Input These pins set the operating mode. Inputs at
these pins should not be changed during
operation.
hardware standby mode.
Output Address output pins
I/O Bidirectional data bus
I/O Lower 16-bit bus
Rev. 1.00, 09/03, page 9 of 704
Page 48
Type Symbol Pin No. I/O Name and Function
Bus control WAIT 22 Input Requests insertion of a wait state in the bus
cycle when accessing an external 3-state
address space.
RD 18 Output This pin is low when the external address space
is being read.
HWR 19 Output This pin is low when the external address space
is to be written to, and the upper half of the data
bus is enabled.
LWR 14 Output This pin is low when the external address space
is to be written to, and the lower half of the data
bus is enabled.
AS20 Output This pin is low when address output on the
address bus is valid.
CS3 to CS191, 15, 17 Output Chip select signals for areas 3 to 1.
AH 20 Output Address latch signal for address/data multiplex
bus.
Interrupts
On-chip
emulator
NMI 27 Input Nonmaskable interrupt request input pin
IRQ7 to IRQ0 76 to 73
Selectable to which pin of IRQn or ExIRQn to
input IRQ7 to IRQ0 interrupts.
Interface pins for the on-chip emulator.
Reset by holding the ETRST pin to low when
activating the H-UDI. At this time, the ETRST pin
should be held low for 20 clocks of ETCK. For
details, see section 24, Electrical
Characteristics. Then, to activate the H-UDI, the
ETRST pin should be set to 1 and desired
values should be set to the ETCK, ETMS, and
ETDI pins. When in the normal operation without
activating the H-UDI, the ETRST, ETCK, ETMS,
and ETDI pins should be set to 1 or highimpedance. Since these pins are internally
pulled up, care should be taken in the standby
state.
8-bit PWM
timer (PWM)
PW7 to PW0 116, 117,
119, 124
ExPW7 to
ExPW0
97, 98,
48, 47,
Output Pulse output pins for the PWM timer.
Selectable from which pin of PWn or ExPWn to
output PW5 to PW0.
AVCC 71 Input Analog power supply pin for the A/D converter.
When the A/D converter is not used, this pin
should be connected to the system power supply
(+3.3 V).
AVref 72 Input Reference power supply pin for the A/D
converter. When the A/D converter is not used,
this pin should be connected to the system
power supply (+3.3 V).
AVSS 54 Input Ground pin for the A/D converter. This pin
should be connected to the system power supply
(0 V).
I/O ports P07 to P00 70 to 63 Input Eight input pins
P17 to P10 116, 117,
I/O Eight input/output pins
119 to 124
P27 to P20 107 to 114 I/O Eight input/output pins
P37 to P30 125 to 4 I/O Eight input/output pins
P47 to P40 76 to 73,
I/O Eight input/output pins
52 to 49
P57 to P50 48 to 41 I/O Eight input/output pins
P67 to P60 5 to 12 I/O Eight input/output pins
P77 to P70 62 to 55 Input Eight input pins
P87 to P80 87 to 90
I/O Eight input/output pins
99 to 102
P97 to P90 22 to 14 I/O Eight input/output pins
PA7 to PA0 91 to 98 I/O Eight input/output pins
PB7 to PB0 85, 84,
I/O Eight input/output pins
82 to 77
PC7 to PC4*1 40, 38,
Input Four input pins
36, 35
PC3 to PC0 106 to 103 I/O Four input/output pins
Rev. 1.00, 09/03, page 13 of 704
Page 52
Notes: 1. Not supported by the on-chip emulator.
2. Following precautions are required on the power-on reset signal that is applied to the
ETRST pin.
The reset signal must be applied at a power-on.
Apart the power-on reset circuit from this LSI to prevent the ETRST pin of the board
tester from affecting the operation of this LSI.
Apart the power-on reset circuit from this LSI to prevent the system reset of this LSI
from affecting the ETRST pin of the board tester.
Figure1.3 shows an example of design in which signals for reset do not affect each other.
Board edge pin
System
reset
Power-on
reset circuit
This LSI
Figure 1.3 Sample Design of Reset Signals without Affection Each Other
Rev. 1.00, 09/03, page 14 of 704
Page 53
Section 2 CPU
The H8S/2600 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/2600 CPU has sixteen 16-bit
general registers, can address a 16-Mbyte linear address space, and is ideal for realtime control.
This section describes the H8S/2600 CPU. The usable modes and address spaces differ depending
on the product. For details on each product, refer to section 3, MCU Operating Modes.
2.1 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-nine basic instructions
8/16/32-bit arithmetic and logic instructions
Multiply and divide instructions
Powerful bit-manipulation instructions
Multiply-accumulate instruction
• 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]
• 16-Mbyte address space
Program: 16 Mbytes
Data: 16 Mbytes
• High-speed operation
All frequently-used instructions execute in one or two states
8/16/32-bit register-register add/subtract: 1 state
8 × 8-bit register-register multiply: 3 states
16 ÷ 8-bit register-register divide: 12 states
16 × 16-bit register-register multiply: 4 states
32 ÷ 16-bit register-register divide: 20 states
CPUS260A_020020020300
Rev. 1.00, 09/03, page 15 of 704
Page 54
• Two CPU operating modes
Normal mode*
Advanced mode
• Power-down state
Transition to power-down state by SLEEP instruction
CPU clock speed selection
Note: Normal mode is not available in this LSI.
2.1.1 Differences 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.
• The number of execution states of the MULXU and MULXS instructions
Execution States
Instruction Mnemonic H8S/2600 H8S/2000
In addition, there are differences in addr ess space, CCR and EXR register functions, power-d own
modes, etc., depending on the model.
Rev. 1.00, 09/03, page 16 of 704
Page 55
2.1.2 Differences from H8/300 CPU
In comparison to the H8/300 CPU, the H8S/2600 CPU has the following enhancements.
• More general registers and control registers
Eight 16-bit expanded registers, and one 8-bit and two 32-bit control registers, 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.
A multiply-accumulate instruction has been added.
Two-bit shift and rotate instructions have been added.
Instructions for saving and restoring multip le r e gisters have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions execute twice as fast.
Note: Normal mode is not available in this LSI.
2.1.3 Differences from H8/300H CPU
In comparison to the H8/300H CPU, the H8S/2600 CPU has the following enhancements.
• Additional control register
One 8-bit and two 32-bit control registers have been added.
• Enhanced instructions
Addressing modes of bit-manipulation instructions have been enhanced.
A multiply-accumulate instruction has been added.
Two-bit shift and rotate instructions have been added.
Instructions for saving and restoring multip le r e gisters have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions execute twice as fast.
Rev. 1.00, 09/03, page 17 of 704
Page 56
2.2 CPU Operating Modes
The H8S/2600 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. The mode is selected by the mode pins.
2.2.1 Normal Mode
The exception-handling vector table and stack have the same structure as in the H8/300 CPU.
• Address Space
The H8S/2600 CPU provides linear access to a maximum 64-kbyte address space.
• 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.
• Exception-handling Vector Table and Memory Indirect Branch Addresses
In normal mode the top area starting at H'0000 is allocated to the exception-handling vector
table. One branch address is stored per 16 bits. The exception-handling vector table in normal
mode is shown in figure 2.1. For details of the exception-handling 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 16-bit 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-handling vector table.
• 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.2. EXR is not pushed onto the
stack in interrupt control mode 0. For details, see section 4, Exception Handling.
1. When EXR is not used, it is not stored on the stack.
2. SP when EXR is not used.
3. lgnored when returning.
PC
(16 bits)
Figure 2.2 Stack Structure in Normal Mode
(SP
SP
1
EXR*
2
*
)
Reserved*
CCR
CCR*
(16 bits)
(b) Exception Handling(a) Subroutine Branch
PC
1
,
3
*
3
Rev. 1.00, 09/03, page 19 of 704
Page 58
2.2.2 Advanced Mode
• Address Space
Linear access is provided to a 16-Mbyte maximum address space.
• 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.
• Exception-handling Vector Table and Memory Indirect Branch Addresses
In advanced mode the top area starting at H'00000000 is allocated to the exception-handling
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.3). For details of the exception-handling 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.
Rev. 1.00, 09/03, page 20 of 704
Page 59
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 used for the exception-handling vector table.
• 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.4. EXR is not
pushed onto the stack in interrupt control mode 0. For details, see section 4, Exception
Handling.
1
EXR*
Reserved*
CCR
PC
(24 bits)
1
,
3
*
SP
Reserved
PC
(24 bits)
SP
(SP
2
*
)
(a) Subroutine Branch(b) Exception Handling
Notes:1. 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.4 Stack Structure in Advanced Mode
Rev. 1.00, 09/03, page 21 of 704
Page 60
2.3 Address Space
Figure 2.5 shows a memory map of the H8S/2600 CPU. The H8S/2600 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. The usable modes and address spaces
differ depending on the product. For details on each product, refer to section 3, MCU Operating
Modes.
H'0000
64-kbyte16-Mbyte
H'FFFF
Note: * Normal mode cannot be used in this LSI.
H'00000000
H'00FFFFFF
H'FFFFFFFF
Figure 2.5 Memory Map
Note: Normal mode is not available in this LSI.
Program area
Data area
Cannnot be
used in this LSI
(b) Advanced Mode(a) Normal Mode*
Rev. 1.00, 09/03, page 22 of 704
Page 61
2.4 Registers
The H8S/2600 CPU has the internal registers shown in figure 2.6. There are two types of registers:
general registers and control registers. Control registers are a 24-bit program counter (PC), an 8-bit
extended register (EXR), an 8-bit condition code register ( CCR), and a 64-bit multiply-accumulate
register (MAC).
General Registers (Rn) and Extended Registers (En)
150 70 70
ER0
ER1
ER2
ER3
ER4
ER5
ER6
ER7 (SP)
E0
E1
E2
E3
E4
E5
E6
E7
R0H
R1H
R2H
R3H
R4H
R5H
R6H
R7H
R0L
R1L
R2L
R3L
R4L
R5L
R6L
R7L
Control Registers (CR)
23
633241
MAC
310
Sign extension
MACL
[Legend]
Stack pointer
SP:
Program counter
PC:
Extended register
EXR:
Trace bit
T:
Interrupt mask bits
I2 to I0:
Condition-code register
CCR:
Interrupt mask bit
I:
User bit or interrupt mask bit*
UI:
Note: * UI cannot be used as an interrupt mask bit in this LSI.
Figure 2.6 CPU Registers
PC
76543210
TI2I1I0
EXR
----
76543210
CCR
IUIHUNZVC
H:
Half-carry flag
U:
User bit
N:
Negative flag
Z:
Zero flag
V:
Overflow flag
C:
Carry flag
MAC:
Multiply-accumulate register
0
MACH
Rev. 1.00, 09/03, page 23 of 704
Page 62
2.4.1 General Registers
The H8S/2600 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 . Figure 2.7 illustrates the
usage of the general registers. 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.
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.8 shows the
stack.
• Address registers
• 32-bit registers
ER registers
(ER0 to ER7)
Figure 2.7 Usage of General Registers
Rev. 1.00, 09/03, page 24 of 704
• 16-bit registers• 8-bit registers
E registers (extended registers)
(E0 to E7)
R registers
(R0 to R7)
RH registers
(R0H to R7H)
RL registers
(R0L to R7L)
Page 63
Free area
SP (ER7)
Stack area
Figure 2.8 Stack
2.4.2 Program Counter (PC)
This 24-bit counter indicates the address of the next instructio n 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 signif icant PC bit is regarded as 0.)
2.4.3 Extended Register (EXR)
EXR is an 8-bit register that can be manipulated by the LDC, STC, ANDC, ORC, and XORC
instructions. When these instructions except for the STC instruction is executed, all inter r upts
including NMI will be masked for three states after execution is co mpleted.
Bit Bit Name Initial Value R/W Description
7 T 0 R/W Trace Bit
When this bit is set to 1, a trace exception-handling is
started each time an instruction is executed. When
this bit is cleared to 0, instructions are executed in
sequence.
6 to 3 All 1 Reserved
These bits are always read as 1.
2
1
0
I2
I1
I0
1
1
1
R/W
R/W
R/W
These bits designate the interrupt mask level (0 to 7).
For details, refer to section 5, Interrupt Controller.
Rev. 1.00, 09/03, page 25 of 704
Page 64
2.4.4 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.
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.
Bit Bit Name Initial Value R/W Description
7 I 1 R/W Interrupt Mask Bit
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 exception-handling
sequence. For details, refer to section 5, Interrupt
Controller.
6 UI Undefined R/W User Bit or Interrupt Mask Bit
Can be written and read by software using the LDC,
STC, ANDC, ORC, and XORC instructions. This bit
cannot be used as an interrupt mask bit in this LSI.
5 H Undefined R/W Half-Carry Flag
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.
4 U Undefined R/W User Bit
Can be written and read by software using the LDC,
STC, ANDC, ORC, and XORC instructions.
3 N Undefined R/W Negative Flag
Stores the value of the most significant bit of data as a
sign bit.
2 Z Undefined R/W Zero Flag
Set to 1 to indicate zero data, and cleared to 0 to
indicate non-zero data.
Rev. 1.00, 09/03, page 26 of 704
Page 65
Bit Bit Name Initial Value R/W Description
1 V Undefined R/W Overflow Flag
Set to 1 when an arithmetic overflow occurs, and
cleared to 0 otherwise.
0 C Undefined R/W Carry Flag
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 indicate a carry
The carry flag is also used as a bit accumulator by bit
manipulation instructions.
2.4.5 Multiply-Accumulate Register (MAC)
This 64-bit register stores the results of multiply-accumulate operation s. It consists of two 32-bit
registers denoted MACH and MACL. The lower 10 bits of MACH are valid; the upper bits are a
sign extension.
2.4.6 Initial Values of CPU Internal Registers
When the reset exception handling loads the start address from the vector address, PC is
initialized, the T bit in EXR is cleared to 0, and the I bits in EXR and CCR are set to 1. Howev e r,
the general registers and the other CCR bits ar e not initialized. The initial value of SP (E R7) is
undefined. SP should therefore be initialized by using the MOV.L instruction immediately after a
reset.
Rev. 1.00, 09/03, page 27 of 704
Page 66
2.5 Data Formats
The H8S/2600 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.1 General Register Data Formats
Figure 2.9 shows the data formats in general registers.
Data TypeRegister NumberData Format
70
65432710
Don't care
1-bit data
RnH
1-bit data
4-bit BCD data
4-bit BCD data
Byte data
Byte data
RnL
RnH
RnL
RnH
RnL
Don't care
7043
UpperLower
Don't care
70
MSBLSB
Don't care
70
65432710
Don't care
7043
UpperLower
70
MSBLSB
Figure 2.9 General Register Data Formats (1)
Don't care
Rev. 1.00, 09/03, page 28 of 704
Page 67
Data TypeData FormatRegister Number
Word data
Word data
150
MSBLSB
Longword data
3116
MSB
Rn
En
ERn
EnRn
[Legend]
General register ER
ERn:
General register E
En:
General register R
Rn:
General register RH
RnH:
General register RL
RnL:
Most significant bit
MSB:
Least significant bit
LSB :
Figure 2.9 General Register Data Formats (2)
150
MSBLSB
150
LSB
Rev. 1.00, 09/03, page 29 of 704
Page 68
2.5.2 Memory Data Formats
Figure 2.10 shows the data formats in memory. The H8S/2600 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.
When ER7 is used as an address register to access the stack, the operand size should be word size
or longword size.
Data T ypeAddress
70
1-bit data
Byte data
Word data
Longword dataAddress 2N
Address L
Address L
Address 2M
Address 2M+1
Address 2N+1
Address 2N+2
Address 2N+3
76 543210
MSB
MSB
MSB
Figure 2.10 Memory Data Formats
Data Format
LSB
LSB
LSB
Rev. 1.00, 09/03, page 30 of 704
Page 69
2.6 Instruction Set
The H8S/2600 CPU has 69 types of instructions. The instructions are classified by function in
table 2.1.
Table 2.1 Inst ruction Classification
Function Instructions Size Types
Data transfer MOV B/W/L 5
POP*1, PUSH*1 W/L
LDM, STM L
MOVFPE*3, MOVTPE*3 B
Branch Bcc*2, JMP, BSR, JSR, RTS — 5
System control TRAPA, RTE, SLEEP, LDC, STC, ANDC, ORC, XORC, NOP — 9
Block data transfer EEPMOV — 1
Total: 69
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,
2. Bcc is the general name for conditional branch instructions.
3. Cannot be used in this LSI.
4. Only register ER0, ER1, ER4, or ER5 should be used when using the TAS instruction.
@-SP respectively. POP.L ERn and PUSH.L ERn are identical to MOV.L @SP+, ERn
and MOV.L ERn, @-SP respectively.
ADDX, SUBX, DAA, DAS B
4
*
B
B 14
BIAND, BOR, BIOR, BXOR, BIXOR
Rev. 1.00, 09/03, page 31 of 704
Page 70
2.6.1 Table of Instructions Classified by Function
Tables 2.3 to 2.10 summarize the instructions in each functional category. The notation used in
tables 2.3 to 2.10 is defined below.
Table 2.2 Operation Notation
Symbol Description
Rd General register (destination)*
Rs General register (source)*
Rn General register*
ERn General register (32-bit register)
MAC Multiply-accumulate register (32-bit register)
(EAd) Destination operand
(EAs) Source operand
EXR Extended register
CCR Condition-code register
N N (negative) flag in CCR
Z Z (zero) flag in CCR
V V (overflow) flag in CCR
C C (carry) flag in CCR
PC Program counter
SP Stack pointer
#IMM Immediate data
disp Displacement
+ Addition
– Subtraction
× Multiplication
÷ Division
∧ Logical AND
∨ Logical OR
⊕ Logical exclusive OR
→ Move
~ NOT (logical complement)
:8/:16/:24/:32 8-, 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).
Rev. 1.00, 09/03, page 32 of 704
Page 71
Table 2.3 Data Transfer Instructions
Instruction Size* Function
MOV B/W/L (EAs) → Rd, Rs → (EAd)
Transfers data between two general registers or between a general
register and memory, or transfers immediate data to a general register.
MOVFPE B Cannot be used in this LSI.
MOVTPE B Cannot be used in this LSI.
POP W/L @SP+ → Rn
Pops a general register from the stack. POP.W Rn is identical to
MOV.W @SP+, Rn. POP.L ERn is identical to MOV.L @SP+, ERn.
PUSH W/L Rn → @–SP
Pushes a general register onto the stack. PUSH.W Rn is identical to
MOV.W Rn, @–SP. PUSH.L ERn is identical to MOV.L ERn, @–SP.
LDM L @SP+ → Rn (register list)
Pops two or more general registers from the stack.
STM L Rn (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
Rev. 1.00, 09/03, page 33 of 704
Page 72
Table 2.4 Arithmetic Operations Instructions (1)
Instruction Size* Function
ADD
SUB
ADDX
SUBX
INC
DEC
ADDS
SUBS
DAA
DAS
MULXU B/W Rd × Rs → Rd
MULXS B/W Rd × Rs → Rd
DIVXU B/W Rd ÷ Rs → Rd
Note: Size refers to the operand size.
B: Byte
W: Word
L: Longword
B/W/L Rd ± 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 b yte data can not
be subtracted from byte data in a general register. Use the SUBX or ADD
instruction.)
B Rd ± 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/L Rd ± 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)
L Rd ± 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.
B Rd (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 16-bit remainder.
Rev. 1.00, 09/03, page 34 of 704
Page 73
Table 2.4 Arithmetic Operations Instructions (2)
Instruction Size*1 Function
DIVXS B/W Rd ÷ Rs → Rd
Performs signed division on data in two general registers.
Either 16 bits ÷ 8 bits → 8-bit quotient and 8-bit remainder or
Clears the multiply-accumulate register to zero.
LDMAC
STMAC
Notes: 1. Size refers to the operand size.
B: Byte
W: Word
L: Longword
2. Only register ER0, ER1, ER4, or ER5 should be used when using the TAS instruction.
L Rs → MAC, MAC → Rd
Transfers data between a general register and a multiply-ac c um ulate
register.
Rev. 1.00, 09/03, page 35 of 704
Page 74
Table 2.5 Logic Operations Instructions
Instruction Size* Function
AND B/W/L Rd ∧ Rs → Rd, Rd ∧ #IMM → Rd
Performs a logical AND operation on a general register and another
general register or immediate data.
OR B/W/L Rd ∨ Rs → Rd, Rd ∨ #IMM → Rd
Performs a logical OR operation on a general register and another
general register or immediate data.
XOR B/W/L Rd ⊕ Rs → Rd, Rd ⊕ #IMM → Rd
Performs a logical exclusive OR operation on a general register and
another general register or immediate data.
NOT B/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.6 Shift Inst ructions
Instruction Size* Function
SHAL
SHAR
SHLL
SHLR
ROTL
ROTR
ROTXL
ROTXR
Note: Size refers to the operand size.
B: Byte
W: Word
L: Longword
B/W/L Rd (shift) → Rd
Performs an arithmetic shift on general register contents.
1-bit or 2-bit shift is possible.
B/W/L Rd (shift) → Rd
Performs a logical shift on general register contents.
1-bit or 2-bit shift is possible.
B/W/L Rd (rotate) → Rd
Rotates general register contents.
1-bit or 2-bit rotation is possible.
B/W/L Rd (rotate) → Rd
Rotates general register contents through the carry flag.
1-bit or 2-bit rotation is possible.
Rev. 1.00, 09/03, page 36 of 704
Page 75
Table 2.7 Bit Manipulation Instructions (1)
Instruction Size* Function
BSET B 1 → (<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.
BCLR B 0 → (<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.
BNOT B ~ (<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.
BTST B ~ (<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 lowe r three bits of a general register.
BAND
BIAND
BOR
BIOR
Note: Size refers to the operand size.
B: Byte
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.
Rev. 1.00, 09/03, page 37 of 704
Page 76
Table 2.7 Bit Manipulation Instructions (2)
Instruction Size*1 Function
BXOR
BIXOR
BLD
BILD
BST
BIST
Note: Size refers to the operand size.
B: Byte
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 memo ry 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.
Rev. 1.00, 09/03, page 38 of 704
Page 77
Table 2.8 Branch Instructions
Instruction Size Function
Bcc — Branches to a specified address if a specified condition is true. The
branching conditions are listed below.
Mnemonic Description Condition BRA (BT) Always (true) Always
BRN (BF) Never (false) Never
BHI High C ∨ Z = 0
BLS Low or same C ∨ Z = 1
BCC (BHS) Carry clear
(high or same)
BCS (BLO) Carry set (low) C = 1
BNE Not equal Z = 0
BEQ Equal Z = 1
BVC Overflow clear V = 0
BVS Overflow set V = 1
BPL Plus N = 0
BMI Minus N = 1
BGE Greater or equal N ⊕ V = 0
BLT Less than N ⊕ V = 1
BGT Greater than Z ∨ (N ⊕ V) = 0
BLE Less or equal Z ∨ (N ⊕ V) = 1
JMP — Branches unconditionally to a specified addre ss .
BSR — Branches to a subroutine at a specified address.
JSR — Branches to a subroutine at a specified address.
RTS — Returns from a subroutine
C = 0
Rev. 1.00, 09/03, page 39 of 704
Page 78
Table 2.9 System Control Instructions
Instruction Size* Function
TRAPA — Starts trap-instruction exception handling.
RTE — Returns from an exception-handling routine.
SLEEP — Causes a transition to a power-down state.
LDC B/W (EAs) → CCR, (EAs) → EXR
Transfers the contents of a general register or memory, or immediate
data to CCR or EXR. Although CCR and EXR are 8-bit registers, wordsize transfers are performed between them and memory. The upper 8
bits are valid.
STC B/W CCR → (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.
ANDC B CCR ∧ #IMM → CCR, EXR ∧ #IMM → EXR
Logically ANDs the CCR or EXR contents with immediate data.
ORC B CCR ∨ #IMM → CCR, EXR ∨ #IMM → EXR
Logically ORs the CCR or EXR contents with immediate data.
XORC B CCR ⊕ #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.
Note: Size refers to the operand size.
B: Byte
W: Word
Rev. 1.00, 09/03, page 40 of 704
Page 79
Table 2.10 Block Data Transfer Instructions
Instruction Size Function
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. Starting from the address set in ER5, transfers
data for the number of bytes set in R4L or R4 to the address location
set in ER6.
Execution of the next instruction begins as soon as the transfer is
completed.
2.6.2 Basic Instruction Formats
The H8S/2600 Series instructions consist of 2-byte (1-word) units. An instruction consists of an
operation field (op), a register field (r), an effective address extension (EA), and a condition field
(cc).
Figure 2.11 shows examples of instruction formats.
Rev. 1.00, 09/03, page 41 of 704
Page 80
• 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.
• Register Field
Specifies a general register. Address registers are specified by 3 bits, data registers by 3 bits or
4 bits. Some instructions have two register fields. Some have no register field.
• Effective Address Extension
8, 16, or 32 bits specifying immediate data, an absolute address, or a displacement.
• Condition Field
Specifies the branching condition of Bcc instructions.
(1) Operation field only
op
(2) Operation field and register fields
op
(3) Operation field, register fields, and effective address extension
op
EA (disp)
rn
rnrm
rm
NOP, RTS, etc.
ADD.B Rn, Rm, etc.
MOV.B @(d:16, Rn), Rm, etc.
(4) Operation field, effective address extension, and condition field
opccEA (disp)BRA d:16, etc.
Figure 2.11 Instruction Formats (Examples)
Rev. 1.00, 09/03, page 42 of 704
Page 81
2.7 Addressing Modes and Effective Address Calculation
The H8S/2600 CPU supports the eight addressing modes listed in table 2.11. The usable address
modes are different in each instruction.
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, BNO T, and BTST instructions) or
immediate (3-bit) addressing mode to specify a bit number in the operand.
Table 2.11 Addressing Modes
No. Addressing Mode Symbol
1 Register direct Rn
2 Register indirect @ERn
3 Register indirect with displacement @(d:16,ERn)/@(d:32,ERn)
4 Register indirect with post-increment
The register field of the instruction code 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.7.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).
2.7.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 code, and the sum gives the address of a memory
operand. A 16-bit displacement is sign-extended when added.
Rev. 1.00, 09/03, page 43 of 704
Page 82
2.7.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 by te 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 resu lt 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.
2.7.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). Table 2.12 indicates the accessible absolute address ranges.
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.12 Absolute Address Access Ranges
Absolute Address Normal Mode* Advanced Mode
Data address 8 bits (@aa:8) H'FF00 to H'FFFF H'FFFF00 to H'FFFFFF
16 bits (@aa:16) H'0000 to H'FFFF H'000000 to H'007FFF,
H'FF8000 to H'FFFFFF
32 bits (@aa:32) H'000000 to H'FFFFFF
Program instruction
address
Note: * Not available in this LSI.
Rev. 1.00, 09/03, page 44 of 704
24 bits (@aa:24)
Page 83
2.7.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 ADDS, SUBS, INC, and DEC instructions contain immediate data imp licitly . 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.
2.7.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-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.
2.7.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-handling vector
area. For further details, refer to section 4, Exception Handling.
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.)
Note: Norm al m ode is not available in this LSI.
Rev. 1.00, 09/03, page 45 of 704
Page 84
Specified
by @aa:8
Branch address
Specified
by @aa:8
Reserved
Branch address
(a) Normal Mode
Note: * Normal mode is not available in this LSI.
*
(a) Advanced Mode
Figure 2.12 Branch Address Specification in Memory Indirect Mode
2.7.9 Effective Address Calculation
Table 2.13 indicates how effective addresses (EA) 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.
Note: Norm al m ode is not available in this LSI.
Rev. 1.00, 09/03, page 46 of 704
Page 85
Table 2.13 Effective Address Calculation (1)
No
Addressing Mode and Instruction FormatEffective Address CalculationEffective Address (EA)
The H8S/2600 CPU has five main processing states: the reset state, exception handling state,
program execution state, bus-released state, and program stop state. Figure 2.13 indicates the state
transitions.
• Reset State
The CPU and on-chip peripheral modules are all initialized and stop. When the RES input goes
low, all current processing stops and the CPU enters the reset state. All interrupts are masked
in the reset state. Reset exception handling starts when the RES signal changes from low to
high. For details, refer to section 4, Exception Handling.
The reset state can also be entered by a watchdog timer overflow.
• Exception-Handling State
The exception-handling state is a transient state that occurs when the CPU alters the normal
processing flow due to an exception source, such as, a reset, trace, interrupt, or trap instruction.
The CPU fetches a start address (vector) from the exception-handling vector table and
branches to that address. For further details, refer to section 4, Exception Handling.
• Program Execution State
In this state the CPU executes program instructions in sequence.
• Bus-Released State
In a product which has a bus mastership other than the CPU, such as a direct memory access
controller (DMAC) and a data transfer controller (DTC), the bus-released state occurs when
the bus has been released in response to a bus request from a bus mastership other than the
CPU. While the bus is released, the CPU halts operations.
• Program stop state
This is a power-down state in which the CPU stops operating. The program stop state occurs
when a SLEEP instruction is executed or the CPU enters hardware standby mode. For further
details, refer to section 22, Power-Down Modes.
Rev. 1.00, 09/03, page 49 of 704
Page 88
End of bus request
Bus request
Program execution state
SSBY = 1
SLEEP instruction
Bus request
nd of bus request
E
Bus-released state
End of exception handling
Exception
handling state
= High
Reset state
Reset state
Notes: 1. From any state except hardware standby mode, a transition to the reset state occurs whenever goes low.
A transition can also be made to the reset state when the watchdog timer overflows.
2. In every state, when the STBY pin becomes low, the hardware standby mode is entered.
3. For details, refer to section 22, Power-Down Modes.
*1
Interrupt request
Request for exception handling
External interrupt request
= High,
= Low
SSBY = 0
SLEEP
instruction
Sleep mode
Software standby
mode
Hardware standby
*2
mode
Power down state
*3
Figure 2.13 State Transitions
2.9 Usage Note
2.9.1 Usage Notes on Bit-Wise Operation Instructions
The BSET, BCLR, BNOT, BST, and BIST instructions are used to read data in bytes, operate the
data in bit units, and write the result of the bit unit op eration in bits again. Therefore, special care
is necessary to use these instructions for the registers and the ports that include write-only bit.
The BCLR instruction can be used to clear the flags in the internal I/O registers to 0. In this time,
if it is obvious that the flag has been set to 1 in the interrupt handler, there is no need to read the
flag beforehand.
Rev. 1.00, 09/03, page 50 of 704
Page 89
Section 3 MCU Operating Modes
3.1 Operating Mode Selection
This LSI has four operating modes (modes 1, 3, 5, and 7). These modes are determined by the
mode pin settings (MD2, MD1, and MD0). For normal program execution mode, the mode pins
must be set to mode 7. Do not change the mode pins while in the middle of an operation. Table 3.1
shows the MCU operating mode selection.
Modes 0, 2, 4, and 6 are not available with this LSI.
After a reset in mode 7, the operation is started in sin gle-chip mode. It is possible to shift to
extended mode when the EXPE bit in MDCR is set to 1.
Modes 1 and 5 are boot modes for flash memory programming/erasing. For details, refer to section
20, Flash Memory (0.18-µm F-ZTAT Version).
Mode 3 is on-chip emulation mode. The JTAG interface is controlled by the on-chip emulator, onchip emulation is possible.
Rev. 1.00, 09/03, page 51 of 704
Page 90
3.2 Register Descriptions
The following registers are related to the operating mode.
• Mode control register (MDCR)
• System control register (SYSCR)
3.2.1 Mode Control Register (MDCR)
MDCR monitors the current operating mode and operating mode settings.
Bit Bit Name Initial Value R/W Descriptions
7 EXPE 0 R/W Extended Mode Enable
Extended Mode Set Up
0: Single-chip mode
1: Extended mode
6 to 3 All 0 R Reserved
2
1
0
Note: * Determined by pins MD2 to MD0.
MDS2
MDS1
MDS0
*
*
*
R
R
R
Mode Select 2 to 0
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 and 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 reset
Rev. 1.00, 09/03, page 52 of 704
Page 91
3.2.2 System Control Register (SYSCR)
SYSCR selects saturating calculation for the MAC instruction, and controls reset source monitor,
Ram address space, and on-chip flash memory control.
Bit Bit Name Initial Value R/W Descriptions
7 MACS 0 R/W MAC Saturation
Selects either saturating or non-saturating calculation
for the MAC instruction.
0: Non-saturating calculation for MAC instruction
1: Saturating calculation for MAC instruction
6 to 4 All 0 R/W Reserved
The initial value should not be changed.
3 XRST 1 R External Reset
Indicates reset source. Reset occurs as external reset
input or watchdog timer overflow.
0: Generated by watchdog timer overflow
1: Generated by external reset
2 FLASHE 0 R/W Flash Memory Control Register Enable
Controls CPU access to the flash memory control
registers (FCCS, FPCS, FECS, FKEY, FMATS, and
FTDAR).
0: Flash memory control registers are not selected
1: Flash memory control registers are selected
1 0 R/W Reserved
The initial value should not be changed.
0 RAME 1 R/W RAM Enable
Enables or disables the on-chip RAM. The RAME bit
is initialized when the reset status is released.
0: On-chip RAM is disabl ed
1: On-chip RAM is enabled
Rev. 1.00, 09/03, page 53 of 704
Page 92
3.3 Operating Mode Descriptions
3.3.1 Mode 7
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled.
The initial mode after a reset is single-chip mode, to use the external address space, set the EXPE
bit in MDCR to 1.
Normal Extended Mode:
After a reset, ports 1 and 2 become input ports.
The address bus can be output when the corresponding port data direction register (DDR) is set to
1. Port 3 is a data bus, part of port 9 and port A become a bus control signal. When the ABWn bit
in BCRAn is cleared to 0, port 6 becomes the data bus. (n = 1 to 3)
Multiplex Extended Mode:
When using an 8-bit bus, regardless of the data direction register (DDR) setting of port 2, it
becomes an address output and data input/output port. Port 1 can be used as a general port.
When using a 16-bit bus, regardless of the data direction register (DDR) setting of port 1 or 2, they
become address output and data input/output ports.
Rev. 1.00, 09/03, page 54 of 704
Page 93
3.3.2 Pin Functions
The pin functions of ports 1 to 3, 6, 9, and A change according to operating modes. Table 3.2
shows the pin functions in each operating mode.
Table 3.2 Pin Functions in Each Operating Mode
Mode 7
Port Normal Extended Mode Multiplex Extended Mode
Port 1 P*/A P*/AD
Port 2 P*/A P*/AD
Port 3 P*/D P*
Port 6 P*/D P*
Port 9 P*/C P*/C
Port A PA7 P*/C P*/C
[Legend]
P: Input/output port
A: Address bus output
D: Data bus input/output
AD: Address data multiplex input/output
C: Control signals, clock input/output
Note: * After a reset
Mode 7 (EXPE = 1)
Advanced mode
External mode with on-chip ROM enabled
Mode 7 (EXPE = 0)
Advanced mode
Single-chip mode
H'000000
H'03FFFF
H'040000
H'07FFFF
H'080000
H'FBFFFF
H'FC0000
H'FCFFFF
H'FD0000
H'FDFFFF
H'FE0000
H'FEFFFF
H'FF0000
H'FF6000
H'FF9FFF
H'FFA000
H'FFBFFF
H'FFC000
H'FFFEFF
H'FFFF00
H'FFFF7F
H'FFFF80
H'FFFFFF
On-chip ROM
Reserved
External
address space
Area 1
Area 2
Area 3
Reserved
On-chip RAM
16384 bytes
Reserved
Internal I/O register 2
Reserved
Internal I/O register 1
*
*
H'000000
H'03FFFF
H'040000
H'07FFFF
H'080000
H'FF0000
H'FF6000
H'FF9FFF
H'FFA000
H'FFBFFF
H'FFC000
H'FFFEFF
H'FFFF00
H'FFFF7F
H'FFFF80
H'FFFFFF
On-chip ROM
Reserved
Reserved
Reserved
On-chip RAM
16384 bytes
Reserved
Internal I/O register 2
Reserved
Internal I/O register 1
Note :
*
This area can be specified as an external address area by clearing the RAME bit in SYSCR to 0.
Rev. 1.00, 09/03, page 56 of 704
Figure 3.1 Memory Map
Page 95
Section 4 Exception Handling
4.1 Exception Handling Types and Priority
As table 4.1 indicates, exception handling may be caused by a reset, trace, interrupt, or trap
instruction. 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. Exception sources, the
stack structure, and operation of the CPU vary depending on the interrupt control mode. For
details on the interrupt control mode, refer to section 5, Interrupt Controller.
Table 4.1 Exception Types and Priority
Priority Exception Type Start of Exception Handling
High Reset Starts immediately after a low-to-high transition at the RES
pin, or when the watchdog timer overflows. The CPU enters
the reset state when the RES pin is low
Trace*1 Starts when execution of the current instruction or exception
handling ends, if the trace (T) bit in the EXR is set to 1.
Direct transition*2 Starts when the direct transition occurs by execution of the
SLEEP instruction.
Interrupt Starts when execution of the current instruction or exception
handling ends, if an interrupt request has been issued.
Interrupt detection is not performed on completion of ANDC,
ORC, XORC, or LDC instruction execution, or on completion
of reset exception handling.
Low Trap instruction Started by execution of a trap instruction (TRAPA)
Trap instruction exception handling requests are accepted at
all times in program ex ecution state.
Notes: 1. Traces are enabled only in interrupt control mode 2. Trace exception handling is not
executed after execution of an RTE instruction.
2. Not available in this LSI.
Rev. 1.00, 09/03, page 57 of 704
Page 96
4.2 Exception Sources and Exception Vector Table
Different vector addresses are assigned to different exception sources. Table 4.2 lists the exception
sources and their vector addresses. Since the usable modes differ depending on the product, for
details on each product, refer to section 3, MCU Operating Modes.
Table 4.2 Exception HandlingVector Table
Vector Address*1
Exception Source Vector Number Normal Mode*
Power-on reset 0 H'0000 to H'0001 H'0000 to H'0003
Manual reset*3 1 H'0002 to H'0003 H'0004 to H'0007
Reserved for system use 2 H'0004 to H'0005 H'0008 to H'000B
3 H'0006 to H'0007 H'000C to H'000F
4 H'0008 to H'0009 H'0010 to H'0013
Trace 5 H'000A to H'000B H'0014 to H'0017
Interrupt (direct transition)*3 6 H'000C to H'000D H'0018 to H'001B
Interrupt (NMI) 7 H'000E to H'000F H'001C to H'001F
Trap instruction (#0) 8 H'0010 to H'0011 H'0020 to H'0023
(#1) 9 H'0012 to H'0013 H'0024 to H'0027
(#2) 10 H'0014 to H'0015 H'0028 to H'002B
(#3) 11 H'0016 to H'0017 H'002C to H'002F
Reserved for system use 12 H'0018 to H'0019 H'0030 to H'0033
13 H'001A to H'001B H'0034 to H'0037
14 H'001C to H'001D H'0038 to H'003B
15 H'001E to H'001F H'003C to H'003F
External interrupt IRQ0 16 H'0020 to H'0021 H'0040 to H'0043
IRQ1 17 H'0022 to H'0023 H'0044 to H'0047
IRQ2 18 H'0024 to H'0025 H'0048 to H'004B
IRQ3 19 H'0026 to H'0027 H'004C to H'004F
IRQ4 20 H'0028 to H'0029 H'0050 to H'0053
IRQ5 21 H'002A to H'002B H'0054 to H'0057
IRQ6 22 H'002C to H'002D H'0058 to H'005B
IRQ7 23 H'002E to H'002F H'005C to H'005F
Internal interrupt*4 24
127
H'0030 to H'0031
H'00FE to H'00FF
2
Advanced Mode
H'0060 to H'0063
H'01FC to H'01FF
Rev. 1.00, 09/03, page 58 of 704
Page 97
Notes: 1. Lower 16 bits of the address.
2. Not available in this LSI.
3. Not available in this LSI. Becomes reserved for system use.
4. For details on internal interrupt vectors, see section 5.5, Interrupt Exception Handling
Vector Table.
4.3 Reset
A reset has the highest exception priority. When the RES pin goes low, all processing halts and
this LSI enters the reset. To ensure that this LSI is reset, hold the RES pin low for at least 20 ms at
power-up. To reset the chip during operation, hold the RES pin low for at least 20 states. A reset
initializes the internal state of the CPU and the re gisters of on-chip peripheral modules.
The chip can also be reset by overflow of the watchdog timer. For details see section 15,
Watchdog Timer (WDT).
The interrupt control mode is 0 immediately after reset.
4.3.1 Reset exception handling
When the RES pin goes high after being held low for the necessary time, this LSI starts reset
exception handling as follows:
1. The internal state of the CPU and the registers of the on-chip peripheral modules are
initialized, the T bit is cleared to 0 in EXR, and the I bit is set to 1 in EXR and CCR.
2. The reset exception-handling vector address is read and transferred to the PC, and program
execution starts from the address indicated by the PC.
Figure 4.1 shows an example of th e reset sequence.
Rev. 1.00, 09/03, page 59 of 704
Page 98
Vector fetch
φ
Internal
processing
Prefetch of first
program instruction
Internal
address bus
Internal read
signal
Internal write
signal
Internal data
bus
(1)(3) Reset exception-handling vector address (when reset, (1)=H'000000, (3)=H'000002)
(2)(4) Start address (contents of reset exception-handling vector address)
(5) Start address ((5)=(2)(4))
(6) First program instruction
(1)
High
(2)(4)(6)
(3)(5)
Figure 4.1 Reset Sequence
4.3.2 Interrupts after Reset
If an interrupt is accepted after a reset but before the stack pointer (SP) is initialized, the PC and
CCR will not be saved correctly, leading to a program crash . To prevent this, all interrupt requests,
including NMI, are disabled immediately after a reset. Since the first instruction of a program is
always executed immediately after the reset state ends, mak e sure that this instruction initializes
the stack pointer (example: MOV.L #xx: 32, SP).
4.3.3 On-Chip Peripheral Functions after Reset Release
After reset release, the module stop contro l register ( M STPCR, EXMSTPCR) is initialized and all
modules enter module stop mode.
Consequently, on-chip peripheral module registers cannot be read or written to. Register reading
and writing is enabled when module stop mode is exited.
Rev. 1.00, 09/03, page 60 of 704
Page 99
4.4 Traces
Traces are enabled in interrupt control mode 2. Trace mode is not activated in interrupt control
mode 0, irrespective of the state of the T bit. For details on interrupt control modes, see section 5,
Interrupt Controller.
If the T bit in EXR is set to 1, trace mode is activated. In trace mode, a trace exception occurs on
completion of each instruction. Trace mode is not affected by interrupt masking. Table 4.3 shows
the state of CCR and E X R a fter execution of trace exception handling. Trace mode is canceled by
clearing the T bit in EXR to 0. The T bit saved on the stack retains its value of 1, and when control
is returned from the trace exception handling routine by the RTE instruction, trace mode resumes.
Trace exception-handling is not carried out after execution of the RTE instruction.
Interrupts are accepted even within the trace exception-handling routine.
Table 4.3 Status of CCR and EXR after Trace Exception Handling
[Legend]
1: Set to 1
0: Cleared to 0
: Retains value prior to execution.
4.5 Interrupts
Interrupts are controlled by the interrupt controller. The interrupt controller has two interrupt
control modes and can assign interrupts other than NMI to eight priority/mask levels to enable
multiplexed interrupt control. For details on the source that starts interrupt exception handling and
the vector address, refer to section 5, Interrupt Controller.
The interrupt exception handling is as follows:
1. The values in the program counter (PC), condition code register (CCR), an d extended register
(EXR) are saved in the stack.
2. The interrupt mask bit is updated and the T bit is cleared to 0.
3. A vector address corresponding to the interrupt source is generated, the start address is loaded
from the vector table to the PC, and program execution starts from that address.
Rev. 1.00, 09/03, page 61 of 704
Page 100
4.6 Trap Instruction
Trap instruction exception handling starts when a TRAPA instruction is executed. Trap instruction
exception handling can be executed at all times in the program execution state.
The trap instruction exception handling is as follows:
1. The values in the program counter (PC), condition code register (CCR), an d extended register
(EXR) are saved in the stack.
2. The interrupt mask bit is updated and the T bit is cleared to 0.
3. A vector address corresponding to the interrupt source is generated, the start address is loaded
from the vector table to the PC, and program execution starts from that address.
The TRAPA instruction fetches a start address from a vector table entry corresponding to a vector
number from 0 to 3, as specified in the instruction code.
Table 4.4 shows the status of CCR and EXR after execution of trap instruction exception handling.
Table 4.4 Status of CCR and EXR after Trap Instruction Exception Handling
CCR EXR
Interrupt Control Mode I UI I2 to I0 T
0 1
2 1 0
[Legend]
1: Set to 1
0: Cleared to 0
: Retains value prior to execution.
Rev. 1.00, 09/03, page 62 of 704
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.