Hitachi Single-Chip Microcomputer
H8/3039 Series
H8/3039, H8/3038
H8/3037, H8/3036
TM
H8/3039 F-ZTAT
Hardware Manual
ADE-602-131A
Rev. 2.0
3/5/99
Hitachi,Ltd
Notice
When using this document, keep the following in mind:
1. This document may, wholly or partially, be subject to change without notice.
2. All rights are reserved: No one is permitted to reproduce or duplicate, in any form, the
whole or part of this document without Hitachi’s permission.
3. Hitachi will not be held responsible for any damage to the user that may result from
accidents or any other reasons during operation of the user’s unit according to this document.
4. Circuitry and other examples described herein are meant merely to indicate the
characteristics and performance of Hitachi’s semiconductor products. Hitachi assumes no
responsibility for any intellectual property claims or other problems that may result from
applications based on the examples described herein.
5. No license is granted by implication or otherwise under any patents or other rights of any
third party or Hitachi, Ltd.
6. MEDICAL APPLICATIONS: Hitachi’s products are not authorized for use in MEDICAL
APPLICATIONS without the written consent of the appropriate officer of Hitachi’s sales
company. Such use includes, but is not limited to, use in life support systems. Buyers of
Hitachi’s products are requested to notify the relevant Hitachi sales offices when planning to
use the products in MEDICAL APPLICATIONS.
Contents
Contents ..... .....................................................................................................i
Preface ....... .....................................................................................................1
Section 1 Overview ........................................................................................3
1.1 Overview ........................................................................................................................ 3
1.2 Block Diagram................................................................................................................ 7
1.3 Pin Description ............................................................................................................... 8
1.3.1 Pin Arrangement................................................................................................ 8
1.3.2 Pin Functions ..................................................................................................... 9
1.4 Pin Functions .................................................................................................................. 13
Section 2 CPU................................................................................................17
2.1 Overview ........................................................................................................................ 17
2.1.1 Features ............................................................................................................. 17
2.1.2 Differences from H8/300 CPU ........................................................................... 18
2.2 CPU Operating Modes .................................................................................................... 18
2.3 Address Space................................................................................................................. 19
2.4 Register Configuration .................................................................................................... 20
2.4.1 Overview ........................................................................................................... 20
2.4.2 General Registers............................................................................................... 21
2.4.3 Control Registers ............................................................................................... 22
2.4.4 Initial CPU Register Values ............................................................................... 23
2.5 Data Formats................................................................................................................... 23
2.5.1 General Register Data Formats .......................................................................... 24
2.5.2 Memory Data Formats ....................................................................................... 25
2.6 Instruction Set................................................................................................................. 27
2.6.1 Instruction Set Overview.................................................................................... 27
2.6.2 Instructions and Addressing Modes.................................................................... 28
2.6.3 Tables of Instructions Classified by Function..................................................... 30
2.6.4 Basic Instruction Formats .................................................................................. 39
2.6.5 Notes on Use of Bit Manipulation Instructions................................................... 40
2.7 Addressing Modes and Effective Address Calculation..................................................... 41
2.7.1 Addressing Modes ............................................................................................. 41
2.7.2 Effective Address Calculation............................................................................ 45
2.8 Processing States............................................................................................................. 48
2.8.1 Overview ........................................................................................................... 48
2.8.2 Program Execution State.................................................................................... 48
2.8.3 Exception-Handling State .................................................................................. 48
i
2.8.4 Exception-Handling Sequences.......................................................................... 50
2.8.5 Reset State......................................................................................................... 51
2.8.6 Power-Down State ............................................................................................. 52
2.9 Basic Operational Timing ............................................................................................... 53
2.9.1 Overview ........................................................................................................... 53
2.9.2 On-Chip Memory Access Timing ...................................................................... 53
2.9.3 On-Chip Supporting Module Access Timing...................................................... 54
2.9.4 Access to External Address Space...................................................................... 55
Section 3 MCU Operating Modes .................................................................. 57
3.1 Overview ........................................................................................................................ 57
3.1.1 Operating Mode Selection ................................................................................. 57
3.1.2 Register Configuration....................................................................................... 58
3.2 Mode Control Register (MDCR) ..................................................................................... 58
3.3 System Control Register (SYSCR).................................................................................. 59
3.4 Operating Mode Descriptions.......................................................................................... 61
3.4.1 Mode 1 .............................................................................................................. 61
3.4.2 Mode 3 .............................................................................................................. 61
3.4.3 Mode 5 .............................................................................................................. 61
3.4.4 Mode 6 .............................................................................................................. 61
3.4.5 Mode 7 .............................................................................................................. 61
3.5 Pin Functions in Each Operating Mode ........................................................................... 62
3.6 Memory Map in Each Operating Mode ........................................................................... 62
3.7 Restrictions on Use of Mode 6 ....................................................................................... 71
Section 4 Exception Handling ........................................................................ 73
4.1 Overview ........................................................................................................................ 73
4.1.1 Exception Handling Types and Priority.............................................................. 73
4.1.2 Exception Handling Operation........................................................................... 73
4.1.3 Exception Vector Table ..................................................................................... 74
4.2 Reset............................................................................................................................... 75
4.2.1 Overview ........................................................................................................... 75
4.2.2 Reset Sequence.................................................................................................. 75
4.2.3 Interrupts after Reset.......................................................................................... 77
4.3 Interrupts ........................................................................................................................ 77
4.4 Trap Instruction .............................................................................................................. 78
4.5 Stack Status after Exception Handling ............................................................................ 78
4.6 Notes on Stack Usage ..................................................................................................... 79
ii
Section 5 Interrupt Controller.........................................................................81
5.1 Overview ........................................................................................................................ 81
5.1.1 Features ............................................................................................................. 81
5.1.2 Block Diagram................................................................................................... 82
5.1.3 Pin Configuration............................................................................................... 83
5.1.4 Register Configuration....................................................................................... 83
5.2 Register Descriptions ...................................................................................................... 84
5.2.1 System Control Register (SYSCR)..................................................................... 84
5.2.2 Interrupt Priority Registers A and B (IPRA, IPRB) ............................................ 85
5.2.3 IRQ Status Register (ISR) .................................................................................. 90
5.2.4 IRQ Enable Register (IER) ................................................................................ 91
5.2.5 IRQ Sense Control Register (ISCR) ................................................................... 92
5.3 Interrupt Sources............................................................................................................. 93
5.3.1 External Interrupts ............................................................................................. 93
5.3.2 Internal Interrupts .............................................................................................. 94
5.3.3 Interrupt Vector Table ....................................................................................... 95
5.4 Interrupt Operation.......................................................................................................... 97
5.4.1 Interrupt Handling Process................................................................................. 97
5.4.2 Interrupt Sequence ............................................................................................. 102
5.4.3 Interrupt Response Time.................................................................................... 103
5.5 Usage Notes.................................................................................................................... 104
5.5.1 Contention between Interrupt and Interrupt-Disabling Instruction ...................... 104
5.5.2 Instructions that Inhibit Interrupts ...................................................................... 105
5.5.3 Interrupts during EEPMOV Instruction Execution ............................................. 105
5.5.4 Usage Notes....................................................................................................... 105
Section 6 Bus Controller ................................................................................109
6.1 Overview ........................................................................................................................ 109
6.1.1 Features ............................................................................................................. 109
6.1.2 Block Diagram................................................................................................... 110
6.1.3 Input/Output Pins............................................................................................... 110
6.1.4 Register Configuration....................................................................................... 111
6.2 Register Descriptions ...................................................................................................... 111
6.2.1 Access State Control Register (ASTCR) ............................................................ 111
6.2.2 Wait Control Register (WCR)............................................................................ 112
6.2.3 Wait State Controller Enable Register (WCER) ................................................. 113
6.2.4 Address Control Register (ADRCR)................................................................... 114
6.3 Operation ........................................................................................................................ 116
6.3.1 Area Division..................................................................................................... 116
6.3.2 Bus Control Signal Timing ................................................................................ 117
6.3.3 Wait Modes ....................................................................................................... 119
6.3.4 Interconnections with Memory (Example) ......................................................... 125
iii