1. Hitachi neither warrants nor grants licenses of any rights of Hitachi’s or any third party’s
patent, copyright, trademark, or other intellectual property rights for information contained in
this document. Hitachi bears no responsibility for problems that may arise with third party’s
rights, including intellectual property rights, in connection with use of the information
contained in this document.
2. Products and product specifications may be subject to change without notice. Confirm that you
have received the latest product standards or specifications before final design, purchase or
use.
3. Hitachi makes every attempt to ensure that its products are of high quality and reliability.
However, contact Hitachi’s sales office before using the product in an application that
demands especially high quality and reliability or where its failure or malfunction may directly
threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear
power, combustion control, transportation, traffic, safety equipment or medical equipment for
life support.
4. Design your application so that the product is used within the ranges guaranteed by Hitachi
particularly for maximum rating, operating supply voltage range, heat radiation characteristics,
installation conditions and other characteristics. Hitachi bears no responsibility for failure or
damage when used beyond the guaranteed ranges. Even within the guaranteed ranges,
consider normally foreseeable failure rates or failure modes in semiconductor devices and
employ systemic measures such as fail-safes, so that the equipment incorporating Hitachi
product does not cause bodily injury, fire or other consequential damage due to operation of
the Hitachi product.
5. This product is not designed to be radiation resistant.
6. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document
without written approval from Hitachi.
7. Contact Hitachi’s sales office for any questions regarding this document or Hitachi
semiconductor products.
Table 7.11 Absolute Maximum Ratings
Note: Operating temperature ranges amended
Entire table amended
Max. values of ΣI
and Σ–IOH amended
OL
Conditions: Operating temperature range amended
Unit of t
amended
E
z and γ amended
Organization of H8S/2678 Series
Reference Manual
The following manuals are available for H8S/2678 Series products.
Table 1H8S/2678 Series Manuals
TitleDocument Code
H8S/2600 Series, H8S/2000 Series Programming ManualADE-602-083A
H8S/2678 Series Hardware ManualADE-602-193A
H8S/2678 Series Reference ManualADE-602-192A
The H8S/2600 Series, H8S/2000 Series Programming Manual gives a detailed description of the
architecture and instruction set of the H8S/2600 CPU incorporated into H8S/2678 Series products.
The H8S/2678 Series Hardware Manual describes the operation of on-chip functions common to
H8S/2678 Series products, and gives a detailed description of the related registers.
The H8S/2678 Series Reference Manual mainly covers information specific to H8S/2678 Series
products, including pin arrangement, I/O ports, MCU operating modes (memory maps), interrupt
vectors, bus control, and electrical characteristics, and also includes a brief description of all I/O
registers for the convenience of the user.
The contents of the H8S/2678 Series Hardware Manual and the H8S/2678 Series Reference
Manual are summarized in table 2.
Table 2Contents of Hardware Manual and Reference Manual
The H8S/2678 Series comprises microcomputers (MCUs), built around the H8S/2600 CPU,
employing Hitachi’s original architecture, and equipped with on-chip supporting functions
necessary for system configuration.
The H8S/2600 CPU has an internal 32-bit architecture, is provided with sixteen 16-bit general
registers and a concise, optimized instruction set designed for high-speed operation, and can
address a 16-Mbyte linear 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 direct memory access
controller (DMAC), EXDMA controller (EXDMAC), and data transfer controller (DTC) bus
masters, ROM and RAM memory, a16-bit timer pulse unit (TPU), programmable pulse generator
(PPG), 8-bit timer module (TMR), watchdog timer module (WDT), serial communication
interfaces (SCI, IrDA), A/D converter, D/A converter, and I/O ports.
A high-functionality bus controller is also provided, enabling fast and easy connection of DRAM
and other kinds of memory.
The on-chip ROM is either single-power-supply flash memory (F-ZTAT™*) or mask ROM,
enabling users to respond quickly and flexibly to changing application specifications, growing
production volumes, and other conditions. The 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 the H8S/2678 Series are shown in table 1.1.
Note: * F-ZTAT is a trademark of Hitachi, Ltd.
1
Table 1.1Overview
ItemSpecifications
CPU
• General-register architecture
Sixteen 16-bit general registers (also usable as sixteen 8-bit registers
or eight 32-bit registers)
• High-speed operation suitable for realtime control
Maximum operating frequency: 33 MHz
High-speed arithmetic operations
Note: *F-ZTAT version only. In other versions, this is an NC pin.
19
1.5Pin Functions
Table 1.3Pin Functions
Pin No.
TypeSymbolFP-144I/OName and Function
PowerVCC5, 39, 67,
96, 116
VSS12, 19, 26,
47, 76, 99,
136
PLLVCC94InputPLL power: The on-chip PLL oscillator
PLLVSS92InputPLL ground: The on-chip PLL oscillator
ClockXTAL98InputFor connection to a crystal oscillator.
EXTAL97InputFor connection to a crystal oscillator.
ø95OutputSystem clock: Supplies the system
InputPower: For connection to the power
supply. All V
pins should be connected
CC
to the system power supply.
InputGround: For connection to the power
supply. All V
pins should be connected
SS
to the system power supply (0 V).
power supply.
ground.
See section 19, Clock Pulse Generator,
in the H8S/2678 Series Hardware
Manual for typical connection diagrams
for a crystal oscillator and external clock
input.
The EXTAL pin can also input an
external clock. See section 19, Clock
Pulse Generator, in the H8S/2678
Series Hardware Manual for typical
connection diagrams for a crystal
oscillator and external clock input.
clock to external devices.
20
Pin No.
TypeSymbolFP-144I/OName and Function
Operating mode
control
MD2 to MD0 1, 144, 143 InputMode pins: These pins set the
operating mode. The relation between
the settings of pins MD2 to MD0 and the
operating mode is shown below. These
pins should not be changed while the
MCU is operating.
MD0MD1MD0Operating Mode
000—
1Mode 1
10Mode 2
1—
100Mode 4
1Mode 5
10Mode 6
1Mode 7
System controlRES93InputReset input: When this pin is driven
low, the chip is reset.
STBY100InputStandby: When this pin is driven low, a
transition is made to hardware standby
mode.
BREQ115InputBus request: Requests chip to release
the bus to an external bus master.
BREQO113OutputBus request output: External bus
request signal used when an internal
bus master accesses external space
when the external bus is released.
BACK114OutputBus request acknowledge: Indicates
that the bus has been released to an
external bus master.
FWE*62InputFlash write enable: Enables/disables
flash memory.
21
Pin No.
TypeSymbolFP-144I/OName and Function
Interrupt signalsNMI38InputNonmaskable interrupt: Requests a
nonmaskable interrupt. Fix high when
not used.
IRQ15 to
IRQ0
(IRQ15) to
(IRQ0)
Address busA23 to A032 to 27,
Data busD15 to D072 to 75,
Bus controlCS7 to CS0112, 111,
AS91OutputAddress strobe: When this pin is low, it
RD90OutputRead: When this pin is low, it indicates
HWR89OutputHigh write/write enable: Strobe signal
LWR88OutputLow write: Strobe signal indicating that
87, 86,
84 to 81,
61, 60,
130 to 127,
110 to 107,
59 to 52,
112, 111,
4 to 2,
142 to 140
25 to 20,
18 to 13,
11 to 6
77 to 80,
63 to 66,
68 to 71
106 to 101
InputInterrupt request 15 to 0: These pins
request a maskable interrupt.
OutputAddress bus: These pins output an
address.
Input/
output
OutputChip select: Signals that select areas 7
Data bus: These pins constitute a
bidirectional data bus.
to 0.
indicates that address output on the
address bus is valid.
that the external address space is being
read.
indicating that external space is to be
written, and the upper half (D15 to D8)
of the data bus is enabled.
Write enable signal for DRAM interface
space.
external space is to be written, and the
lower half (D7 to D0) of the data bus is
enabled.
22
Pin No.
TypeSymbolFP-144I/OName and Function
Bus controlUCAS86OutputUpper column address strobe: Upper
column address strobe signal for 16-bit
DRAM interface space.
Column address strobe signal for 8-bit
DRAM interface space.
LCAS87OutputLower column address strobe: Lower
column address strobe signal for 16-bit
DRAM interface space.
WAIT85InputWait: Requests insertion of a wait state
in the bus cycle when accessing
external 3-state address space.
DMA controller
(DMAC)
EXDMA controller
(EXDMAC)
OE
(OE)
DREQ1,
DREQ0,
(DREQ1),
(DREQ0)
TEND1,
TEND0,
(TEND1),
(TEND0)
DACK1,
DACK0,
(DACK1),
(DACK0),
EDREQ3 to
EDREQ0
ETEND3 to
ETEND0
EDACK3 to
EDACK0
EDRAK3 to
EDRAK0
112
133
61
60
35
34
82
81
40
36
84
83
42
41
141, 140,
35, 34
2, 142, 40,36OutputEXDMA transfer end 3 to 0: These
4, 3, 42, 41
51, 50, 59,
58Output
OutputOutput enable: Output enable signal for
DRAM interface space.
InputDMA transfer request 1, 0: These
signals request DMAC activation.
OutputDMA transfer end 1, 0: These signals
indicate the end of DMAC data transfer.
DMA transfer acknowledge 1, 0:
Output
InputEXDMA transfer request 3 to 0: These
Output
DMAC single address transfer
acknowledge signals.
signals request EXDMAC activation.
signals indicate the end of EXDMAC
data transfer.
EXDMA transfer acknowledge 3 to 0:
EXDMAC single address transfer
acknowledge signals.
EDREQ acknowledge 3 to 0: These
signals notify an external device of
acceptance and start of execution of an
external request.
23
Pin No.
TypeSymbolFP-144I/OName and Function
16-bit timer pulse
unit (TPU)
Programmable
pulse generator
(PPG)
8-bit timerTMO0,
TCLKD to
TCLKA
TIOCA0,
TIOCB0,
TIOCC0,
TIOCD0
TIOCA1,
TIOCB1
TIOCA2,
TIOCB2
TIOCA3,
TIOCB3,
TIOCC3,
TIOCD3
TIOCA4,
TIOCB4
TIOCA5,
TIOCB5
PO15 to
PO0
TMO1
TMCI0,
TMCI1
TMRI0,
TMRI1
51, 49, 46,
45Input
43 to 46Input/
output
48, 49Input/
output
50, 51Input/
output
52 to 55Input/
output
56, 57Input/
output
58, 59Input/
output
51 to 48,
46 to 43,
59 to 52
83, 84OutputCompare match output: Compare
81, 82InputCounter external clock input: Input
60, 61InputCounter external reset input: Counter
OutputPulse output 15 to 0: Pulse output
Clock input D to A: External clock input
pins.
Input capture/output compare match
A0 to D0: TGR0A to TGR0D input
DA1, DA0
AVCC122InputThe power supply pin for the A/D
AVSS131InputThe ground pin for the A/D converter
Vref121InputThe reference voltage input pin for the
107, 138,
139
108, 135,
137
109, 133,
134
130 to 127,
126 to 123,
120 to 117
130, 129,
126, 125
OutputTransmit data (channels 0, 1, 2): Data
output pins.
InputReceive data (channels 0, 1, 2): Data
input pins.
Input/
output
InputAnalog 15 to 12, 7 to 0: Analog input
OutputAnalog output: D/A converter analog
Serial clock (channels 0, 1, 2): Clock
input/output pins.
pins.
Pin for input of an external trigger to
start A/D conversion.
output pins.
converter and D/A converter.
When the A/D converter and D/A
converter are not used, this pin should
be connected to the system power
supply (+3 V).
and D/A converter.
This pin should be connected to the
system power supply (0 V).
A/D converter and D/A converter.
When the A/D converter and D/A
converter are not used, this pin should
be connected to the system power
supply (+3 V).
25
Pin No.
TypeSymbolFP-144I/OName and Function
I/O portsP17 to P1051 to 48,
46 to 43
P27 to P2059 to 52Input/
P35 to P30133 to 135,
137 to 139
P47 to P40126 to 123,
120 to 117
P57 to P50130 to 127,
110 to 107
P65 to P6084 to 81,
61, 60
P75 to P7042 to 40,
36 to 34
P85 to P804 to 2,
142 to 140
PA7 to PA032 to 27,
25, 24
PB7 to PB023 to 20,
18 to 15
Input/
output
output
Input/
output
InputPort 4: Eight input pins.
Input
Input/
output
Input/
output
Input/
output
Input/
output
Input/
output
Input/
output
Port 1: Eight input/output pins. The
direction of each pin can be selected in
the port 1 data direction register
(P1DDR).
Port 2: Eight input/output pins. The
direction of each pin can be selected in
the port 2 data direction register
(P2DDR).
Port 3: Six input/output pins. The
direction of each pin can be selected in
the port 3 data direction register
(P3DDR).
Port 5: Four input pins and four
input/output pins. The direction of each
input/output pin can be selected in the
port 5 data direction register (P5DDR).
Port 6: Six input/output pins. The
direction of each pin can be selected in
the port 6 data direction register
(P6DDR).
Port 7: Six input/output pins. The
direction of each pin can be selected in
the port 7 data direction register
(P7DDR).
Port 8: Six input/output pins. The
direction of each pin can be selected in
the port 8 data direction register
(P8DDR).
Port A: Eight input/output pins. The
direction of each pin can be selected in
the port A data direction register
(PADDR).
Port B: Eight input/output pins. The
direction of each pin can be selected in
the port B data direction register
(PBDDR).
26
Pin No.
TypeSymbolFP-144I/OName and Function
I/O portsPC7 to PC014, 13,
11 to 6
PD7 to PD072 to 75,
77 to 80
PE7 to PE063 to 66,
68 to 71
PF7 to PF095,
91 to 85
PG6 to PG0115 to 113,
104 to 101
PH3 to PH0112, 111,
106, 105
Note: * F-ZTAT version only. In other versions, this is an NC pin.
Input/
output
Input/
output
Input/
output
Input/
output
Input/
output
Input/
output
Port C: Eight input/output pins. The
direction of each pin can be selected in
the port C data direction register
(PCDDR).
Port D: Eight input/output pins. The
direction of each pin can be selected in
the port D data direction register
(PDDDR).
Port E: Eight input/output pins. The
direction of each pin can be selected in
the port E data direction register
(PEDDR).
Port F: Eight input/output pins. The
direction of each pin can be selected in
the port F data direction register
(PFDDR).
Port G: Seven input/output pins. The
direction of each pin can be selected in
the port G data direction register
(PGDDR).
Port H: Four input/output pins. The
direction of each pin can be selected in
the port H data direction register
(PHDDR).
27
1.6Product Lineup
Table 1.4H8S/2678 Series Product Lineup
Package
Product TypeModelMarking
2
H8S/2677*
F-ZTAT™ version HD64F2677HD64F2677VFC 144-pin plastic QFP (FP-144)
H8S/2676*1F-ZTAT™ version HD64F2676HD64F2676VFC 144-pin plastic QFP (FP-144)
Mask ROM version HD6432676HD6432676FC
H8S/2675*2Mask ROM version HD6432675HD6432675FC144-pin plastic QFP (FP-144)
H8S/2673*1Mask ROM version HD6432673HD6432673FC144-pin plastic QFP (FP-144)
H8S/2670*1ROMless versionHD6412670HD6412670VFC144-pin plastic QFP (FP-144)
Notes: 1. Under development
2. In planning stage
(Hitachi Package Code)
1.7Package Dimensions
22.0 ± 0.2
20
108
109
22.0 ± 0.2
144
0.22 ± 0.05
*
0.20 ± 0.04
*Dimension including the plating thickness
1
0.10
0.10
Base material dimension
M
Figure 1.3 FP-144 Package Dimensions
73
36
72
37
2.70
+0.15
–0.10
0.10
0.5
3.05 Max
0.17 ± 0.05
0.15 ± 0.04
*
Hitachi Code
JEDEC
EIAJ
Weight
1.25
(reference value)
Unit: mm
1.0
0° – 8°
0.5 ± 0.1
FP-144G
—
Conforms
2.4 g
28
Section 2 MCU Operating Modes
2.1Overview
2.1.1Operating Mode Selection (F-ZTAT Version)
The H8S/2678 Series F-ZTAT version has twelve operating modes (modes 1, 2, 4 to 7, and 10 to
15) that are selected by the flash write enable pin (FWE) and the mode pins (MD2 to MD0). The
input at these pins determines the CPU operating mode and the initial bus width, as shown in table
The CPU’s architecture allows for 4 gigabytes of address space, but the H8S/2678 Series chip
actually accesses a maximum of 16 Mbytes.
Modes 1, 2, and 4 to 6 are externally expanded modes that allow access to external memory and
peripheral devices.
The externally expanded modes allow switching between 8-bit and 16-bit bus modes. After
program execution starts, 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 8bit access is selected for all areas, 8-bit bus mode is set. Pin functions depend on the operating
mode.
Mode 7 is a single-chip activation externally expanded mode that allows access to external
memory and peripheral devices to be switched at the start of program execution.
In the single-chip activation externally expanded mode, it is possible to switch between externally
expanded mode and single-chip mode by means of the EXPE bit in the system control register
(SYSCR). Immediately after a reset, the chip starts up in single-chip mode, but after the start of
program execution, it is possible to change to externally expanded mode by setting EXPE
accordingly. Pin functions depend on the operating mode.
Modes 10 to 15 are boot modes and user program modes that allow programming and erasing of
flash memory. For details see section 18, ROM, in the H8S/2678 Series Hardware Manual.
The H8S/2678 Series F-ZTAT Version can be used only in modes 1, 2, 4 to 7, and 10 to 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.
2.1.2Operating Mode Selection (ROMless and Mask ROM Versions)
The H8S/2678 Series ROMless and mask ROM versions have six operating modes* (modes 1, 2,
and 4 to 7) that are selected by the mode pins (MD2 to MD0). The input at these pins determines
the CPU operating mode, enabling or disabling of on-chip ROM, and the initial bus width, as
shown in table 2.2.
Table 2.2 lists the MCU operating modes.
31
Table 2.2MCU Operating Mode Selection* (ROMless and Mask ROM Versions)
External Data
MCUCPU
Operating
ModeMD2MD1MD0
0000——— ——
11AdvancedExpanded mode
210
31—————
4100AdvancedExpanded mode
51External ROM
610
Operating
ModeDescription
with on-chip
ROM disabled
with on-chip
ROM enabled
activation
expanded mode
with on-chip
ROM enabled
On-Chip
ROM
Disabled 16 bits16 bits
Enabled8 bits16 bits
Bus
Initial
Width
8 bits16 bits
16 bits16 bits
8 bits16 bits
Max.
Width
71Single-chip
activation mode
with on-chip
ROM enabled
Note: * Only modes 1 and 2 are available in the ROMless version.
—16 bits
The CPU’s architecture allows for 4 gigabytes of address space, but the H8S/2678 Series chip
actually accesses a maximum of 16 Mbytes.
Modes 1, 2, and 4 to 6 are externally expanded modes that allow access to external memory and
peripheral devices.
The externally expanded modes allow switching between 8-bit and 16-bit bus modes. After
program execution starts, 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 8bit access is selected for all areas, 8-bit bus mode is set. Pin functions depend on the operating
mode.
In the single-chip activation externally expanded mode, it is possible to switch between externally
expanded mode and single-chip mode. Immediately after a reset, the chip starts up in single-chip
mode, but after the start of program execution, it is possible to change to externally expanded
mode by setting the EXPE bit in the system control register (SYSCR) accordingly. Pin functions
depend on the operating mode.
32
The H8S/2678 Series mask ROM version can be used only in modes 1, 2, and 4 to 7, and the
ROMless version only in modes 1 and 2. This means that the mode pins must be set to select one
of these modes.
Do not change the inputs at the mode pins during operation.
2.1.3Register Configuration
The H8S/2678 Series has a mode control register (MDCR) that indicates the inputs at the mode
pins (MD2 to MD0), and a system control register (SYSCR) that controls the operation of the
chip. Table 2.3 summarizes these registers.
Table 2.3Registers
NameAbbreviationR/WInitial ValueAddress*
Mode control registerMDCRRUndefinedH'FF3E
System control registerSYSCRR/WH'C1/H'C3*2H'FF3D
Notes: 1. Lower 16 bits of the address.
2. Determined by pins MD2 to MD0.
1
2.2Register Descriptions
2.2.1Mode Control Register (MDCR)
Bit76543210
—————MDS2MDS1MDS0
Initial value00000—*—*—*
Read/Write————— R R R
Note: * Determined by pins MD2 to MD0.
MDCR is an 8-bit read-only register that monitors the current operating mode of the H8S/2678
Series chip.
Bits 7 to 3—Reserved: These bits are always read as 0 and cannot be modified. The write value
should always be 1.
Bits 2 to 0—Mode Select 2 to 0 (MD2 to MD0): These bits indicate the input levels at pins MD2
to MD0 (the current operating mode). Bits MDS2 to MDS0 correspond to pins MD2 to MD0.
MDS2 to MDS0 are read-only bits—they cannot be written to. The mode pin (MD2 to MD0) input
levels are latched into these bits when MDCR is read. These latches are canceled by a reset.
Bits 7 and 6—Reserved: These are readable/writable bits, but the write value should always be 1.
Bit 5—MAC Saturation (MACS): Selects either saturating or non-saturating calculation for the
MAC instruction.
Bit 5
MACSDescription
0Non-saturating calculation for MAC instruction(Initial value)
1Saturating calculation for MAC instruction
Bit 4—Reserved: This is a readable/writable bit, but the write value should always be 0.
Bit 3—Flash Memory Control Register Enable (FLSHE): Controls CPU access to the flash
memory control registers (FLMCR1, FLMCR2, EBR1, and EBR2). For details see section 18,
ROM, in the H8S/2678 Series Hardware Manual.
In the mask ROM and ROMless versions, 0 should be written to this bit.
Bit 3
FLSHEDescription
0Flash memory control registers are not selected for area H'FFFFC8 to H'FFFFCB
(Initial value)
1Flash memory control registers are selected for area H'FFFFC8 to H'FFFFCB
Bit 2—Reserved: This bit is always read as 0 and cannot be modified. The write value should
always be 0.
Bit 1—External Bus Mode Enable (EXPE): Sets external bus mode.
In modes 1, 2, 4, 5, 6, 10, 12, 13, and 14, this bit is fixed at 1 and cannot be modified. In modes 7,
11, and 15, this bit has an initial value of 0, and can be read and written.
34
Writing of 0 to EXPE when its value is 1 should only be carried out when an external bus cycle* is
not being executed.
Note: * There are cases where external and internal bus cycles are executed in parallel due to the
write data buffer function, the refresh control function, the EXDMAC, the bus-released
state, and so forth.
Bit 1
EXPEDescription
0External bus disabled
1External bus enabled
Bit 0—RAM Enable (RAME): Enables or disables the on-chip RAM. The RAME bit is
initialized when the reset state is released. It is not initialized in software standby mode.
2.3.1Mode 1 (Expanded Mode with On-Chip ROM Disabled)
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is disabled.
Ports A, B, and C function as an address bus, ports D and E function as a data bus, and parts of
ports F and G carry bus control signals.
The initial bus mode after a reset is 16 bits, with 16-bit access to all areas. However, if 8-bit access
is designated for all areas by the bus controller, the bus mode switches to 8 bits.
2.3.2Mode 2 (Expanded Mode with On-Chip ROM Disabled)
This is an externally expanded mode with on-chip ROM disabled.
Operation is the same as in mode 1, except that the initial external bus mode after a reset is 8 bits.
2.3.3Mode 3
This mode is not supported in the H8S/2678 Series, and must not be selected.
35
2.3.4Mode 4 (Expanded Mode with On-Chip ROM Enabled)
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled.
Ports A, B, and C function as input ports immediately after a reset, but can be set to function as an
address bus. For details see section 5, I/O Ports. Port D functions as a data bus, and parts of ports
F and G carry bus control signals.
The initial bus mode after a reset is 8 bits, with 8-bit access to all areas. The program in on-chip
ROM connected to the first half of area 0 is executed. However, if 16-bit access is designated for
any area by the bus controller, the bus mode switches to 16 bits and port E functions as a data bus.
2.3.5Mode 5 (External ROM Activation Expanded Mode with On-Chip ROM Enabled)
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM*1 is enabled.
Ports A, B, and C function as an address bus, ports D and E function as a data bus, and parts of
ports F and G carry bus control signals.
The initial bus mode after a reset is 16 bits, with 16-bit access to all areas. The program in on-chip
ROM*2 connected to the first half of area 0 is executed. However, if 8-bit access is designated for
any area by the bus controller, the bus mode switches to 8 bits.
Notes: 1. H8S/2678: H'100000 to H'180000; H8S/2675: H'100000 to H'140000
2. H8S/2678, H8S/2675: H'000000 to H'100000
2.3.6Mode 6 (External ROM Activation Expanded Mode with On-Chip ROM Enabled)
This is an external ROM activation expanded mode with on-chip ROM disabled.
Operation is the same as in mode 5, except that the initial external bus mode after a reset is 8 bits.
2.3.7Mode 7 (Single-Chip Activation Mode with On-Chip ROM Enabled)
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled,
and the chip starts up in single-chip mode. External addresses cannot be used in single-chip mode,
but they can be made accessible by means of a setting in the system control register (SYSCR).
When external addresses are enabled, settings can be made to designate ports A, B, and C for
address output, and ports D and E as data bus. For details see section 5, I/O Ports.
The initial mode after a reset is single-chip mode, with all I/O ports available for use as
input/output ports. However, the mode can be switched to externally expanded mode by means of
a setting in SYSCR. When externally expanded mode is selected, all areas are initially designated
as 16-bit access space. The function of pins in ports A to H is the same as in externally expanded
mode with on-chip ROM enabled.
36
2.3.8Modes 8 and 9 [F-ZTAT Version Only]
Modes 8 and 9 are not supported in the H8S/2678 Series, and must not be selected.
2.3.9Mode 10 [F-ZTAT Version Only]
This is a flash memory boot mode. For details see section 18, ROM, in the H8S/2678 Series
Hardware Manual.
Except for flash memory erasing and programming, operation is the same as in mode 4 (advanced
expanded mode with on-chip ROM enabled).
2.3.10Mode 11
This is a flash memory boot mode. For details see section 18, ROM, in the H8S/2678 Series
Hardware Manual.
Except for flash memory erasing and programming, operation is the same as in mode 7 (advanced
single-chip activation expanded mode with on-chip ROM enabled).
2.3.11Mode 12
This is a flash memory user program mode. For details see section 18, ROM, in the H8S/2678
Series Hardware Manual.
Except for flash memory erasing and programming, operation is the same as in mode 4 (advanced
expanded mode with on-chip ROM enabled).
2.3.12Modes 13 and 14 [F-ZTAT Version Only]
This is a flash memory user program mode. For details see section 18, ROM, in the H8S/2678
Series Hardware Manual.
Except for flash memory erasing and programming, operation is the same as in modes 5 and 6
(advanced external ROM activation expanded mode with on-chip ROM enabled).
2.3.13Mode 15 [F-ZTAT Version Only]
This is a flash memory user program mode. For details see section 18, ROM, in the H8S/2678
Series Hardware Manual.
Except for flash memory erasing and programming, operation is the same as in mode 7 (advanced
single-chip activation expanded mode with on-chip ROM enabled).
37
2.4Pin Functions in Each Operating Mode
The pin functions of ports A to H vary depending on the operating mode. Table 2.4 shows their
functions in each operating mode.
PA0
Port BAAP*/AAAP*/AP*/AP*/AP*/AAAP*/A
Port CAAP*/AAAP*/AP*/AP*/AP*/AAAP*/A
Port DDDDDDP*/DDP*/DDDDP*/D
Port EP/D*P*/DP/D*P/D*P*/DP*/DP*/DP*/DP*/DP/D*P*/DP*/D
Port F PF7,
PF6
PF5,
PF4
PF3P/C*P/C*P/C*P/C*P/C*P/C*P/C*P/C*P/C*
PF2 to
PF0
Port G PG7 to
PG1
PG0P/C*P/C*P*/CP/C*P/C*P/C*P*/CP/C*P/C*
Port HP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/C
P*/AP*/AP*/AP*/AP*/AP*/AP*/AP*/AP*/AP*/AP*/AP*/A
AAAAAA
P/C*P/C*P/C*P/C*P/C*P*/CP*/CP*/CP/C*P/C*P/C*P*/C
CCCCCCCCC
P*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/C
P*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/CP*/C
Legend: P: I/O port
A: Address bus output
D: Data bus input/output
C: Control signals, clock input/output
Note: * After reset
15
38
2.5Memory Map in Each Operating Mode
Figures 2.1 to 2.13 show memory maps for each of the operating modes.
The address space is 16 Mbytes.
The on-chip ROM capacity is 384 kbytes in the H8S/2677, 256 kbytes in the H8S/2676, 128
kbytes in the H8S/2675, and 64 kbytes in the H8S/2673; the on-chip RAM capacity is 8 kbytes.
The address space is divided into eight areas. For details see section 4, Bus Controller.
Only advanced mode is supported in the H8S/2678 Series.
39
Modes 1 and 2
(expanded modes
with on-chip ROM disabled)
Mode 4
(expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'060000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
Note: * External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
Figure 2.1 H8S/2677 Memory Map in Each Operating Mode (1)
40
Modes 5 and 6
(external ROM activation
expanded modes
with on-chip ROM enabled)
Mode 7
(single-chip activation
expanded mode
with on-chip ROM enabled)
H'000000
H'100000
H'160000
External
address space
On-chip ROM
External
address space
H'000000
H'060000
On-chip ROM
External address
space/reserved area
*2
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip RAM/external
address space
*1
External address space
Internal I/O registers
External address space
Internal I/O registers
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip RAM/external
address space
External address
space/reserved area
Internal I/O registers
External address
space/reserved area
Internal I/O registers
Notes: 1. External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
2. When EXPE = 1, external address space; when EXPE = 0, reserved area.
3. When EXPE = 1, external address space when RAME = 0, on-chip RAM when RAME = 1.
When EXPE = 0, on-chip RAM area.
Figure 2.2 H8S/2677 Memory Map in Each Operating Mode (2)
*3
*2
*2
41
Mode 10 Boot mode
(expanded mode
with on-chip ROM enabled)
(single-chip activation expanded mode
Mode 11 Boot mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM
*2
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'060000H'060000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM
External address
space/reserved area
*2
Internal I/O registers
External address
space/reserved area
Internal I/O registers
*1
*1
*1
Notes: 1. When EXPE = 1, external address space; when EXPE = 0, reserved area.
2. On-chip RAM is used for flash memory programming. Do not clear the RAME bit in SYSCR to 0.
Figure 2.3 H8S/2677 Memory Map in Each Operating Mode (3)
[F-ZTAT™ Version Only]
42
Mode 12 User program mode
(expanded mode
with on-chip ROM enabled)
Modes 13 and 14
(external ROM activation
expanded modes
with on-chip ROM enabled)
Mode 15 User program mode
(single-chip activation
expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM
*2
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'100000
H'160000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip ROM
External
address space
On-chip RAM
*2
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'060000H'060000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM
External address
space/reserved area
*2
Internal I/O registers
External address
space/reserved area
Internal I/O registers
*1
*1
*1
Notes: 1. When EXPE = 1, external address space; when EXPE = 0, reserved area.
2. On-chip RAM is used for flash memory programming. Do not clear the RAME bit in SYSCR to 0.
Figure 2.4 H8S/2677 Memory Map in Each Operating Mode (4)
[F-ZTAT™ Version Only]
43
Modes 1 and 2
(expanded modes
with on-chip ROM disabled)
Mode 4
(expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'040000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
Note: * External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
Figure 2.5 H8S/2676 Memory Map in Each Operating Mode (1)
44
Modes 5 and 6
(external ROM activation
expanded modes
with on-chip ROM enabled)
Mode 7
(single-chip activation
expanded mode
with on-chip ROM enabled)
H'000000
H'100000
H'140000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip ROM
External
address space
On-chip RAM/external
address space
*1
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'040000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM/external
address space
External address
space/reserved area*2
*3
Internal I/O registers
External address
space/reserved area
*2
Internal I/O registers
*2
Notes: 1. External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
2. When EXPE = 1, external address space; when EXPE = 0, reserved area.
3. When EXPE = 1, external address space when RAME = 0, on-chip RAM when RAME = 1.
When EXPE = 0, on-chip RAM area.
Figure 2.6 H8S/2676 Memory Map in Each Operating Mode (2)
45
Mode 10 Boot mode
(expanded mode
with on-chip ROM enabled)
Mode 11 Boot mode
(single-chip activation expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM
*2
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'040000H'040000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM
External address
space/reserved area
*2
Internal I/O registers
External address
space/reserved area
Internal I/O registers
*1
*1
*1
Notes: 1. When EXPE = 1, external address space; when EXPE = 0, reserved area.
2. On-chip RAM is used for flash memory programming. Do not clear the RAME bit in SYSCR to 0.
Figure 2.7 H8S/2676 Memory Map in Each Operating Mode (3)
[F-ZTAT™ Version Only]
46
Mode 12 User program mode
(expanded mode
with on-chip ROM enabled)
Modes 13 and 14
(external ROM activation
expanded modes
with on-chip ROM enabled)
Mode 15 User program mode
(single-chip activation
expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM
*2
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'100000
H'140000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip ROM
External
address space
On-chip RAM
*2
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'040000H'040000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM
External address
space/reserved area
*2
Internal I/O registers
External address
space/reserved area
Internal I/O registers
*1
*1
*1
Notes: 1. When EXPE = 1, external address space; when EXPE = 0, reserved area.
2. On-chip RAM is used for flash memory programming. Do not clear the RAME bit in SYSCR to 0.
Figure 2.8 H8S/2676 Memory Map in Each Operating Mode (4)
[F-ZTAT™ Version Only]
47
Modes 1 and 2
(expanded modes
with on-chip ROM disabled)
Mode 4
(expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'020000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
Note: * External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
Figure 2.9 H8S/2675 Memory Map in Each Operating Mode (1)
48
Modes 5 and 6
(external ROM activation
expanded modes
with on-chip ROM enabled)
Mode 7
(single-chip activation
expanded mode
with on-chip ROM enabled)
H'000000
H'100000
H'120000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip ROM
External
address space
On-chip RAM/external
address space
*1
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'020000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM/external
address space
External address
space/reserved area*2
*3
Internal I/O registers
External address
space/reserved area
*2
Internal I/O registers
*2
Notes: 1. External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
2. When EXPE = 1, external address space; when EXPE = 0, reserved area.
3. When EXPE = 1, external address space when RAME = 0, on-chip RAM when RAME = 1.
When EXPE = 0, on-chip RAM area.
Figure 2.10 H8S/2675 Memory Map in Each Operating Mode (2)
49
Modes 1 and 2
(expanded modes
with on-chip ROM disabled)
Mode 4
(expanded mode
with on-chip ROM enabled)
H'000000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'010000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External
address space
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
Note: * External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
Figure 2.11 H8S/2673 Memory Map in Each Operating Mode (1)
50
Modes 5 and 6
(external ROM activation
expanded modes
with on-chip ROM enabled)
Mode 7
(single-chip activation
expanded mode
with on-chip ROM enabled)
H'000000
H'100000
H'110000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
External
address space
On-chip ROM
External
address space
On-chip RAM/external
address space
*1
External address space
Internal I/O registers
External address space
Internal I/O registers
H'000000
H'010000
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
On-chip ROM
External address
space/reserved area
On-chip RAM/external
address space
External address
space/reserved area*2
*3
Internal I/O registers
External address
space/reserved area
*2
Internal I/O registers
*2
Notes: 1. External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
2. When EXPE = 1, external address space; when EXPE = 0, reserved area.
3. When EXPE = 1, external address space when RAME = 0, on-chip RAM when RAME = 1.
When EXPE = 0, on-chip RAM area.
Figure 2.12 H8S/2673 Memory Map in Each Operating Mode (2)
51
Modes 1 and 2
(expanded modes
with on-chip ROM disabled)
H'000000
External
address space
H'FFA000
H'FFC000
H'FFFC00
H'FFFF00
H'FFFF20
H'FFFFFF
Note: * External addresses can be accessed by clearing the RAME bit in SYSCR to 0.
On-chip RAM/external
address space*
External address space
Internal I/O registers
External address space
Internal I/O registers
Figure 2.13 H8S/2670 Memory Map in Each Operating Mode
52
Section 3 Exception Handling and Interrupt Controller
3.1Overview
3.1.1Exception Handling Types and Priority
As table 3.1 indicates, exception handling may be caused by a reset, trap instruction, or interrupt.
Exception handling is prioritized as shown in table 3.1. If two or more exceptions occur
simultaneously, they are accepted and processed in order of priority. Trap instruction exceptions
are accepted at all times in the program execution state.
Exception handling sources, the stack structure, and the operation of the CPU vary depending on
the interrupt control mode set by the INTM0 and INTM1 bits in INTCR.
For details of exception handling and the interrupt controller, see section 2, Exception Handling,
and section 3, Interrupt Controller, in the H8S/2678 Series Hardware Manual.
Table 3.1Exception Types and Priority
PriorityException TypeStart of Exception Handling
HighResetStarts after a low-to-high transition at the RES pin, or
when the watchdog timer overflows
1
Trace*
InterruptStarts when execution of the current instruction or
LowTrap instruction*3 (TRAPA)Started by execution of a trap instruction (TRAPA)
Notes: 1. Traces are enabled only in interrupt control mode 2. Trace exception handling is not
executed after execution of an RTE instruction.
2. Interrupt detection is not performed on completion of ANDC, ORC, XORC, or LDC
instruction execution, or on completion of reset exception handling.
3. Trap instruction exception handling requests are accepted at all times in the program
execution state.
Starts when execution of the current instruction or
exception handling ends, if the trace (T) bit is set to 1
exception handling ends, if an interrupt request has
been issued*
2
53
3.2Interrupt Controller
3.2.1Interrupt Controller Features
• Two interrupt control modes
Either of two interrupt control modes can be set by means of the INTM1 and INTM0 bits in
the interrupt control register (INTCR).
• Priorities settable with IPRs
Interrupt priority registers (IPRs) are provided for setting interrupt priorities. Eight priority
levels can be set for each module for all interrupts except NMI.
NMI is assigned the highest priority level of 8, and can be accepted at all times.
• Independent vector addresses
All interrupt sources are assigned independent vector addresses, making it unnecessary for
the source to be identified in the interrupt handling routine.
• Seventeen external interrupt pins
NMI is the highest-priority interrupt, and is accepted at all times. Rising edge or falling
edge can be selected for NMI.
Falling edge, rising edge, or both edge detection, or level sensing, can be selected
independently for IRQ15 to IRQ0.
• DTC and DMAC control
DTC and DMAC activation is controlled by means of interrupts.
54
3.2.2Block Diagram
Figure 3.1 shows a block diagram of the interrupt controller.
NMI input
IRQ input
Internal
interrupt
sources
SWDTEND
to TEI
INTM1 INTM0
INTCR
Legend
ISCR:IRQ sense control register
IER:IRQ enable register
ISR:IRQ status register
IPR:Interrupt priority register
INTCR: Interrupt control register
ITSR:IRQ pin select register
NMIEG
NMI input unit
IRQ input unit
ISR
ITSRIER
Interrupt controller
ISCR
Priority
determination
IPR
Interrupt
request
Vector
number
I
I2 to I0
CPU
CCR
EXR
Figure 3.1 Block Diagram of Interrupt Controller
55
3.2.3Pin Configuration
Table 3.2 summarizes the interrupt controller pins.
Note: * Reserved bits. These bits are read as H'7, and the write value should be H'7.
59
As shown in table 3.4, multiple interrupts are assigned to one IPR. Setting a value in the range
from H'0 to H'7 in the 3-bit groups of bits 14 to 12, 10 to 8, 6 to 4, and 2 to 0 sets the priority of
the corresponding interrupt. The lowest priority level, level 0, is assigned by setting H'0, and the
highest priority level, level 7, by setting H'7.
When interrupt requests are generated, the highest-priority interrupt according to the priority
levels set in the IPR registers is selected. This interrupt level is then compared with the interrupt
mask level set by the interrupt mask bits (I2 to I0) in the extend register (EXR) in the CPU, and if
the priority level of the interrupt is higher than the set mask level, an interrupt request is issued to
the CPU.
The ISCR registers are two 16-bit readable/writable registers that select rising edge, falling edge,
or both edge detection, or level sensing, for the input at pins IRQ15 to IRQ0.
The ISCR registers are initialized to H'0000 by a reset and in hardware standby mode.
61
Bits 15 to 0—IRQ15 Sense Control A and B (IRQ15SCA, IRQ15SCB) to IRQ0 Sense
Control A and B (IRQ0SCA, IRQ0SCB)
IRQnSCBIRQnSCADescription
00Interrupt request generated at IRQn input low level (Initial value)
1Interrupt request generated at falling edge of IRQn input
10Interrupt request generated at rising edge of IRQn input
1Interrupt request generated at both falling and rising edges of IRQn
When an ITSR setting is changed, if the selected pin level before the change is different from the
selected pin level after the change, an edge may be generated internally and IRQnF (n = 0 to 15) in
ISR may be set at an unintended timing. If the IRQn interrupt (n = 0 to 15) is enabled at this time,
the associated interrupt exception handling will be executed.
To prevent unintended interrupts, make changes to ITSR settings with IRQn interrupts (n = 0 to
SSIER is a 16-bit readable/writable register that selects the IRQ pins used to recover from the
software standby state.
SSIER is initialized to H'0007 by a reset and in hardware standby mode.
An IRQ interrupt used to recover from the software standby state must not be set as a DTC
activation source.
Bits 15 to 0—Software Standby Release IRQ Setting (SSI15 to SSI0): These bits select the
IRQ pins used to recover from the software standby state.
Bit n
SSInDescription
0IRQn requests are not sampled in the software standby state
(Initial value when n = 15 to 3)
1When an IRQn request occurs in the software standby state, the chip recovers from
the software standby state after the elapse of the oscillation settling time
(Initial value when n = 2 to 0)
65
3.4Interrupt Sources
Interrupt sources comprise external interrupts (NMI and IRQ15 to IRQ0) and internal interrupts
(56 sources).
3.4.1External Interrupts
There are 17 external interrupt sources: NMI and IRQ15 to IRQ0. Setting an SSI bit to 1 in SSIER
enables the corresponding IRQ15–IRQ0 interrupt to be used as a software standby mode release
source.
NMI Interrupt: NMI is the highest-priority interrupt, and is always accepted by the CPU
regardless of the interrupt control mode and the status of the CPU interrupt mask bits. The
NMIEG bit in INTCR specifies whether an interrupt is requested at a rising edge or a falling edge
on the NMI pin.
The vector number for NMI interrupt exception handling is 7.
IRQ15 to IRQ0 Interrupts: Interrupts IRQ15 to IRQ0 are requested by an input signal at pins
IRQ15 to IRQ0. Interrupts IRQ15 to IRQ0 have the following features:
• Using ISCR, it is possible to select whether an interrupt is generated by a low level, falling
edge, rising edge, or both edges, at pins IRQ15 to IRQ0.
• Enabling or disabling of interrupt requests IRQ15 to IRQ0 can be selected with IER.
• The interrupt priority level can be set with IPR.
• The status of interrupt requests IRQ15 to IRQ0 is indicated in ISR. ISR flags can be cleared to
0 by software.
A block diagram of interrupts IRQ15 to IRQ0 is shown in figure 3.2.
IRQnE
Q
IRQn
input
Note: n = 15 to 0
IRQnSCA, IRQnSCB
Edge/
level detection
circuit
Clear signal
IRQnF
S
R
Figure 3.2 Block Diagram of Interrupts IRQ15 to IRQ0
66
IRQn interrupt
request
Figure 3.3 shows the timing of the setting of IRQnF.
ø
IRQn
input pin
IRQnF
Figure 3.3 Timing of Setting of IRQnF
The vector numbers for IRQ15 to IRQ0 interrupt exception handling are 31 to 16.
Detection of IRQ15 to IRQ0 interrupts does not depend on whether the relevant pin has been set
for input or output. When a pin is used as an external interrupt input pin, clear the corresponding
DDR bit to 0 and do not use the pin as an I/O pin for another function.
When interrupt request generation by a low level at the IRQ pin is selected for an IRQ15 to IRQ0
interrupt by means of an ISCR setting, when an interrupt is requested the relevant IRQ pin should
be held low until interrupt handling starts. The IRQ pin should then be returned to the high level,
and IRQnF (n = 0 to 15) cleared, in the interrupt handling routine. If the IRQ pin is returned to the
high level before interrupt handling is started, the associated interrupt may not be executed.
3.4.2Internal Interrupts
There are 56 sources for internal interrupts from on-chip supporting modules.
1. For each on-chip supporting module there are flags that indicate the interrupt request status,
and enable bits that select enabling or disabling of these interrupts. If any one of these is set to
1, an interrupt request is issued to the interrupt controller.
2. The interrupt priority level can be set by means of IPR.
3. The DMAC and DTC can be activated by a TPU, SCI, or other interrupt request. When the
DMAC or DTC is activated by an interrupt, the interrupt control mode and CPU interrupt mask
bits have no effect.
67
3.4.3Interrupt Vector Table
Table 3.5 shows interrupt exception handling sources, their vector addresses, and their priority
order. In the default priority order, smaller vector numbers have higher priority.
Priorities among modules can be set by means of IPR. The priority order when two or more
modules are set to the same priority, and the priority order within a module, are fixed as shown in
table 3.5.
68
Table 3.5Interrupt Sources, Vector Addresses, and Priority Order
Origin of
Interrupt
Interrupt Source
Power-on reset0H'0000—High——
Reserved1H'0004
Reserved for system2H'0008
Trace5H'0014
Reserved for system6H'0018
NMIExternal
capture/compare match)
TCI5V (overflow 5)70H'0118——
TCI5U (underflow 5)71H'011C——
CMIA0 (compare match A) 8-bit timer72H'0120IPRH14–IPRH12—
CMIB0 (compare match B)
OVI0 (overflow 0)74H'0128——
Reserved—75H'012C——
CMIA1 (compare match A) 8-bit timer76H'0130IPRH10–IPRH8—
CMIB1 (compare match B)
OVI1 (overflow 1)78H'0138——
Reserved—79H'013CLow——
Notes: Interrupt sources vary depending on the model. See the reference manual for the relevant
model for details.
* Lower 16 bits of the start address.
73
3.5Interrupt Operation
3.5.1Interrupt Control Modes and Interrupt Operation
Interrupt operations in the H8S/2678 Series differ depending on the interrupt control mode.
NMI interrupts are accepted at all times except in the reset state and the hardware standby state. In
the case of IRQ interrupts and on-chip supporting module interrupts, an enable bit is provided for
each interrupt. Clearing an enable bit to 0 disables the corresponding interrupt request. Interrupt
sources for which the enable bits are set to 1 are controlled by the interrupt controller.
Table 3.6 shows the interrupt control modes.
The interrupt controller performs interrupt control according to the interrupt control mode set by
the INTM1 and INTM0 bits in INTCR, the priorities set in IPR, and the masking state indicated by
the I bit in the CPU’s CCR, and bits I2 to I0 in EXR.
Table 3.6Interrupt Control Modes
Interrupt
Control
ModeINTM1INTM0
000—IInterrupt mask control is performed by
—1——Setting prohibited
210IPRI2 to I08-level interrupt mask control is
—1——Setting prohibited
INTCR
Priority
Setting
Registers
Interrupt
Mask BitsDescription
the I bit.
performed by bits I2 to I0.
8 priority levels can be set with IPR.
74
Figure 3.4 shows a block diagram of the priority decision circuit.
Interrupt
control
mode 0
Interrupt
acceptance
I
control
Interrupt source
8-level
mask control
I2 to I0
IPR
Interrupt control mode 2
Default priority
determination
Vector number
Figure 3.4 Block Diagram of Interrupt Control Operation
Interrupt Acceptance Control: In interrupt control mode 0, interrupt acceptance control is
performed by means of the I bit in CCR.
Table 3.7 shows the interrupts that can be selected in each interrupt control mode.
Table 3.7Interrupts Selected in Each Interrupt Control Mode (1)
Interrupt Mask Bit
Interrupt Control ModeISelected Interrupts
00All interrupts
1NMI interrupt
2*All interrupts
*: Don’t care
75
8-Level Control: In interrupt control mode 2, 8-level mask level determination is performed
according to the interrupt priority level (IPR) for interrupts selected in interrupt acceptance
control.
The interrupt source selected is the interrupt with the highest priority level, and for which the
priority level set in IPR is higher than the mask level.
Table 3.8Interrupts Selected in Each Interrupt Control Mode (2)
Interrupt Control ModeSelected Interrupts
0All interrupts
2Highest-priority-level (IPR) interrupt whose priority level is greater
than the mask level (IPR > I2 to I0)
Default Priority Determination: When an interrupt is selected by 8-level control, its priority is
determined and a vector number is generated.
If the same value is set for IPR, acceptance of multiple interrupts is enabled, and so only the
interrupt source with the highest priority according to the preset default priorities is selected and
has a vector number generated.
Interrupt sources with a lower priority than the accepted interrupt source are held pending.
Table 3.9 shows operations and control signal functions in each interrupt control mode.
Table 3.9Operations and Control Signal Functions in Each Interrupt Control Mode
Interrupt
Acceptance
Interrupt
Control Mode INTM1 INTM0II2–I0IPRDetermination (Trace)
000OIMX——*2O—
210X—*
Legend
O:Interrupt operation control performed
X:No operation (all interrupts enabled)
IM:Used as interrupt mask bit
PR:Sets priority.
—:Not used.
Notes: 1. Set to 1 when interrupt is accepted.
2. Keep the initial setting (IPR writes prohibited).
76
Setting
Control8-Level Control
1
OIM PR OT
Default Priority T
3.5.2Interrupt Control Mode 0
Enabling and disabling of IRQ interrupts and on-chip supporting module interrupts can be set by
means of the I bit in the CPU’s CCR. Interrupts are enabled when the I bit is cleared to 0, and
disabled when the I bit is set to 1.
Figure 3.5 shows a flowchart of the interrupt acceptance operation in this case.
1. If an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt
request is sent to the interrupt controller.
2. The I bit is then referenced. If the I bit is cleared to 0, the interrupt request is accepted. If the I
bit is set to 1, only an NMI interrupt is accepted, and other interrupt requests are held pending.
3. Interrupt requests are sent to the interrupt controller, the highest-priority interrupt according to
the priority order is selected, and the others are held pending.
4. When an interrupt request is accepted, processing for the instruction being executed at that
time is completed before interrupt exception handling is started.
5. PC and CCR are saved to the stack area in interrupt exception handling. The PC value saved
on the stack shows the address of the first instruction to be executed after returning from the
interrupt service routine.
6. Next, the I bit in CCR is set to 1. This masks all interrupts except NMI.
7. A vector address is generated for the accepted interrupt, and execution of the interrupt service
routine starts at the address indicated by the contents of that vector address.
77
Program execution
state
IRQ0?
Yes
Yes
No
Save PC and CCR
Interrupt
generated?
Yes
NMI?
No
I = 0?
Yes
IRQ1?
Yes
No
No
No
Hold pending
TEI2?
Yes
78
I ← 1
Read vector address
Branch to interrupt
service routine
Figure 3.5 Flowchart of Procedure Up to Interrupt Acceptance
in Interrupt Control Mode 0
3.5.3Interrupt Control Mode 2
Eight-level masking is implemented for IRQ interrupts and on-chip supporting module interrupts
by comparing the interrupt mask level set by bits I2 to I0 of EXR in the CPU with IPR.
Figure 3.6 shows a flowchart of the interrupt acceptance operation in this case.
1. If an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt
request is sent to the interrupt controller.
2. When interrupt requests are sent to the interrupt controller, the interrupt with the highest
priority level according to the interrupt priority levels set in IPR is selected, and lower-priority
interrupt requests are held pending. If a number of interrupt requests with the same priority are
generated at the same time, the interrupt request with the highest priority according to the
priority system shown in table 3.4 is selected.
3. Next, the priority of the selected interrupt request is compared with the interrupt mask level set
in EXR. An interrupt request with a priority no higher than the mask level set at that time is
held pending, and only an interrupt request with a priority higher than the interrupt mask level
is accepted.
4. When an interrupt request is accepted, processing for the instruction being executed at that
time is completed before interrupt exception handling is started.
5. PC, CCR, and EXR are saved to the stack area in interrupt exception handling. The PC value
saved on the stack shows the address of the first instruction to be executed after returning from
the interrupt service routine.
6. The T bit in EXR is cleared to 0. As a result, the interrupt mask level is rewritten with the
priority level of the accepted interrupt.
If the accepted interrupt is NMI, the interrupt mask level is set to H'7.
7. A vector address is generated for the accepted interrupt, and execution of the interrupt service
routine starts at the address indicated by the contents of that vector address.
79
Program execution state
Level 7 interrupt?
Yes
Mask level 6
or below?
Yes
Interrupt
generated?
Yes
No
No
Save PC, CCR, and EXR
NMI?
Level 6 interrupt?
Mask level 5
or below?
Yes
No
Yes
Yes
No
No
Level 1 interrupt?
No
Yes
Mask level 0?
Yes
Hold pending
No
No
80
Clear T bit to 0
Update mask level
Read vector address
Branch to interrupt
service routine
Figure 3.6 Flowchart of Procedure Up to Interrupt Acceptance
in Interrupt Control Mode 2
3.5.4Interrupt Exception Handling Sequence
Figure 3.7 shows the interrupt exception handling sequence. The example shown is for the case
where interrupt control mode 0 is set in advanced mode, and the program area and stack area are
in on-chip memory.
(10), (12) Interrupt service routine start address (vector address contents)
(13) Interrupt service routine start address ((13) = (10), (12))
(14) First instruction of interrupt service routine
3.5.5Interrupt Response Times
The H8S/2678 Series is capable of fast word access to on-chip memory, and the program area is
provided in on-chip ROM and the stack area in on-chip RAM, enabling high-speed processing.
Table 3.10 shows interrupt response times—the interval between generation of an interrupt request
and execution of the first instruction in the interrupt service routine. The symbols used in table
3.10 are explained in table 3.11.
Table 3.10 Interrupt Response Times
Advanced Mode
No.ItemINTM1 = 0INTM1 = 1
1Interrupt priority determination*
2Number of wait states until executing
instruction ends*
2
3Saving PC, CCR, EXR to stack2 ⋅ S
4Vector fetch2 ⋅ S
5Instruction fetch*
6Internal processing*
3
4
Total (using on-chip memory)12 to 3213 to 33
Notes: 1. Two states in case of internal interrupt.
2. Refers to MULXS and DIVXS instructions.
3. Prefetch after interrupt acceptance and interrupt service routine prefetch.
4. Internal processing after interrupt acceptance and internal processing after vector fetch.
1
33
1 to 19 + 2 ⋅ S
K
I
2 ⋅ S
I
I
1 to 19 + 2 ⋅ S
3 ⋅ S
K
2 ⋅ S
I
2 ⋅ S
I
I
22
Table 3.11 Number of States in Interrupt Exception Handling
Object of Access
External Device
8-Bit Bus16-Bit Bus
SymbolInternal
Memory
Instruction fetch S
I
Branch address read S
Stack manipulation S
K
146 + 2m23 + m
J
Legend
m: Number of wait states in an external device access
2-State
Access
3-State
Access
2-State
Access
3-State
Access
83
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.