Renesas H8S/2319 series, H8S/2318 series Hardware Manual

Page 1
H8S/2319Group, H8S/2318Group
The revision list summarizes the locations of revisions and additions. Details should always be checked by referring to the relevant text.
16
Hardware Manual
Renesas 16-Bit Single-Chip Microcomputer
H8S Family/H8S/2300 Series
Rev.5.00
2003.12.15
Page 2
Page 3
Renesas 1 6-Bit Single-Chip Microcomputer
H8S Family/H8S/2300 Series
H8S/2319 Group,
H8S/2318 Group
Hardware Manual
REJ09B0089-0500O
Page 4

Cautions

Keep safety first in your circuit designs!
1. RenesasTechnology Corp.putsthe maximum effort into making semiconductor products better and morereliable, but there is alwaysthe possibility that troublemay occur with them. Troublewith semiconductors may lead to personalinjury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap.
Notes regarding these materials
1. These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corp. product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corp. or a third party.
2. Renesas Technology Corp. assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials.
3. All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on productsat the time of publication of these materials, andare subject to change by RenesasTechnologyCorp. 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 purchasinga product listed herein. The information described here may contain technicalinaccuracies or typographicalerrors. 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 besureto evaluateall information as a total systembefore making a final decision on the applicability of the information and products. Renesas TechnologyCorp. assumes no responsibility for any damage, liabilityor 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. 5.00, 12/03, page iv of xxx
Page 5

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 eit her not connected to any of the internal circuitry or are they 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 pass­through current flows internally, and a malfunction may occur.
3. Processing before Initialization Note: When p ower is first supplied, the product’s state is u ndefined.
The states of internal circuits are undefined until full power is supplied throughout the chip and a low level is input o n 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. 5.00, 12/03, page v of xxx
Page 6
Rev. 5.00, 12/03, page vi of xxx
Page 7

Preface

