Hitachi Single-Chip Microcomputer
H8/3217 Series
H8/3217, H8/3216
H8/3214, H8/3212
H8/3202
Hardware Manual
8/12/97
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
Preface ....... .....................................................................................................1
Section 1 Overview ........................................................................................3
1.1 Overview ......................................................................................................................... 3
1.2 Block Diagram................................................................................................................. 8
1.3 Pin Assignments and Functions........................................................................................ 9
1.3.1 Pin Arrangement................................................................................................. 9
1.3.2 Pin Functions ...................................................................................................... 13
Section 2 CPU................................................................................................27
2.1 Overview ......................................................................................................................... 27
2.1.1 Features .............................................................................................................. 27
2.1.2 Address Space..................................................................................................... 28
2.1.3 Register Configuration........................................................................................ 28
2.2 Register Descriptions ....................................................................................................... 29
2.2.1 General Registers................................................................................................ 29
2.2.2 Control Registers ................................................................................................ 29
2.2.3 Initial Register Values ........................................................................................ 30
2.3 Data Formats.................................................................................................................... 31
2.3.1 Data Formats in General Registers...................................................................... 32
2.3.2 Memory Data Formats ........................................................................................ 33
2.4 Addressing Modes............................................................................................................ 34
2.4.1 Addressing Modes .............................................................................................. 34
2.4.2 Effective Address Calculation............................................................................. 35
2.5 Instruction Set.................................................................................................................. 39
2.5.1 Data Transfer Instructions................................................................................... 41
2.5.2 Arithmetic Operations......................................................................................... 43
2.5.3 Logic Operations ................................................................................................ 44
2.5.4 Shift Operations.................................................................................................. 44
2.5.5 Bit Manipulations ............................................................................................... 46
2.5.6 Branching Instructions ........................................................................................ 51
2.5.7 System Control Instructions ................................................................................ 53
2.5.8 Block Data Transfer Instruction .......................................................................... 54
2.6 CPU States....................................................................................................................... 56
2.6.1 Program Execution State..................................................................................... 57
2.6.2 Exception-Handling State ................................................................................... 58
2.6.3 Power-Down State .............................................................................................. 58
i
2.7 Access Timing and Bus Cycle.......................................................................................... 59
2.7.1 Access to On-Chip Memory (RAM and ROM) ................................................... 59
2.7.2 Access to On-Chip Register Field and External Devices ..................................... 62
Section 3 MCU Operating Modes and Address Space .................................... 67
3.1 Overview ......................................................................................................................... 67
3.1.1 Operating Modes ................................................................................................ 67
3.1.2 Mode and System Control Registers ................................................................. 67
3.2 System Control Register (SYSCR)................................................................................... 68
3.3 Mode Control Register (MDCR) ...................................................................................... 70
3.4 Mode Descriptions ........................................................................................................... 70
3.5 Address Space Maps for Each Operating Mode................................................................ 71
Section 4 Exception Handling ........................................................................ 77
4.1 Overview ......................................................................................................................... 77
4.2 Reset................................................................................................................................ 77
4.2.1 Overview ............................................................................................................ 77
4.2.2 Reset Sequence................................................................................................... 78
4.2.3 Disabling of Interrupts after Reset ...................................................................... 81
4.3 Interrupts ......................................................................................................................... 81
4.3.1 Overview ............................................................................................................ 81
4.3.2 Interrupt-Related Registers ................................................................................. 83
4.3.3 External Interrupts .............................................................................................. 86
4.3.4 Internal Interrupts ............................................................................................... 87
4.3.5 Interrupt Handling .............................................................................................. 87
4.3.6 Interrupt Response Time..................................................................................... 93
4.3.7 Precaution........................................................................................................... 93
4.4 Note on Stack Handling ................................................................................................... 94
4.5 Notes on the Use of Key-Sense Interrupts ........................................................................ 95
Section 5 Wait-State Controller...................................................................... 97
5.1 Overview ......................................................................................................................... 97
5.1.1 Features .............................................................................................................. 97
5.1.2 Block Diagram ................................................................................................... 98
5.1.3 Input/Output Pins................................................................................................ 98
5.1.4 Register Configuration........................................................................................ 99
5.2 Register Description......................................................................................................... 99
5.2.1 Wait-State Control Register (WSCR).................................................................. 99
5.3 Wait Modes ..................................................................................................................... 100
Section 6 Clock Pulse Generator .................................................................... 103
6.1 Overview ......................................................................................................................... 103
6.1.1 Block Diagram ................................................................................................... 103
ii
6.1.2 Wait-State Control Register (WSCR).................................................................. 104
6.2 Oscillator Circuit ............................................................................................................. 105
6.3 Duty Adjustment Circuit .................................................................................................. 111
6.4 Prescaler .......................................................................................................................... 111
Section 7 I/O Ports .........................................................................................113
7.1 Overview ......................................................................................................................... 113
7.2 Port 1 ............................................................................................................................... 120
7.2.1 Overview ............................................................................................................ 120
7.2.2 Register Configuration and Descriptions............................................................. 121
7.2.3 Pin Functions in Each Mode ............................................................................... 123
7.2.4 MOS Input Pull-Ups ........................................................................................... 126
7.3 Port 2 ............................................................................................................................... 127
7.3.1 Overview ............................................................................................................ 127
7.3.2 Register Configuration and Descriptions............................................................. 128
7.3.3 Pin Functions in Each Mode ............................................................................... 130
7.3.4 MOS Input Pull-Ups ........................................................................................... 133
7.4 Port 3 ............................................................................................................................... 134
7.4.1 Overview ............................................................................................................ 134
7.4.2 Register Configuration and Descriptions............................................................. 135
7.4.3 Pin Functions in Each Mode ............................................................................... 137
7.4.4 Input Pull-Up Transistors .................................................................................... 138
7.5 Port 4 ............................................................................................................................... 139
7.5.1 Overview ............................................................................................................ 139
7.5.2 Register Configuration and Descriptions............................................................. 140
7.5.3 Pin Functions ...................................................................................................... 142
7.6 Port 5 ............................................................................................................................... 145
7.6.1 Overview ............................................................................................................ 145
7.6.2 Register Configuration and Descriptions............................................................. 145
7.6.3 Pin Functions ...................................................................................................... 147
7.7 Port 6 ............................................................................................................................... 149
7.7.1 Overview ............................................................................................................ 149
7.7.2 Register Configuration and Descriptions............................................................. 150
7.7.3 Pin Functions ...................................................................................................... 152
7.8 Port 7 ............................................................................................................................... 154
7.8.1 Overview ............................................................................................................ 154
7.8.2 Register Configuration and Descriptions............................................................. 155
7.8.3 Pin Functions ...................................................................................................... 157
Section 8 PWM Timers ..................................................................................161
8.1 Overview ......................................................................................................................... 161
8.1.1 Features .............................................................................................................. 161
8.1.2 Block Diagram.................................................................................................... 162
iii