The revision list can be viewed directly by
clicking the title page.
The revision list summarizes the locations of
revisions and additions. Details should always
be checked by referring to the relevant text.
Group
16
Hardware Manual
Renesas 16-Bit Single-Chip Microcomputer
H8S Family/H8S/2300 Series
Rev.2.00
2003.5.23
Renesas 16-Bit Single-Chip Microcomputer
H8S/Family/H8S/2300 Series
H8S/2368 Group
Hardware Manual
REJ09B0050-0200O
Cautions
Keep safety first in your circuit designs!
1. Renesas Technology Corporation puts the maximum effort into making semiconductor products better and more reliabl e, but
there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire
or propert y da mage.
Remember to give due consideration to safety when making your circuit designs, with appropriate measu res such as (i)
placement of substitutive, auxiliar y circuits, (ii) use of nonflammable materia l or (iii) preve n tio n agai n st any malf unc tio n or
mishap.
Notes regar ding these materials
1. These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corporation
product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any
other rights, belonging to Renesas Technology Corporation or a third party.
2. Renesas Technology Corporation assumes no responsibility for any damage, or infringement of any third-party 's rights,
originating in th e u se of any product data, diagrams, charts, programs, algorithms, or circuit applicatio n examples contained in
these materials.
3. All information contained in these materials, including product data, diag rams, charts, programs and algorithms represents
information on products at the time of publication of these materials, and are subject to change by Renesas Technology
Corporation without notice due to product improvements or other reasons. It is therefore recommended that customers contact
Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor for the latest product
informati o n be fore purc ha sing a produc t listed herein.
The informa tion descri bed here may c o ntain techni c al inaccuracies or typ og r aphical err ors.
Renesas Technology Corp oration assumes no responsibility for any damage, liability, or other loss rising from these
inaccuracies or errors.
Please also pay attention to information published by Renesas Technology Corporation by various means, including the
Renesas Technology Corporation Semiconductor home page (http://www.renesas .com).
4. When usi ng any or all of the informat i on containe d i n th e s e ma terials, inc luding prod uct data, diagrams, chart s, programs, and
algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the
information and products. Renesas Technology Corpora tion assumes no responsibilit y for any damage, liability or ot her 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 potentially at stake. Please contact Renesas Technology Corporation or an
authorized Renesas Te chnology Corporation product dis tributor when considering the use of a product contained herein for
any specific purposes, such as apparat us or system s for tra nsp or ta tio n, veh icul ar, medica l, aer o space, nucle ar, or unders ea
repeater use.
6. The prior written approval of Renesas Technology Corporation is necessary to reprint or reproduce in whole or in part these
materials.
7. If these products o r technologies are sub ject to the Japanese exp ort contro l restrictions, they must be exported under a l i cense
from the Japanese govern ment and cannot be imported into a country other than the approved destination.
Any diversion or reexport contrary to the export contro l laws and regulations of Japan and/or the country of destination is
prohibited.
8. Please contact Renesas Technology Corporation for further details on these materials or the products contained the rein.
Rev. 2.00, 05/03, page iv of lii
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 connected 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 m ay occur.
3. Processing before Initializatio n
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. 2.00, 05/03, page v of lii
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 Ed ition (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 th e actual locations in this
manual.
11.Index
Rev. 2.00, 05/03, page vi of lii
Preface
The H8S/2368 Group are microcomputers (MCU) made up of the H8S/2600 CPU employing
Renesas Technology’s original architecture as their cores, 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.
This LSI is equipped with direct memory access controller (DMAC) and data transfer controller
(DTC) bus masters, ROM and RAM memory, a 16-bit timer pulse unit (TPU), a programmable
pulse generator (PPG), 8-bit timers (TMR), a watchdog timer (WDT), serial communication
interfaces (SCI and IrDA), a 10-bit A/D converter, an 8-bit D/A converter, and I/O ports as onchip peripheral modules required for system configuration. I
included as an optional interface.
A high-functionality bus controller is also provided, enabling fast and easy connection of DRAM
and other kinds of memory.
TM
A single-power flash memory (F-ZTAT
) version is available for this LSI's ROM. This provides
flexibility as it can be reprogrammed in no time to cope with all situ ations from the early stages of
mass production to full-scale mass production. This is particularly applicable to application
devices with specifications that will most probably change.
2
C bus interface 2 (IIC2) can also be
TM
Note: F-ZTAT
is a trademark of Renesas Technology Corp.
Target Users: This manual was written for users who will be using the H8S/2368 Group in the
design of application systems. Target users are expected to understand the
fundamentals of electrical circuits, logical circuits, and microcomputers.
Objective:This manual was written to explain the hardware function s and electrical
characteristics of the H8S/2368 Group to the target users.
Refer to the H8S/2600 Series, H8S/2000 Series Programming Manual for a
detailed description of the instru ction set.
Notes on reading this manual:
• In order to understand the overall functions of the chip
Read the manual according to the contents. This manual can be roughly categorized into parts
on the CPU, system control functions, peripheral functions and electrical characteristics.
Rev. 2.00, 05/03, page vii of lii
• In order to understand the details of the CPU's functions
Read the H8S/2600 Series, H8S/2000 Series Programming Manual.
For the execution state of each instruction in this LSI, see Appendix D, Bus State during
Execution of Instructions.
• In order to understand the details of a register when its 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.
Examples:Register name:The following notation is used for cases when the same or a
similar function, e.g. 16-bit timer pulse un it or ser ial
communication, 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/
H8S/2368 Group manuals:
Manual TitleADE No.
H8S/2368 Group Hardware ManualThis manual
H8S/2600 Series, H8S/2000 Series Programming ManualADE-602-083
H8S, H8/300 Series Simulator/Debugger User's ManualADE-702-282
H8S, H8/300 Series Hi-Performance Embedded Workshop, HDI TutorialADE-702-231
Hi-Performance Embedded Workshop User's ManualADE-702-201
Rev. 2.00, 05/03, page viii of lii
ADE-702-247
Main Revisions and Additions in this Edition
ItemPageRevision (See Manual for Details)
AllH8S/2366 added.
1.1 Features1Table amended.
ROM TypeModelROMRAMRemarks
Flash memory version HD64F2367 384 kbytes24 kbytes
Masked ROM version HD6432365 256 kbytes16 kbytes
ROMless versionHD641236316 kbytes
1.2 Block Diagram
Figure 1.1 Internal Block
Diagram
of H8S/2367,
H8S/2365, and H8S/2363
3
Description added in the 2nd line.
Figures 1.1 and 1.2 show the internal block diagrams
of this LSI.
Figure and its title amended.
(Error) I2C bus interface (option) →
(Correction) I
Figure 1.2 Internal Block
4Newly added.
Diagram of H8S/2366
1.3.1 Pin Arrangement5Description added in the 3rd line.
Figures 1.3 to 1.6 show the pin arrangements of this
LSI.
Figure 1.3 Pin Arrangement
of H8S/2367, H8S/2365, and
Pin names of pins 70 and 71 amended and note
added to pin 30.
H8S/2363
HD64F2366 384 kbytes30 kbytesIn planning stage
2
C bus interface 2 (option)
Figure 1.4 Pin Arrangement
of H8S/2366
PF6/
PF5/
PF4/
PF3/
PF2//
757473727170696867666564636261
2627282930
EMLE*
PA4/A20/
PA5/A21/
PA6/A22/
PA7/A23/ /
Note: * This is an emulator enable pin. Normally, this
pin should be set to low. If this pin goes high in
the flash memory version, the on-chip
emulator function is enabled. At this time, pins
P53, PG4, PG5, PG6, and WDTOVF function
only for the on-chip emulator.
6Newly added.
PF1//
PF0//
PD7/D15
PD6/D14
PD5/D13
PD4/D12
PD3/D11
PD2/D10
PD1/D9
PD0/D8
Rev. 2.00, 05/03, page ix of lii
ItemPageRevision (See Manual for Details)
1.3.1 Pin Arrangement
Figure 1.5 Pin Arrangement
7Pin name of pin 86 amended and note added to pin
34.
of H8S/2367, H8S/2365, and
H8S/2363
EXTAL
XTAL
VSSPF7/φPLLVSSPLLVCCPF6/
908988878685848382
303132333435363738
PA4/A20/
PA5/A21/
PA6/A22/
PF5/
PF4/
PF3/
PF2/ /
PF1/ /
PF0//
PD7/D15
PD6/D14
PD5/D13
PD4/D12
PD3/D11
PD2/D10
PD1/D9
PD0/D8
VSSNC*1VCCPE7/D7
75747677787980
81
2
SS
VSSV
NMI
EMLE*
PA7/A23/ /
737271706968676665
Notes: *1The NC pin should be fixed to Vss or should
be open.
This is an emulator enable pin. Normally,
*2
this pin should be set to low. If this pin goes
high in the flash memory version, the onchip emulator function is enabled. At this
time, pins P53, PG4, PG5, PG6, and
WDTOVF function only for the on-chip
emulator.
Figure 1.6 Pin Arrangement
8Newly added.
of H8S/2366
3.3.6 Pin Functions
Table 3.2 Pin Functions in
61Note *2 added
Note: *2 Setting not allowed on no-ROM versions.
Each Operating Mode
3.4 Memory Map in Each
64, 65Newly added.
Operating Mode
Figure 3.3
H8S/2366
Memory Map (1)
Figure 3.4
H8S/2366
Memory Map (2)
Figure 3.7 H8S/2363
Memory Map
5.1 Features
Figure 5.1 Block Diagram
68Figure amended.
(Error) H′FF6000 → (Correction) H′FF
80Register name amended.
(Error) ISCR → (Correction) ISCR
L
of Interrupt Controller
5.3 Register Descriptions81Register name amended in the 6th line.
L (ISCRL)
L
5.3.4 IRQ Sense Control
Register
L (ISCRL)
• IRQ sense control register
85Title amended.
Description amended in the 2nd line.
(Error) ISCR → (Correction) ISCR
8000
Rev. 2.00, 05/03, page x of lii
ItemPageRevision (See Manual for Details)
5.4.1 External Interrupts90Description amended in the 13th line.
Using ISCR
L, it is possible to select whether an
interrupt is generated by a low level, falling edge,
rising edge, or both edges, at pins IRQ7 to IRQ0.
6.8.1 Operation187Description added in the 1st line.
Table 6.7 shows whether an idle cycle is inserted or
not in mixed access to normal space and DRAM.
Section 9 I/O Ports
Table 9.1 Port Functions
300Description of port 2 amended.
(Error) General I/O port also functioning as PPG
outputs, TPU I/Os,
TMR I/Os, and bus control I/Os →
(Correction) General I/O port also functioning as PPG
9.1.4 Pin Functions
1
• P13/PO11*
KB/TEND1*
• P12/PO10*
KA/TEND0*
• P11/PO9*
DREQ1*
/TIOCD0/TCL
1
1
/TIOCC0/TCL
1
1
/TIOCB0/
1
outputs, TPU I/Os, and
309Description amended in the 5th line.
(Error) bit TEEI → (Correction) bit TEE
310Description amended in the 5th line.
(Error) bit TEEO → (Correction) bit TEE
311Description amended in the 3rd line.
…(by bits MD3 to MD0 in TMDR_0, bits IOB3 to IOB0
TMR I/Os
in TIORH_0, and bits CCLR2 to CCLR0 in TCR_0),…
9.2.4 Pin Functions
1
• P24/PO4*
/TIOCA4/
RxD4/TMO0
318Description amended in the 3rd line.
The pin function is switched as shown below
according to the combination of the TPU channel 4
settings (by bits MD3 to MD0 in TMDR_4, bits IOA3 to
IOA0 in TIOR_4
, and bits CCLR1 and CCLR0 in
TCR4), bit NDER4*1 in NDERL, bit RE in SCI_4, bit
P24DDR, and bit OS3 to OS0 in TCSRO of TMR.
Table amended.
RE01
9.3.5 Port Function Control
Register 2 (PFCR2)
TPU channel 4
settings
OS3 to OS0All 0Not all 0—
P24DDR—011——
NDER4——01——
Pin functionTIOCA4 output
326Note added.
Note: * In the H8S/2366, this bit is reserved. This bit
(1) in table below(2) in table below
P24
P24
output
TIOCA4 input*
PO4
output*
input
is always read as 1 and the write value should
always be 1.
9.3.6 Pin Functions
• P35/SCK1/SCL0/(OE)*
327Amended.
3
(Error) C/A → (Correction) C/A
1
0
—
TMO0
output
RXD4 input
1
2
Rev. 2.00, 05/03, page xi of lii
ItemPageRevision (See Manual for Details)
9.6.4 Pin Functions
• P81/TxD3
9.8.6 Port Function Control
Register 0 (PFCR0)
338Amended.
(Error) TxD3 input → (Correction) TxD3
344Bit table amended.
Bit Bit Name Initial Value R/W Description
7CS7E 1R/W
6CS6E 1R/W
5CS5E 1R/W
4CS4E 1R/W
3CS3E 1R/W
2CS2E 1R/W
1CS1E 1R/W
0CS0E 1R/W
to enable
Enable/disable corresponding
0: Set as I/O port.
1: Set as
output pin.
output
output.
(n = 7 to 0)
9.14.4 Pin Functions
• PG3/CS3/RAS3*,
PG2/CS2/RAS2*
14.3.9 Bit Rate Register
(BRR)
Table 14.3 BRR Settings
for Various Bit Rates
(Asynchronous Mode)
Table 14.4 Maximum Bit
Rate for Each Frequency
(Asynchronous Mode)
Table 14.5 Maximum Bit
Rate with External Clock
Input (Asynchronous Mode)
Table 14.6 BRR Settings
for Various Bit Rates
(Clocked Synchronous
Mode)
Table 14.7 Maximum Bit
Rate with External Clock
Input (Clocked Synchronous
Mode)
Table 14.8 Examples of Bit
Rate for Various BRR
Settings (Smart Card
Interface Mode) (when n = 0
and S = 372)
372Table amended.
Operating
mode
EXPE—01
CSnE01—01
RMTS2*
to
RMTS0*
PGnDDR 0101—010101—
Pin
PGn
function
input
1, 2, 47
—Area n is in
normal space
PGn
output
PGn
input
output
Area n is in
DRAM*
space
output
*
——Area n is in
PGn
PGn
PGn
input
output
input
PGn
output
normal space
PGn
input
output
Area n is in
DRAM*
space
output
529Values when operating frequency φ is 2 MHz to
7.3728 MHz deleted.
531Values when operating frequency φ is 2 MHz to
7.3728 MHz deleted.
532Values when operating frequency φ is 2 MHz to
7.3728 MHz deleted.
533Values when operating frequency φ is 2 MHz and
4 MHz deleted.
534Values when operating frequency φ is 2 MHz, 4 MHz,
and 6 MHz deleted.
535Values when operating frequency φ is 7.1424 MHz
deleted.
*
Rev. 2.00, 05/03, page xii of lii
ItemPageRevision (See Manual for Details)
14.3.9 Bit Rate Register
(BRR)
536Values when operating frequency φ is 7.1424 MHz
deleted.
Table 14.9 Maximum Bit
Rate at Various Frequencies
(Smart Card Interface Mode)
(when S = 372)
14.8 IrDA Operation
Table 14.12 Settings of Bits
IrCKS2 to IrCKS0
579Values when operating frequency φ is 2 MHz to
7.3728 MHz deleted.
Values when operating frequency φ is 30 MHz and
Table D.1Execution State of Instructions ..............................................................................797
Rev. 2.00, 05/03, page li of lii
Rev. 2.00, 05/03, page lii of lii
Section 1 Overview
1.1Features
• High-speed H8S/2000 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
65 basic instructions
• Various peripheral functions
DMA controller (DMAC)*
Data transfer controller (DTC)
16-bit timer-pulse unit (TPU)
Programmable pulse generator (PPG)*
8-bit timer (TMR)
Watchdog timer (WDT)
Asynchronous or clocked synchronous serial communication interface (SCI)
2
I
C bus interface 2 (IIC2)
10-bit A/D converter
8-bit D/A converter
Clock pulse generator
Notes: *1 The NC pin should be fixed to Vss or should be open.
*2 This is an emulator enable pin. Normally, this pin should be set to low. If this pin goes high in the flash memory version, the on-chip emulator function is
enabled. At this time, pins P53, PG4, PG5, PG6, and
XTAL8189InputFor connection to a crystal oscillator.
EXTAL8290InputFor connection to a crystal oscillator.
07987Output Supplies the system clock to external
MD2
MD1
MD0
RES7785InputReset pin. When this pin is driven
STBY8896InputWhen this pin is driven low, a
EMLE3034InputEnables emulator. This pin should be
Pin No.
TFP-120QFP-128
2,33,60,
83,84
6,39,66,
91,92
I/OFunction
InputPower supply pins. VCC pins should
be connected to the system power
supply.
8,17,22,
58,80,87
3,4,12,
21,26,35,
36,64,68
InputGround pins. V
connected to the system power
supply (0 V).
pins should be
SS
88,95,99
100
7684InputPower supply pin for the on-chip PLL
oscillator.
7886InputGround pin for the on-chip PLL
oscillator.
See section 21, 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 21, Clock
Pulse Generator for typical
connection diagrams for a crystal
oscillator and external clock input.
devices.
1,
120,
119
5,
2,
1
InputThese pins set the operating mode.
These pins should not be changed
while the MCU is operating.
low, the chip is reset.
transition is made to hardware
standby mode.
connected to the power supply (0 V).
Rev. 2.00, 05/03, page 14 of 820
Pin No.
TypeSymbol
Address busA23 toA029 to 23,
Data busD15 toD068 to 61,
Bus controlCS7 to
CS0
AS7583Output When this pin is low, it indicates that
RD7482Output When this pin is low, it indicates that
HWR7381Output Strobe signal indicating that external
LWR7280Output Strobe signal indicating that external
BREQ108118InputThe external bus master requests the
BREQO106116InputExternal bus request signal when the
BACK107117Output Indicates the bus is released to the
UCAS*7078Output Upper column address strobe signal
TFP-120QFP-128
21 to 18,
16 to 9,
7 to 3
59,
57 to 51
29,71,70,
106,
92 to 89
33 to 27,
25 to 22,
20 to 13,
11 to 7
76 to 69,
65,
63 to 57
33,79,78,
116,102,
101,98,97
I/OFunction
Output Address output pins.
Input/
output
Output Signals that select division areas 7 to
These pins constitute a bidirectional
data bus.
0 in the external address space.
address output on the address bus is
valid.
the external address space is being
read.
address space is to be written, and
the upper half (D15 to D8) of the data
bus is enabled.
Write enable signal for accessing the
DRAM space.
address space is to be written, and
the lower half (D7 to D0) of the data
bus is enabled.
bus to this LSI.
internal bus master accesses the
external space in external bus
release state.
external bus master.
for accessing the 16-bit DRAM
space.
Column address strobe signal for
accessing the 8-bit DRAM space.
Rev. 2.00, 05/03, page 15 of 820
Pin No.
TypeSymbol
Bus controlLCAS*7179Output Lower column address strobe signal
RAS2*
RAS3*9192
WAIT*6977InputRequests insertion of a wait state in
OE*
(OE)*
Interrupt
signals
DMA controller
(DMAC)*
16-bit timer
pulse unit
(TPU)
NMI3238InputNonmaskable interrupt request pin.
IRQ7 to
IRQ0
(IRQ7) to
(IRQ0)
DREQ1*
DREQ0*
TEND1*,
TEND0*
DACK1*,
DACK0*
TCLKD
TCLKC
TCLKB
TCLKA
TIOCA0
TIOCB0
TIOCC0
TIOCD0
TIOCA1
TIOCB1
TFP-120QFP-128
101
102
69,
113
29 to 26,
112 to 109,
102 to 95
35,
34
37,
36
39,
38
41,
39,
37,
36
34,
35,
36,
37
38,
39
77,
123
33 to 30,
122 to 119,
112 to 105
41,
40
43,
42
45,
44
47,
45,
43,
42
40,
41,
42,
43
44,
45
I/OFunction
for accessing the 16-bit DRAM
space.
Output Row address strobe signal for the
DRAM interface.
the bus cycle when accessing
external 3-state address space.
Output Output enable signal for accessing
the DRAM space.
The output pins of OE and (OE) are
selected by the port function control
register 2 (PFCR2) of port 3.
Fix high when not used.
InputThese pins request a maskable
interrupt.
The input pins of IRQn and (IRQn)
are selected by the IRQ pin select
register (ITSR) of the interrupt
controller. (n = 0 to 7)
InputThese signals request DMAC
activation.
Output These signals indicate the end of
DMAC data transfer.
Output DMAC single address transfer
acknowledge signals.
InputExternal clock input pins for the timer.
Input/
output
Input/
output
TGRA_0 to TGRD_0 input capture
input/output compare output/PWM
output pins.
TGRA_1 and TGRB_1 input capture
input/output compare output/PWM
output pins.
Rev. 2.00, 05/03, page 16 of 820
TypeSymbol
16-bit timer
pulse unit
(TPU)
Programmable
pulse generator
(PPG)*
8-bit timer
(TMR)
Watchdog
Timer(WDT)
Serial
communication
interface(SCI)/
smart card
interface
(SCI_0 with
IrDA function)
TIOCA2
TIOCB2
TIOCA3
TIOCB3
TIOCC3
TIOCD3
TIOCA4
TIOCB4
TIOCA5
TIOCB5
PO15 to
PO0*
TMO0
TMO1
TMCI0
TMCI1
TMRI0
TMRI1
WDTOVF 3137Output Counter overflow sig nal output pin in
TxD4
TxD3
TxD2
TxD1
TxD0/
IrTxD
RxD4
RxD3
RxD2
RxD1
RxD0/
IrRxD
SCK4
SCK3
SCK2
SCK1
SCK0
Pin No.
TFP-120QFP-128
40,
41
42,
43,
44,
45
46,
47
48,
49
41 to 34,
49 to42
46,
47
44,
45
42,
43
45,
86,
109,
117,
118
46,
85,
110,
115,
116
114,
50,
111,
113,
114
46,
47
48,
49,
50,
51
52,
53
54,
55
47 to 40,
55 to 48
52,
53
50,
51
48,
49
51,
94,
119,
127,
128
52,
93,
120
125,
126
124,
56,
121,
123,
124
I/OFunction
Input/
output
Input/
output
Input/
output
Input/
output
Output Pulse output pins.
Output Waveform output pins with output
InputExternal event input pins.
InputCounter reset input pins.
Output Data output pins.
InputData input pins.
Input/
output
TGRA_2 and TGRB_2 input capture
input/output compare output/PWM
output pins.
TGRA_3 to TGRD_3 input capture
input/output compare output/PWM
output pins.
TGRA_4 and TGRB_4 input capture
input/output compare output/PWM
output pins.
TGRA_5 and TGRB_5 input capture
input/output compare output/PWM
output pins.
compare function.
watchdog timer mode.
Clock input/output pins.
Rev. 2.00, 05/03, page 17 of 820
TypeSymbol
IIC bus
interface2
SCL1
SCL0
(IIC2)
IIC bus
interface (IIC)
SDA1
SDA0
AN13,
AN12,
AN7 to
AN0
ADTRG112122InputPin for input of an external trigger to
D/A converter DA3,
DA2
A/D converter,
AV
cc
D/A converter
AV
ss
Vref94104InputThe reference voltage input pin for
I/O portsP17 to
P10
P27 to
P20
P35 to
P30
P47 to
P40
P53 to
P50
Pin No.
TFP-120QFP-128
115,
113
116,
114
125,
123
126,
124
I/OFunction
Input/
IIC clock input/output pins.
output
Input/
IIC data input/output pins.
output
104 to 95114 to 105InputAnalog input pins.A/D converter
start A/D conversion.
104,
103
114,
113
Output Analog output pins.
93103InputThe analog 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 (+3 V).
105115InputThe ground pin for the A/D
converter and D/A converter.
This pin should be connected to the
system power supply (0 V).
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 (+3 V).
41 to 3447 to 40Input/
Eight-bit input/output pins.
output
49 to 4255 to 48Input/
Eight-bit input/output pins.
output
113 to 118 123 to 128Input/
Six-bit input/output pins.
output
102 to 95112 to 105InputEight-bit input pins.
112 to 109 122 to 119Input/
Four-bit input/output pins.
output
Rev. 2.00, 05/03, page 18 of 820
Pin No.
TypeSymbol
I/O portsP85,
P83,
P81
P95,
P94
PA7 to
PA0
PB7 to
PB0
PC7 to
PC0
PD7 to
PD0
PE7 to
PE0
PF7 to
PF0
PG6 to
PG0
Note: * Not supported by the H8S/2366.
TFP-120QFP-128
50,
85,
86
104,
103
29 to 23,2133 to 27,25Input/
20 to 18,
16 to 12
11 to 9,
7 to 3
68 to 6176 to 69Input/
59,
57 to 51
79,
75 to 69
108 to 106,
92 to 89
56,
93,
94
114,
113
24 to 22,
20 to 16
15 to 13,
11 to 7
65,
63 to 57
87,
83 to 77
118 to 116,
102,101,
98,97
I/OFunction
Input/
output
InputTwo-bit input pins.
output
Input/
output
Input/
output
output
Input/
output
Input/
output
Input/
output
Three-bit input/output pins.
Eight-bit input/output pins.
Eight-bit input/output pins.
Eight-bit input/output pins.
Eight-bit input/output pins.
Eight-bit input/output pins.
Eight-bit input/output pins.
Seven-bit input/output pins.
Rev. 2.00, 05/03, page 19 of 820
Rev. 2.00, 05/03, page 20 of 820
Section 2 CPU
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 linear address space, and is ideal for realtime control.
This section describes the H8S/2000 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.1Features
• Upward-compatibility with H8/300 and H8/300H CPUs
Can execute H8/300 and H8/300H CPU 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:3 2]
Program-counter relative [@(d:8,PC) or @(d:16,PC)]
Memory indirect [@@aa:8]
• High-speed operation
All frequently-used instructions are executed in one or two states
8/16/32-bit register-register add/subtract: 1 state
8 × 8-bit register-register multiply: 12 states (MULXU.B), 13 states (MULXS.B)
16 ÷ 8-bit register-register divide: 12 states (DIVXU.B)
16 × 16-bit register-register multiply: 20 states (MULXU.W), 21 states (MULXS.W)
32 ÷ 16-bit register-register divide: 20 states (DIVXU.W)
CPUS211A_000020020100
Rev. 2.00, 05/03, page 21 of 820
• Two CPU operating modes
Normal mode*
Advanced mode
Note: * For this LSI, normal mode is not available.
• Power-down state
Transition to power-down state by SLEEP instruction
Selectable CPU clock speed
2.1.1Differences 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
InstructionMnemonicH8S/2600H8S/2000
MULXUMULXU.B Rs, Rd312
MULXU.W Rs, ERd420
MULXSMULXS.B Rs, Rd413
MULXS.W Rs, ERd521
In addition, there are differences in address space, CCR and EXR register function s, p o wer-do wn
modes, etc., depending on the model.
Rev. 2.00, 05/03, page 22 of 820
2.1.2Differences 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 extended 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 add ed.
Two-bit shift and two-bit rotate instructions have been added.
Instructions for saving and restoring multiple r egisters have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions are executed twice as fast.
2.1.3Differences 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 and two-bit rotate instructions have been added.
Instructions for saving and restoring multiple r egisters have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions are executed twice as fast.
Rev. 2.00, 05/03, page 23 of 820
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 address space.
The mode is selected by the LSI's mode pins.
2.2.1Normal Mode
The exception vector table and stack have the same structure as in the H8/300 CPU in normal
mode.
• Address spac e
Linear access to a maximum address space of 64 kbytes is possible.
• 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 extended register 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 general register Rn is
referenced in the register indirect addressing mode with pre-decrement (@–Rn) or postincrement (@Rn+) and a carry or borrow occurs, the value in the corresponding extended
register (En) will be affected.)
• Instruction set
All instructions and addressing modes can be used. Only the lo wer 16 bits of effective
addresses (EA) are valid.
• 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 exception vector table in normal mode is shown in
figure 2.1. 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 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 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 th e 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.
Note: For this LSI, normal mode is not availab le.
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)
SP
(SP
2
*
)
(b) Exception Handling(a) Subroutine Branch
1
EXR*
Reserved*1*
CCR
3
CCR*
PC
(16 bits)
3
Figure 2.2 Stack Structure in Normal Mode
2.2.2Advanced Mode
• Address spac e
Linear access to a maximum address space of 16 Mbytes is possible.
• Extended registers (En)
The extended registers (E0 to E7) can be used as 16-bit registers. They can also be used as the
upper 16-bit segments of 32-bit registers or address registers.
• Instruction set
All instructions and addressing modes can be used.
Rev. 2.00, 05/03, page 25 of 820
• Exception vector table and memory indirect br anch addresses
In advanced mode, the top area starting at H'00000000 is allocated to the exception vector table
in 32-bit units. In each 32 bits, the upper 8 bits are ignored and a branch address is stored in the
lower 24 bits (see figure 2.3). 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
Reset exception vector
Reserved
(Reserved for system use)
Exception vector table
(Reserved for system use)
Reserved
Exception vector 1
Figure 2.3 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 th at is
regarded as H'00. Branch addresses can be stored in the area from H'00000000 to H'000000FF.
Note that the top area of this range is also used for the exception 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 d e tails, see section 4, Exception
Handling.
Rev. 2.00, 05/03, page 26 of 820
SP
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.
Reserved
PC
(24 bits)
(a) Subroutine Branch(b) Exception Handling
SP
(SP
Figure 2.4 Stack Structure in Advanced Mode
1
EXR*
2
*
)
Reserved*1*
CCR
PC
(24 bits)
3
Rev. 2.00, 05/03, page 27 of 820
2.3Address Space
Figure 2.5 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. 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: * For this LSI, normal mode is not available.
H'00000000
H'00FFFFFF
H'FFFFFFFF
Figure 2.5 Memory Map
Program area
Data area
Not available
in this LSI
(b) Advanced Mode(a) Normal Mode*
Rev. 2.00, 05/03, page 28 of 820
2.4Register Configuration
The H8S/2000 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 control register (EXR), and an 8-bit condition code register (CCR).
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
230
Legend
:Stack pointer
SP
:Program counter
PC
:Extended control 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: * For this LSI, the interrupt mask bit is not available.
Figure 2.6 CPU Internal Registers
PC
H
U
N
Z
V
C
76543210
TI2I1I0
EXR
----
76543210
CCR
IUIHUNZVC
:Half-carry flag
:User bit
:Negative flag
:Zero flag
:Overflow flag
:Carry flag
Rev. 2.00, 05/03, page 29 of 820
2.4.1General Registers
The H8S/2000 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).
When the general registers are used as 16-bit registers, the ER registers are divided into 16-bit
general registers designated by the letters E (E0 to E7) and R (R0 to R7). These registers are
functionally equivalent, prov iding a maximum sixteen 16-bit registers. The E registers (E0 to E7)
are also referred to as extended registers.
When the general registers are used as 8-bit registers, the R registers are divided 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 th e 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. 2.00, 05/03, page 30 of 820
• 16-bit registers• 8-bit registers
E registers (extended registers)
(E0 to E7)
RH registers
(R0H to R7H)
R registers
(R0 to R7)
RL registers
(R0L to R7L)
Free area
SP (ER7)
Stack area
Figure 2.8 Stack
2.4.2Program 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 for read, the least significant PC bit is regarded as 0.)
2.4.3Extended Control Register (EXR)
EXR is an 8-bit register that can be operated by the LDC, STC, ANDC, ORC, and XORC
instructions. When an instruction oth e r than STC is executed, all interrupts including NMI are
masked in three states after the instruction is completed.
BitBit NameInitial Value R/WDescription
7T0R/WTrace Bit
When this bit is set to 1, trace exception processing
starts every when an instruction is executed. When
this bit is cleared to 0, instructions are consecutively
executed.
6 to3–1–Reserved
These bits are always read as 1.
2 to 0 I2
I1
I0
1R/WInterrupt Mask Bits 2 to 0
Specify interrupt request mask levels (0 to 7). For
details, see section 5, Interrupt Controller.
Rev. 2.00, 05/03, page 31 of 820
2.4.4Condition-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 bran ching conditions for conditional branch
(Bcc) instructions.
Rev. 2.00, 05/03, page 32 of 820
BitBit Name Initial ValueR/W Description
7I1R/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
at the start of an exception-handling sequence. For details,
refer to section 5, Interrupt Controller.
6UIUndefinedR/W User Bit or Interrupt Mask Bit
Can be written to and read from by software using the
LDC, STC, ANDC, ORC, and XORC instructions.
For this LSI, Interrupt Mask Bit is not available.
5HUndefinedR/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.
4UUndefinedR/W User Bit
Can be written to and read from by software using the
LDC, STC, ANDC, ORC, and XORC instructions.
3NUndefinedR/W Negative Flag
Stores the value of the most significant bit of data as a sign
bit.
2ZUndefinedR/W Zero Flag
Set to 1 to indicate zero data, and cleared to 0 to indicate
non-zero data.
1VUndefinedR/W Overflow Flag
Set to 1 when an arithmetic overflow occurs, and cleared to
0 otherwise.
0CUndefinedR/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.
Rev. 2.00, 05/03, page 33 of 820
2.4.5Initial Register Values
Reset exception handling loads the CPU's program counter (PC) from the vector table, clears the
trace (T) bit in EXR to 0, and sets the interrupt mask (I) bits in CCR and EXR to 1. The other CCR
bits and the general registers are not initialized. Note that the stack pointer (ER7) is undefined. The
stack pointer should therefore be initialized by an MOV.L instruction executed immediately after a
reset.
2.5Data Formats
The H8S/2000 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.9 shows the data formats of 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
Figure 2.9 General Register Data Formats (1)
Rev. 2.00, 05/03, page 34 of 820
70
Don't care
7043
UpperLower
Don't care
70
MSBLSB
Don't care
65432710
Don't care
7043
UpperLower
Don't care
70
MSBLSB
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. 2.00, 05/03, page 35 of 820
2.5.2Memory Data Formats
Figure 2.10 shows the data formats in memory. The H8S/2000 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 fe tches.
When SP (ER7) is used as an address register to access the stack, the operand size should be word
size or longword size.
Data TypeAddress
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. 2.00, 05/03, page 36 of 820
2.6Instruction Set
The H8S/2000 CPU has 65 types of instructions. The instructions are classified by function as
shown in table 2.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 fo r 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.
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.2Operation Notation
SymbolDescription
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).
Rev. 2.00, 05/03, page 38 of 820
Table 2.3Data Transfer Instructions
InstructionSize*Function
MOVB/W/L(EAs) → Rd, Rs → (EAd)
Moves data between two general registers or between a general register
and memory, or moves immediate data to a general register.
MOVFPEBCannot be used in this LSI.
MOVTPEBCannot be used in this LSI.
POPW/L@SP+ → Rn
Pops a general register from the stack. POP.W Rn is identical to MOV.W
@SP+, Rn. POP.L ERn is identical to MOV.L @SP+, ERn
PUSHW/LRn → @-SP
Pushes a general register onto the stack. PUSH.W Rn is identical to
MOV.W Rn, @-SP. 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
Rev. 2.00, 05/03, page 39 of 820
Table 2.4Arithmetic Operations Instructions
Instruction Size*
ADD
SUB
ADDX
SUBX
1
Function
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. (Subtraction on
immediate data and data in a general register cannot be performed in
bytes. Use the SUBX or ADD instruction.)
BRd ± Rs ± C → Rd, Rd ± #IMM ± C → Rd
Performs addition or subtraction with carry on data in two general
registers, or on immediate data and data in a general register.
INC
DEC
B/W/LRd ± 1 → Rd, Rd ± 2 → Rd
Adds or subtracts the value 1 or 2 to or from data in a general register.
(Only the value 1 can be added to or subtracted from byte operands.)
ADDS
SUBS
DAA
DAS
LRd ± 1 → Rd, Rd ± 2 → Rd, Rd ± 4 → Rd
Adds or subtracts the value 1, 2, or 4 to or from data in a 32-bit register.
BRd (decimal adjust) → Rd
Decimal-adjusts an addition or subtraction result in a general register by
referring to CCR to produce 4-bit BCD data.
MULXUB/WRd × Rs → Rd
Performs unsigned multiplication on data in two general registers: either
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. 2.00, 05/03, page 40 of 820
Instruction Size*
1
Function
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 the 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.
2
TAS*
B@ERd – 0, 1 → (<bit 7> of @ERd)
Tests memory contents, and sets the most significant bit (bit 7) to 1.
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.
Rev. 2.00, 05/03, page 41 of 820
Table 2.5Logic Operations Instructions
Instruction Size*Function
ANDB/W/LRd ∧ Rs → Rd, Rd ∧ #IMM → Rd
Performs a logical AND operation on a general register and another
general register or immediate data.
ORB/W/LRd ∨ Rs → Rd, Rd ∨ #IMM → Rd
Performs a logical OR operation on a general register and another
general register or immediate data.
XORB/W/LRd ⊕ Rs → Rd, Rd ⊕ #IMM → Rd
Performs a logical exclusive OR operation on a general register and
another general register or immediate data.
NOTB/W/L∼ Rd → Rd
Takes the one's complement (logical complement) of data in a general
register.
Note: *Size refers to the operand size.
B: Byte
W: Word
L: Longword
Table 2.6Shift Instructions
Instruction Size*Function
SHAL
SHAR
SHLL
SHLR
ROTL
ROTR
ROTXL
ROTXR
Note: * Size refers to the operand size.
Rev. 2.00, 05/03, page 42 of 820
B/W/LRd (shift) → Rd
Performs an arithmetic shift on data in a general register. 1-bit or 2 bit
shift is possible.
B/W/LRd (shift) → Rd
Performs a logical shift on data in a general register. 1-bit or 2 bit shift is
possible.
B/W/LRd (rotate) → Rd
Rotates data in a general register. 1-bit or 2 bit rotation is possible.
B/W/LRd (rotate) → Rd
Rotates data including the carry flag in a general register. 1-bit or 2 bit
rotation is possible.
B: Byte
W: Word
L: Longword
Table 2.7Bit Manipulation Instructions
Instruction Size*Function
BSETB1 → (<bit-No.> of <EAd>)
Sets a specified bit in a general register or memory operand to 1. The bit
number is specified by 3-bit immediate data or the lower 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 specif ied by 3-bi t
immediate data or the lower three bits of a general register.
BANDBC ∧ (<bit-No.> of <EAd>) → C
Logically ANDs the carry flag with a specified bit in a general register or
memory operand and stores the result in the carry flag.
BIANDBC ∧ (<bit-No.> of <EAd>) → C
Logically 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.
BORBC ∨ (<bit-No.> of <EAd>) → C
Logically ORs the carry flag with a specified bit in a general register or
memory operand and stores the result in the carry flag.
BIORBC ∨ (∼ <bit-No.> of <EAd>) → C
Logically 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. 2.00, 05/03, page 43 of 820
InstructionSize*Function
BXORBC ⊕ (<bit-No.> of <EAd>) → C
Logically exclusive-ORs the carry flag with a specified bit in a general
register or memory operand and stores the result in the carry flag.
BIXORBC ⊕ ∼ (<bit-No.> of <EAd>) → C
Logically exclusive-ORs the carry flag with the inverse of a specified bit
in a general register or memory operand and stores the result in the
carry flag. The bit number is specified by 3-bit immediate data.
BLDB(<bit-No.> of <EAd>) → C
Transfers a specified bit in a general register or memory operand to the
carry flag.
BILDB∼ (<bit-No.> of <EAd>) → C
Transfers the inverse of a specified bit in a general register or memory
operand to the carry flag. The bit number is specified by 3-bit immediate
data.
BSTBC → (<bit-No.> of <EAd>)
Transfers the carry flag value to a specified bit in a general register or
memory operand.
BISTB∼ 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 3bit immediate data.
Note:* Size refers to the operand size.
B: Byte
Rev. 2.00, 05/03, page 44 of 820
Table 2.8Branch Instructions
InstructionSizeFunction
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
(high or same)
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
C = 0
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.
Rev. 2.00, 05/03, page 45 of 820
Table 2.9System Control Instructions
InstructionSize*Function
TRAPA–Starts trap-instruction exception handling.
RTE–Returns from an exception-handling routine.
SLEEP–Causes a transition to a power-down state.
LDCB/W(EAs) → CCR, (EAs) → EXR
Moves the memory 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
operand. 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.
Note:* Size refers to the operand size.
B: Byte
W: Word
Rev. 2.00, 05/03, page 46 of 820
Table 2.10 Block Data Transfer Instructions
InstructionSizeFunction
EEPMOV.B–if R4L ≠ 0 then
Repeat @ER5+ → @ER6+
R4L–1 → R4L
Until R4L = 0
else next:
EEPMOV.W–i f 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.2Basic Instruction Formats
The H8S/2000 CPU 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.
• 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, and data registers by 3
bits or 4 bits. Some instructions have two register fields, and 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.
Rev. 2.00, 05/03, page 47 of 820
(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.11 Instruction Formats (Examples)
2.7Addressing Modes and Effective Address Calculation
The H8S/2000 CPU supports the eight addressing modes listed in table 2.11. Each instruction uses
a subset of these addressing modes.
Arithmetic and logic operations instructions can use the register direct and immediate addressing
modes. Data transfer instructions can use all addressing modes except program-counter relative
and memory indirect. Bit manipulation instructions can 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.11 Addressing Modes
No. Addressing ModeSymbol
1Register directRn
2Register indirect@ERn
3Register indirect with displacement@(d:16,ERn)/@(d:32,ERn)
4Register indirect with post-increment