This LSI is a single-chip microcomputer made up of the H8S/2000 CPU with an internal 32-bit architecture as its core, and the peripheral functions required to configure a system.
This LSI is equipped with ROM, RAM, a bus controller, data transfer controller (DTC), a 16-bit timer pulse unit (TPU), a watchdog timer (WDT ), a serial communication interface (SCI), a D/A converter, an A/D converter, and I/O ports as on-chip supporting modules. This LSI is suitable for use as an embedded processor for high-level control systems. Its on-chip ROM are flash memory (F-ZTAT™*) and mask ROM that provides flexibility as it can be reprogrammed in no time to cope with all situations 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.
Note: * F-ZTAT is a trademark of Renesas Technology Corp.
Target Users: This manual was written for users who will be using the H8S/2319 Group,
H8S/2318 Group in the design of application systems. Members of this audience are expected to understand the fundamentals of electrical circuits, logical circuits, and microcomputers.
Objective: This manual was written to explain the hardware functions and electrical
characteristics of the H8S/2319 Group, H8S/2318 Group to the above audience. 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 f unctions 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.
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 details of a register when its name is known
The addresses, bits, and initial values of the registers are summarized in Appendix B, Internal I/O Registers.
Example: Bit order: The MSB is on the left and the LSB is on the right.
Related Manuals: The latest versions of all related manuals are available from our web site.
Please ensure you have the latest versions of all documents you require. (http://www.renesas.com/eng/)
Rev. 5.00, 12/03, page vii of xxx
Page 8
H8S/2319 Group, H8S/2318 Group manuals:
Manual Title ADE No.
H8S/2319 Group, H8S/2318 Group Hardware Manual This manual H8S/2600 Series, H8S/2000 Series Programming Manual ADE-602-083
Users manuals for development tools:
Manual Title ADE No.
C/C++ Compiler, Assembler, Optimized Linkage Editor User's Manual ADE-702-247 Simulator Debugger (for W indows) Users Manual ADE-702-037 High-Performance Embedded Workshop Users Manual ADE-702-201
Application Notes:
Manual Title ADE No.
H8S Family Technical Q & A ADE-502-059
Rev. 5.00, 12/03, page viii of xxx
Page 9

Main Revisions and Additions in this Edition

Item Page Revision (See Manual for Details)
1.3.1 Pin Arrangement Figure 1-2 Pin
Arrangement (TFP­100B
, TFP-100G: Top
View)
1.3.2 Pin Functions in Each Operating Mode
Table 1-2 Pin Functions in Each Operating Mode
1.3.3 Pin Functions Table 1.3 Pin
Functions
9 Figure title amended
13 to 16
17 to 23
Table amended
Table amended
Type Symbol
TFP-100B
,
TFP-100G FP-100A
Pin No.
Pin No.
TFP-100B
,
TFP-100G FP-100A
17.11.2 Socket Adapters and Memory Map
Figure 17-21 H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, H8S/2314 F-ZTAT Socket Adapter Pin Assignments
596 Figure amended
H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, H8S/2314 F-ZTAT
TFP-100B, TFP-100G
32
33
FP-100A
34
35
Pin Name
A
0
A
1
Rev. 5.00, 12/03, page ix of xxx
Page 10
Item Page Revision (See Manual for Details)
A.4 Number of States Required for Instruction Execution
895, 897, 901, 902
“Advanced” deleted from Mnemonic column
Instruc­tion Fetch
Instruction Mnemonic I J K L M N
BSR BSR d:8 2 2
BSR d:16 2 2 1
JMP JMP @ERn 2
JMP @aa:24 2 1 JMP @@aa:8 2 2 1
JSR JSR @ERn 2 2
JSR @aa:24 2 2 1
JSR @@aa:8 2 2 2 RTE RTE 2 2/3 RTS RTS 2 2 1 TRAPA TRAPA #x:2 2 2 2/3
Branch Address Read
Stack Opera­tion
1
*
1
*
Byte Data Access
Word Data Access
Internal Opera­tion
1
2
Table A-5 Number of Cycles in Instruction Execution
A.5 Bus States during InstructionExecution
Table A-6 Instruction Execution Cycles
903 Note 1 amended
The number of state cycles is 2 when EXR is invalid, and 3 when EXR is valid.
909, 911, 915, 916, 917
“Advanced” deleted from Instruction column
Instruction1234 5 6789
BSR d:8 R:W NEXT R:W EA W:W:M
BSR d:16 R:W 2nd Internal
JMP
R:W NEXT R:W:M aa:8 R:W: aa:8 Internal
@@aa:8
JSR @ERn R:W NEXT R:W EA W:W:M
JSR @aa:24 R:W 2nd Internal
JSR
R:W NEXT R:W:M aa:8 R:W aa:8 W:W:M
@@aa:8 RTS R:WNEXT W:W:M
TRAPA #x:2 R:W NEXT Internal
Reset
R:W VEC R:W exception handling
Interrupt
R:W*6Internal exception handling
operation, 1 state
operation, 1 state
stack(H)
operation, 1 state
VEC+2
operation, 1 state
W:W
stack(H)
stack(L)
R:W EA W:W:M
stack(H)
operation, 1 state
W:W
stack(H)
stack(L)
R:W EA W:W:M
stack(H)
stack(H)
R:W
Internal
stack(L)
operation, 1 state
W:W
W:W
stack(L)
stack(H)
Internal
R:W* operation, 1 state
W:W
W:W stack(L)
stack(H)
W:W stack(L)
R:W EA
W:W stack(L)
W:W
R:W EA
stack(L)
4
R:W*
7
W:W
R:W:M VEC R:W
stack(EXR)
5
W:W stack(EXR)
R:W:M VEC R:W
VEC+2
VEC+2
Internal operation, 1 state
Internal operation, 1 state
R:W*
R:W*
7
Rev. 5.00, 12/03, page x of xxx
Page 11
Item Page Revision (See Manual for Details)
Appendix E Product Lineup
Table E-1 H8S/2319 Series, H8S/2318 Series Product Lineup
1084
Table amended
Product Type Model Marking Package (Package Code)
H8S/2318 HD6432318
H8S/2317 HD6432317
version
F-ZTAT version
Mask ROM version
F-ZTAT version
HD64F2318 HD64F2318VTE 100-pin TQFP (TFP-100B)
HD6432317S
HD64F2317 HD64F2317VTE 100-pin TQFP (TFP-100B)
3
*
3
*
4
*
HD6432318TE 100-pinTQFP (TFP-100B)Mask ROM HD6432318F 100-pin QFP (FP-100A)
HD64F2318VTF 100-pin TQFP (TFP-100G) HD64F2318VF 100-pin QFP (FP-100A) HD6432317TE 100-pin TQFP (TFP-100B) HD6432317F 100-pin QFP (FP-100A) HD64F2317STE 100-pin TQFP (TFP-100B) HD6432317STF 100-pin TQFP (TFP-100G) HD64F2317SF 100-pin QFP (FP-100A)
HD64F2317VTF 100-pin TQFP (TFP-100G) HD64F2317VF 100-pin QFP (FP-100A)
Appendix F Package Dimensions
Figure F.2 TFP-100G Package Dimensions
1087 Figure added
*
Dimension including the plating thickness
Base material dimension
14.0 ± 0.2
12
75 51
76
14.0 ± 0.2
100 26
125
*0.18 ± 0.05
0.16 ± 0.04
0.07
1.2
0.10
50
M
1.00
0.10 ± 0.10
0.4
1.20 Max
0.15 ± 0.04
*0.17 ± 0.05
Package Code JEDEC JEITA Mass
1.0
0.5 ± 0.1
(reference value)
As of January, 2003
0° – 8°
TFP-100G — Conforms
0.4 g
Unit: mm
Rev. 5.00, 12/03, page xi of xxx
Page 12
Rev. 5.00, 12/03, page xii of xxx
Page 13

Contents

Section 1 Overview............................................................................................................. 1
1.1 Overview........................................................................................................................... 1
1.2 Block Diagra m.................................................................................................................. 8
1.3 Pin Description.................................................................................................................. 9
1.3.1 Pin Arrangement.................................................................................................. 9
1.3.2 Pin Functions in Each Operating Mode ............................................................... 13
1.3.3 Pin Functions ....................................................................................................... 17
Section 2 CPU...................................................................................................................... 25
2.1 Overview........................................................................................................................... 25
2.1.1 Features................................................................................................................ 25
2.1.2 Differences between H8S/2600 CPU and H8S/2000 CPU.................................. 26
2.1.3 Differences from H8/300 CPU ............................................................................ 27
2.1.4 Differences from H8/300H CPU.......................................................................... 27
2.2 CPU Operating Modes...................................................................................................... 28
2.3 Address Space................................................................................................................... 31
2.4 Register Configuration...................................................................................................... 32
2.4.1 Overview.............................................................................................................. 32
2.4.2 General Registers................................................................................................. 33
2.4.3 Control Registers ................................................................................................. 34
2.4.4 Initial Register Values.......................................................................................... 35
2.5 Data Formats ..................................................................................................................... 36
2.5.1 General Register Data Formats............................................................................ 36
2.5.2 Memory Data Formats......................................................................................... 38
2.6 Instruction Set ................................................................................................................... 39
2.6.1 Overview.............................................................................................................. 39
2.6.2 Instructions and Addressing Modes..................................................................... 40
2.6.3 Table of Instructions Classified by Function ...................................................... 41
2.6.4 Basic Instruction For mats .................................................................................... 51
2.7 Addressing Modes and Effective Address Calculatio n..................................................... 52
2.7.1 Addressing Mode................................................................................................. 52
2.7.2 Effective Address Calc ulation ............................................................................. 55
2.8 Processing States............................................................................................................... 59
2.8.1 Overview.............................................................................................................. 59
2.8.2 Reset State............................................................................................................ 60
2.8.3 Exception-Handling State .................................................................................... 61
2.8.4 Program Execution State...................................................................................... 63
2.8.5 Bus-Released State............................................................................................... 63
2.8.6 Power-Down State ............................................................................................... 63
Rev. 5.00, 12/03, page xiii of xxx
Page 14
2.9 Basic Timing ..................................................................................................................... 64
2.9.1 Overview.............................................................................................................. 64
2.9.2 On-Chip Memory (ROM, RAM)......................................................................... 64
2.9.3 On-Chip Supporting Module Access Timing....................................................... 66
2.9.4 External Address Space Access Timing .............................................................. 67
2.10 Usage Note........................................................................................................................ 67
2.10.1 TAS Instruction.................................................................................................... 67
Section 3 MCU Operating M odes .................................................................................. 69
3.1 Overview........................................................................................................................... 69
3.1.1 Operating Mode Selection (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT,
H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT)...................................................... 69
3.1.2 Operating Mode Selection (Mask ROM, ROMless, H8S/2319 F-ZTAT, and
H8S/2319C F-ZTAT) .......................................................................................... 70
3.1.3 Register Configuration......................................................................................... 72
3.2 Register Descriptions ........................................................................................................ 72
3.2.1 Mode Control Register (MDCR) ......................................................................... 72
3.2.2 System Control Register (SYSCR)...................................................................... 73
3.2.3 System Control Register 2 (SYSCR2) (F-ZTAT Versions Only)........................ 74
3.3 Operating Mode Descriptions ........................................................................................... 75
3.3.1 Mode 1 (H8S/2319C F-ZTAT Only)................................................................... 75
3.3.2 Mode 2 (H8S/2319 F-ZTAT and H8S/2319C F-ZTAT Only)............................. 75
3.3.3 Mode 3 (H8S/2319 F-ZTAT and H8S/2319C F-ZTAT Only)............................. 75
3.3.4 Mode 4 (Expanded Mode with On-Chip ROM Disabled) ................................... 75
3.3.5 Mode 5 (Expanded Mode with On-Chip ROM Disabled) ................................... 76
3.3.6 Mode 6 (Expanded Mode with On-Chip ROM Enabled) .................................... 76
3.3.7 Mode 7 (Single-Chip Mode)................................................................................ 76
3.3.8 Modes 8 and 9 (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT,
and H8S/2314 F-ZTAT Only).............................................................................. 76
3.3.9 Mode 10 (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT,
and H8S/2314 F-ZTAT Only).............................................................................. 77
3.3.10 Mode 11 (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT,
and H8S/2314 F-ZTAT Only).............................................................................. 77
3.3.11 Modes 12 and 13 (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT,
and H8S/2314 F-ZTAT Only).............................................................................. 77
3.3.12 Mode 14 (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT,
and H8S/2314 F-ZTAT Only).............................................................................. 77
3.3.13 Mode 15 (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT,
and H8S/2314 F-ZTAT Only).............................................................................. 77
3.4 Pin Functions in Each Operating Mode ............................................................................ 77
3.5 Memory Map in Each Operating Mode ............................................................................ 78
Rev. 5.00, 12/03, page xiv of xxx
Page 15
Section 4 Exception Handling ......................................................................................... 99
4.1 Overview........................................................................................................................... 99
4.1.1 Exception Handling Types and Priority............................................................... 99
4.1.2 Exception Handling Operation............................................................................. 99
4.1.3 Exception Vector Table ....................................................................................... 100
4.2 Reset ....................................................................................................................... .......... 102
4.2.1 Overview.............................................................................................................. 102
4.2.2 Reset Sequence.................................................................................................... 102
4.2.3 Interrupts after Reset............................................................................................ 103
4.2.4 State of On-Chip Supporting Modules after Reset Release ................................. 103
4.3 T races................................................................................................................................ 104
4.4 Interrupts........................................................................................................................... 105
4.5 T rap Instruction................................................................................................................. 106
4.6 Stack Sta tus after Exception Handling.............................................................................. 106
4.7 Notes on Use of the Stack................................................................................................. 107
Section 5 Interrupt Controller.......................................................................................... 109
5.1 Overview........................................................................................................................... 109
5.1.1 Features................................................................................................................ 109
5.1.2 Block Diagram..................................................................................................... 110
5.1.3 Pin Configuration................................................................................................. 111
5.1.4 Register Configuration......................................................................................... 111
5.2 Register Descriptions ........................................................................................................ 112
5.2.1 System Control Register (SYSCR)...................................................................... 112
5.2.2 Interrupt Priority Registers A to K (IPRA to IPRK)............................................ 113
5.2.3 IRQ Enable Register (IER).................................................................................. 114
5.2.4 IRQ Sense Control Registers H and L (ISCRH, ISCRL)..................................... 115
5.2.5 IRQ Status Register (ISR).................................................................................... 116
5.3 Interrupt Sources............................................................................................................... 117
5.3.1 External Interrupts ............................................................................................... 117
5.3.2 Internal Interrupts................................................................................................. 118
5.3.3 Interrupt Exception Vector Table ........................................................................ 118
5.4 Interrupt Operation............................................................................................................ 124
5.4.1 Interrupt Control Modes and Interrupt Operation................................................ 124
5.4.2 Interrupt Control Mode 0..................................................................................... 127
5.4.3 Interrupt Control Mode 2..................................................................................... 129
5.4.4 Interrupt Exception Handling Sequence .............................................................. 131
5.4.5 Interrupt Response Times .................................................................................... 133
5.5 Usage Notes ...................................................................................................................... 134
5.5.1 Contention between Interrupt Generation and Disabling ..................................... 134
5.5.2 Instructions that Disable Interrupts...................................................................... 135
5.5.3 Times when Interrupts are Disabled .................................................................... 135
5.5.4 Interrupts during Execution of EEP MOV Instruction.......................................... 135
Rev. 5.00, 12/03, page xv of xxx
Page 16
5.6 DTC Activation by Interrupt............................................................................................. 136
5.6.1 Overview.............................................................................................................. 136
5.6.2 Block Diagram..................................................................................................... 136
5.6.3 Operation ............................................................................................................. 137
Section 6 Bus Controller ................................................................................................... 139
6.1 Overview........................................................................................................................... 139
6.1.1 Features................................................................................................................ 139
6.1.2 Block Diagram..................................................................................................... 140
6.1.3 Pin Configuration................................................................................................. 141
6.1.4 Register Configuration......................................................................................... 142
6.2 Register Descriptions ........................................................................................................ 143
6.2.1 Bus Width Control Register (ABWCR)............................................................... 143
6.2.2 Access Sta te Control Re gister (ASTCR) ............................................................. 144
6.2.3 Wait Control Registers H and L (WCRH, WCRL).............................................. 145
6.2.4 Bus Control Register H (BCRH) ......................................................................... 148
6.2.5 Bus Control Register L (BCRL) .......................................................................... 150
6.3 Overview of B us Control.................................................................................................. 152
6.3.1 Area Partitioning.................................................................................................. 152
6.3.2 Bus Specifications................................................................................................ 153
6.3.3 Memory Interfaces............................................................................................... 154
6.3.4 Advanced Mode................................................................................................... 155
6.3.5 Chip Select Signals.............................................................................................. 156
6.4 Basic Bus Interface ........................................................................................................... 157
6.4.1 Overview.............................................................................................................. 157
6.4.2 Data Size and Data Alignment............................................................................. 157
6.4.3 Valid Strobes........................................................................................................ 159
6.4.4 Basic Timing........................................................................................................ 160
6.4.5 Wait Control ........................................................................................................ 168
6.5 Burst ROM Interface......................................................................................................... 170
6.5.1 Overview.............................................................................................................. 170
6.5.2 Basic Timing........................................................................................................ 170
6.5.3 Wait Control ........................................................................................................ 172
6.6 Idle Cycle.......................................................................................................................... 173
6.6.1 Operation ............................................................................................................. 173
6.6.2 Pin States in Idle Cycle........................................................................................ 176
6.7 Bus Release....................................................................................................................... 177
6.7.1 Overview.............................................................................................................. 177
6.7.2 Operation ............................................................................................................. 177
6.7.3 Pin States in External Bus Released State ............................................................ 178
6.7.4 Transition Timing................................................................................................ 179
6.7.5 Usage Note........................................................................................................... 180
6.8 Bus Arbitration.................................................................................................................. 180
Rev. 5.00, 12/03, page xvi of xxx
Page 17
6.8.1 Overview.............................................................................................................. 180
6.8.2 Operation ............................................................................................................. 180
6.8.3 Bus Transfer Timing............................................................................................ 181
6.8.4 External Bus Release Usage Note........................................................................ 181
6.9 Resets and the Bus Controller........................................................................................... 181
Section 7 Data Transfer Controller................................................................................. 183
7.1 Overview........................................................................................................................... 183
7.1.1 Features................................................................................................................ 183
7.1.2 Block Diagram..................................................................................................... 184
7.1.3 Register Configuration......................................................................................... 185
7.2 Register Descriptions ........................................................................................................ 186
7.2.1 DTC Mode Register A (MRA) ............................................................................ 186
7.2.2 DTC Mode Register B (MRB)............................................................................. 187
7.2.3 DTC Source Address Register (SAR).................................................................. 189
7.2.4 DTC Destination Address Register (DAR).......................................................... 189
7.2.5 DTC Transfer Count Register A (CRA) .............................................................. 189
7.2.6 DTC Transfer Count Register B (CRB)............................................................... 190
7.2.7 DTC Enable Registers (DTCER)......................................................................... 190
7.2.8 DTC Vector Register (DTVECR)........................................................................ 191
7.2.9 Module Stop Control Register (MSTPCR).......................................................... 192
7.3 Operation .......................................................................................................................... 192
7.3.1 Overview.............................................................................................................. 192
7.3.2 Activation Sources............................................................................................... 196
7.3.3 DTC Vector Table ............................................................................................... 197
7.3.4 Location of Register Information in Address Space............................................ 200
7.3.5 Normal Mode....................................................................................................... 201
7.3.6 Repeat Mode........................................................................................................ 202
7.3.7 Block Transfer Mode........................................................................................... 203
7.3.8 Chain Tr ansfer ..................................................................................................... 205
7.3.9 Operation Timing................................................................................................. 206
7.3.10 Number of DTC Execution States........................................................................ 207
7.3.11 Procedures for Using DTC................................................................................... 209
7.3.12 Examples of Use of the DTC............................................................................... 210
7.4 Interrupts........................................................................................................................... 214
7.5 Usage Notes ...................................................................................................................... 214
Section 8 I/O Ports.............................................................................................................. 215
8.1 Overview........................................................................................................................... 215
8.2 Port 1................................................................................................................................. 220
8.2.1 Overview.............................................................................................................. 220
8.2.2 Register Configuration......................................................................................... 221
8.2.3 Pin Functions ....................................................................................................... 223
Rev. 5.00, 12/03, page xvii of xxx
Page 18
8.3 Port 2................................................................................................................................. 232
8.3.1 Overview.............................................................................................................. 232
8.3.2 Register Configuration......................................................................................... 232
8.3.3 Pin Functions ....................................................................................................... 234
8.4 Port 3................................................................................................................................. 242
8.4.1 Overview.............................................................................................................. 242
8.4.2 Register Configuration......................................................................................... 242
8.4.3 Pin Functions ....................................................................................................... 245
8.5 Port 4................................................................................................................................. 247
8.5.1 Overview.............................................................................................................. 247
8.5.2 Register Configuration......................................................................................... 247
8.5.3 Pin Functions ....................................................................................................... 248
8.6 Port A ................................................................................................................................ 248
8.6.1 Overview.............................................................................................................. 248
8.6.2 Register Configuration......................................................................................... 249
8.6.3 Pin Functions ....................................................................................................... 252
8.6.4 MOS Input P ull-Up Function............................................................................... 253
8.7 Port B ................................................................................................................................ 254
8.7.1 Overview.............................................................................................................. 254
8.7.2 Register Configuration......................................................................................... 255
8.7.3 Pin Functions ....................................................................................................... 257
8.7.4 MOS Input P ull-Up Function............................................................................... 259
8.8 Port C................................................................................................................................ 260
8.8.1 Overview.............................................................................................................. 260
8.8.2 Register Configuration......................................................................................... 261
8.8.3 Pin Functions ....................................................................................................... 263
8.8.4 MOS Input P ull-Up Function............................................................................... 265
8.9 Port D ................................................................................................................................ 266
8.9.1 Overview.............................................................................................................. 266
8.9.2 Register Configuration......................................................................................... 267
8.9.3 Pin Functions ....................................................................................................... 269
8.9.4 MOS Input P ull-Up Function............................................................................... 270
8.10 Port E ................................................................................................................................ 272
8.10.1 Overview.............................................................................................................. 272
8.10.2 Register Configuration......................................................................................... 273
8.10.3 Pin Functions ....................................................................................................... 275
8.10.4 MOS Input Pull-Up Function............................................................................... 276
8.11 Port F ................................................................................................................................ 278
8.11.1 Overview.............................................................................................................. 278
8.11.2 Register Configuration......................................................................................... 279
8.11.3 Pin Functions ....................................................................................................... 284
8.12 Port G................................................................................................................................ 287
8.12.1 Overview.............................................................................................................. 287
Rev. 5.00, 12/03, page xviii of xxx
Page 19
8.12.2 Register Configuration......................................................................................... 288
8.12.3 Pin Functions ....................................................................................................... 292
Section 9 16-Bit Timer Pulse Unit (TPU).................................................................... 295
9.1 Overview........................................................................................................................... 295
9.1.1 Features................................................................................................................ 295
9.1.2 Block Diagram..................................................................................................... 299
9.1.3 Pin Configuration................................................................................................. 300
9.1.4 Register Configuration......................................................................................... 302
9.2 Register Descriptions ........................................................................................................ 304
9.2.1 Timer Control Registers (TCR) ........................................................................... 304
9.2.2 Timer Mode Registers (TMDR) .......................................................................... 309
9.2.3 Timer I/O Control Registers (TIOR) ................................................................... 311
9.2.4 Timer Interrupt Enable Registers (TIER) ............................................................ 324
9.2.5 Timer Status Registers (TSR).............................................................................. 326
9.2.6 Timer Counters (T CNT ) ...................................................................................... 330
9.2.7 Timer General Registers (TGR)........................................................................... 330
9.2.8 Timer Start Register (TSTR) ............................................................................... 331
9.2.9 Timer Synchro Register (TSYR) ......................................................................... 331
9.2.10 Module Stop Control Register (MSTPCR).......................................................... 332
9.3 Interface to Bus Master..................................................................................................... 333
9.3.1 16-Bit Registers ................................................................................................... 333
9.3.2 8-Bit Registers ..................................................................................................... 333
9.4 Operation .......................................................................................................................... 335
9.4.1 Overview.............................................................................................................. 335
9.4.2 Basic Functions.................................................................................................... 336
9.4.3 Synchronous Operation........................................................................................ 342
9.4.4 Buffer Operation.................................................................................................. 344
9.4.5 Cascaded Operation ............................................................................................. 348
9.4.6 PWM Modes........................................................................................................ 350
9.4.7 Phase Counting Mode.......................................................................................... 355
9.5 Interrupts........................................................................................................................... 362
9.5.1 Interrupt Sources and Priorities............................................................................ 362
9.5.2 DTC Activation.................................................................................................... 364
9.5.3 A/D Converter Activation.................................................................................... 364
9.6 Operation Timing............................................................................................................. . 365
9.6.1 Input/Output Timing............................................................................................ 365
9.6.2 Interrupt Signal Ti ming........................................................................................ 369
9.7 Usage Notes ...................................................................................................................... 373
Rev. 5.00, 12/03, page xix of xxx
Page 20
Section 10 8-Bit Timers..................................................................................................... 383
10.1 Overview........................................................................................................................... 383
10.1.1 Features................................................................................................................ 383
10.1.2 Block Diagram..................................................................................................... 384
10.1.3 Pin Configuration................................................................................................. 385
10.1.4 Register Configuration......................................................................................... 385
10.2 Register Descriptions........................................................................................................ 386
10.2.1 Timer Counters 0 and 1 (TCNT0, TCNT1) ......................................................... 386
10.2.2 Time Constant Registers A0 and A1 (TCORA0, TCORA1) ............................... 386
10.2.3 Time Constant Registers B0 and B1 (TCORB0, TCORB1)................................ 387
10.2.4 Time Control Registers 0 and 1 (TCR0, TCR1) .................................................. 387
10.2.5 Timer Control/Status Registers 0 and 1 (TCSR0, TCSR1).................................. 389
10.2.6 Module Stop Control Register (MSTPCR).......................................................... 392
10.3 Operation.......................................................................................................................... 393
10.3.1 TCNT Incrementation Timing............................................................................. 393
10.3.2 Compare Match Timing....................................................................................... 394
10.3.3 Timing of TCNT External Reset.......................................................................... 396
10.3.4 Timing of Overflow Flag (OVF) Setting ............................................................. 396
10.3.5 Operation with Cascaded Connection.................................................................. 397
10.4 Interrupts........................................................................................................................... 398
10.4.1 I nterrupt Sources and DTC Activation ................................................................ 398
10.4.2 A/D Converter Activation .................................................................................... 398
10.5 Sample Application ........................................................................................................... 399
10.6 Usage Notes ...................................................................................................................... 400
10.6.1 Contention bet ween TCNT Write and Clear........................................................ 400
10.6.2 Contention bet ween TCNT Write and Increment ................................................ 401
10.6.3 Contention bet ween TCOR Write and Compare Match ...................................... 402
10.6.4 Contention bet ween Compare Matches A and B ................................................. 403
10.6.5 Switching of Internal Clocks and TCNT Operation............................................. 403
10.6.6 Interrupts and Module S top Mode....................................................................... 405
Section 11 Watchdog Timer............................................................................................. 407
11.1 Overview........................................................................................................................... 407
11.1.1 Features................................................................................................................ 407
11.1.2 Block Diagram..................................................................................................... 408
11.1.3 Pin Configuration................................................................................................. 409
11.1.4 Register Configuration......................................................................................... 409
11.2 Register Descriptions........................................................................................................ 410
11.2.1 Timer Counter (TCNT)........................................................................................ 410
11.2.2 Timer Control/Status Register (TCSR)................................................................ 410
11.2.3 Reset Control/Status Register (RSTCSR)............................................................ 412
11.2.4 Notes on Register Access..................................................................................... 413
11.3 Operation.......................................................................................................................... 415
Rev. 5.00, 12/03, page xx of xxx
Page 21
11.3.1 Operation in Watchdog Timer Mode................................................................... 415
11.3.2 Operation in Interval Timer Mode....................................................................... 417
11.3.3 Timing of Overflow Flag (OVF) Setting ............................................................. 417
11.3.4 Timing of Watchdog Timer Overflow Flag (WOVF) Setting.............................. 418
11.4 Interrupts........................................................................................................................... 418
11.5 Usage Notes ...................................................................................................................... 418
11.5.1 Contention bet ween Timer Counter (TCNT) Write and Increment..................... 418
11.5.2 Changing Value of CKS2 to CKS0...................................................................... 419
11.5.3 Switching between Watchdog Timer Mode and Interval Timer Mode................ 419
11.5.4 System Reset by WDTOVF Signal...................................................................... 420
11.5.5 Internal Reset i n Watchdog Timer Mode............................................................. 420
Section 12 Serial Communication Interface (SCI) .................................................... 421
12.1 Overview........................................................................................................................... 421
12.1.1 Features................................................................................................................ 421
12.1.2 Block Diagram..................................................................................................... 423
12.1.3 Pin Configuration................................................................................................. 424
12.1.4 Register Configuration......................................................................................... 425
12.2 Register Descriptions........................................................................................................ 426
12.2.1 Receive Shift Register (RSR) .............................................................................. 426
12.2.2 Receive Data Register (RDR).............................................................................. 426
12.2.3 Transmit Shift Register (TSR)............................................................................. 427
12.2.4 Transmit Data Register (TDR)............................................................................. 427
12.2.5 Serial Mode Register (SMR)................................................................................ 428
12.2.6 Serial Control Register (SCR).............................................................................. 431
12.2.7 Serial Status Register (SSR) ................................................................................ 435
12.2.8 Bit Rate Register (BRR) ...................................................................................... 438
12.2.9 Smart Card Mode Register (SCMR).................................................................... 446
12.2.10 Module Stop Control Register (MSTPCR).......................................................... 448
12.3 Operation.......................................................................................................................... 449
12.3.1 Overview.............................................................................................................. 449
12.3.2 Operation in Asynchronous Mode ....................................................................... 451
12.3.3 Multiprocessor Communication Function............................................................ 462
12.3.4 Operation in Synchronous Mode ......................................................................... 470
12.4 SCI Interrupts.................................................................................................................... 479
12.5 Usage Notes ...................................................................................................................... 480
Section 13 Smart Card Interface..................................................................................... 487
13.1 Overview........................................................................................................................... 487
13.1.1 Features................................................................................................................ 487
13.1.2 Block Diagram..................................................................................................... 488
13.1.3 Pin Configuration................................................................................................. 489
13.1.4 Register Configuration......................................................................................... 490
Rev. 5.00, 12/03, page xxi of xxx
Page 22
13.2 Register Descriptions........................................................................................................ 491
13.2.1 Smart Card Mode Register (SCMR).................................................................... 491
13.2.2 Serial Status Register (SSR) ................................................................................ 492
13.2.3 Serial Mode Register (SMR)................................................................................ 493
13.2.4 Serial Control Register (SCR).............................................................................. 495
13.3 Operation.......................................................................................................................... 496
13.3.1 Overview.............................................................................................................. 496
13.3.2 Pin Connections................................................................................................... 496
13.3.3 Data Format ......................................................................................................... 498
13.3.4 Register Settings.................................................................................................. 500
13.3.5 Clock.................................................................................................................... 502
13.3.6 Data Transfer Operations..................................................................................... 504
13.3.7 Operation in GSM Mode ..................................................................................... 511
13.3.8 Operation in Block Transfer Mode...................................................................... 512
13.4 Usage Notes ...................................................................................................................... 513
Section 14 A/D Converter (8 Analog Input Channel Version) ............................. 517
14.1 Overview........................................................................................................................... 517
14.1.1 Features................................................................................................................ 517
14.1.2 Block Diagram..................................................................................................... 518
14.1.3 Pin Configuration................................................................................................. 519
14.1.4 Register Configuration......................................................................................... 520
14.2 Register Descriptions........................................................................................................ 521
14.2.1 A/D Data Registers A to D (ADDRA to ADDRD) ............................................. 521
14.2.2 A/D Control/Status Register (ADCSR) ............................................................... 522
14.2.3 A/D Control Register (ADCR) ............................................................................ 524
14.2.4 Module Stop Control Register (MSTPCR).......................................................... 525
14.3 Interface to Bus Master..................................................................................................... 526
14.4 Operation.......................................................................................................................... 527
14.4.1 Single Mode (SCAN = 0) .................................................................................... 527
14.4.2 Scan Mode (SCAN = 1)....................................................................................... 529
14.4.3 I nput Sampling and A/D Conversion Time ......................................................... 531
14.4.4 External Trigger Inp ut Timing............................................................................. 532
14.5 Interrupts........................................................................................................................... 533
14.6 Usage Notes ...................................................................................................................... 534
Section 15 D/A Converter................................................................................................. 539
15.1 Overview........................................................................................................................... 539
15.1.1 Features................................................................................................................ 539
15.1.2 Block Diagram..................................................................................................... 540
15.1.3 Pin Configuration................................................................................................. 541
15.1.4 Register Configuration......................................................................................... 541
15.2 Register Descriptions........................................................................................................ 542
Rev. 5.00, 12/03, page xxii of xxx
Page 23
15.2.1 D/A Data Registers 0, 1 (DADR0, DADR1) ....................................................... 542
15.2.2 D/A Control Re gisters 01 (DACR01).................................................................. 542
15.2.3 Module Stop Control Register (MSTPCR).......................................................... 544
15.3 Operation.......................................................................................................................... 545
Section 16 RAM.................................................................................................................. 547
16.1 Overview........................................................................................................................... 547
16.1.1 Block Diagram..................................................................................................... 547
16.1.2 Register Configuration......................................................................................... 548
16.2 Register Descriptions........................................................................................................ 548
16.2.1 System Control Register (SYSCR)...................................................................... 548
16.3 Operation.......................................................................................................................... 549
16.4 Usage Note........................................................................................................................ 549
Section 17 ROM.................................................................................................................. 551
17.1 Overview........................................................................................................................... 551
17.1.1 Block Diagram..................................................................................................... 551
17.1.2 Register Configuration......................................................................................... 552
17.2 Register Descriptions........................................................................................................ 552
17.2.1 Mode Control Register (MDCR) ......................................................................... 552
17.2.2 B us Control Register L (BCRL) .......................................................................... 553
17.3 Operation.......................................................................................................................... 553
17.4 Overview o f Flash Memory (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT,
H8S/2315 F-ZTAT, H8S/2314 F-ZTAT) ......................................................................... 557
17.4.1 Features................................................................................................................ 557
17.4.2 Overview.............................................................................................................. 558
17.4.3 Flash Memory Operating Modes ......................................................................... 559
17.4.4 On-Board Programming Modes........................................................................... 560
17.4.5 Flash Memory Emulation in RAM ...................................................................... 562
17.4.6 Differences between Boot Mode and User Program Mode ................................. 563
17.4.7 B lock Configuration............................................................................................. 564
17.4.8 Pin Configuration................................................................................................. 565
17.4.9 Register Configuration......................................................................................... 566
17.5 Register Descriptions........................................................................................................ 567
17.5.1 Flash Memory Control Register 1 (FLMCR1)..................................................... 567
17.5.2 Flash Memory Control Register 2 (FLMCR2)..................................................... 570
17.5.3 Erase Block Register 1 (EBR1) ........................................................................... 571
17.5.4 Erase Block Register 2 (EBR2) ........................................................................... 571
17.5.5 System Control Register 2 (SYSCR2)................................................................. 572
17.5.6 R AM Emulation Register (RAMER)................................................................... 573
17.6 On-BoardProgramming Modes........................................................................................ 575
17.6.1 B oot Mode........................................................................................................... 575
17.6.2 User Program Mode............................................................................................. 581
Rev. 5.00, 12/03, page xxiii of xxx
Page 24
17.7 Programming/Erasing Flash Memory............................................................................... 583
17.7.1 Program Mode ..................................................................................................... 583
17.7.2 Program-Verify Mode.......................................................................................... 584
17.7.3 Erase Mode.......................................................................................................... 586
17.7.4 Erase-Verify Mode............................................................................................... 586
17.8 Flash Memory Protection.................................................................................................. 588
17.8.1 Hardware Protection ............................................................................................ 588
17.8.2 Software Protection.............................................................................................. 588
17.8.3 Error Protection.................................................................................................... 589
17.9 Flash Memory Emulation in RAM ................................................................................... 591
17.9.1 Emulation in RAM............................................................................................... 591
17.9.2 RAM Overlap ...................................................................................................... 592
17.10 Interrupt Handling when Programming/Erasing Flash Memory....................................... 593
17.11 Flash Memory Programmer Mode.................................................................................... 594
17.11.1 Progremmer Mode Setting................................................................................... 594
17.11.2 Socket Adapters and Memory Map...................................................................... 595
17.11.3 Programmer Mode Operation .............................................................................. 597
17.11.4 Memory Read Mode ............................................................................................ 598
17.11.5 Auto-Program Mode............................................................................................ 601
17.11.6 Auto-Erase Mode................................................................................................. 603
17.11.7 Status Read Mode ................................................................................................ 604
17.11.8 Status Polling ....................................................................................................... 605
17.11.9 Programmer Mode Transition Ti me..................................................................... 606
17.11.10 Notes on Memory P rogramming ...................................................................... 606
17.12 Flash Memory Programming and Erasing Precautions..................................................... 607
17.13 Overview of Flash Memory (H8S/2319 F-ZTAT)............................................................ 612
17.13.1 Features................................................................................................................ 612
17.13.2 Overview.............................................................................................................. 613
17.13.3 Flash Memory Operating Modes ......................................................................... 614
17.13.4 On-Board Programming Modes........................................................................... 615
17.13.5 Flash Me mory Emulation i n RAM ...................................................................... 617
17.13.6 Differences between Boot Mode and User Program Mode ................................. 618
17.13.7 Block Configuration............................................................................................. 619
17.13.8 Pin Configuration................................................................................................. 620
17.13.9 Register Configuration......................................................................................... 621
17.14 Register Descriptions........................................................................................................ 622
17.14.1 Flash Memory Control Register 1 (FLMCR1)..................................................... 622
17.14.2 Flash Memory Control Register 2 (FLMCR2)..................................................... 624
17.14.3 Erase Block Register 1 (EBR1) ........................................................................... 627
17.14.4 Erase Block Register 2 (EBR2) ........................................................................... 628
17.14.5 System Control Register 2 (SYSCR2)................................................................. 629
17.14.6 RAM Emulation Register (RAMER)................................................................... 629
17.15 On-Board Programming Modes........................................................................................ 631
Rev. 5.00, 12/03, page xxiv of xxx
Page 25
17.15.1 Boot Mode ........................................................................................................... 631
17.15.2 User Program Mode............................................................................................. 636
17.16 Programming/Erasing Flash Memory............................................................................... 638
17.16.1 Program Mode (n = 1 for addresses H'000000 to H'03FFFF,
and n = 2 for addresses H'040000 to H'07FFFF)................................................. 638
17.16.2 Program-Verify Mode (n = 1 for addresses H'000000 to H'03FFFF,
and n = 2 for addresses H'040000 to H'07FFFF)................................................. 639
17.16.3 Erase Mode (n = 1 for addresses H'000000 to H'03FFFF,
and n = 2 for addresses H'040000 to H'07FFFF)................................................. 641
17.16.4 Erase-Verify Mode (n = 1 for addresses H'000000 to H'03FFFF,
and n = 2 for addresses H'040000 to H'07FFFF)................................................. 641
17.17 Flash Memory Protection.................................................................................................. 643
17.17.1 Hardware Protection ............................................................................................ 643
17.17.2 Software Protection.............................................................................................. 643
17.17.3 Error Protection.................................................................................................... 645
17.18 Flash Memory Emulation in RAM ................................................................................... 647
17.18.1 Emulation in RAM............................................................................................... 647
17.18.2 RAM Overlap ...................................................................................................... 648
17.19 Interrupt Handling when Programming/Erasing Flash Memory....................................... 649
17.20 Flash Memory Programmer Mode.................................................................................... 650
17.20.1 Programmer Mode Setting................................................................................... 650
17.20.2 Socket Adapters and Memory Map...................................................................... 650
17.20.3 Programmer Mode Operation .............................................................................. 652
17.20.4 Memory Read Mode ............................................................................................ 653
17.20.5 Auto-Program Mode............................................................................................ 656
17.20.6 Auto-Erase Mode................................................................................................. 658
17.20.7 Status Read Mode ................................................................................................ 659
17.20.8 Status Polling ....................................................................................................... 660
17.20.9 Programmer Mode Transition Ti me..................................................................... 661
17.20.10 Notes on Memory Programming....................................................................... 661
17.21 Flash Memory Programming and Erasing Precautions..................................................... 662
17.22 Overview of Flash Memory (H8S/2319C 0.18µm F-ZTAT)............................................ 664
17.22.1 Features................................................................................................................ 664
17.22.2 Overview.............................................................................................................. 666
17.22.3 Operating Mode of Fla sh Memor y....................................................................... 667
17.22.4 Mode Comparison................................................................................................ 668
17.22.5 Flash M AT Configuration.................................................................................... 669
17.22.6 Block Division ..................................................................................................... 669
17.22.7 Programming/Erasing Interface........................................................................... 670
17.22.8 Pin Configuration................................................................................................. 673
17.22.9 Register Configuration......................................................................................... 673
17.23 Register Description of Flash Memory............................................................................. 675
17.23.1 Programming/Erasing Interface Register............................................................. 675
Rev. 5.00, 12/03, page xxv of xxx
Page 26
17.23.2 Programming/Erasing Interface Parameter.......................................................... 681
17.23.3 System Control Register 2 (SYSCR2)................................................................. 693
17.23.4 RAM Emulation Register (RAMER)................................................................... 694
17.24 On-Board Programming Mode ......................................................................................... 696
17.24.1 Boot Mode ........................................................................................................... 696
17.24.2 User Program Mode............................................................................................. 699
17.24.3 User Boot Mode................................................................................................... 710
17.25 Protection.......................................................................................................................... 713
17.25.1 Hardware Protection ............................................................................................ 713
17.25.2 Software Protection.............................................................................................. 714
17.25.3 Error Protection.................................................................................................... 715
17.26 Flash Memory Emulation in RAM ................................................................................... 717
17.27 Switching between User MAT and User Boot MAT........................................................ 720
17.27.1 Usage Notes ......................................................................................................... 721
17.28 PROM Mode..................................................................................................................... 723
17.28.1 Pin Arrangement of the Socket Adapter .............................................................. 723
17.28.2 PROM Mode Operation....................................................................................... 726
17.28.3 Memory-Read Mode............................................................................................ 727
17.28.4 Auto-Program Mode............................................................................................ 727
17.28.5 Auto-Erase Mode................................................................................................. 728
17.28.6 Status-Read Mode................................................................................................ 728
17.28.7 Status Polling ....................................................................................................... 729
17.28.8 Time Taken in Transition to PROM Mode.......................................................... 729
17.28.9 Notes on Using PROM Mode.............................................................................. 729
17.29 Further Information........................................................................................................... 731
17.29.1 Serial Communication Interface Specification for Boot Mode ............................ 731
17.29.2 AC Characteristics and Timing in PROM Mode ................................................. 757
17.29.3 Procedure Program and Storable Area for Programming Data............................ 763
Section 18 Clock Pulse Generator.................................................................................. 769
18.1 Overview........................................................................................................................... 769
18.1.1 Block Diagram..................................................................................................... 769
18.1.2 Register Configuration......................................................................................... 770
18.2 Register Descriptions........................................................................................................ 770
18.2.1 System Clock Control Register (SCKCR)........................................................... 770
18.3 Oscillator........................................................................................................................... 772
18.3.1 Connecting a Crystal Resonator........................................................................... 772
18.3.2 External Clock Inp ut............................................................................................ 774
18.4 Duty Adjustment Circuit................................................................................................... 776
18.5 Medium-Speed Clock Divider .......................................................................................... 776
18.6 Bus Master Clock Selection Circuit.................................................................................. 776
Rev. 5.00, 12/03, page xxvi of xxx
Page 27
Section 19 Power-Down Modes...................................................................................... 777
19.1 Overview........................................................................................................................... 777
19.1.1 Register Configuration......................................................................................... 778
19.2 Register Descriptions........................................................................................................ 779
19.2.1 Standb y Control Register ( SBYCR) .................................................................... 779
19.2.2 System Clock Control Register (SCKCR)........................................................... 781
19.2.3 Module Stop Control Register (MSTPCR).......................................................... 783
19.3 Medium-Speed Mode........................................................................................................ 784
19.4 Sleep Mode ....................................................................................................................... 785
19.5 Module Stop Mode ........................................................................................................... 785
19.5.1 Module Stop Mode .............................................................................................. 785
19.5.2 Usage Notes......................................................................................................... 786
19.6 Software Standby Mode.................................................................................................... 787
19.6.1 Software Standb y Mode....................................................................................... 787
19.6.2 Clearing Software Standby Mode........................................................................ 787
19.6.3 Setting Oscillation Stabilization Time after Clearing Software Standby Mode... 788
19.6.4 Software Standby Mode Application Example.................................................... 788
19.6.5 Usage Notes......................................................................................................... 789
19.7 Hardware Standby Mode .................................................................................................. 790
19.7.1 Hardware Standby Mode ..................................................................................... 790
19.7.2 Hardware Standby Mode Timing......................................................................... 790
19.8 φClock Output Disabling Function .................................................................................. 791
Section 20 Electrical Characteristics.............................................................................. 793
20.1 Electrical Characteristics of Mask ROM Versions (H8S/2319, H8S/2318, H8S/2317, H8S/2316, H8S/2313, H8S/2311) and ROMless
Versions (H8S/2312S, H8S/2310) .................................................................................... 793
20.1.1 Absolute Maximum Ratings ................................................................................ 793
20.1.2 DC Characteristics............................................................................................... 794
20.1.3 AC Characteristics............................................................................................... 796
20.1.4 A/D Conversion Characteristics........................................................................... 814
20.1.5 D/A Conversion Characteristics........................................................................... 815
20.2 Electrical Characteristics of Mask ROM Versions
(H8S/2318, H8S/2317, H8S/2316, H8S/2313) in Low-Voltage Operation ...................... 816
20.2.1 Absolute Maximum Ratings ................................................................................ 816
20.2.2 DC Characteristics............................................................................................... 817
20.2.3 AC Characteristics............................................................................................... 819
20.2.4 A/D Conversion Characteristics........................................................................... 823
20.2.5 D/A Conversion Characteristics........................................................................... 823
20.3 Electrical Characteristics of F-ZTAT Versions (H8S/2319 F-ZTAT, H8S/2319E F-ZTAT, H8S/2318 F-ZTAT, H8S/2317 F-ZTAT,
H8S/2315 F-ZTAT, H8S/2314 F-ZTAT) ......................................................................... 824
20.3.1 Absolute Maximum Ratings ................................................................................ 824
Rev. 5.00, 12/03, page xxvii of xxx
Page 28
20.3.2 DC Characteristics............................................................................................... 825
20.3.3 AC Characteristics............................................................................................... 828
20.3.4 A/D Conversion Characteristics........................................................................... 832
20.3.5 D/A Conversion Characteristics........................................................................... 832
20.3.6 Flash Memory Characteristics ............................................................................. 833
20.4 Electrical Characteristics of F-ZTAT Version (H8S/2319C F-ZTAT)
(In planning)...................................................................................................................... 835
20.4.1 Absolute Maximum Ratings ................................................................................ 835
20.4.2 DC Characteristics............................................................................................... 836
20.4.3 AC Characteristics............................................................................................... 839
20.4.4 A/D Conversion Characteristics........................................................................... 843
20.4.5 D/A Conversion Characteristics........................................................................... 843
20.4.6 Flash Memory Characteristics ............................................................................. 844
20.4.7 Usage Note (Internal Voltage Step Down for the H8S/2319C F-ZTAT) ............ 844
20.5 Usage Note........................................................................................................................ 845
Appendix A Instruction Set.............................................................................................. 847
A.1 Instruction List.................................................................................................................. 847
A.2 Instruction Codes .............................................................................................................. 871
A.3 Operation Code Map......................................................................................................... 886
A.4 Number of States Required for Instruction Execution ...................................................... 890
A.5 Bus States during Instruction Execution ........................................................................... 904
A.6 Condition Code Modification ........................................................................................... 918
Appendix B Internal I/O Registers................................................................................. 924
B.1 List of Registers (Address Order) ..................................................................................... 924
B.2 List of Registers (By Module)........................................................................................... 933
B.3 Functions........................................................................................................................... 942
Appendix C I/O Port Block Diagrams......................................................................... 1051
C.1 Port 1............................................................................................................................... 1051
C.2 Port 2............................................................................................................................... 1055
C.3 Port 3............................................................................................................................... 1056
C.4 Port 4............................................................................................................................... 1059
C.5 Port A .............................................................................................................................. 1060
C.6 Port B .............................................................................................................................. 1061
C.7 Port C.............................................................................................................................. 1062
C.8 Port D .............................................................................................................................. 1063
C.9 Port E.............................................................................................................................. 1064
C.10 Po rt F .............................................................................................................................. 1065
C.11 Po rt G.............................................................................................................................. 1073
Rev. 5.00, 12/03, page xxviii of xxx
Page 29
Appendix D Pin States..................................................................................................... 1078
D.1 Port States in Each Mode................................................................................................ 1078
Appendix E Product Lineup........................................................................................... 1084
Appendix F Package Dimensions................................................................................. 1086
Rev. 5.00, 12/03, page xxixof xxx
Page 30
Rev. 5.00, 12/03, page xxxof xxx
Page 31

Section 1 Overview

1.1 Overview

The H8S/2319 Group and H8S/2318 Group are series of microcomputers (MCUs: microcomputer units), built around the H8S/2000 CPU, employing Renesas's proprietary architecture, and equipped with supporting functions on-chip.
The H8S/2000 CPU has an internal 32-bit architecture, is provided with sixteen 16-bit general registers a nd a concise, optimized instruction set designed for high-speed operation, and can address a 16-Mbyte li near address space. The instruction set is upward-compatible with H8/300 and H8/300H CPU instructions at the object-code level, facilitating migration from the H8/300, H8/300L, or H8/300H Series.
On-chip supporting functions required for system configuration include data transfer controller (DTC) bus masters, ROM and RAM memory, a 16-bit timer-pulse unit (TPU), 8-bit timer, watchdog timer (WDT), serial communication interface (SCI), A/D converter, D/A converter, and I/O ports.
Single-power-supply flash memory (F-ZTAT™*) and mask ROM versions are ava ilable, providing a quick and flexible response to conditions from ramp-up through full-scale volume production, even for applications with frequently changing specifications. ROM is connected to the CPU via a 16-bit data bus, enabling both byte and word data to be accessed in one state. Instruction fetching is thus speeded up, and processing speed increased.
The features of t he H8S/2319 Group and H8S/2318 Group are shown in table 1-1.
Note: *F-ZTAT is a trademark of Renesas Technology Corp.
Rev. 5.00, 12/03, page 1 of 1088
Page 32
Table 1-1 Overview
Item Specification
CPU
Bus controller
Data transfer controller (DTC)
16-bit timer-pulse unit (TPU)
General-register machineSixteen 16-bit general registers (also usable as sixteen 8-bit registers
or eight 32-bit registers)
High-speed operation suitable for realtime controlMaximum clock rate: 25 MHzHigh-speed arithmetic operations
8/16/32-bit register-register add/subtract: 40 ns (at 25 MHz operation) 16 × 16-bit register-register multiply: 800 ns (at 25 MHz operation) 32 ÷ 16-bit register-register divide: 800 ns (at 25 MHz operation)
Instruction set suitable for high-speed operationSixty-five basic instructions8/16/32-bit move/arithmetic and logic instructionsUnsigned/signed multiply and divide instructionsPowerful bit-manipulation instructions
CPU operating modeAdvanced mode: 16-Mbyte address space
Address space divided into 8 areas, with bus specifications settable
independently for each area
Chip select output possible for each area
Choice of 8-bit or 16-bit access space for each area
2-state or 3-state access space can be designated for each area
Number of program wait states can be set for each area
Burst ROM directly connectable
External bus release function
Can be activated by internal interrupt or software
Multiple transfers or multiple types of transfer possible for one activation
source
Transfer possible in repeat mode, block transfer mode, etc.
Request can be sent to CPU for interrupt that activated DTC
6-channel 16-bit timer
Pulse I/O processing capability for up to 16 pins
Automatic 2-phase encoder count capability
Rev. 5.00, 12/03, page 2 of 1088
Page 33
Item Specification
8-bit timer, 2 channels
8-bit up-counter (external event count capability)
Two time constant registers
Two-channel connection possible
Watchdog timer Serial
communication interface (SCI), 2 channels
A/D converter
Watchdog timer or interval timer selectable
Asynchronous mode or synchronous mode selectable
Multiprocessor communication function
Smart card interface function
Resolution: 10 bits
Input: 8 channels
High-speed conversion: 6.7 µs minimum conversion time
(at 20 MHz operation)
Single or scan mode selectable
Sample-and-hold circuit
A/D conversion can be activated by external trigger or timer trigger
D/A converter
Resolution: 8 bits
Output: 2 channels
I/O ports Memory
71 input/output pins, 8 input pins
Flash memory, mask ROM
High-speed static RAM
Product Name ROM RAM
H8S/2319C
*
H8S/2319 512 kbytes 8 kbytes H8S/2318 256 kbytes 8 kbytes H8S/2317 128 kbytes 8 kbytes H8S/2316 64 kbytes 8 kbytes H8S/2315 384 kbytes 8 kbytes H8S/2314 384 kbytes 4 kbytes H8S/2313 64 kbytes 2 kbytes H8S/2312S 8 kbytes H8S/2311 32 kbytes 2 kbytes H8S/2310 2 kbytes Note: * H8S/2319C F-ZTAT is in planning.
Interrupt controller
9 external interrupt pins (NMI, IRQ0 to IRQ7)
43 internal interrupt sources
Eight priority levels settable
512 kbytes 16 kbytes
Rev. 5.00, 12/03, page 3 of 1088
Page 34
Item Specification
Power-down state
Operating modes
Medium-speed mode
Sleep mode
Module stop mode
Software standby mode
Hardware standby mode
Variable clock division ratio
Eight MCU operating modes (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT,
H8S/2315 F-ZTAT, H8S/2314 F-ZTAT)
CPU Operating
Mode
Mode Description
1— — — — 2 3 4 Advanced Disabled 16 bits 16 bits 5 6 On-chip ROM enabled
7 Single-chip mode — 8— — — — 9 10 Advanced Boot mode Enabled 8 bits 16 bits 11 — 12 — 13 14 Advanced User program mode Enabled 8 bits 16 bits 15
On-chip ROM disabled expansion mode
expansion mode
External Data Bus
On-Chip ROM
Enabled 8 bits 16 bits
Initial Value
8bits 16bits
Maximum Value
Rev. 5.00, 12/03, page 4 of 1088
Page 35
Item Specification
Operating modes
Four MCU operating modes (ROMless, mask ROM versions, H8S/2319 F­ZTAT, and H8S/2319C F-ZTAT)
CPU Operating
Mode
Mode Description
1
*
1
—— ———
2
*
2
2
*
3
3
*
4
Advanced
3
*
5
6
7 Single-chip mode Enabled — — Notes: 1.User boot mode in the H8S/2319C F-ZTAT. For user boot mode in
the H8S/2319C F-ZTAT, see table 17-52 in section 17.24, On­Board Programming Modes.
2.Boot mode in the H8S/2319 F-ZTAT and H8S/2319C F-ZTAT. For boot mode in the H8S/2319 F-ZTAT, see table 17-30 in
section 17.15, On-Board Programming Modes. Also see table 17­30 in section 17.15, On-Board Programming Modes, for information on user program mode.
For boot mode in the H8S/2319C F-ZTAT, see table 17-52 in
section 17.24, On-Board Programming Modes. Also see table 17­52 in section 17.24, On-Board Programming Modes, for information on user program mode.
3.The ROMless version can use only modes 4 and 5.
Clock pulse
Built-in duty correction circuit
generator
On-chip ROM disabled expansion mode
On-chip ROM disabled expansion mode
On-chip ROM enabled expansion mode
External Data Bus
On-Chip ROM
Initial Value
Maximum Value
Disabled 16 bits 16 bits
Disabled 8bits 16bits
Enabled 8 bits 16 bits
Rev. 5.00, 12/03, page 5 of 1088
Page 36
Item Specification
Product lineup Condition A Condition B Condition C
Operating power supply
2.7 to 3.6 V 3.0 to 3.6 V 2.4 to 3.6 V
voltage Operating frequency 2 to 20 MHz 2 to 25 MHz 2 to 14 MHz Model HD64F2319 O
3
HD64F2319E HD64F2319C
*
—O —
2
*
— HD6432319 O O — HD64F2318 O — HD6432318 O O O HD64F2317 O — HD6432317 O O O
4
HD6432317S
*
OO— HD6432316 O O O HD64F2315 O — HD64F2314 O — HD6432313 O O O HD6412312S O O — HD6432311 O O — HD6412310 O O
O: Products in the current lineup Notes: 1.T
= –40°C to 85°C (wide-range specifications) is not available for
a
condition C.
2.In planning
3.The on-chip debug function can be used with the E10-A emulator (E10-A compatible version). However, some function modules and pin functions are unavailable when the on-chip debug function is in use. Refer to figure 1-4 and figure 1-5, Pin Arrangement. (The SCI channel 1 is unavailable when the on-chip debug function is in use. Also, since the WDT continues to operate during break status, a reset is generated when an overflow occurs if a setting is made to reset the chip internally.)
4.This is a low-cost version. For specifications, refer to the items for the H8S/2317.
1
*
Rev. 5.00, 12/03, page 6 of 1088
Page 37
Item Specification
Other features
Differences between H8S/2319 F-ZTAT and H8S/2319C F-ZTATOn-chip RAM
H8S/2319 F-ZTAT: 8 kbytes (H'FFDC00 to H'FFFBFF) H8S/2319C F-ZTAT: 16 kbytes (H'FFBC00 to H'FFFBFF)
On-chip flash memory
The H8S/2319 F-ZTAT and H8S/2319C F-ZTAT both have 512 kbytes of on-chip flash memory. However, the method for controlling the flash memory is different for the two LSIs. When the on-chip flash memory is enabled, the registers (parameters) used to control it are different. For details, see the section about the H8S/2319 F-ZTAT and H8S/2319C F-ZTAT in section 17, ROM.
Address map
The address maps of the H8S/2319 F-ZTAT and H8S/2319C F-ZTAT differ in places. For details, see section 3.5, Memory Map in Each Operating Mode.
Rev. 5.00, 12/03, page 7 of 1088
Page 38

1.2 Block Diagram

5 4
MD2 MD1 MD0 EXTAL XTAL
STBY RES WDTOVF (FWE, EMLE, V
NMI
PF7/φ PF6/AS PF5/RD PF4/HWR PF3/LWR/ IRQ3 PF2/WAIT/ IRQ2/DREQO PF1/BACK/ IRQ1/CS5 PF0/BREQ/ IRQ0/CS4
PG4/CS0 PG3/CS1/ CS7 PG2/CS2 PG1/CS3/ IRQ7/CS6 PG0/ADTRG/ IRQ6
SS
PD7/D15
PD6/D14
PD5/D13
PD4/D12
VCCVCCVCCVSSVSSVSSVSSVSSV
ROM
TPU
RAM
H8S/2000 CPU
2
*
1
*
)
CL
Port
F
Port
G
generator
Clock pulse
Interrupt controller
PD3/D11
Port D
DTC
PE7/D7
PD2/D10
PD1/D9
PD0/D8
WDT
8-bit timer
SCI
D/A converter
PE6/D6
PE5/D5
PE4/D4
Port E
Internal data bus
Internal address bus
Bus controller
PE3/D3
PE2/D2
PE1/D1
Peripheral data bus
PE0/D0
PA3/A19 PA2/A18
Port
PA1/A17
A
PA0/A16
PB7/A15 PB6/A14 PB5/A13 PB4/A12
Port
PB3/ A11
B
PB2/A10 PB1/A9 PB0/A8
PC7/A7
Port
Port
C
3
PC6/A6 PC5/A5 PC4/A4 PC3/A3 PC2/A2 PC1/A1 PC0/A0
P35/SCK1/IRQ P34/SCK0/IRQ P33/RxD1 P32/RxD0 P31/TxD1 P30/TxD0
Peripheral address bus
A/D converter
Port 4Port 2Port 1
SS
ref
V
AVCCAV
P47/AN7/ DA1
P46/AN6/ DA0
P45/AN5
P44/AN4
P43/AN3
P42/AN2
P41/AN1
P40/AN0
P10/TIOCA0/A20
P11/TIOCB0/A21
P12/TIOCC0 /TCLKA/A22
P13/TIOCD0 /TCLKB/A23
P14/TIOCA1
P15/TIOCB1 /TCLKC
P16/TIOCA2
P17/TIOCB2 /TCLKD
P20/TIOCA3
P21/TIOCB3
P22/TIOCC3/TMRI0
P23/TIOCD3/TMCI0
P24/TIOCA4/TMRI1
P25/TIOCB4/TMCI1
P26/TIOCA5/TMO0
P27/TIOCB5/TMO1
Notes: 1. The FWE pin function is only available in the H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT. The EMLE pin function is only available in the H8S/2319 F-ZTAT. The V The WDTOVF pin function is not available in the F-ZTAT versions.
pin function is only available in the H8S/2319C F-ZTAT.
CL
2. ROM is not supported in the ROMless versions.
Figure 1-1 Block Diagram
Rev. 5.00, 12/03, page 8 of 1088
Page 39

1.3 Pin Description

1.3.1 Pin Arrangement

*
)
CL
PF0/BREQ/IRQ0/CS4
AV
V
P40/AN0
P41/AN1
P42/AN2
P43/AN3
P44/AN4
P45/AN5
P46/AN6/DA0
P47/AN7/DA1
AV
V
P24/TIOCA4/TMRI1
P25/TIOCB4/TMCI1
P26/TIOCA5/TMO0
P27/TIOCB5/TMO1
PG0/ADTRG/IRQ6
PG1/CS3/IRQ7/CS6
PG2/CS2
PG3/CS1/CS7
PG4/CS0
V
P10/TIOCA0/A20
P11/TIOCB0/A21
PF1/BACK/IRQ1/CS5
PF2/WAIT/IRQ2/BREQO
PF3/LWR/IRQ3
PF4/HWR
75747372717069686766656463626160595857565554535251
76
77
CC
78
ref
79
80
81
82
83
84
85
86
87
SS
88
SS
89
90
91
92
93
94
95
96
97
98
CC
99
100
123456789
P14/TIOCA1
P15/TIOCB1/TCLKC
P12/TIOCC0/TCLKA/A22
P13/TIOCD0/TCLKB/A23
SS
PF5/RD
PF6/AS
PF7/φ
V
SS
V
P30/TxD0
P16/TIOCA2
P17/TIOCB2/TCLKD
EXTAL
XTAL
VCCSTBY
NMI
RES
MD2
WDTOVF (FWE, EMLE, V
P23/TIOCD3/TMCI0
MD1
MD0
P22/TIOCC3/TMRI0
P21/TIOCB3
101112131415161718192021222324
SS
P31/TxD1
P32/RxD0
P33/RxD1
P34/SCK0/IRQ4
PE0/D0
P35/SCK1/IRQ5
PE1/D1
PE2/D2
V
PE3/D3
PE4/D4
PE5/D5
PE6/D6
P20/TIOCA3
PA3/A19
PA2/A18
PE7/D7
PD0/D8
PD1/D9
PA1/A17
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
PD2/D10
PA0/A16
V
SS
PB7/A15
PB6/A14
PB5/A13
PB4/A12
PB3/A11
PB2/A10
PB1/A9
PB0/A8
V
CC
PC7/A7
PC6/A6
PC5/A5
PC4/A4
PC3/A3
PC2/A2
PC1/A1
PC0/A0
V
SS
PD7/D15
PD6/D14
PD5/D13
PD4/D12
PD3/D11
Note: * The FWE pin function is only available in the H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT. The EMLE pin function is only available in the H8S/2319 F-ZTAT. The V The WDTOVF pin function is not available in the F-ZTAT versions.
pin function is only available in the H8S/2319C F-ZTAT.
CL
Figure 1-2 Pin Arrangement (TFP-100B, TFP-100G: Top View)
Rev. 5.00, 12/03, page 9 of 1088
Page 40
*
)
CL
, V
P40/AN0 P41/AN1 P42/AN2 P43/AN3 P44/AN4
P45/AN5 P46/AN6/DA0 P47/AN7/DA1
AV
V P24/TIOCA4/TMRI1 P25/TIOCB4/TMCI1
P26/TIOCA5/TMO0 P27/TIOCB5/TMO1
PG0/ADTRG/IRQ6
PG1/CS3/IRQ7/CS6
PG2/CS2
PG3/CS1/CS7
PG4/CS0
V
ref
V
AVCCPF0/BREQ/IRQ0/CS4
PF1/BACK/IRQ1/CS5
PF2/WAIT/IRQ2/BREQO
PF3/LWR/IRQ3
PF4/HWR
PF5/RD
PF6/AS
PF7/φ
VSSEXTAL
XTAL
VCCSTBY
NMI
8079787776757473727170696867666564636261605958575655545352
81
P23/TIOCD3/TMCI0
RES
MD2
WDTOVF (FWE, EMLE
MD1
MD0
P22/TIOCC3/TMRI0
P21/TIOCB3
P20/TIOCA3
PA3/A19
82 83 84 85 86 87 88 89
SS
90
SS
91 92 93 94 95 96 97 98 99 100
CC
1234567891011121314151617181920212223242526272829
P14/TIOCA1
P16/TIOCA2
P10/TIOCA0/A20
P11/TIOCB0/A21
P15/TIOCB1/TCLKC
P12/TIOCC0/TCLKA/A22
P13/TIOCD0/TCLKB/A23
SS
V
P30/TxD0
P31/TxD1
P32/RxD0
P33/RxD1
P34/SCK0/IRQ4
P17/TIOCB2/TCLKD
PE0/D0
P35/SCK1/IRQ5
PE1/D1
PE2/D2
SS
V
PE3/D3
PE4/D4
PE5/D5
PE6/D6
PE7/D7
PD0/D8
PD1/D9
PA2/A18
PA1/A17
PA0/A16
PD2/D10
PD3/D11
PD4/D12
SS
V
51
50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31
30
PD5/D13
PB7/A15 PB6/A14 PB5/A13 PB4/A12 PB3/A11 PB2/A10 PB1/A9 PB0/A8 V
CC
PC7/A7 PC6/A6 PC5/A5 PC4/A4 PC3/A3 PC2/A2 PC1/A1 PC0/A0 V
SS
PD7/D15 PD6/D14
Note: * The FWE pin function is only available in the H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT. The EMLE pin function is only available in the H8S/2319 F-ZTAT. The V The WDTOVF pin function is not available in the F-ZTAT versions.
pin function is only available in the H8S/2319C F-ZTAT.
CL
Figure 1-3 Pin Arrangement (FP-100A: Top View)
Rev. 5.00, 12/03, page 10 of 1088
Page 41
E10-A compatible version
*
PF0/BREQ/IRQ0/CS4
AV
V
P40/AN0
P41/AN1
P42/AN2
P43/AN3
P44/AN4
P45/AN5
P46/AN6/DA0
P47/AN7/DA1
AV
V
P24/TIOCA4/TMRI1
P25/TIOCB4/TMCI1
P26/TIOCA5/TMO0
P27/TIOCB5/TMO1
PG0/ADTRG/IRQ6
PG1/CS3/IRQ7/CS6
PG2/CS2
PG3/CS1/CS7
PG4/CS0
V
P10/TIOCA0/A20
P11/TIOCB0/A21
PF4/HWR
PF1/BACK/IRQ1/CS5
PF2/WAIT/IRQ2/BREQO
PF3/LWR/IRQ3
75747372717069686766656463626160595857565554535251
76
77
CC
78
ref
79
80
81
82
83
84
85
86
87
SS
88
SS
89
90
91
92
93
94
95
96
97
98
CC
99
100
123456789
P14/TIOCA1
P15/TIOCB1/TCLKC
P12/TIOCC0/TCLKA/A22
P13/TIOCD0/TCLKB/A23
SS
PF5/RD
PF6/AS
PF7/φ
V
*
SS
V
P30/TxD0
P16/TIOCA2
P17/TIOCB2/TCLKD
EXTAL
XTAL
VCCSTBY
NMI
RES
MD2
EMLE*P23/TIOCD3/TMCI0
MD1
MD0
P22/TIOCC3/TMRI0
P21/TIOCB3/TRST*P20/TIOCA3/TMS
101112131415161718192021222324
*
*
P32/RxD0
P33/RxD1/TDI
P34/SCK0/IRQ4
P31/TxD1/TDO
PE0/D0
P35/SCK1/IRQ5/TCK
PE1/D1
PE2/D2
SS
V
PE3/D3
PE4/D4
PE5/D5
PE6/D6
PA3/A19
PE7/D7
PD0/D8
PA2/A18
PA1/A17
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
PD1/D9
PD2/D10
PA0/A16
V
SS
PB7/A15
PB6/A14
PB5/A13
PB4/A12
PB3/A11
PB2/A10
PB1/A9
PB0/A8
V
CC
PC7/A7
PC6/A6
PC5/A5
PC4/A4
PC3/A3
PC2/A2
PC1/A1
PC0/A0
V
SS
PD7/D15
PD6/D14
PD5/D13
PD4/D12
PD3/D11
Note: * If an E10-A emulator is used, the TDO, TDI, TDK, TMS, and TRST pins are used exclusively for the H-UDI and the
functions and function modules associated with these pins are not available. (The SCI channel 1 is unavailable when
the on-chip debug function is in use. Also, since the WDT continues to operate during break status, a reset is generated when an overflow occurs if a setting is made to reset the chip internally.) Refer to the E10-A Emulator User's Manual for E10-A emulator connection examples. Refer to the H8S/2319 F-ZTAT section for HD64F2319E.
Figure 1-4 HD64F2319E Pin Arrangement (TFP-100B: Top View)
Rev. 5.00, 12/03, page 11 of 1088
Page 42
E10-A compatible version
*
*
P40/AN0 P41/AN1 P42/AN2 P43/AN3 P44/AN4
P45/AN5 P46/AN6/DA0 P47/AN7/DA1
AV
V P24/TIOCA4/TMRI1 P25/TIOCB4/TMCI1
P26/TIOCA5/TMO0 P27/TIOCB5/TMO1
PG0/ADTRG/IRQ6
PG1/CS3/IRQ7/CS6
PG2/CS2
PG3/CS1/CS7
PG4/CS0
V
ref
AVCCPF0/BREQ/IRQ0/CS4
PF1/BACK/IRQ1/CS5
PF2/WAIT/IRQ2/BREQO
PF3/LWR/IRQ3
PF4/HWR
PF5/RD
PF6/AS
PF7/φ
VSSEXTAL
XTAL
VCCSTBY
NMI
RES
MD2
EMLE*P23/TIOCD3/TMCI0
V
8079787776757473727170696867666564636261605958575655545352
81
MD1
P20/TIOCA3/TMS
MD0
PA3/A19
P22/TIOCC3/TMRI0
P21/TIOCB3/TRST
82 83 84 85 86 87 88 89
SS
90
SS
91 92 93 94 95 96 97 98 99 100
CC
1234567891011121314151617181920212223242526272829
*
*
*
P32/RxD0
P33/RxD1/TDI
P34/SCK0/IRQ4
P35/SCK1/IRQ5/TCK
PE0/D0
PE1/D1
PE2/D2
PE3/D3
SS
V
PE4/D4
PE5/D5
PE6/D6
PE7/D7
PD0/D8
PD1/D9
P14/TIOCA1
P16/TIOCA2
P10/TIOCA0/A20
P11/TIOCB0/A21
P15/TIOCB1/TCLKC
P12/TIOCC0/TCLKA/A22
P13/TIOCD0/TCLKB/A23
SS
V
P30/TxD0
P31/TxD1/TDO
P17/TIOCB2/TCLKD
PA2/A18
PA1/A17
PA0/A16
PD2/D10
PD3/D11
PD4/D12
SS
V
51
50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31
30
PD5/D13
PB7/A15 PB6/A14 PB5/A13 PB4/A12 PB3/A11 PB2/A10 PB1/A9 PB0/A8 V
CC
PC7/A7 PC6/A6 PC5/A5 PC4/A4 PC3/A3 PC2/A2 PC1/A1 PC0/A0 V
SS
PD7/D15 PD6/D14
Note: * If an E10-A emulator is used, the TDO, TDI, TDK, TMS, and TRST pins are used exclusively for the H-UDI and the
functions and function modules associated with these pins are not available. (The SCI channel 1 is unavailable when
the on-chip debug function is in use. Also, since the WDT continues to operate during break status, a reset is generated when an overflow occurs if a setting is made to reset the chip internally.) Refer to the E10-A Emulator User's Manual for E10-A emulator connection examples. Refer to the H8S/2319 F-ZTAT section for HD64F2319E.
Figure 1-5 HD64F2319E Pin Arrangement (FP-100A: Top View)
Rev. 5.00, 12/03, page 12 of 1088
Page 43

1.3.2 Pin Functions in Each Operating Mode

Table 1-2 shows the pin functions in each of t he operating modes.
Table 1-2 Pin Functions in Each Operating Mode
Pin No. Pin Name
TFP-100B, TFP-100G FP-100A
1 3 P12/TIOCC0/
2 4 P13/TIOCD0/
3 5 P14/TIOCA1 P14/TIOCA1 P14/TIOCA1 P14/TIOCA1 NC 4 6 P15/TIOCB1/
5 7 P16/TIOCA2 P16/TIOCA2 P16/TIOCA2 P16/TIOCA2 NC 6 8 P17/TIOCB2/
79V 8 10 P30/TxD0 P30/TxD0 P30/TxD0 P30/TxD0 NC 9 11 P31/TxD1 P31/TxD1 P31/TxD1 P31/TxD1 NC 10 12 P32/RxD0 P32/RxD0 P32/RxD0 P32/RxD0 NC 11 13 P33/RxD1 P33/RxD1 P33/RxD1 P33/RxD1 NC 12 14 P34/SCK0/IRQ4 P34/SCK0/IRQ4 P34/SCK0/IRQ4 P34/SCK0/IRQ4 NC 13 15 P35/SCK1/IRQ5 P35/SCK1/IRQ5 P35/SCK1/IRQ5 P35/SCK1/IRQ5 NC 14 16 PE0/D0 PE0/D0 PE0/D0 PE0 NC 15 17 PE1/D1 PE1/D1 PE1/D1 PE1 NC 16 18 PE2/D2 PE2/D2 PE2/D2 PE2 NC 17 19 PE3/D3 PE3/D3 PE3/D3 PE3 NC 18 20 V 19 21 PE4/D4 PE4/D4 PE4/D4 PE4 NC 20 22 PE5/D5 PE5/D5 PE5/D5 PE5 NC 21 23 PE6/D6 PE6/D6 PE6/D6 PE6 NC 22 24 PE7/D7 PE7/D7 PE7/D7 PE7 NC 23 25 D8 D8 D8 PD0 I/O0 24 26 D9 D9 D9 PD1 I/O1 25 27 D10 D10 D10 PD2 I/O2
Mode 4
TCLKA/A22
TCLKB/A23
TCLKC
TCLKD
SS
SS
Mode 5
P12/TIOCC0/ TCLKA/A22
P13/TIOCD0/ TCLKB/A23
P15/TIOCB1/ TCLKC
P17/TIOCB2/ TCLKD
V
SS
V
SS
Mode
1
*
6
P12/TIOCC0/ TCLKA/A22
P13/TIOCD0/ TCLKB/A23
P15/TIOCB1/ TCLKC
P17/TIOCB2/ TCLKD
V
SS
V
SS
Mode
1
*
7
P12/TIOCC0/ TCLKA
P13/TIOCD0/ TCLKB
P15/TIOCB1/ TCLKC
P17/TIOCB2/ TCLKD
V
SS
V
SS
Flash Memory Programmer Mode
NC
NC
NC
NC
V
V
SS
SS
Rev. 5.00, 12/03, page 13 of 1088
Page 44
Pin No. Pin Name
TFP-100B, TFP-100G FP-100A
Mode 4
Mode 5
Mode
1
*
6
Mode
1
*
7
Flash Memory Programmer Mode
26 28 D11 D11 D11 PD3 I/O3 27 29 D12 D12 D12 PD4 I/O4 28 30 D13 D13 D13 PD5 I/O5 29 31 D14 D14 D14 PD6 I/O6 30 32 D15 D15 D15 PD7 I/O7 31 33 V
SS
V
SS
V
SS
V
SS
V 32 34 A0 A0 PC0/A0 PC0 A0 33 35 A1 A1 PC1/A1 PC1 A1 34 36 A2 A2 PC2/A2 PC2 A2 35 37 A3 A3 PC3/A3 PC3 A3 36 38 A4 A4 PC4/A4 PC4 A4 37 39 A5 A5 PC5/A5 PC5 A5 38 40 A6 A6 PC6/A6 PC6 A6 39 41 A7 A7 PC7/A7 PC7 A7 40 42 V
CC
V
CC
V
CC
V
CC
V 41 43 A8 A8 PB0/A8 PB0 A8 42 44 A9 A9 PB1/A9 PB1 A9 43 45 A10 A10 PB2/A10 PB2 A10 44 46 A11 A11 PB3/A11 PB3 A11 45 47 A12 A12 PB4/A12 PB4 A12 46 48 A13 A13 PB5/A13 PB5 A13 47 49 A14 A14 PB6/A14 PB6 A14 48 50 A15 A15 PB7/A15 PB7 A15 49 51 V
SS
V
SS
V
SS
V
SS
V 50 52 A16 A16 PA0/A16 PA0 A16 51 53 A17 A17 PA1/A17 PA1 A17 52 54 A18 A18 PA2/A18 PA2 A18 53 55 A19 A19 PA3/A19 PA3 NC 54 56 P20/TIOCA3 P20/TIOCA3 P20/TIOCA3 P20/TIOCA3 OE 55 57 P21/TIOCB3 P21/TIOCB3 P21/TIOCB3 P21/TIOCB3 CE 56 58 P22/TIOCC3/
TMRI0
P22/TIOCC3/ TMRI0
P22/TIOCC3/ TMRI0
P22/TIOCC3/ TMRI0
WE
57 59 MD0 MD0 MD0 MD0 V 58 60 MD1 MD1 MD1 MD1 V 59 61 P23/TIOCD3/
TMCI0
60 62 WDTOVF
(FWE, EMLE,
2
*
V
)
CL
P23/TIOCD3/ TMCI0
WDTOVF
(FWE, EMLE,
2
*
V
)
CL
P23/TIOCD3/ TMCI0
WDTOVF
(FWE, EMLE,
2
*
V
)
CL
P23/TIOCD3/ TMCI0
WDTOVF
(FWE, EMLE,
2
*
V
)
CL
V
FWE, EMLE,
V
SS
CC
SS
SS
SS
CC
2
*
CL
Rev. 5.00, 12/03, page 14 of 1088
Page 45
Pin No. Pin Name
TFP-100B, TFP-100G FP-100A
61 63 MD2 MD2 MD2 MD2 V
Mode 4
Mode 5
Mode
1
*
6
Mode
1
*
7
Flash Memory Programmer Mode
SS
62 64 RES RES RES RES RES 63 65 NMI NMI NMI NMI V 64 66 STBY STBY STBY STBY V 65 67 V
CC
V
CC
V
CC
V
CC
CC
CC
V
CC
66 68 XTAL XTAL XTAL XTAL XTAL 67 69 EXTAL EXTAL EXTAL EXTAL EXTAL 68 70 V
SS
V
SS
V
SS
V
SS
V
SS
69 71 PF7/φ PF7/φ PF7/φ PF7/φ NC 70 72 PF6/AS PF6/AS PF6/AS PF6 NC 71 73 RD RD RD PF5 NC 72 74 HWR HWR HWR PF4 NC 73 75 PF3/LWR/IRQ3 PF3/LWR/IRQ3 PF3/LWR/IRQ3 PF3/IRQ3 NC 74 76 PF2/WAIT/
IRQ2/DREQO
75 77 PF1/BACK/
IRQ1/CS5
76 78 PF0/BREQ/
IRQ0/CS4 77 79 AV 78 80 V
CC
ref
PF2/WAIT/ IRQ2/DREQO
PF1/BACK/ IRQ1/CS5
PF0/BREQ/ IRQ0/CS4
AV
CC
V
ref
PF2/WAIT/ IRQ2/DREQO
PF1/BACK/ IRQ1/CS5
PF0/BREQ/ IRQ0/CS4
AV
CC
V
ref
PF2/IRQ2 V
PF1/IRQ1 V
PF0/IRQ0 V
AV
CC
V
ref
CC
SS
SS
V
CC
V
CC
79 81 P40/AN0 P40/AN0 P40/AN0 P40/AN0 NC 80 82 P41/AN1 P41/AN1 P41/AN1 P41/AN1 NC 81 83 P42/AN2 P42/AN2 P42/AN2 P42/AN2 NC 82 84 P43/AN3 P43/AN3 P43/AN3 P43/AN3 NC 83 85 P44/AN4 P44/AN4 P44/AN4 P44/AN4 NC 84 86 P45/AN5 P45/AN5 P45/AN5 P45/AN5 NC 85 87 P46/AN6/DA0 P46/AN6/DA0 P46/AN6/DA0 P46/AN6/DA0 NC 86 88 P47/AN7/DA1 P47/AN7/DA1 P47/AN7/DA1 P47/AN7/DA1 NC 87 89 AV 88 90 V
SS
SS
89 91 P24/TIOCA4/
TMRI1 90 92 P25/TIOCB4/
TMCI1
AV
SS
V
SS
P24/TIOCA4/ TMRI1
P25/TIOCB4/ TMCI1
AV
SS
V
SS
P24/TIOCA4/ TMRI1
P25/TIOCB4/ TMCI1
AV
SS
V
SS
P24/TIOCA4/ TMRI1
P25/TIOCB4/ TMCI1
V V NC
V
SS
SS
SS
Rev. 5.00, 12/03, page 15 of 1088
Page 46
Pin No. Pin Name
TFP-100B, TFP-100G FP-100A
91 93 P26/TIOCA5/
92 94 P27/TIOCB5/
93 95 PG0/IRQ6/
94 96 PG1/CS3/
Mode 4
TMO0
TMO1
ADTRG
IRQ7/CS6
Mode 5
P26/TIOCA5/ TMO0
P27/TIOCB5/ TMO1
PG0/IRQ6/
ADTRG PG1/CS3/
IRQ7/CS6
Mode
1
*
6
P26/TIOCA5/ TMO0
P27/TIOCB5/ TMO1
PG0/IRQ6/
ADTRG PG1/CS3/
IRQ7/CS6
Mode
1
*
7
P26/TIOCA5/
Flash Memory Programmer Mode
NC
TMO0 P27/TIOCB5/
NC
TMO1 PG0/IRQ6/
NC
ADTRG
PG1/IRQ7 NC
95 97 PG2/CS2 PG2/CS2 PG2/CS2 PG2 NC 96 98 PG3/CS1/CS7 PG3/CS1/CS7 PG3/CS1/CS7 PG3 NC 97 99 PG4/CS0 PG4/CS0 PG4/CS0 PG4 NC 98 100 V
CC
V
CC
V
CC
V
CC
V 99 1 P10/TIOCA0/A20 P10/TIOCA0/A20 P10/TIOCA0/A20 P10/TIOCA0 NC 100 2 P11/TIOCB0/A21 P11/TIOCB0/A21 P11/TIOCB0/A21 P11/TIOCB0 NC
Notes: 1. Only modes 4 and 5 are available in the ROMless version.
2. The FWE pin function is only available in the H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT. The EMLE pin function is only available in the H8S/2319 F-ZTAT.
The V
pin function is only available in the H8S/2319C F-ZTAT.
CL
It cannot be used as a WDTOVF pin in the F-ZTAT versions.
CC
Rev. 5.00, 12/03, page 16 of 1088
Page 47

1.3.3 Pin Functions

Table 1-3 Pin Functions
Pin No.
TFP-100B,
Type Symbol
Power V
Internal voltage
CC
V
SS
1
*
V
CL
step-down pin
Clock XTAL 66 68 Input Connects to a crystal oscillator.
EXTAL 67 69 Input Connects to a crystal oscillator.
φ 69 71 Output System clock: Supplies the system
TFP-100G FP-100A I/O Name and Function
40, 65,9842, 67,
100
Input Power supply: For connection to the
power supply. All V
pins should be
CC
connected to the system power supply.
7, 18, 31, 49, 68, 88
9, 20, 33, 51, 70, 90
Input Ground: For connection to ground
(0 V). All V
pins should be
SS
connected to the system power supply (0 V).
60 62 Output An external capacitor should be
connected between this pin and GND (0 V). Do not connect it to V
CC
See section 18, 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 18, Clock Pulse Generator, for typical connection diagrams for a crystal oscillator and external clock input.
clock to an external device.
.
Rev. 5.00, 12/03, page 17 of 1088
Page 48
Type Symbol
Operating mode control
MD2 to MD0
Pin No.
TFP-100B, TFP-100G FP-100A I/O Name and Function
61, 58,5763, 60,59Input Mode pins: These pins set the
operating mode. The relation between the s ettings of pins MD2 to MD0 and the operating mode is shown below. These pins should not be changed while the H8S/2319 and H8S/2318 Groups are operating.
H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT
Operating
FWE MD2 MD1 MD0
0001—
10—
100Mode4
1 0 Mode 6
1000—
1 0 Mode 10
100—
1 0 Mode 14
Mode
1—
1 Mode 5
1 Mode 7
1—
1 Mode 11
1—
1 Mode 15
Rev. 5.00, 12/03, page 18 of 1088
Page 49
Pin No.
TFP-100B,
Type Symbol
Operating mode control
MD2 to MD0
TFP-100G FP-100A I/O Name and Function
61, 58,5763, 60,59Input
Mask ROM and ROMless versions, H8S/2319 F-ZTAT, and H8S/2319C F-ZTAT
Operating
MD2 MD1 MD0
001Mode1
10Mode2
100Mode4
Mode
1 Mode 2
1 Mode 5
1
*
2
*
2
*
3
*
3
*
10Mode6
1 Mode 7
System control RES 62 64 Input Reset input: When this pin is driven
low, the chip is reset.
STBY 64 66 Input Standby: When this pin is driven low,
a transition is made to hardware standby mode.
BREQ 76 78 Input Bus request: Used by an external
bus master to issue a bus request to the H8S/2318 Group.
BREQO 74 76 Output Bus request output: External bus
request signal used when an internal bus master accesses external space in the external-bus-released state.
BACK 75 77 Output Bus request acknowledge: Indicates
that the bus has been released to an external bus master.
4
*
FWE
60 62 Input Flash write enable: Enables or
disables writing to flash memory.
5
*
EMLE
60 62 Input Emulator enable: For connection to
ground (0 V).
Rev. 5.00, 12/03, page 19 of 1088
Page 50
Pin No.
TFP-100B,
Type Symbol
TFP-100G FP-100A I/O Name and Function
Interrupts NMI 63 65 Input Nonmaskable interrupt: Requests a
nonmaskable interrupt. When this pin is not used, it should be fixed high.
IRQ7 to IRQ0
Address bus A23 to
A0
94, 93, 13, 12, 73 to 76
2, 1, 100, 99, 53 to 50, 48 to 41,
96, 95, 15, 14, 75 to 78
4to1, 55 to 52, 50 to 43, 41 to 34
Input Interrupt request 7 to 0: These pins
request a maskable interrupt.
Output Address bus: These pins output an
address.
39 to 32
Data bus D15 to
D0
Bus control CS7 to
CS0
30 to 19, 17 to 14
94 to 97 75, 76
32 to 21, 19 to 16
96 to 99 77, 78
I/O Data bus: These pins constitute a
bidirectional data bus.
Output Chip select: Signals for selecting
areas 7 to 0.
AS 70 72 Output Address strobe: When this pin is low,
it indicates that address output on the address bus is enabled.
RD 71 73 Output Read: When this pin is low, it
indicates that the external address space c an be read.
HWR 72 74 Output High write: A strobe signal that writes
to external space and indicates that the upper half (D15 to D8) of the data bus is enabled.
LWR 73 75 Output Low write: A strobe signal that writes
to external space and indicates that the lower half (D7 to D0) of the data bus is enabled.
WAIT 74 76 Input Wait: Requests insertion of a wait
state in the bus cycle when accessing external 3-state access space.
Rev. 5.00, 12/03, page 20 of 1088
Page 51
Type Symbol
16-bit timer­pulse unit (TPU)
TCLKD to TCLKA
TIOCA0, TIOCB0, TIOCC0, TIOCD0
TIOCA1, TIOCB1
TIOCA2, TIOCB2
TIOCA3, TIOCB3, TIOCC3, TIOCD3
TIOCA4, TIOCB4
TIOCA5, TIOCB5
8-bit timer TMO0,
TMO1 TMCI0,
TMCI1
TMRI0, TMRI1
Watchdog
WDTOVF
timer (WDT)
Pin No.
TFP-100B, TFP-100G FP-100A I/O Name and Function
6, 4, 2, 1 8, 6, 4, 3 Input Clock input D to A: These pins input
an external clock.
99, 100, 1, 2
1 to 4 I/O Input capture/ output compare match
A0 to D0: The TGR0A to TGR0D input capture input or output compare output, or PWM output pins.
3, 4 5, 6 I/O Input capture/ output compare match
A1 and B1: The TGR1A and TGR1B input capture input or output compare output, or PWM output pins.
5, 6 7, 8 I/O Input capture/ output compare match
A2 and B2: The TGR2A and TGR2B input capture input or output compare output, or PWM output pins.
54 to 56,5956 to 58,61I/O Input capture/ output compare match
A3 to D3: The TGR3A to TGR3D input capture input or output compare output, or PWM output pins.
89, 90 91, 92 I/O Input capture/ output compare match
A4 and B4: The TGR4A and TGR4B input capture input or output compare output, or PWM output pins.
91, 92 93, 94 I/O Input capture/ output compare match
A5 and B5: The TGR5A and TGR5B input capture input or output compare output, or PWM output pins.
91, 92 93, 94 Output Compare match output: The
compare match output pins.
59, 90 61, 92 Input Counter external clock input: Input
pins for the external clock input to the counter.
56, 89 58, 91 Input Counter external reset input: The
counter reset input pins.
6
*
60 62 Output Watchdog timer overflows: The
counter overflows signal output pin in watchdog timer mode.
Rev. 5.00, 12/03, page 21 of 1088
Page 52
Pin No.
TFP-100B,
Type Symbol
Serial communication interface (SCI) Smart Card interface
TxD1, TxD0
RxD1, RxD0
SCK1 SCK0
A/D converter AN7 to
TFP-100G FP-100A I/O Name and Function
9, 8 11, 10 Output Transmit data (channel 0, 1):
Data output pins.
11, 10 13, 12 Input Receive data (channel 0, 1):
Data input pins.
13, 12 15, 14 I/O Serial clock (channel 0, 1):
Clock I/O pins.
86 to 79 88 to 81 Input Analog 7 to 0: Analog input pins.
AN0 ADTRG 93 95 Input A/D conversion external trigger input:
Pin for input of an external trigger to start A/D conversion.
D/A converter DA1, DA0 86, 85 88, 87 Output Analog output: D/A converter analog
output pins.
A/D converter and D/A converters
AV
CC
77 79 Input This is the power supply pin for the
A/D converter and D/A converter. When the A/D converter and D/A converter are not used, this pin should be connected to the system
CC
).
AV
power supply (V
SS
87 89 Input This is the ground pin for the A/D
converter and D/A converter. This pin should be connected to the system power supply (0 V).
V
ref
78 80 Input This is the reference voltage input
pin for the A/D converter and D/A converter. When the A/D converter and D/A converter are not used, this pin should be connected to the system
CC
).
I/O ports P17 to
P10
6to1, 100, 99
power supply (V
8 to 1 I/O Port 1: An 8-bit I/O port. Input or
output can be designated for each bit by means of the port 1 data direction register (P1DDR).
P27 to P20
92 to 89, 59, 56 to 54
94 to 91, 61, 58 to 56
I/O Port 2: An 8-bit I/O port. Input or
output can be designated for each bit by means of the port 2 data direction register (P2DDR).
Rev. 5.00, 12/03, page 22 of 1088
Page 53
Pin No.
TFP-100B,
Type Symbol
I/O ports P35 to
TFP-100G FP-100A I/O Name and Function
13 to 8 15 to 10 I/O Port 3: A 6-bit I/O port. Input or
P30
P47 to
86 to 79 88 to 81 Input Port 4: An 8-bit input port.
P40 PA3 to
53 to 50 55 to 52 I/O Port A
PA0
PB7 to
48 to 41 50 to 43 I/O Port B
PB0
PC7 to
39 to 32 41 to 34 I/O Port C
PC0
PD7 to
30 to 23 32 to 25 I/O Port D
PD0
PE7 to PE0
PF7 to
22 to 19, 17 to 14
24 to 21, 19 to 16
69 to 76 71 to 78 I/O Port F: An 8-bit I/O port. Input or
PF0
PG4 to
97 to 93 99 to 95 I/O Port G: A 5-bit I/O port. Input or
PG0
Notes: 1. Applies to the H8S/2319C F-ZTAT only.
2. Applies to the H8S/2319 F-ZTAT and H8S/2319C F-ZTAT only.
3. Only modes 4 and 5 are available in the ROMless versions.
4. Applies to the H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT only.
5. Applies to the H8S/2319 F-ZTAT only.
6. Applies to mask ROM and ROMless versions only. Cannot be used as an I/O port in the ROMless versions.
output can be designated for each bit by means of the port 3 data direction register (P3DDR).
7
*
: A 4-bit I/O port. Input or output can be designated for each bit by means of the port A data direction register (PADDR).
7
*
: An 8-bit I/O port. Input or output can be designated for each bit by means of the port B data direction register (PBDDR).
7
*
: An 8-bit I/O port. Input or output can be designated for each bit by means of the port C data direction register (PCDDR).
7
*
: An 8-bit I/O port. Input or output can be designated for each bit by means of the port D data direction register (PDDDR).
I/O Port E: An 8-bit I/O port. Input or
output can be designated for each bit by means of the port E data direction register (PEDDR).
output can be designated for each bit by means of the port F data direction register (PFDDR).
output can be designated for each bit by means of the port G data direction register (PGDDR).
Rev. 5.00, 12/03, page 23 of 1088
Page 54
Rev. 5.00, 12/03, page 24 of 1088
Page 55

Section 2 CPU

2.1 Overview

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 (4-Gbyte architecturally) linear address space, and is ideal for realtime control.

2.1.1 Features

The H8S/2000 CPU has the following features.
Upward-compatible with H8/300 and H8/300H CPUsCan execute H8/300 and H8/300H object programs
General-register architectureSixteen 16-bit general registers (also usable as sixteen 8-bit registers or eight 32-bit
registers)
Sixty-five basic instructions8/16/32-bit arithmetic and logic instructionsMultiply and divide instructionsPowerful bit-manipulationinstructions
Eight addressing modesRegister direct [Rn]Register indirect [@ERn]Register indirect with displacement [@(d:16,ERn) or @(d:32,ERn)]Register indirect with post-increment or pre-decrement [@ERn+ or @–ERn]Absolute address [@aa:8, @aa:16, @aa:24, or @aa:32]Immediate [#xx:8, #xx:16, or #xx:32]Program-counter relative [@(d:8,PC) or @(d:16,PC)]Memory indirect [@@aa:8]
16-Mbyte address spaceProgram: 16 MbytesData: 16 Mbytes (4 Gbytes architecturally)
Rev. 5.00, 12/03, page 25 of 1088
Page 56
High-speed operationAll frequently-used instructions execute in one or two statesMaximum clock rate : 25 MHz8/16/32-bit register-register add/subtract : 40 ns8 × 8-bit register-register multiply : 480 ns16 ÷ 8-bit register-register divide : 480 ns16 × 16-bit register-register multiply : 800 ns32 ÷ 16-bit register-register divide : 800 ns
CPU operating modeAdvanced mode
Power-down stateTransition to power-down state by SLEEP instructionCPU clock speed selection

2.1.2 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.
Number of execution states The number of exection states of the MULXU and MULXS instructions.
Internal Operation
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
There are also differences in the address space, CCR and EXR functions, power-down state, etc., depending on the product.
Rev. 5.00, 12/03, page 26 of 1088
Page 57

2.1.3 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 registersEight 16-bit expanded registers, and one 8-bit control register, have been added.
Expanded address spaceAdvanced mode supports a maximum 16-Mbyte address space.
Enhanced addressingThe addressing modes have been enhanced to make effective use of the 16-Mb yte address
space.
Enhanced instructionsAddressing modes of bit-manipulation instructions have been enhanced.Signed multiply and divide instructions have been added.Two-bit shift instructions have been added.Instructions for saving and restoring multiple registers have been added.A test and set instruction has been added.
Higher speedBasic instructions execute twice as fast.

2.1.4 Differences from H8/300H CPU

In comparison to the H8/300H CPU, the H8S/2000 CPU has the following enhancements.
Additional control registerOne 8-bit control register has been added.
Enhanced instructionsAddressing modes of bit-manipulation instructions have been enhanced.Two-bit shift instructions have been added.Instructions for saving and restoring multiple registers have been added.A test and set instruction has been added.
Higher speedBasic instructions execute twice as fast.
Rev. 5.00, 12/03, page 27 of 1088
Page 58

2.2 CPU Operating Modes

The H8S/2319 Group and H8S/2318 Group CPUs have advanced operating mode. Advanced mode supports a maximum 16-Mbyte total address space (architecturally a maximum 16-Mbyte program area and a maximum of 4 Gbytes for program and data areas combined). The mode is selected by the mode pins of the microcontroller.
Advanced Mode
Address Space: Linear access is provided to a 16-Mbyte maximum address space (architecturally
a maximum 16-Mbyte program area and a maximum 4-Gbyte data area, with a maximum of 4 Gbytes for program and data areas combined).
Extended Registers (En): The extended registers (E0 to E7) can be used as 16-bit r egisters, or as the upper 16-bit segments of 32-bit registers or address registers.
Instruction Set: All instructions and addressing modes can be used.
Rev. 5.00, 12/03, page 28 of 1088
Page 59
Exception Vector Table and Memory Indirect Branch Addresses: In advanced mode the top area starting at H'00000000 is allocated to the exception vector table in units of 32 bits. In each 32 bits, the upper 8 bits are ignored and a branch address is stored in the lower 24 bits (figure 2-1). For details of the exception vector table, see section 4, Exception Handling.
H'00000000
H'00000003
H'00000004
H'00000007 H'00000008
H'0000000B
H'0000000C
H'00000010
Reserved
Power-on reset exception vector
Reserved
Exception vector table
(Reserved for system use)
Reserved
Exception vector 1
Figure 2-1 Exception Vector Table (Advanced Mode)
The memory indirect addressing mode (@@aa:8) employed in the JMP and JSR instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. In advanced mode the operand is a 32-bit longword operand, providing a 32-bit branch address. The upper 8 bits of these 32 bits are a reserved area that is regarded as H'00. Branch addresses can be stored in the area from H'00000000 to H'000000FF. Note that the first p art of this range is also the exception vector table.
Rev. 5.00, 12/03, page 29 of 1088
Page 60
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-2. When EXR is invalid, it is not pushed onto the stack. For details, see section 4, Exception Handling.
*1
EXR
Reserved
CCR
PC
(24 bits)
*1 *3
SP
SP
Reserved
PC
*2
(SP )
(24 bits)
(a) Subroutine Branch (b) Exception Handling
Notes: 1.
When EXR is not used it is not stored on the stack.
2.
SP when EXR is not used.
3.
Ignored when returning.
Figure 2-2 Stack Structure in Advanced Mode
Rev. 5.00, 12/03, page 30 of 1088
Page 61

2.3 Address Space

Figure 2-3 shows a memory map of the H8S/2000 CPU. The H8S/2000 CPU provides linear access to a maximum 16-Mbyte (4-Gbyte architecturally) address space in advanced mode.
H'00000000
Program area
H'00FFFFFF
H'FFFFFFFF
Data area
Cannot be used by the H8S/2319 and H8S/2318 Groups
Advanced Mode
Figure 2-3 Memory Map
Rev. 5.00, 12/03, page 31 of 1088
Page 62

2.4 Register Configuration

2.4.1 Overview

The CPU has the internal registers shown in figure 2-4. There are two types of registers: general registers and control registers.
General Registers (Rn) and Extended Registers (En)
15 07 07 0
ER0
ER1
ER2
ER3
ER4
ER5
ER6
ER7 (SP)
Control Registers (CR)
E0
E1
E2
E3
E4
E5
E6
E7
23 0
R0H
R1H
R2H
R3H
R4H
R5H
R6H
R7H
PC
R0L
R1L
R2L
R3L
R4L
R5L
R6L
R7L
76543210 T

76543210
IUIHUNZ VCCCR
Legend: SP:
PC: EXR: T: I2 to I0: CCR: I: UI:
Note: * In the H8S/2319 and H8S/2318 Groups, this bit cannot be used as an interrupt mask.
Stack pointer Program counter Extended control register Trace bit Interrupt mask bits Condition-code register Interrupt mask bit User bit or interrupt mask bit*
H: U: N: Z: V: C:
Half-carry flag User bit Negative flag Zero flag Overflow flag Carry flag
Figure 2-4 CPU Registers
Rev. 5.00, 12/03, page 32 of 1088
I2 I1 I0EXR
Page 63

2.4.2 General Registers

The CPU has eight 32-bit general registers. These general registers are all functionally alike and can be used as both address registers and data registers. When a general register is used as a data register, it can be accessed as a 32-bit, 16-bit, or 8-bit register. When the general registers are used as 32-bit registers or address registers, they are designated b y the letters ER (ER0 to ER7).
The ER registers divide into 16-bit general registers designated by the letters E (E0 to E7) and R (R0 to R7). These registers are functionally equivalent, providing a maximum sixteen 16-bit registers. The E registers (E0 to E7) are also referred to as extended registers.
The R registers divide into 8-bit general registers designated by the letters RH (R0H to R7H) and RL (R0L to R7L). These registers are functionally equivalent, providing a maximum sixteen 8-bit registers.
Figure 2-5 illustrates the usage of the general registers. The usage of each re gister can be selected independently.
· Address registers
· 32-bit registers · 16-bit registers · 8-bit registers
E registers (extended registers)
(E0 to E7)
ER registers
(ER0 to ER7)
R registers
(R0 to R7)
RH registers
(R0H to R7H)
RL registers
(R0L to R7L)
Figure 2-5 Usage of General Registers
General register ER7 has the function of stack pointer (SP) in addition to its general-register function, and is used implicitly in exception handling and subroutine calls. Figure 2-6 shows the stack.
Rev. 5.00, 12/03, page 33 of 1088
Page 64
Free area
SP (ER7)
Stack area
Figure 2-6 Stack

2.4.3 Control Registers

The control registers are the 24-bit program counter (PC), 8-bit extended control register (EXR), and 8-bit condition-code register (CCR).
(1) ProgramCounter (PC): This 24-bit counter indicates the address of the next instruction the CPU will execute. The length of all CPU instructions is 2 bytes (one word), so the least significant PC bit is ignored (When an instruction is fetched, the least significant PC bit is regarded as 0).
(2) Extended Control Register (EXR): This 8-bit register contains the trace bit (T) and three interrupt mask bits (I2 to I0).
Bit 7—Trace Bit (T): Selects trace mode. When this bit is cleared to 0, instructions are executed in sequence. When this bit is set to 1, a trace exception is generated each time an instruction is executed.
Bits 6 to 3—Reserved: T hese b its are reserved. They are always read as 1.
Bits 2 to 0—Interrupt Mask Bits (I2 to I0): These bits designate the interrupt mask level (0 to
7). For details, refer to section 5, Interrupt Controller.
Operations can be performed on the EXR bits by the LDC, STC, ANDC, ORC, and XORC instructions. All interrupts, including NMI, are disabled for three states after one of these instructions is executed, except for STC.
(3) Condition-Code Register (CCR): This 8-bit register contains internal CPU status information, including an interrupt mask bit (I) and half-carry (H), ne gative (N), zero (Z), overflow (V), and carry (C) flags.
Rev. 5.00, 12/03, page 34 of 1088
Page 65
Bit 7—Interrupt Mask Bit (I): Masks interrupts other than NMI when set to 1. (NMI is accepted regardless of the I bit setting.) The I bit is set to 1 by hardware at the start of an exception­handling sequence. For details, refer to section 5 , Interrupt Controller.
Bit 6—User Bit or Interrupt Mask Bit (UI): Can be written and read by software using the LDC, STC, ANDC, ORC, and XORC instructions. With the H8S/2319 and H8S/2318 Groups, this bit cannot be used as an interrupt mask bit.
Bit 5—Half-Carry Flag (H): When the ADD.B, ADDX.B, SUB.B, SUBX.B, CMP.B, or NEG.B instruction is executed, this flag is set to 1 if there is a carry or borrow at bit 3, and cleared to 0 otherwise. When the ADD.W, SUB.W, CMP.W, or NEG.W instruction is executed, the H flag is set to 1 if there is a carry or borrow at bit 11, and cleared to 0 otherwise. When the ADD.L, SUB.L, CMP.L, or NEG.L instruction is executed, the H flag is set to 1 if there is a carry or borrow at bit 27, and cleared to 0 otherwise.
Bit 4—User Bit (U): Can be written and read by software using the LDC, STC, ANDC, ORC, and XORC instructions.
Bit 3—Negative Flag (N): Stores the value of the most significant bit (sign bit) of data.
Bit 2—Zero Flag (Z): Set to 1 to indicate zero data, and cleared to 0 to indicate non-zero data.
Bit 1—Overflow Flag (V): Set to 1 when an arithmetic overflow occurs, and cleared to 0 at other
times.
Bit 0—Carry Flag (C): Set to 1 when a carry occurs, and cleared to 0 otherwise. Used by:
Add instructions, to indicate a carry
Subtract instructions, to indicate a borrow
Shift and rotate instructions, to store the value shifted out of the end bit
The carry flag is also used as a bit accumulator b y bit manipulation instructions.
Some instructions leave some or all of the flag bits unchanged. For the action of each instruction on the flag bits, refer to Appendix A.1, Instruction List.
Operations can be performed on the CCR bits by the LDC, STC, ANDC, ORC, and XORC instructions. The N, Z, V, and C flags are used as branching conditions for conditional branch (Bcc) instructions.

2.4.4 Initial Register Values

Reset exception handling loads the CPU's program counter (PC) from the vector table, clears the trace bit in EXR to 0, and sets the interrupt mask bits in CCR and EXR to 1. The other CCR bits and the general registers are not initialized. In particular, the stack pointer (ER7) is not initialized.
Rev. 5.00, 12/03, page 35 of 1088
Page 66
The stack pointer should therefore be initialized by an MOV.L instruction executed immediately after a reset.

2.5 Data Formats

The CPU can process 1-bit, 4-bit (BCD), 8-bit (byte), 16-bit (word), and 32-bit (longword) data. Bit-manipulation instructions operate on 1-bit data by accessing bit n (n = 0, 1, 2, …, 7) of byte operand data. The DAA and DAS decimal-adjust instructions treat byte data as two digits of 4-bit BCD data.

2.5.1 General Register Data Formats

Figure 2-7 shows the data formats in general registers.
Data Type Register Number Data Format
1-bit data
1-bit data
4-bit BCD data
4-bit BCD data
Byte data
Byte data
RnH
RnL
RnH
RnL
RnH
RnL
70
7 6 5 4 3 2 1 0 Don't care
Don't care 76543210
70
70
MSB LSB
43
Don't care
Don't care
Figure 2-7 General Register Data Formats
70
Don't careUpper Lower
Upper
Don't care
43
Lower
LSB
70
70
MSB
Rev. 5.00, 12/03, page 36 of 1088
Page 67
Data Type Register Number Data Format
Word data
Word data
15
MSB LSB
Longword data ERn
31
MSB
Legend:
ERn:
General register ER
En:
General register E
Rn:
General register R
RnH:
General register RH
RnL:
General register RL
MSB:
Most significant bit
LSB:
Least significant bit
Rn
En
16
En Rn
15
MSB LSB
0
15
0
0
LSB
Figure 2-7 General Register Data Formats (cont)
Rev. 5.00, 12/03, page 37 of 1088
Page 68

2.5.2 Memory Data Formats

Figure 2-8 shows the data formats in memory. The CPU can access word data and longword data in memory, but word or longword data must begin at an even address. If an attempt is made to access word or longword data at an odd address, no address error occurs but the least significant bit of the address is regarded as 0, so the access starts at the preceding address. This also applies to instruction fetches.
Data Type Data Format
Address
70
1-bit data
Address L
76543210
Byte data
Word data
Longword data
Address L
Address 2M
Address 2M + 1
Address 2N
Address 2N + 1
Address 2N + 2
Address 2N + 3
MSB LSB
MSB
LSB
MSB
LSB
Figure 2-8 Memory Data Formats
When ER7 is used as an address r egister to access the stack, the operand size should be word size or longword size.
Rev. 5.00, 12/03, page 38 of 1088
Page 69

2.6 Instruction Set

2.6.1 Overview

The H8S/2000 CPU has 65 types of instructions. The instructions are classified by function in table 2-1.
Table 2-1 Instruction Classification
Function Instructions Size Types
Data transfer MOV BWL 5
1
*
POP
,PUSH LDM, STM L MOVFPE, MOVTPE
Arithmetic ADD, SUB, CMP, NEG BWL 19 operations
ADDX, SUBX, DAA, DAS B INC, DEC BWL ADDS, SUBS L MULXU, DIVXU, MULXS, DIVXS BW EXTU, EXTS WL
4
*
TAS
Logic operations AND, OR, XOR, NOT BWL 4 Shift SHAL, SHAR, SHLL, SHLR, ROTL, ROTR, ROTXL, ROTXR BWL 8 Bit manipulation BSET, BCLR, BNOT, BTST, BLD, BILD, BST, BIST, BAND,
BIAND, BOR, BIOR, BXOR, BIXOR
2
Branch Bcc
*
,JMP,BSR,JSR,RTS 5 System control TRAPA, RTE, SLEEP, LDC, STC, ANDC, ORC, XORC, NOP — 9 Block data transfer EEPMOV 1
Legend: B: byte size; W: word size; L: longword size. Notes: 1. POP.W Rn and PUSH.W Rn are identical to MOV.W @SP+, Rn and MOV.W Rn,
@-SP. POP.L ERn and PUSH.L ERn are identical to MOV.L @SP+, ERn and MOV.L ERn, @-SP.
2. Bcc is the general name for conditional branch instructions.
3. Cannot be used in the H8S/2319 and H8S/2318 Groups.
4. Only register ER0, ER1, ER4, or ER5 should be used when using the TAS instruction.
1
*
3
*
WL
B
B
B14
Total 65
Rev. 5.00, 12/03, page 39 of 1088
Page 70

2.6.2 Instructions and Addressing Modes

Table 2-2 indicates the combinations of instructions and addressing modes that the H8S/2600 CPU can use.
Table 2-2 Combinations of Instructions and Addressing Modes
Addressing Modes
Function
Data transfer
Arithmetic operations
Logic operations
Shift
Bit manipulation
Branch
System control
Block data transfer
Legend: Size refers to the operand size. B: Byte W: Word L: Longword Notes: 1. Cannot be used in the H8S/2319 and H8S/2318 Groups.
2. Only register ER0, ER1, ER4, or ER5 should be used when using the TAS instruction.
Instruction
#xx
Rn
@ERn
@(d:16,ERn)
@(d:32,ERn)
@ERn/@ERn+
@aa:8
MOV BWL BWL BWL BWL BWL BWL B BWL BWL
POP, PUSH WL
LDM, STM L
MOVFPE, B MOVTPE
ADD, CMP BWL BWL
SUB WL BWL
ADDX, SUBX B B
ADDS, SUBS L
INC, DEC BWL
DAA, DAS B
MULXU, BW DIVXU
MULXS, BW DIVXS
NEG BWL
EXTU, EXTS WL
TAS
AND, OR, BWL BWL XOR
NOT BWL
BWL
B B B B B
Bcc, BSR
JMP, JSR
RTS
TRAPA
RTE
SLEEP
LDC B B W W W W W W
STC B W W W W W W
ANDC, B ORC, XORC
NOP
BW
1
*
2
*
B
@aa:16
@aa:24
@aa:32
@(d:8,PC)
@(d:16,PC)
@@aa:8
Rev. 5.00, 12/03, page 40 of 1088
Page 71

2.6.3 Table of Instructions Classified by Function

Table 2-3 summarizes the instructions in each functional category. The notation used in table 2-3 is defined below.
Operation Notation
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. 5.00, 12/03, page 41 of 1088
Page 72
Table 2-3 Instructions Classified by Function
1
Type Instruction Size
Data transfer MOV B/W/L (EAs) Rd, Rs → (Ead)
MOVFPE B Cannot be used in the H8S/2357 Series. MOVTPE B Cannot be used in the H8S/2357 Series. POP W/L @SP+ Rn
PUSH W/L Rn @–SP
LDM L @SP+ Rn (register list)
STM L Rn (register list) @–SP
*
Function
Moves data between two general registers or between a general register and memory, or moves immediate data to a general register.
Pops a register from the stack. POP.W Rn is identical to MOV.W @SP+, Rn. POP.L ERn is identical to MOV.L @SP+, ERn.
Pushes a register onto the stack. PUSH.W Rn is identical to MOV.W Rn, @–SP. PUSH.L ERn is identical to MOV.L ERn, @–SP.
Pops two or more general registers from the stack.
Pushes two or more general registers onto the stack.
Rev. 5.00, 12/03, page 42 of 1088
Page 73
Type Instruction Size
Arithmetic operations
ADD SUB
ADDX
B/W/L Rd ± Rs Rd, Rd ± #IMM Rd
BRd±Rs±C→ Rd, Rd ± #IMM ± C → Rd
SUBX
INC
B/W/L Rd ± 1 Rd, Rd ± 2 Rd
DEC
ADDS
LRd±1→ Rd, Rd ± 2 → Rd, Rd ± 4 → Rd
SUBS
DAA
B Rd decimal adjust Rd
DAS
MULXU B/W Rd × Rs Rd
MULXS B/W Rd × Rs Rd
DIVXU B/W Rd ÷ Rs Rd
1
*
Function
Performs addition or subtraction on data in two general registers, or on immediate data and data in a general register. (Immediate byte data cannot be subtracted from byte data in a general register. Use the SUBX or ADD instruction.)
Performs addition or subtraction with carry or borrow on byte data in two general registers, or on immediate data and data in a general register.
Increments or decrements a general register by 1 or 2. (Byte operands can be incremented or decremented by 1 only.)
Adds or subtracts the value 1, 2, or 4 to or from data in a 32-bit register.
Decimal-adjusts an addition or subtraction result in a general register by referring to the CCR to produce 4-bit BCD data.
Performs unsigned multiplication on data in two general registers: either 8 b its × 8bits16 bits or 16 bits × 16 bits 32 bits.
Performs signed multiplication on data in two general registers: either 8 b its × 8bits16 bits or 16 bits × 16 bits 32 bits.
Performs unsigned division on data in two general registers: either 16 bits ÷ 8 bits 8-bit quotient and 8-bit remainder or 32 bits ÷ 16 bits 16-bit quotient and 16­bit remainder.
Rev. 5.00, 12/03, page 43 of 1088
Page 74
Type Instruction Size
Arithmetic
DIVXS B/W Rd ÷ Rs Rd
operations
CMP B/W/L Rd–Rs, Rd–#IMM
NEG B/W/L 0–RdRd
EXTU W/L Rd (zero extension) Rd
EXTS W/L Rd (sign extension) Rd
TAS B @ERd–0,1(<bit7>of@Erd)
1
*
Function
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.
Compares data in a general register with data in another general register or with immediate data, and sets CCR bits according to the result.
Takes the two's c omplement (arithmetic complement) of data in a general register.
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.
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
*
Tests memory contents, and sets the most significant bit (bit 7) to 1.
Rev. 5.00, 12/03, page 44 of 1088
Page 75
Type Instruction Size
Logic
AND B/W/L Rd Rs Rd, Rd #IMM Rd
operations
OR B/W/L Rd Rs Rd, Rd #IMM Rd
XOR B/W/L Rd Rs Rd, Rd #IMM Rd
NOT B/W/L ¬ (Rd) (Rd)
Shift operations
SHAL SHAR
SHLL
B/W/L Rd (shift) Rd
B/W/L Rd (shift) Rd
SHLR
ROTL
B/W/L Rd (rotate) Rd
ROTR
ROTXL
B/W/L Rd (rotate) Rd
ROTXR
1
*
Function
Performs a logical AND operation on a general register and another general register or immediate data.
Performs a logical OR operation on a general register and another general register or immediate data.
Performs a logical exclusive OR operation on a general register and another general register or immediate data.
Takes the one's complement of general register contents.
Performs an arithmetic shift on general register contents. 1-bit or 2-bit shift is possible.
Performs a logical shift on general register contents. 1-bit or 2-bit shift is possible.
Rotates general register contents. 1-bit or 2-bit rotation is possible.
Rotates general register contents through the carry flag. 1-bit or 2-bit rotation is possible.
Rev. 5.00, 12/03, page 45 of 1088
Page 76
Type Instruction Size
Bit-
BSET B 1 (<bit-No.> of <EAd>) manipulation instructions
BCLR B 0 (<bit-No.> of <EAd>)
BNOT B ¬ (<bit-No.> of <EAd>) (<bit-No.> of <EAd>)
BTST B ¬ (<bit-No.> of <EAd>) → Z
BAND
BIAND
BOR
BIOR
B
B
B
B
1
*
Function
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.
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.
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.
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.
C (<bit-No.> of <EAd>) C ANDs the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag.
C ¬(<bit-No.>of<EAd>)→ C ANDs the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. The bit number is specified by 3-bit immediate data.
C (<bit-No.> of <EAd>) C ORs the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag.
C¬(<bit-No.>of<EAd>)→ C ORs the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. The bit number is specified by 3-bit immediate data.
Rev. 5.00, 12/03, page 46 of 1088
Page 77
Type Instruction Size
Bit-
BXOR
B manipulation instructions
BIXOR
BLD
BILD
BST
BIST
B
B
B
B
B
1
*
Function
C (<bit-No.> of <EAd>) C Exclusive-ORs the carry flag with a specified bit in a general register or memory operand and stores the result in the carry flag.
C ¬ (<bit-No.> of <EAd>) C Exclusive-ORs the carry flag with the inverse of a specified bit in a general register or memory operand and stores the result in the carry flag. The bit number is specified by 3-bit immediate data.
(<bit-No.> of <EAd>) → C Transfers a specified bit in a general register or memory operand to the carry flag.
¬(<bit-No.>of<EAd>)→ C Transfers the i nverse of a specified bit in a general register or memory operand to the carry flag. The bit number is specified by 3-bit immediate data.
C (<bit-No.> of <EAd>) Transfers the c arry flag value to a specified bit in a general register or memory operand.
¬C(<bit-No.> of <EAd>) Transfers the i nverse of the c arry flag value to a specified bit in a general register or memory operand. The bit number is specified by 3-bit immediate data.
Rev. 5.00, 12/03, page 47 of 1088
Page 78
Type Instruction Size Function
Branch instructions
Bcc Branches to a specified relative 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 CZ=0 BLS Low or same CZ=1 BCC(BHS) Carry clear
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
C=0
(high or same)
JMP Branches unconditionally to a specified absolute
BSR Branches to a subroutine at a specified relative address. JSR Branches to a subroutine at a specified absolute
RTS Returns from a subroutine.
Rev. 5.00, 12/03, page 48 of 1088
address.
address.
Page 79
1
Type Instruction Size
*
Function
System control TRAPA Starts trap-instruction exception handling. instructions
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 source operand contents or immediate data to CCR or EXR. Although CCR and EXR are 8-bit registers, word-size transfers are performed between them and memory. The upper 8 bits are valid.
STC B/W CCR (EAd), EXR (EAd)
Transfers CCR or EXR contents to a general register or memory. Although CCR and EXR are 8-bit registers, word-size transfers are performed between them and memory. The upper 8 bits are valid.
ANDC B CCR #IMM CCR, EXR #IMM EXR
Logically ANDs the CCR or EXR contents with immediate data.
ORC B CCR#IMM CCR, EXR#IMM EXR
Logically ORs the CCR or EXR contents with immediate data.
XORC B CCR #IMM CCR, EXR #IMM EXR
Logically exclusive-ORs the CCR or EXR contents with immediate data.
NOP PC + 2 PC
Only increments the program counter.
Rev. 5.00, 12/03, page 49 of 1088
Page 80
Type Instruction Size Function
Block data transfer instruction
Notes: 1. Size refers to the operand size.
2. Only register ER0, ER1, ER4, or ER5 should be used when using the TAS instruction.
EEPMOV.B
EEPMOV.W——
B: Byte W: Word L: Longword
if R4L 0then
Repeat @ER5+ @ER6+ Until R4L = 0
else next; if R4 0 then
Repeat @ER5+ @ER6+ Until R4 = 0
else next; Transfers a data block according to parameters set in
general registers R4L or R4, ER5, and ER6. R4L or R4: size of block (bytes)
ER5: startingsource address ER6: startingdestination address
Execution of the next instruction begins as soon as the transfer is completed.
R4L–1 R4L
R4–1 R4
Rev. 5.00, 12/03, page 50 of 1088
Page 81

2.6.4 Basic Instruction Formats

The CPU instructions consist of 2-byte (1-word) units. An instruction consists of an operation field (op field), a register field (r field), an effective address extension (EA field), and a condition field (cc).
Figure 2-9 shows examples o f instruction formats.
(1) Operation field only
op
(2) Operation field and register fields
op
(3) Operation field, register fields, and effective address extension
op
EA (disp)
(4) Operation field, effective address extension, and condition field
op cc EA (disp) BRA d:16, etc
rn
rn rm
rm
NOP, RTS, etc.
ADD.B Rn, Rm, etc.
MOV.B @(d:16, Rn), Rm, etc.
Figure 2-9 Instruction Formats (Examples)
(1) Operation Field: Indicates the function of the instruction, the addressing mode, and the
operation to be carried out on the operand. The operation field always includes the first four bits of the instruction. Some instructions have two operation fields.
(2) Register Field: Specifies a general register. Address registers are specified by 3 bits, data registers by 3 bits or 4 bits. Some instructions have two register fields. Some have no register field.
(3) Effective Address Extension: Eight, 16, or 32 bits specifying immediate data, an absolute address, or a displacement.
(4) Condition Field: Specifies the branching condition of Bcc instructions.
Rev. 5.00, 12/03, page 51 of 1088
Page 82

2.7 Addressing Modes and Effective Address Calculation

2.7.1 Addressing Mode

The CPU supports the eight addressing modes listed in table 2-4. Each instruction uses a subset of these addressing modes. Arithmetic and logic instructions can use the register direct and immediate modes. Data transfer instructions can use all addressing modes except program-counter relative and memory indirect. Bit manipulation instructions use register direct, register indirect, or absolute addressing mode to specify an operand, and register direct (BSET, BCLR, BNOT, and BTST instructions) or immediate (3-bit) addressing mode to specify a bit number in the operand.
Table 2-4 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
(1) Register Direct—Rn: The register field of the instruction specifies an 8-, 16-, or 32-bit general register containing the operand. R0H to R7H and R0L to R7L can be specified as 8-bit registers. R0 to R7 and E0 to E7 can be specified as 16-bit r egisters. ER0 to ER7 can be specified as 32-bit registers.
(2) Register Indirect—@ERn: The register field of the instruction code specifies an address register (ERn) which contains the address of the operand on memory. If the address is a program instruction address, the lower 24 bits are valid and the upper 8 bits are all assumed to be 0 (H'00).
(3) Register Indirect w ith Displacement—@(d:16, ERn) or @(d:32, ERn): A 16-bit or 32-bit displacement contained in the instruction is added to an address register (ERn) specified by the register field o f the instruction, and the sum gives the address of a memory operand. A 16-bit displacement is sign-extended when added.
Rev. 5.00, 12/03, page 52 of 1088
Page 83
(4) Register Indirect with Post-Increment or Pre-Decrement—@ERn+ or @-ERn:
Register indirect with post-increment—@ERn+
The register field of the instruction code specifies an address register (ERn) which contains the address of a memory operand. After the operand is accessed, 1, 2, or 4 is added to the address register contents and the sum is stored in the address register. The value added is 1 for byte access, 2 for word transfer instruction, or 4 for longword transfer instruction. For word or longword transfer instruction, the register value should be even.
Register indirect with pre-decrement—@-ERn
The value 1, 2, or 4 is subtracted from an address register (ERn) specified by the register field in the instruction code, and the result becomes the address of a memory operand. The result is also stored in the address register. T he value subtracted is 1 for byte access, 2 for word transfer instruction, or 4 for longword transfer instruction. For word or longword transfer instruction, the register value should be even.
(5) Absolute Address—@aa:8, @aa:16, @aa:24, or @aa:32: The instruction code contains the absolute address of a memory operand. The absolute address may be 8 bits long (@aa:8), 16 bits long (@aa:16), 24 bits long (@aa:24), or 32 bits long (@aa:32).
To access data, the absolute address should be 8 bits (@aa:8), 16 bits (@aa:16), or 32 bits (@aa:32) long. For an 8-bit absolute address, the upper 24 bits are all assumed to be 1 (H'FFFF). For a 16-bit absolute address the upper 16 bits are a sign extension. A 32-bit absolute address can access the entire address space.
A 24-bit absolute address (@aa:24) indicates the address of a program instruction. The upper 8 bits are all assumed to be 0 (H'00).
Table 2-5 indicates the accessible absolute address ranges.
Table 2-5 Absolute Address Access Ranges
Absolute Address Advanced Mode
Data address 8 bits (@aa:8) H'FFFF00 to H'FFFFFF
16 bits (@aa:16) H'000000to H'007FFF,
H'FF8000 to H'FFFFFF
32 bits (@aa:32) H'000000to H'FFFFFF
Program instruction address 24 bits (@aa:24)
Rev. 5.00, 12/03, page 53 of 1088
Page 84
(6) Immediate—#xx:8, #xx:16, or #xx:32: The instruction contains 8-bit (#xx:8), 16-bit (#xx:16), or 32-bit (#xx:32) immediate data as an operand.
The ADDS, SUBS, INC, and DEC instructions contain immediate data implicitly. Some bit manipulation instructions contain 3-bit immediate data in the instruction code, specifying a bit number. The TRAPA instruction contains 2-bit immediate data in its instruction code, specifying a vector address.
(7) Program-Counter Relative—@(d:8, PC) or @(d:16, PC): This mode is used in the Bcc and BSR instructions. An 8-bit or 16-bit displacement contained in the instruction is sign-extended and added to the 24-bit PC contents to generate a branch address. Only the lower 24 bits of this branch address are valid; the upper 8 bits are all assumed to be 0 (H'00). The PC value to which the displacement is added is the address of the first byte of the next instruction, so the possible branching range is –126 to +128 bytes (–63 to +64 words) or –32766 to +32768 bytes (–16383 to +16384 words) from the branch instruction. The resulting value should be an even number.
(8) Memory Indirect—@@aa:8: This mode can be used by the JMP and JSR instructions. The instruction code contains an 8-bit absolute address specifying a memory operand. This memory operand contains a b ranch address. The upper bits of the absolute address are all assumed to be 0, so the address range is 0 to 255 (H'000000 to H'0000FF).
In advanced mode the memory operand is a longword operand, the first byte of which is assumed to be all 0 (H'00).
Note that the first part of the address range is also the exception vector area. For further details, refer to section 4, Exception Handling.
Specified by @aa:8
Reserved
Branch address
Advanced Mode
Figure 2-10 Branch Address Specification in Memory Indirect Mode
Rev. 5.00, 12/03, page 54 of 1088
Page 85
If an odd address is specified in word or longword memory access, or as a branch address, the least significant bit is regarded as 0, causing data to be accessed or instruction code to be fetched at the address preceding the specified address (For further information, see section 2.5.2, Memory Data Formats).

2.7.2 Effective Address Calculation

Table 2-6 indicates how effective addresses are calculated in each addressing mode.
Rev. 5.00, 12/03, page 55 of 1088
Page 86
Table 2-6 Effective Address Calculation
24 23
Effective Address (EA)
Don't care
Operand is general register contents.
Effective Address Calculation
31 0
General register contents
31 0
24 23
Don't care
31 0
disp
General register contents
Sign extension
31 0
31 0
disp
24 23
Don't care
31 0
1, 2, or 4
General register contents
31 0
24 23
Don't care
31 0
1, 2, or 4
General register contents
31 0
Operand Size Value added
124
Byte
Word
Longword
rop
op rm rn
Register indirect (@ERn)2
1 Register direct (Rn)
No. Addressing Mode and Instruction Format
Register indirect with displacement
3
Rev. 5.00, 12/03, page 56 of 1088
op r
@(d:16, ERn) or @(d:32, ERn)
r
op
Register indirect with post-increment or
pre-decrement
· Register indirect with post-increment @ERn+
4
· Register indirect with pre-decrement @ERn
r
op
Page 87
H'FFFF
Effective Address (EA)
24 23
16 15
Sign extension
24 23
24 23
24 23
Don't care
31 08 7
Effective Address Calculation
op abs
@aa:8
Absolute address
31 0
@aa:16
Don't care
abs
op
Don't care
31 0
@aa:24
abs
op
op
@aa:32
31 0
Don't care
abs
Operand is immediate data.
IMM
op
Immediate #xx:8/#xx:16/#xx:32
5
No. Addressing Mode and Instruction Format
6
Rev. 5.00, 12/03, page 57 of 1088
Page 88
Effective Address (EA)
24 23
24 23
Don't care
31 0
0
PC contents
23
Effective Address Calculation
0
23
disp
disp
Sign
extension
0
31 8 7
abs
H'000000
31
Don't care
31 0
0
Memory contents
op
Program-counter relative
@(d:8, PC)/@(d:16, PC)8Memory indirect @@aa:8
7
No. Addressing Mode and Instruction Format
Rev. 5.00, 12/03, page 58 of 1088
op abs
· Advanced mode
Page 89

2.8 Processing States

2.8.1 Overview

The CPU has five main processing states: the reset state, exception handling state, program execution state, bus-released state, and power-down state. Figure 2-11 shows a diagram of the processing states. Figure 2-12 indicates the sta te transitions.
Reset state
The CPU and all on-chip supporting modules have been initialized and are stopped.
Exception-handling
state
A transient state in which the CPU changes the normal processing flow in response to a reset, interrupt, or trap instruction.
Processing
states
Note: *The power-down state also includes a medium-speed mode, module stop mode etc.
Program execution
state
The CPU executes program instructions in sequence.
Bus-released state
The external bus has been released in response to a bus request signal from a bus master other than the CPU.
Sleep mode
Power-down state
CPU operation is stopped to conserve power.*
Software standby
mode
Hardware standby
mode
Figure 2-11 Processing States
Rev. 5.00, 12/03, page 59 of 1088
Page 90
End of bus request
Bus-released state
End of exception handling
Exception-handling state
RES = high
End of bus request
Program execution
Bus request
Request for exception handling
External interrupt
Bus request
state
Interrupt request
SLEEP instruction with SSBY = 1
SLEEP instruction with SSBY = 0
Sleep mode
Software standby mode
Reset state
Notes: 1.2.From any state except hardware standby mode, a transition to the reset state occurs whenever
goes low. A transition can also be made to the reset state when the watchdog timer overflows. From any state, a transition to hardware standby mode occurs when
*1
STBY = high, RES = low
Hardware standby mode
Power-down state
STBY
goes low.
*2
RES
Figure 2-12 State Transitions

2.8.2 Reset State

When the RES input goes low all current processing stops and the CPU enters the reset state. All interrupts are masked in the reset state. Reset exception handling starts when the RES signal changes from low to high.
The reset state can also be entered by a watchdog timer overflow. For details, refer to section 11, Watchdog Timer.
Rev. 5.00, 12/03, page 60 of 1088
Page 91

2.8.3 Exception-Handling State

The exception-handling state is a transient state that occurs when the CPU alters the normal processing flow due to a reset, interrupt, or trap instruction. The CPU fetches a start address (vector) from the exception vector table and branches to that address.
(1) Types of Exception Handling and Their Priority
Exception handling is performed for traces, resets, interrupts, and trap instructions. Table 2-7 indicates the types of exception handling and their priority. Trap instruction exception handling is always accepted, in the program execution state.
Exception handling and the stack structure depend on the interrupt control mode set in SYSCR.
Table 2 -7 Exception Handling Types and Priority
Priority Type of Exception Detection Timing Start of Exception Handling
High Reset Synchronized with clock Exception handling starts
immediately after a low-to-high transition at the RES pin, or when the watchdog timer overflows.
Trace End of instruction
execution or end of exception-handling sequence
Interrupt End of instruction
execution or end of exception-handling sequence
Trap instruction When TRAPA instruction
is executed
Low Notes: 1. Traces are enabled only in interrupt control mode 2. Trace exception-handling is not
executed at the end of the RTE instruction.
2. Interrupts are not detected at the end of the ANDC, ORC, XORC, and LDC instructions, or immediately after reset exception handling.
3. Trap instruction exception handling is always accepted, in the program execution state.
1
*
2
*
When the trace (T) bit is set to 1, the trace starts at the end of the current instruction or current exception-handling sequence.
When an interrupt is requested, exception handling starts at the end of the current instruction or current exception-handling sequence.
Exception handling starts when a trap (TRAPA) instruction is executed
3
*
.
Rev. 5.00, 12/03, page 61 of 1088
Page 92
(2) Reset Exception Handling
After the RES pin has gone low and the reset sta te has been entered, when RES goes high again, reset exception handling starts. When reset exception handling starts the CPU fetches a start address (vector) from the exception vector table and starts program execution from that address. All interrupts, including NMI, are disabled during reset exception handling and after it ends.
(3) Traces
Traces are enabled only in interrupt control mode 2. Trace mode is entered when the T bit of EXR is set to 1. When trace mode is established, trace exception handling starts at the end of each instruction.
At the end of a trace exception-handling sequence, the T bit of E XR is cleared to 0 and trace mode is cleared. Interrupt masks are not affected.
The T bit saved on the stack retains its value of 1, and when the RTE instruction is executed to return from the trace exception-handling routine, trace mode is entered again. Trace exception­handling is not executed at the end of the RTE instruction.
Trace mode is not entered in interrupt control mode 0, regardless of the state of the T bit.
(4) Interrupt Exception Handling and Trap Instruction Exception Handling
When interrupt or trap-instruction exception handling begins, the CPU references the stack pointer (ER7) and pushes the program counter and other control registers onto the stack. Next, the CPU alters the settings of the interrupt mask bits in the control registers. Then the CPU fetches a start address (vector) from the exception vector table and program execution starts from that start address.
Figure 2-13 shows the stack after exception handling ends.
Rev. 5.00, 12/03, page 62 of 1088
Page 93
A
dvanced mode
SP
SP
(c) Interrupt control mode 0 (d) Interrupt control mode 2
Note: * Ignored when returning.
CCR
PC
(24 bits)
EXR
Reserved*
CCR
PC
(24 bits)
Figure 2-13 Stack Structure after Exception Handling (Examples)

2.8.4 Program Execution State

In this state the CPU executes program instructions in sequence.

2.8.5 Bus-Released State

This is a state in which the bus has been released in response to a bus request from a bus master other than the CPU. While the bus is released, the CPU halts.
There is one other bus master in addition to the CPU: the data transfer controller (DTC).
For further details, refer to section 6, Bus Controller.

2.8.6 Power-Down State

The power-down state includes both modes in which the CPU stops operating and modes in which the CPU does not stop. There are three modes in which the CPU stops operating: sleep mode, software standby mode, and hardware standby mode. There are also two other power-down modes: medium-speed mode, and module stop mode. In medium-speed mode the CPU and other bus masters operate on a medium-speed clock. Module stop mode permits halting of the operation of individual modules, other than the CPU. For details, refer to section 19, Power-Down Modes.
Rev. 5.00, 12/03, page 63 of 1088
Page 94
(1) Sleep Mode: A transition to sleep mode is made if the SLEEP instruction is executed while the software standby bit (SSBY) in the standby control register (SBYCR) is cleared to 0. In sleep mode, CPU operations stop immediately after execution of the SLEEP instruction. The contents of CPU registers are retained.
(2) Software Standby Mode: A transition to software standby mode is made if the SLEEP instruction is executed while the SSBY bit in SBYCR is set to 1. In software standby mode, the CPU and clock halt and all MCU operations stop. As long as a specified voltage is supplied, the contents of CPU registers and on-chip RAM are retained. The I/O ports also remain in their existing states.
(3) Hardware Standby Mode: A transition to hardware standby mode is made when the STBY pin goes low. In hardware standby mode, the CPU and clock halt and all MCU operations stop. The on-chip supporting modules are reset, but as long as a specified voltage is supplied, on-chip RAM contents are retained.

2.9 Basic Timing

2.9.1 Overview

The CPU is driven by a system clock, denoted by the symbol φ. The period from one rising edge of φ to the next is referred to as a "state." The memory cycle or bus cycle consists of one, two, or three states. Different methods are used to access o n-chip memory, on-chip supporting modules, and the external address space.

2.9.2 On-Chip Memory (ROM, RAM)

On-chip memory is accessed in one state. The data bus is 16 bits wide, permitting both byte and word transfer instruction. Figure 2-14 shows the on-chip memory acce ss cycle. Figure 2-15 shows the pin states.
Rev. 5.00, 12/03, page 64 of 1088
Page 95
Bus cycle
A
T
1
φ
Internal address bus
Read
Internal read signal
access
Internal data bus
Internal write signal
Write access
Internal data bus
Figure 2-14 On-Chip Memory Access Cycle
φ
ddress bus
AS
Bus cycle
T
1
Unchanged
High
Address
Read data
Write data
RD
HWR, LWR
Data bus
High-impedance state
High
High
Figure 2-15 Pin States during On-Chip Memory Access
Rev. 5.00, 12/03, page 65 of 1088
Page 96

2.9.3 On-Chip Supporting Module Access Timing

The on-chip supporting modules are accessed in two states. The data bus is either 8 bits or 16 bits wide, depending on the particular internal I/O register being accessed. Figure 2-16 shows the access timing for the on-chip supporting modules. Figure 2-17 shows the pin states.
Bus cycle
φ
Internal address bus
Internal read signal
Read access
Internal data bus
Internal write signal
Write access
Internal data bus
Figure 2-16 On-Chip Supporting Module Access Cycle
T
1
Address
Write data
T
2
Read data
Rev. 5.00, 12/03, page 66 of 1088
Page 97
Bus cycle
A
T
1
φ
ddress bus
AS
RD
HWR, LWR
Data bus
High-impedance state
Figure 2-17 Pin States during On-Chip Supporting Module Access

2.9.4 External Address Space Access Timing

Unchanged
High
High
High
T
2
The external address space is accessed with an 8-bit or 16-bit data bus width in a two-state or three-state bus cycle. In three-state access, wait states can be inserted. For further details, refer to section 6, Bus Controller.

2.10 Usage Note

2.10.1 TAS Instruction

Only register ER0, ER1, ER4, or ER5 should be used when using the TAS instruction. The TAS instruction is not generated by the Renesas H8S and H8/300 Series C/C++ compilers. If the TAS instruction is used as a user-defined intrinsic function, ensure that only register ER0, ER1, ER4, or ER5 is used.
Rev. 5.00, 12/03, page 67 of 1088
Page 98
Rev. 5.00, 12/03, page 68 of 1088
Page 99

Section 3 MCU Operating Modes

3.1 Overview

3.1.1 Operating Mode Selection (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT)

The H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT have eight operating modes ( modes 4 to 7, 10, 11, 14 and 15). These modes are determined by the mode pin (MD2 to MD0) and flash write enable pin (FWE) settings. The CPU operating mode and initial bus width can b e selected as shown in table 3-1.
Table 3-1 lists the MCU operating modes.
Table 3-1 MCU Operating Mode Selection (H8S/2318 F-ZTAT, H8S/2317 F-ZTAT,
H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT)
External Data
MCU CPU Operating Mode FWE MD2 MD1 MD0
*
1
*
2
*
3 4 100AdvancedExpanded mode with Disabled 16 bits 16 bits 51 6 1 0 Expanded mode with
7 1 Single-chip mode
*
8
*
9 10 1 0 Advanced Boot mode Enabled 8 bits 16 bits 11 1
*
12
*
13 14 1 0 Advanced User program mode Enabled 8 bits 16 bits 15 1 — Note: * Cannot be used in this LSI.
0001— — — —
10
1000— — — —
100— — — —
Operating Mode Description
1
1
1
On-Chip ROM
on-chip ROM disabled
Enabled 8 b its 16 bits
on-chip ROM enabled
Bus
Initial Value
8bits 16bits
Max. Value
Rev. 5.00, 12/03, page 69 of 1088
Page 100
The CPU's architecture allows for 4 Gbytes of address space, but the H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT actually access a maximum of 16 Mbytes.
Modes 4 to 6 are externally expanded modes that allow access to external memory and peripheral devices.
The external expansion modes allow switching between 8-bit and 16-bit bus modes. After program execution s tarts, an 8-bit or 16-bit address space can be set for each area, depending on the bus controller setting. If 16-bit access is selected for any one area, 16-bit bus mode is set; if 8­bit access is selected for all areas, 8-bit bus mode is set. Note that the functions of each pin depend on the operating mode.
Modes 10, 11, 14, and 15 are boot modes and user program modes in which the flash memory can be programmed and erased. For details, see section 17, ROM.
The H8S/2318 F-ZTAT, H8S/2317 F-ZTAT, H8S/2315 F-ZTAT, and H8S/2314 F-ZTAT can only be used in modes 4 to 7, 10, 11, 14, and 15. This means that the flash write enable pin and mode pins must be set to select one of these modes.
Do not change the inputs at the mode pins during operation.

3.1.2 Operating Mode Selection (Mask ROM, ROMless, H8S/2319 F-ZTAT, and H8S/2319C F-ZTAT)

The ROMless and mask ROM versions have four operating modes (modes 4 to 7). T he H8S/2319 F-ZTAT has six operating modes (modes 2 to 7). The H8S/2319C F-ZTAT has seven operating mode (modes 1 to 7). The operating mode is determined by the mode pins (MD2 to MD0). The CPU operating mode, enabling or disabling of on-chip ROM, and the initial bus width setting can be selected as shown in table 3-2.
Table 3-2 lists the MCU operating modes.
Rev. 5.00, 12/03, page 70 of 1088
Loading...