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.
16
H8S/2114R R4F2114R
H8S/2114RGroup
Hardware Manual
Renesas 16-Bit Single-Chip Microcomputer
H8S Family / H8S/2100 Series
Rev.3.00
Revision Date: Jul. 14, 2005
Rev. 3.00 Jul. 14, 2005 Page ii of xlviii
Keep safety first in your circuit designs!
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 thirdparty'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 the 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. 3.00 Jul. 14, 2005 Page iii of xlviii
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 hi g h-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 malfun ction 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 Rese rved 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. 3.00 Jul. 14, 2005 Page iv of xlviii
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:
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)
Product code, Package dimensions, etc.
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. 3.00 Jul. 14, 2005 Page v of xlviii
Preface
This H8S/2114R Group is a series of microcomputers (MCUs) made up of the H8S/2000 CPU
with Renesas Technology’s original architecture as its core, and the peripheral functions required
to configure a system.
The H8S/2000 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/2000 CPU can handle a
16-Mbyte linear address space. The instruction set of the H8S/2000 CPU maintains upward
compatibility at the object level with the H8/300 and H8/300 H CPUs. This allows the transition
from the H8/300, H8/300L, or H8/300H to the H8S/2000 CPU.
This LSI is equipped with ROM, RAM, two kinds of PWM timers (PWM and PWMX), a 16-bit
free running timer (FRT), a 16-bit timer pulse unit (TPU), 8-bit timers (TMR), watchdog timer
(WDT), serial communication interface (SCI), I
keyboard buffer control units (KBU), an A/D converter, and I/O ports as on-chip p er ipheral
modules required for system configuration.
A data transfer controller (DTC) and LPC interface (LPC) are included as bus masters.
2
C bus interface (IIC), a LPC interface (LPC), a
A flash memory (F-ZTAT
TM
*) is available for this LSI’s 1 Mbyte ROM. The CPU and ROM 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.
Note: * F-ZTAT
TM
is a trademark of Renesas Technology. Corp.
Target Users: This manual was written for users who use the H8S/2114R in the design of
application systems. Target users are expected to understand the fundamentals of
electrical circuits, logic circuits, and microcomputers.
Objective: This manual was written to explain the hardware functions and electrical
characteristics of the H8S/2114R Group 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. 3.00 Jul. 14, 2005 Page vi of xlviii
• 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 25,
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/
H8S/2114R Group manuals:
Document Title Document No.
H8S/2114R Group Hardware Manual This manual
H8S/2600 Series, H8S/2000 Series Programming Manual REJ09B0139
Figure 17.12 Receive Counter and KBBR Data Load Timing ................................................... 603
Figure 17.13 Receive Timing and KCLK................................................................................... 604
Figure 17.14 Example of KCLK Input Fall Interrupt Operation ................................................ 605
Figure 17.15 Timing of First KCLK Interrupt............................................................................ 606
Figure 17.16 First KCLK Interrupt Path..................................................................................... 608
Figure 17.17 Interrupt Timing in Software Standby Mode, Watch Mode, and Subsleep Mode. 609
Figure 17.18 Internal Flag of First KCLK Falling Interrupt in Software Standby mode,
Watch mode, and Subsleep mode..........................................................................610
I/O Port States in Each Pin State........................................................................... 975
Rev. 3.00 Jul. 14, 2005 Page xlviii of xlviii
Section 1 Overview
Section 1 Overview
1.1 Overview
• 16-bit high-speed H8S/2000 CPU
Upward-compatible with the H8/300 and H8/300H CPUs on an object level
Sixteen 16-bit general registers
65 basic instructions
• Various peripheral functions
Data transfer controller (DTC)
8-bit PWM timer (PWM)
14-bit PWM timer (PWMX)
16-bit timer pulse unit (TPU)
16-bit free-running timer (FRT)
8-bit timer (TMR)
Watchdog timer (WDT)
Asynchronous or clocked synchronous serial communication interface (SCI)
2
I
C bus interface (IIC)
Keyboard buffer control unit (KB U)
LPC interface (LPC)
10-bit A/D converter
Boundary scan (JTAG)
Clock pulse generator
• On-chip memory
ROM Type Model ROM RAM Remarks
Flash memory
version
• General I/O ports
I/O pins: 106
Input-only pins: 13
• Supports various power-down states
• Compact package
R4F2114R 1 Mbyte 8 kbytes Being
developed
Rev. 3.00 Jul. 14, 2005 Page 1 of 986
REJ09B0098-0300
Section 1 Overview
Package Code Body Size Pin Pitch
TQFP-144 TFP-144 16.0 × 16.0 mm 0.4 mm
Rev. 3.00 Jul. 14, 2005 Page 2 of 986
REJ09B0098-0300
1.2 Internal Block Diagram
E
Section 1 Overview
VCC
VCC
VCC
VCL
VSS
VSS
VSS
VSS
VSS
RES
XTAL
EXTAL
MD2
MD1
MD0
FWE
NMI
STBY
RESO
TRST
E
40/TMCI0/TxD2/
P
TMO0/R
41/
P
P42/ExIRQ7/
X1
X2
/IRQ2/
90
P
P97/I
P60/KIN0
61/
P
2/FTI
KIN
62/
P
P63/KIN3
P64/KIN4
P65/KIN5
6/KIN6/
IRQ
66/
P
/KIN7/
Q7
R
P67/I
xD2/
TMRI0/SCK2/SD
P
Q3
R
P84/I
P85/IRQ4/
/SCK1
P86/IRQ5
PE0/LID3
E
PE1*/
/ET
E2*
P
TDO
E
PE3*/
TM
PE4*/E
DTRG
A
IRQ1
91/
P
P92/IRQ0
R
P93/I
IRQ
P94/
P95/IRQ14
E
φ/
96/
P
S
Q15/
R
/FTCI/TMIX
1/FTOA
KIN
A/TMIY
/FTIB
/FTIC
/FTID
TO
F
TMOX
SERIRQ
D
CLKRUN
D
TMCI1
43/
P
/TMO1
44
P
TMRI1
45/
P
P46/PWX0
P47/PWX1
P
P80/
P81/GA20
LKRUN
C
82/
PCPD
L
83/
P
IrTxD
/
/TxD1
IrRxD
RxD1/
SCL1
/
TCK
Q12
XCL
DA0
DI
S
13
B
Port 4Port 6Port 9Port E
A1
ME
Port 8
AVSS
A
VrefAVCC
Clock pulse
generator
ROM
(flash memory)
RAM
Interrupt
controller
FR
16-bit
er
t tim
-bi
8
× 4 channels
I × 2 channel
SC
channel)
1
×
(IrDA
channels
IIC × 2
0-bit A/D converter
1
Boundary sca
AG)
(JT
Port 7
P7
P7
P73
P72
P76/AN6
P77/AN7
5/
4/
/
/
Ex
Ex
ExIRQ3/AN
ExIRQ2/AN2
I
I
RQ5/AN5
RQ4/AN4
3
T
n
P71/ExIRQ1/AN1
H8S/2000CPU
s
PG6/E
PG7/
P70/ExIRQ0/AN0
E
xI
xI
R
R
Q
Q
14/ExS
15/ExSCLB
DAB
Note: * Not supported by the system development tool (emulator).
Notes: (N) indicates the pin is driven by NMOS push-pull/open drain.
* Not supported by the system development tool (emulator).
Rev. 3.00 Jul. 14, 2005 Page 9 of 986
REJ09B0098-0300
Section 1 Overview
1.3.3 Pin Functions
Table 1.2 Pin Functions
Type Symbol Pin No. I/O Name and Function
Power
supply
Clock
Operating
mode
control
System
control
VCC 1, 36,
86
VCL 13 Input External capacitance pin for internal step-down
VSS 7, 42,
95, 111,
139
XTAL 143 Input
EXTAL 144 Input
φ 18 Output Supplies the system clock to external devices.
EXCL 18 Input
ExEXCL 16 Input
X2
X1
MD2 MD1
MD0
141
140
25
9
10
RES 8 Input Reset pin. When this pin is low, the chip is reset.
RESO 142 Output Outputs a reset signal to an external device.
STBY 12 Input When this pin is low, a transition is made to
FWE 26 Input Control pin for use by flash memory
Input Power supply pins. Connect all these pins to the
system power supply. Connect the bypass
capacitor between VCC and VSS (near VCC).
power. Connect this pin to VSS through an
external capacitor (that is located near this pin) to
stabilize internal step-down power.
Input Ground pins. Connect all these pins to the system
power supply (0 V).
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 23, Clock Pulse Generator.
32.768-kHz external clock for sub clock should be
supplied. To which pin the external clock is input
can be selected from the EXCL and ExEXCL
pins.
Input These pins should be left open.
Input These pins set the operating mode. Inputs at
these pins should not be changed during
operation.
To which pin an IRQ interrupt is input can be
selected from the IRQn and ExIRQn pins.
(n = 15 to 0)
134, 133,
24, 23, 22
ExIRQ15
to ExIRQ0
51
to
58
138
14
73
to
68
Boundary
scan
(JTAG)
ETRST*
ETMS 28 Input
ETDO 29 Output
ETDI 30 Input
ETCK 31 Input
2
27 Input
Interface pins for boundary scan
Reset by holding the ETRST pin to low
regardless of the JTAG activation. At this time,
the ETRST pin should be held low for 20 clocks
of ETCK. For details, see section 26, Electrical
Characteristics. Then, to activate the JTAG, the
ETRST pin should be set to high and the pins
ETCK, ETMS, and ETDI should be set
appropriately. When in the normal operation
without activating the JTAG, pins ETRST, ETCK,
ETMS, and ETDI are set to high or high-
impedance. As these pins are pulled up inside
the chip, take care during standby state.
Section 1 Overview
Rev. 3.00 Jul. 14, 2005 Page 11 of 986
REJ09B0098-0300
Section 1 Overview
Type Symbol Pin No. I/O Name and Function
(PWM)
14-bit PWM
timer
PW15 to
PW8
ExPW15 to
ExPW12
PWX1
PWX0
96 to 103 PWM timer
43 to 46
6
5
Output PWM timer pulse output pins.
From which pin pulses are output can be selected
from the PWn and ExPWn pins.
(n = 15 to 12)
Output PWMX pulse output pins
(PWMX)
16-bit free
running
timer (FRT)
FTCI 78 Input External event input pin
FTOA
FTOB
FTIA to
79
Output Output compare output pins
84
80 to 83 Input Input capture input pins
FTID
16-bit timer
pulse unit
(TPU)
8-bit timer
(TMR_0,
TMR_1,
TMR_X,
TMR_Y)
TCLKD
TCLKC
TCLKB
TCLKA
TIOCA0
TIOCB0
TIOCC0
TIOCD0
TIOCA1
TIOCB1
TIOCA2
TIOCB2
TMO0
TMO1
TMOX
ExTMOX
TMOY
TMCI0
TMCI1
ExTMCI0
ExTMCI1
59
61
63
64
66
65
64
63
62
61
60
59
137
3
85
47
15
136
2
58
57
Input Timer external clock input/output pins
Input/
Output
Input/
Output
Input/
Output
Input capture input/output compare output/PWM
output pins for TGRA_0 to TGRD_0
Input capture input/output compare output/PWM
output pins for TGRA_1 and TGRB_1
Input capture input/output compare output/PWM
output pins for TGRA_2 and TGRB_2
Output Waveform output pins with output compare
function.
From which pin waveforms are output can be
selected from the TMOX and ExTMOX pins.
Input Input pins for the external clock input to the
counter. To which pin the external clock is input
can be selected from the TMCIn and ExTMCIn
pins.
(n = 1 or 0)
Rev. 3.00 Jul. 14, 2005 Page 12 of 986
REJ09B0098-0300
Type Symbol Pin No. I/O Name and Function
8-bit timer
(TMR_0,
TMR_1,
TMR_X,
TMR_Y)
TMRI0
TMRI1
TMIX
TMIY
ExTMIX
ExTMIY
138
4
78
80
56
55
Input External event input pin and counter reset input
pin
Input External event input pins and counter reset input
pins. To which pin an external event or counter
reset is input can be selected from the TMIn and
ExTMIn pins.
(n = X or Y)
Serial
communication
interface
(SCI_1,
SCI_2)
TxD1
TxD2
RxD1
RxD2
SCK1
SCK2
133
136
134
137
135
138
Output Transmit data output pins
Input Receive data input pins
Input/
Output
Clock input/output pins. Output type is NMOS
push-pull output.
IrTxD 133 Output Encoded data output pin for IrDA SCI with
IrDA (SCI)
I2C bus
interface
(IIC)
IrRxD 134 Input Encoded data input pin for IrDA
SCL0
SCL1
ExSCLA
ExSCLB
14
135
53
51
Input/
Output
I2C clock input/output pins. These pins can drive
a bus directly with the NMOS open drain output.
To which pin the I
2
C clock is input or output can
be selected from the SCLn, ExSCLA, and
ExSCLB pins.
(n = 1 or 0)
2
SDA0
SDA1
ExSDAA
ExSDAB
17
138
54
52
Input/
Output
C data input/output pins. These pins can drive a
I
bus directly with the NMOS open drain output. To
which pin the I
2
C data is input or output can be
selected from the SDAn, ExSDAA, and ExSDAB
pins.
(n = 1 or 0)
Keyboard
buffer
control unit
PS2AC
PS2BC
PS2CC
39
37
34
Input/
Output
Synchronous clock input/output pins for the
keyboard buffer control unit
(KBU)
PS2AD
PS2BD
PS2CD
38
35
33
Input/
Output
Data input/output pins for the keyboard buffer
control unit.
Section 1 Overview
Rev. 3.00 Jul. 14, 2005 Page 13 of 986
REJ09B0098-0300
Section 1 Overview
Type Symbol Pin No. I/O Name and Function
Keyboard
control
KIN15 to
KIN0
33 to 35,
37 to 41,
85 to 78
Input Matrix keyboard input pins. All pins have a wake-
up function. Normally, KIN0 to KIN15 function as
key scan inputs, and P10 to P17 and P20 to P27
function as key scan outputs. Thus, composed
with a maximum of 16 outputs x 16 inputs, a 256key matrix can be configured.
WUE15 to
WUE8
WUE7 to
87 to 94
113 to 120
Input Wake-up event input pins. Same wake up as key
wake up can be performed with various sources.
WUE0
A/D
converter
AN7 to AN0 75 to 68 Input Analog input pins
ADTRG24 Input External trigger input pin to start A/D conversion
AVCC 76 Input Analog power supply pin. When the A/D
converter is not used, this pin should be
connected to the system power supply (+3.3 V).
AVref 77 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 67 Input Ground pin for the A/D converter. This pin should
be connected to the system power supply (0 V).
Rev. 3.00 Jul. 14, 2005 Page 14 of 986
REJ09B0098-0300
Type Symbol Pin No. I/O Name and Function
LPC
Interface
(LPC)
LAD3 to
LAD0
LFRAME125 Input Input pin indicating transfer cycle start and forced
124 to 121 Input/
Output
Transfer cycle type, address, and data
input/output pins
termination of an abnormal transfer cycle
LRESET126 Input LPC reset pin. When this pin is low, a reset state
is entered.
LCLK 127 Input LPC clock input pin
SERIRQ 128 Input/
Output
LSCI
LSMI
PME
119
120
129
Input/
Output
LPC serial host interrupt (HIRQ1, SMI, HIRQ6, or
HIRQ9 to HIRQ12) input/output pin
General input/output ports of LSCI, LSMI, and
PME
GA20 130 Output GATE A20 control signal output pin
CLKRUN 131 Input/
LCLK operation start request input/output pin
Output
LPCPD 132 Input LPC module shutdown control input pin
LID3 32 Input Input pin for setting host address 31
DLAD3 to
DLAD0
116 to 113 Input/
Output
LAD input/output pins for the docking LPC
DLFRAME 117 Output LFRAME output pin for the docking LPC
DSERIRQ 136 Input/
SERIRQ input/output pin for the docking LPC
Output
DCLKRUN 137 Input/
CLKRUN input/output pin for the docking LPC
Output
LDRQ 88 Output Encoded DMA request output pin for the docking
LPC
DLDRQ 87 Input Encoded DMA request input pin for the docking
LPC
Section 1 Overview
Rev. 3.00 Jul. 14, 2005 Page 15 of 986
REJ09B0098-0300
Section 1 Overview
Type Symbol Pin No. I/O Name and Function
I/O ports
P17 to P10 104 to 110, 112 Input/
Eight input/output pins
Output
P27 to P20 96 to 103 Input/
Eight input/output pins
Output
P37 to P30 128 to 121 Input/
Eight input/output pins
Output
P47 to P40 6 to 2,
138 to 136
P52 to P50 14 to 16 Input/
Input/
Output
Eight input/output pins
Three input/output pins
Output
P67 to P60 85 to 78 Input/
Eight input/output pins
Output
P77 to P70 75 to 68 Input Eight input pins
P86 to P80 135 to 129 Input/
Seven input/output pins
Output
P97 to P90 17 to 24 Input/
Eight input/output pins
Output
PA7 to PA0 33 to 35,
37 to 41
PB7 to PB0 113 to 120 Input/
Input/
Output
Eight input/output pins
Eight input/output pins
Output
PC7 to PC0 87 to 94 Input/
Eight input/output pins
Output
PD7 to PD0 59 to 66 Input/
Eight input/output pins
Output
PE4 to
1
PE0*
PF7 to PF0 43 to 50 Input/
28 to 32 Input Five input pins
Eight input/output pins
Output
PG7 to PG0 51 to 58 Input/
Eight input/output pins
Output
Notes: 1. Pins PE4 to PE1 are not supported by the system development tool (emulator).
2. Following precautions are required on the power-on reset signal that is applied to the
ETRST pin.
The reset signal should be applied on power supply.
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.
Rev. 3.00 Jul. 14, 2005 Page 16 of 986
REJ09B0098-0300
Section 1 Overview
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
ETRST
This LSI
RES
ETRST
Figure 1.3 Sample Design of Reset Signals with no Affection Each Other
Rev. 3.00 Jul. 14, 2005 Page 17 of 986
REJ09B0098-0300
Section 1 Overview
Rev. 3.00 Jul. 14, 2005 Page 18 of 986
REJ09B0098-0300
Section 2 CPU
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 Mbytes 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, see section 3, MCU Operating Modes.
2.1 Features
• Upward-compatibility with H8/300 and H8/300H CPUs
Can execute H8/300 CPU 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]
R egi st er in di rect 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]
Pr ogram-counter relative [@(d:8,PC) or @(d:16,PC)]
Memory indirect [@@aa:8]
• 16 Mbytes address space
Pr og ram: 16 M byt es
Data: 16 Mbytes
• 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)
Rev. 3.00 Jul. 14, 2005 Page 19 of 986
REJ09B0098-0300
Section 2 CPU
16 × 16-bit register-register multiply: 20 states (MULXU.W), 21 states (MULXS.W)
32 ÷ 16-bit register-register divide: 20 states (DIVXU.W)
• Two CPU operating modes
No rmal mo de
Advanced mode
• Power-down state
Transition to power-down state by SLEEP instruction
Selectable CPU clock speed
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
MULXU MULXU.B Rs, Rd 3 12
MULXU.W Rs, ERd 4 20
MULXS MULXS.B Rs, Rd 4 13
MULXS.W Rs, ERd 5 21
In addition, there are differences in address space, CCR and EXR register functions, power-down
modes, etc., depending on the model.
Rev. 3.00 Jul. 14, 2005 Page 20 of 986
REJ09B0098-0300
Section 2 CPU
2.1.2 Differences 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 control register have been added.
• Extended address space
Normal mode supports the same 64 kbytes address space as the H8/300 CPU.
Advanced mode supports a maximum 16 Mbytes address space.
• Enhanced addressing
The addressing modes have been enhanced to make effective use of the 16 Mbytes address
space.
• Enhanced instructions
Ad d ressi n g modes of bit - manipulation instructions have been enha nced.
Signed multiply and divide instructions have been added.
Two-bit shift and two-bit rotate instructions have been added.
Instructions for saving and restoring multiple registers have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions are executed twice as fast.
2.1.3 Differences 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
Ad d ressi n g modes of bit - manipulation instructions have been enha nced.
Two-bit shift and two-bit rotate instructions have been added.
Instructions for saving and restoring multiple registers have been added.
A test and set instruction has been added.
• Higher speed
Basic instructions are executed twice as fast.
Rev. 3.00 Jul. 14, 2005 Page 21 of 986
REJ09B0098-0300
Section 2 CPU
2.2 CPU Operating Modes
The H8S/2000 CPU has two operating modes: normal and advanced. Normal mode supports a
maximum 64 kbytes address space. Advanced mode supports a maximum 16 Mbytes address
space. The mode is selected by the LSI's mode pins.
2.2.1 Normal Mode
The exception vector table and stack have the same structure as in the H8/300 CPU in normal
mode.
• Address space
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 lower 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 vecto r tabl e. 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
In normal mode, when the program counter (PC) is push ed onto the stack in a subroutine call
in normal mode, and the PC and condition-code register (CCR) are pushed onto the stack in
exception handling, they are stored as shown in figure 2.2. The extended control register
(EXR) is not pushed onto the stack. For details, see section 4, Exception Handling.
• Address space
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 o r add ress re gi st er s.
• Instruction set
All instructions and addressing modes can be used.
• Exception vector table and memory indirect branch addresses
In advanced mode, the top area starting at H'00000000 is allocated to the exception vector
table in 32-bit units. In each 32 bits, the upper eight 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)
Rev. 3.00 Jul. 14, 2005 Page 24 of 986
REJ09B0098-0300
Section 2 CPU
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 eight 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 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 and condition-code register (CCR) are pushed onto the stack in exception
handling, they are stored as shown in figure 2.4. The extended control register (EXR) is not
pushed onto the stack. For details, see section 4, Exception Handlin g.
SP
Reserved
PC
(24-bit)
(a) Subroutine Branch(b) Exception Handling
SP
CCR
PC
(24-bit)
Figure 2.4 Stack Structure in Advanced Mode
Rev. 3.00 Jul. 14, 2005 Page 25 of 986
REJ09B0098-0300
Section 2 CPU
2.3 Address Space
Figure 2.5 shows a memory map of the H8S/2000 CPU. The H8S/2000 CPU provides linear
access to a maximum 64 kbytes address space in normal mode, and a maximum 16 Mbytes
(architecturally 4 Gbytes) address space in advanced mode. The usable modes and address spaces
differ depending on the product. For details on each product, see section 3, MCU Operating
Modes.
H'0000
64 kbytes16 Mbytes
H'FFFF
Note: * Not available in this LSI.
Figure 2.5 Memory Map
H'00000000
H'00FFFFFF
H'FFFFFFFF
Program area
Data area
Not available
in this LSI
(b) Advanced Mode(a) Normal Mode*
Rev. 3.00 Jul. 14, 2005 Page 26 of 986
REJ09B0098-0300
Section 2 CPU
2.4 Register Configuration
The H8S/2000 CPU has the internal registers shown in figure 2.6. These are classified into two
types of registers: general registers and control registers. Control registers refer to 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: * Does not affect operation in this LSI.
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. 3.00 Jul. 14, 2005 Page 27 of 986
REJ09B0098-0300
Section 2 CPU
2.4.1 General 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 regi st er 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, providing sixteen 16-bit registers at the maximum. 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 sixteen 8-bit registers at the maximum.
The usage of each register can be selected independently.
General register ER7 has the function of the 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)
• 16-bit registers• 8-bit registers
E registers (extended registers)
(E0 to E7)
R registers
(R0 to R7)
Figure 2.7 Usage of General Registers
Rev. 3.00 Jul. 14, 2005 Page 28 of 986
REJ09B0098-0300
RH registers
(R0H to R7H)
RL registers
(R0L to R7L)
Section 2 CPU
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 instruction the CPU will execute. The length
of all CPU instructions is 2 bytes (one word), so the least significant PC bit is ignored. (When an
instruction is fetched for read, the least significant PC bit is regarded as 0.)
2.4.3 Extended Control Register (EXR)
EXR does not affect operation in this LSI.
Bit Bit Name Initial Value R/W Description
7 T 0 R/W Trace Bit
Does not affect operation in this LSI.
6 to 3 – All 1 R Reserved
These bits are always read as 1.
2 to 0 I2
I1
I0
Rev. 3.00 Jul. 14, 2005 Page 29 of 986
REJ09B0098-0300
1
1
1
R/W
R/W
R/W
Interrupt Mask Bits 2 to 0
Do not affect operation in this LSI.
Section 2 CPU
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 condition s 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
at the start of an exception-handling sequence. For details,
see section 5, Interrupt Controller.
6 UI Undefined R/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.
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 to and read from 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 when data is zero, and cleared to 0 when data is
not zero.
Rev. 3.00 Jul. 14, 2005 Page 30 of 986
REJ09B0098-0300
Section 2 CPU
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 Initial 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.
Rev. 3.00 Jul. 14, 2005 Page 31 of 986
REJ09B0098-0300
Section 2 CPU
2.5 Data Formats
The H8S/2000 CPU can process 1-bit, 4-bit B C D, 8- bi t (byt e), 16 -bi t (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 instruct i o ns treat byte dat a as two
digits of 4-bit BCD data.
2.5.1 General Register Data Formats
Figure 2.9 shows the data formats of general registers.
Data TypeRegister NumberData Image
70
1-bit data
RnH
6543271
Don't care
0
1-bit data
4-bit BCD data
4-bit BCD data
Byte data
Byte data
7
RnL
RnH
RnL
RnH
RnL
Don't care
7
UpperLower
Don't care
70
MSBLSB
Don't care
65432710
04 3
Don't care
704
UpperLower
7
MSB
Figure 2.9 General Register Data Formats (1)
3
Don't care
0
0
LSB
Rev. 3.00 Jul. 14, 2005 Page 32 of 986
REJ09B0098-0300
Data TypeData ImageRegister Number
Section 2 CPU
Word data
Word data
150
MSB
Longword data
3116
MSB
Rn
En
ERn
EnRn
Legend
ERn
: General register ER
En
: General register E
Rn
: General register R
RnH
: General register RH
RnL
: General register RL
MSB
: Most significant bit
LSB
: Least significant bit
Figure 2.9 General Register Data Formats (2)
150
MSB
LSB
150
LSB
LSB
Rev. 3.00 Jul. 14, 2005 Page 33 of 986
REJ09B0098-0300
Section 2 CPU
2.5.2 Memory 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 fetches.
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 Image
LSB
LSB
LSB
Rev. 3.00 Jul. 14, 2005 Page 34 of 986
REJ09B0098-0300
Section 2 CPU
2.6 Instruction Set
The H8S/2000 CPU has 65 types of instructions. The instructions are classified by function as
shown in table 2.1.
is the generic name for conditional branch instructions.
Rev. 3.00 Jul. 14, 2005 Page 35 of 986
REJ09B0098-0300
Section 2 CPU
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)
(EAd) Destination operand
(EAs) Source operand
EXR Extended control 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. 3.00 Jul. 14, 2005 Page 36 of 986
REJ09B0098-0300
Section 2 CPU
Table 2.3 Data Transfer Instructions
Instruction Size*1 Function
MOV B/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.
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.
2
LDM*
L @SP+ → Rn (register list)
Pops two or more general registers from the stack.
2
STM*
L Rn (register list) → @-SP
Pushes two or more general registers onto the stack.
Notes: 1. Size refers to the operand size.
B: Byte
W: Word
L: Longword
2. Since register ER7 functions as the stack pointer in an STM/LDM instruction, it cannot
be used as an STM/LDM register.
Rev. 3.00 Jul. 14, 2005 Page 37 of 986
REJ09B0098-0300
Section 2 CPU
Table 2.4 Arithmetic Operations Instructions (1)
Instruction Size* Function
ADD
SUB
ADDX
SUBX
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. (Subtraction on
immediate data and data in a general register cannot be performed in
bytes. Use the SUBX or ADD instruction.)
B Rd ± 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/L Rd ± 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
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 CCR to produce 4-bit BCD data.
MULXU B/W Rd × Rs → Rd
Performs unsigned multiplication on data in two general registers: either
8-bit × 8-bit → 16-bit or 16-bit × 16-bit → 32-bit.
MULXS B/W Rd × Rs → Rd
Performs signed multiplication on data in two general registers: either 8bit × 8-bit → 16-bit or 16-bit × 16-bit → 32-bit.
DIVXU B/W Rd ÷ Rs → Rd
Performs unsigned division on data in two general registers: either 16-bit
÷ 8-bit → 8-bit quotient and 8-bit remainder or 32-bit ÷ 16-bit → 16-bit
quotient and 16-bit remainder.
Note: * Size refers to the operand size.
B: Byte
W: Word
L: Longword
Rev. 3.00 Jul. 14, 2005 Page 38 of 986
REJ09B0098-0300
Table 2.4 Arithmetic Operations Instructions (2)
Instruction Size* 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 32 bits ÷ 16 bits → 16-bit
quotient and 16-bit remainder.
CMP B/W/L Rd – 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.
NEG B/W/L 0 – Rd → Rd
Takes the two's complement (arithmetic complement) of data in a
general register.
EXTU W/L Rd (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.
EXTS W/L Rd (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. To use the TAS instruction, use registers ER0, ER1, ER4, and ER5.
Section 2 CPU
Rev. 3.00 Jul. 14, 2005 Page 39 of 986
REJ09B0098-0300
Section 2 CPU
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 data in a general
register.
Note: * Size refers to the operand size.
B: Byte
W: Word
L: Longword
Rev. 3.00 Jul. 14, 2005 Page 40 of 986
REJ09B0098-0300
Table 2.6 Shift Instructions
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 data in a general register. 1-bit or 2 bit
shift is possible.
B/W/L Rd (shift) → Rd
Performs a logical shift on data in a general register. 1-bit or 2 bit shift is
possible.
B/W/L Rd (rotate) → Rd
Rotates data in a general register. 1-bit or 2 bit rotation is possible.
B/W/L Rd (rotate) → Rd
Rotates data including the carry flag in a general register. 1-bit or 2 bit
rotation is possible.
Section 2 CPU
Rev. 3.00 Jul. 14, 2005 Page 41 of 986
REJ09B0098-0300
Section 2 CPU
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 lower three bits of a general register.
BAND B C ∧ (<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.
BIAND B C ∧ (<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.
BOR B C ∨ (<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.
BIOR B C ∨ (∼ <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.
Note: * Size refers to the operand size.
B: Byte
Rev. 3.00 Jul. 14, 2005 Page 42 of 986
REJ09B0098-0300
Table 2.7 Bit Manipulation Instructions (2)
Instruction Size* Function
BXOR B C ⊕ (<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.
BIXOR B C ⊕ ∼ (<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.
BLD B (<bit-No.> of <EAd>) → C
Transfers a specified bit in a general register or memory operand to the
carry flag.
BILD B ∼ (<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.
BST B C → (<bit-No.> of <EAd>)
Transfers the carry flag value to a specified bit in a general register or
memory operand.
Section 2 CPU
BIST B ∼ 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.
Note: * Size refers to the operand size.
B: Byte
Rev. 3.00 Jul. 14, 2005 Page 43 of 986
REJ09B0098-0300
Section 2 CPU
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 address.
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. 3.00 Jul. 14, 2005 Page 44 of 986
REJ09B0098-0300
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
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 eight bits are
valid.
STC B/W CCR → (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 eight
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
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.
Rev. 3.00 Jul. 14, 2005 Page 46 of 986
REJ09B0098-0300
Section 2 CPU
2.6.2 Basic 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-bit, and data registers by 3-bit
or 4-bit. Some instructions have two register fields, and some have no register field.
• Effective address extension
8-, 16-, or 32-bit 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)
(4) Operation field, effective address extension, and condition field
opccEA (disp)BRA d:16
rn
rnrm
rm
NOP, RTS
ADD.B Rn, Rm
MOV.B @(d:16, Rn), Rm
Figure 2.11 Instruction Formats (Examples)
Rev. 3.00 Jul. 14, 2005 Page 47 of 986
REJ09B0098-0300
Section 2 CPU
2.7 Addressing 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 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
Register indirect with pre-decrement
5 Absolute address @aa:8/@aa:16/@aa:24/@aa:32
6 Immediate #xx:8/#xx:16/#xx:32
7 Program-counter relative @(d:8,PC)/@(d:16,PC)
8 Memory indirect @@aa:8
@ERn+
@–ERn
2.7.1 Register Direct—Rn
The register field of the instruction code specifies an 8-, 16-, or 32-bit general register which
contains 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 a memory operand. If the address is a program instruction address, the lower 24 bits ar e
valid and the upper eight bits are all assumed to be 0 (H
Rev. 3.00 Jul. 14, 2005 Page 48 of 986
REJ09B0098-0300
′00).
Section 2 CPU
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 code is added to an address register
(ERn) specified by the register field of the instruction, and the sum gives the address of a memory
operand. A 16-bit displacement is sign-extended when added.
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 byte access, 2 for word access, and 4 for longword
access. For word or longword transfer instructions, the register value should be even.
Register Indirect with Pre-Decrement—@-ERn: The value 1, 2, or 4 is subtracted from an
address register (ERn) specified by the register field in the instruction code, and the result
becomes the address of a memory operand. The result is also stored in the address register. The
value subtracted is 1 for byte access, 2 for word access, and 4 for longword access. For word or
longword transfer instructions, 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. For a 32-bit absolute address,
the entire address space is accessed.
A 24-bit absolute address (@aa:24) indicates the address of a program instruction. The upper eight
bits are all assumed to be 0 (H'00).
Rev. 3.00 Jul. 14, 2005 Page 49 of 986
REJ09B0098-0300
Section 2 CPU
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
24 bits (@aa:24)
2.7.6 Immediate—#xx:8, #xx:16, or #xx:32
The 8-bit (#xx:8), 16-bit (#xx:16), or 32-bit (#xx:32) immediate data contained in an instruction
code can be used directly as an operand.
The ADDS, SUBS, INC, and DEC instructions implicitly contain immediate data in their
instruction codes. 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 can be used by the Bcc and BSR instructions. An 8-bit or 16-bit displacement
contained in the instruction code is sign-extended to 24-bit and added to the 24-bit address
indicated by the PC value to generate a 24-bit branch address. Only the lower 24-bit of this branch
address are valid; the upper eight 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-byte (–63 to +64 words) or –32766 to +32768-byte (–16383 to
+16384 words) from the branch instruction. The resulting value should be an even number.
Rev. 3.00 Jul. 14, 2005 Page 50 of 986
REJ09B0098-0300
Section 2 CPU
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 which contains a branch address. The upper bits of
the 8-bit 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 0 (H'00).
Note that the top area of the address range in which the branch address is stored is also used for
the exception vector area. For further details, see 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 the instruction code to be
fetched at the address preceding the specified address. (For further information, see section 2.5.2,
Memory Data Formats.)
Specified
by @aa:8
Branch address
(a) Normal Mode(b) Advanced Mode
Specified
by @aa:8
Reserved
Branch address
Figure 2.12 Branch Address Specification in Memory Indirect Addressing Mode
Rev. 3.00 Jul. 14, 2005 Page 51 of 986
REJ09B0098-0300
Section 2 CPU
2.7.9 Effective Address Calculation
Table 2.13 indicates how effective addresses are calculated in each addressing mode. In normal
mode, the upper eight bits of the effective address are ignored in order to generate a 16-bit
address.
Table 2.13 Effective Address Calculation (1)
No
Addressing Mode and Instruction FormatEffective Address CalculationEffective Address (EA)
1
Register direct (Rn)
op
2
Register indirect (@ERn)
op
Register indirect with displacement
3
@(d:16,ERn) or @(d:32,ERn)
o
Register indirect with post-increment or
4
pre-decrement
• Register indirect with post-increment @ERn+
rn
rm
r
p
r
dis
31
General register contents
31
General register contents
p
31
Sign extension
1
3
General register contents
disp
Operand is general register contents.
312331
0
Don't care
0
312331
on't care
D
0
1
0
1
3
3
Don't care
24
24
3
24
2
0
0
0
p
o
r
• Register indirect with pre-decrement @-ERn
p
o
r
31
General register contents
Operand Size
Byte
Word
Longword
Offset
1
2
4
1, 2, or 4
1, 2, or 4
Rev. 3.00 Jul. 14, 2005 Page 52 of 986
REJ09B0098-0300
0
1
31
3
on't ca
D
23
24
re
0
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.