H8S/2427, H8S/2427R, H8S/2425 Group
H8S/2427, H8S/2427R, H8S/2425 Group
Page iv of xxxii
How to Use This Manual
1. Purpose and Target Readers
This manual is designed to provide the user with an understanding of the hardware functions
and electrical characteristics of the MCU. It is intended for users designing application systems
incorporating the MCU. A basic knowledge of electric circuits, logical circuits, and MCUs is
necessary in order to use this manual.
The manual comprises an overview of the product; descriptions of the CPU, system control
functions, peripheral functions, and electrical characteristics; and usage notes.
Particular attention should be paid to the precautionary notes when using the manual. These
notes occur within the body of the text, at the end of each section, and in the Usage Notes
section.
The revision history summarizes the locations of revisions and additions. It does not list all
revisions. Refer to the text of the manual for details.
The following documents apply to the H8S/2427, H8S/2427R, H8S/2425 Group. Make sure to
refer to the latest versions of these documents. The newest versions of the documents listed
may be obtained from the Renesas Electronics Web site.
Page v of xxxii
2. Description of Numbers and Symbols
Aspects of the notations for register names, bit names, numbers, and symbolic names in this
manual are explained below.
14.3 Operation
14.3.1 Interval Count Operation
When an internal clock is selected with the CKS1 and CKS0 bits in CMCSR and the STR bit in
CMSTR is set to 1, CMCNT starts incrementing using the selected clock. When the values in
CMCNT and the compare match constant register (CMCOR) match, CMCNT is cleared to H'0000
and the CMF flag in CMCSR is set to 1. When the CKS1 and CKS0 bits are set to B'01 at this time,
a f/4 clock is selected.
Rev. 0.50, 10/04, page 416 of 914
(3)
Note: The bit names and sentences in the above figure are examples and have nothing to do
with the contents of this manual.
Page vi of xxxii
3. Description of Registers
Each register description includes a bit chart, illustrating the arrangement of bits, and a table of
bits, describing the meanings of the bit settings. The standard format and notation for bit charts
and tables are described below.
Note: The bit names and sentences in the above figure are examples, and have nothing to do with the contents of this
manual.
(1) Bit
Indicates the bit number or numbers.
In the case of a 32-bit register, the bits are arranged in order from 31 to 0. In the case
of a 16-bit register, the bits are arranged in order from 15 to 0.
(2) Bit name
Indicates the name of the bit or bit field.
When the number of bits has to be clearly indicated in the field, appropriate notation is
included (e.g., ASID[3:0]).
A reserved bit is indicated by "−".
Certain kinds of bits, such as those of timer counters, are not assigned bit names. In such
cases, the entry under Bit Name is blank.
(3) Initial value
Indicates the value of each bit immediately after a power-on reset, i.e., the initial value.
0: The initial value is 0
1: The initial value is 1
−: The initial value is undefined
(4) R/W
For each bit and bit field, this entry indicates whether the bit or field is readable or writable,
or both writing to and reading from the bit or field are impossible.
The notation is as follows:
R/W: The bit or field is readable and writable.
R/(W): The bit or field is readable and writable.
However, writing is only performed to flag clearing.
R: The bit or field is readable.
"R" is indicated for all reserved bits. When writing to the register, write
the value under Initial Value in the bit chart to reserved bits or fields.
W: The bit or field is writable.
(5) Description
Describes the function of the bit or field and specifies the values for writing.
Abbreviation Description
BSC Bus controller
CPG Clock pulse generator
INT Interrupt controller
SCI Serial communication interface
TMR 8-bit timer
TPU 16-bit timer pulse unit
WDT Watchdog timer
Abbreviation Description
ACIA Asynchronous communications interface adapter
bps Bits per second
CRC Cyclic redundancy check
DMA Direct memory access
DMAC Direct memory access controller
GSM Global System for Mobile Communications
Hi-Z High impedance
IEBus ⎯
I/O Input/output
IrDA Infrared Data Association
LSB Least significant bit
MSB Most significant bit
NC No connection
PLL Phase-locked loop
PWM Pulse width modulation
SFR Special function register
SIM Subscriber Identity Module
UART Universal asynchronous receiver/transmitter
VCO Voltage-controlled oscillator
All trademarks and registered trademarks are the property of their respective owners.
Section 1 Overview................................................................................................1
1.1 Features.................................................................................................................................. 1
1.1.1 Applications.............................................................................................................. 1
1.1.2 Overview of Specifications....................................................................................... 2
1.2 List of Products.................................................................................................................... 10
1.3 Block Diagrams ................................................................................................................... 15
1.4 Pin Description .................................................................................................................... 17
1.4.1 Pin Assignments ..................................................................................................... 17
1.4.2 Pin Assignments in Each Operating Mode ............................................................. 20
1.4.3 Pin Functions .......................................................................................................... 34
Section 2 CPU......................................................................................................47
2.1 Features................................................................................................................................ 47
2.1.1 Differences between H8S/2600 CPU and H8S/2000 CPU ..................................... 49
2.1.2 Differences from H8/300 CPU ............................................................................... 50
2.1.3 Differences from H8/300H CPU ............................................................................ 51
2.2 CPU Operating Modes......................................................................................................... 52
2.2.1 Normal Mode.......................................................................................................... 52
2.2.2 Advanced Mode...................................................................................................... 54
2.3 Address Space...................................................................................................................... 56
2.4 Registers .............................................................................................................................. 57
2.4.1 General Registers.................................................................................................... 58
2.4.2 Program Counter (PC) ............................................................................................ 59
2.4.3 Extended Register (EXR) ....................................................................................... 59
2.4.4 Condition-Code Register (CCR)............................................................................. 60
2.4.5 Multiply-Accumulate Register (MAC)................................................................... 61
2.4.6 Initial Values of CPU Internal Registers................................................................. 61
2.5 Data Formats........................................................................................................................ 62
2.5.1 General Register Data Formats............................................................................... 62
2.5.2 Memory Data Formats ............................................................................................ 64
2.6 Instruction Set ...................................................................................................................... 65
2.6.1 Table of Instructions Classified by Function .......................................................... 66
2.6.2 Basic Instruction Formats ....................................................................................... 75
2.7 Addressing Modes and Effective Address Calculation........................................................ 77
2.7.1 Register Direct—Rn ............................................................................................... 77
2.7.2 Register Indirect—@ERn....................................................................................... 77
Page ix of xxxii
2.7.3 Register Indirect with Displacement—@(d:16, ERn) or @(d:32, ERn)................. 78
2.7.4 Register Indirect with Post-Increment or Pre-Decrement—@ERn+ or @-ERn..... 78
2.7.5 Absolute Address—@aa:8 /@aa:16 / @aa:24 /@aa:32.......................................... 78
2.7.6 Immediate—#xx:8 / #xx:16/ #xx:32....................................................................... 79
2.7.7 Program-Counter Relative—@(d:8, PC) or @(d:16, PC) ...................................... 79
2.7.8 Memory Indirect—@@aa:8 ................................................................................... 79
2.7.9 Effective Address Calculation ................................................................................ 81
2.8 Processing States.................................................................................................................. 83
2.9 Usage Note........................................................................................................................... 85
2.9.1 Usage Notes on Bit-wise Operation Instructions .................................................... 85
Section 4 Resets................................................................................................... 99
4.1 Types of Resets.................................................................................................................... 99
4.2 Input/Output Pin ................................................................................................................ 100
4.3 Register Descriptions ......................................................................................................... 101
4.3.1 Timer Control/Status Register (TCSR)................................................................. 102
4.3.2 Reset Control/Status Register (RSTCSR)............................................................. 102
4.4 Pin Reset ............................................................................................................................ 102
4.5 Watchdog Timer Reset ...................................................................................................... 102
4.6 Determination of Reset Generation Source........................................................................ 102
Page x of xxxii
5.3.1 Reset Exception Handling .................................................................................... 108
5.3.2 Interrupts after Reset............................................................................................. 110
5.3.3 On-Chip Peripheral Functions after Reset Release............................................... 110
5.4 Trace Exception Handling ................................................................................................. 111
5.5 Interrupt Exception Handling ............................................................................................ 112
5.6 Trap Instruction Exception Handling................................................................................. 113
5.7 Illegal Instruction Exception Handling .............................................................................. 114
5.8 Stack Status after Exception Handling............................................................................... 115
5.9 Usage Note......................................................................................................................... 116
Page xi of xxxii
Section 7 Bus Controller (BSC) ........................................................................157
7.1 Features.............................................................................................................................. 157
7.2 Input/Output Pins............................................................................................................... 160
7.3 Register Descriptions ......................................................................................................... 163
7.3.1 Bus Width Control Register (ABWCR)................................................................ 164
7.3.2 Access State Control Register (ASTCR) .............................................................. 164
7.3.3 Wait Control Registers AH, AL, BH, and BL
(WTCRAH, WTCRAL, WTCRBH, and WTCRBL) ........................................... 165
7.3.4 Read Strobe Timing Control Register (RDNCR) ................................................. 171
7.3.5 CS Assertion Period Control Registers H, L (CSACRH, CSACRL).................... 173
7.3.6 Area 0 Burst ROM Interface Control Register (BROMCRH) Area 1 Burst
ROM Interface Control Register (BROMCRL).................................................... 175
7.3.7 Bus Control Register (BCR) ................................................................................. 176
7.3.8 Address/Data Multiplexed I/O Control Register (MPXCR) ................................. 178
7.3.9 DRAM Control Register (DRAMCR) .................................................................. 179
7.3.10 DRAM Access Control Register (DRACCR)....................................................... 187
7.3.11 Refresh Control Register (REFCR) ...................................................................... 190
7.3.12 Refresh Timer Counter (RTCNT)......................................................................... 193
7.3.13 Refresh Time Constant Register (RTCOR) .......................................................... 193
7.4 Bus Control........................................................................................................................ 194
7.4.1 Area Division........................................................................................................ 194
7.4.2 Bus Specifications ................................................................................................ 195
7.4.3 Memory Interfaces................................................................................................ 197
7.4.4 Chip Select Signals ............................................................................................... 199
7.5 Basic Bus Interface ............................................................................................................ 200
7.5.1 Data Size and Data Alignment.............................................................................. 200
7.5.2 Valid Strobes ........................................................................................................ 202
7.5.3 Basic Timing......................................................................................................... 202
7.5.4 Wait Control ......................................................................................................... 211
7.5.5 Read Strobe (RD) Timing..................................................................................... 212
7.5.6 Extension of Chip Select (CS) Assertion Period................................................... 214
7.6 Address/Data Multiplexed I/O Interface............................................................................ 215
7.6.1 Setting Address/Data Multiplexed I/O Space ....................................................... 215
7.6.2 Address/Data Multiplexing................................................................................... 215
7.6.3 Data Bus ............................................................................................................... 216
7.6.4 Address Hold Signal ............................................................................................. 216
7.6.5 Basic Timing......................................................................................................... 217
7.6.6 Wait Control ......................................................................................................... 225
7.6.7 Read Strobe (RD) Timing..................................................................................... 226
Page xv of xxxii
9.4.11 Examples of Operation Timing in Each Mode ..................................................... 481
9.4.12 Ending EXDMA Transfer..................................................................................... 495
9.4.13 Relationship between EXDMAC and Other Bus Masters .................................... 496
9.5 Interrupt Sources................................................................................................................ 497
9.6 Usage Notes ....................................................................................................................... 499
Page xx of xxxii
12.10.9 Contention between TGR Write and Input Capture.............................................. 834
12.10.10 Contention between Buffer Register Write and Input Capture ........................... 835
12.10.11 Contention between Overflow/Underflow and Counter Clearing....................... 836
12.10.12 Contention between TCNT Write and Overflow/Underflow.............................. 837
12.10.13 Multiplexing of I/O Pins ..................................................................................... 837
12.10.14 Interrupts in Module Stop State .......................................................................... 837
Index .......................................................................................................1495
Section 1 Overview
1.1 Features
The H8S/2427 Group, H8S/2427R Group, and H8S/2425 Group are CISC (Complex Instruction
Set Computer) microprocessors that integrate an H8S/2600 CPU core, which has an internal 16-bit
architecture and is upward-compatible with Renesas original H8/300, H8/300H, and H8S CPUs.
The on-chip peripheral functions provided for enabling system configuration at a low cost are the
DMA controller, EXDMA controller*, data transfer controller, serial communication interface, I2C
bus interface 2, synchronous serial communication unit, FSI interface, A/D converter, D/A
converter, and various timers. On-chip ROM is flash memory whose size is 512 Kbytes and 384
Kbytes.
1.1.1 Applications
Module/
Type Function Description
Memory ROM • Expanded ROM: Flash memory version
⎯ User ROM: 512 Kbytes and 384 Kbytes
⎯ Data flash: 8 Kbytes
⎯ User boot ROM: 16 Kbytes
RAM RAM size: 64 Kbytes and 48 Kbytes
CPU CPU • 16-bit high-speed H8S/2600 CPU (CISC type)
Upward-compatible with H8/300, H8/300H, and H8S CPUs on
an object level
• General register mode (Sixteen 16-bit general registers)
• Eight addressing modes
• Address space: 16 Mbytes
(program: 16 Mbytes, data: 16 Mbytes)
• Number of basic instructions
69 types (arithmetic and logic, multiply and divide, bit-
manipulation, and multiply-and-accumulate instructions)
• Minimum instruction execution time (ns)
30.3 ns when system clock φ = 33 MHz and Vcc = 3.0 to 3.6 V
(ADD instruction)
• Multiplier is included (16 × 16 → 32 bits)
• Multiply-and-accumulate instructions are supported (16 × 16 +
32 → 32 bits)
Operating Advanced mode
mode
Module/
Type Function Description
CPU MCU • Mode 1: Expanded mode with on-chip ROM disabled,
operating 16-bit bus (MD2 and MD1 pins are low and MD0
mode
pin is high)
• Mode 2: Expanded mode with on-chip ROM disabled,
8-bit bus (MD2 pin is low, MD1 pin is high, and
MD0 pin is low)
• Mode 3: Boot mode (MD2 pin is low and MD1 and MD0 pins
are high)
• Mode 4: Expanded mode with on-chip ROM enabled,
8-bit bus (MD2 pin is high and MD1 and MD0 pins
are low)
• Mode 5: User boot mode (MD2 pin is high, MD1 pin is low,
and MD0 pin is high)
• Mode 7: Single-chip mode (MD2, MD1, and MD0 pins are
high)
• Power-down modes (a power-down mode is entered when the
SLEEP instruction is executed)
Interrupts Interrupt • External interrupt pins
(sources) controller H8S/2427 Group, H8S/2427R Group:
33 pins (NMI, IRQ15-A to IRQ0-A, IRQ15-B to IRQ0-B)
H8S/2425 Group:
17 pins (NMI, IRQ7-A to IRQ0-A, IRQ7-B to IRQ0-B)
• Internal interrupt sources
H8S/2427 Group, H8S/2427R Group: 102 sources
H8S/2425 Group: 100 sources
• Two interrupt control modes (specified by the interrupt control
register)
• Eight priority levels can be set (specified by the interrupt priority
registers)
• Independent vector addresses
Module/
Type Function Description
DMA DMA controller • DMA transfer is possible on six channels
(DMAC)
• Three activation sources (auto-request, on-chip module
interrupt, and external request)
• Byte or word can be set as the transfer unit
• Short address mode or full address mode can be selected (in
common register enabled mode)
• Short address mode and full address mode can be activated
separately (in common register disabled mode)
• 16-Mbyte address space can be specified directly
EXDMA • DMA transfer is possible on two channels
controller
• Two activation sources (auto-request and external request)
(EXDMAC)
• Two transfer modes (normal mode and block transfer mode)
• Dual address mode or single address mode can be selected
• 16-Mbyte address space can be specified directly
• Repeat area can be set
Note: * EXDMAC is supported only by the H8S/2427 Group and
H8S/2427R Group.
Data transfer • Transfer is possible on any number of channels
controller
• An interrupt source can trigger data transfer (chain transfer is
(DTC)
possible)
• Three transfer modes (normal mode, repeat mode, and block
transfer mode)
• Byte or word can be set as the transfer unit
• Activation by software is possible
Module/
Type Function Description
External bus Bus controller • External address space: 16 Mbytes
extension (BSC)
• Manages the external address space divided into eight areas
Chip select signals (CS0 to CS7) can be output
8-bit access or 16-bit access can be selected
2-state access or 3-state access can be selected
Program wait states can be inserted
• External memory interfaces (burst ROM, DRAM*1, synchronous
2
DRAM* , address/data multiplexed I/O)
• Bus arbitration function (bus arbitration of the bus masters CPU,
DTC, DMAC, and EXDMAC*3)
Notes: 1. DRAM is not supported by the 5-V version.
2. Supported only by the H8S/2427R Group.
3. Not supported by the H8S/2425 Group.
Clock Clock pulse • This LSI has a single on-chip clock pulse generator circuit
generator
• Consists of an oscillator, a system-clock PLL circuit, a divider,
(CPG)
and the system clock frequency can be changed
System clock (φ) cycle: 8 to 33 MHz
• Six power-down modes
Divided clock mode, sleep mode, module stop function, all
module clock stop mode, software standby mode, and hardware
standby mode
Module/
Type Function Description
A/D A/D converter • Two units
converter (ADC)
• 10-bit resolution
• Number of input channels
H8S/2427 Group and H8S/2427R Group: 16 channels
⎯ Unit 0: 8 channels
⎯ Unit 1: 8 channels
H8S/2425 Group: 10 channels
⎯ Unit 0: 8 channels
⎯ Unit 1: 2 channels
• Sample and hold functionality
• Conversion time:
3-V version: 4.0 μs per channel (when A/D conversion clock is
set to 10 MHz)
5-V version: 2.5 μs per channel (when A/D conversion clock is
set to 16 MHz)
• Two kinds of operating modes (single mode and scan mode)
• Three types of A/D conversion start (software, trigger by timer
(TPU or TMR), or external trigger)
D/A D/A converter • Resolution (8 bits) × Number of output channels (2 channels)
converter (DAC)
• Conversion time: Maximum 10 μs (with 20-pF load)
• Output voltage: 0 V to Vref
Module/
Type Function Description
Timer 16-bit timer • 16-bit timer × 12 channels (general pulse timer unit)
pulse unit
• Eight counter input clocks can be selected for each channel
(TPU)
• Maximum 16-pulse input/output (when external expanded mode
is set)
• Maximum 32-pulse input/output (when single-chip mode is set)
• Counter clear operation, simultaneous write to multiple timer
counters (TCNT), simultaneous clearing by compare match and
input capture, register simultaneous input/output possible by
counter synchronous operation, and maximum of 15-phase
PWM output by combination with synchronous operation
• Buffer operation, phase counting mode (two-phase encoder
input), and cascaded operation settable for channels
• Input capture function
• Output compare function (waveform output at compare match)
8-bit timer • 8-bit timer × 2 channels (operation as a 16-bit timer is also
(TMR) possible)
• Selection of seven clock sources: Six internal clock signals or an
external clock input
• Pulse output with an arbitrary duty cycle or PWM output
Programmable • 16-bit pulse output
pulse
• Pulse outputs are divided into four groups
generator
(PPG) Non-overlap mode is available
Inverted output can be specified
• Can operate together with the data transfer controller (DTC) and
DMA controller (DMAC)
Watchdog Watchdog • 8-bit timer × 1 channel (eight counter input clocks can be
timer timer (WDT) selected)
• Switchable between watchdog timer mode and interval timer
mode
Module/
Type Function Description
Serial Serial • Five channels (asynchronous or clocked synchronous serial
interface communi- communication mode)
cation
interface (SCI) • Full-duplex communication capability
• Choice of any bit rate and choice of LSB-first or MSB-first
• On-chip cyclic redundancy check (CRC) calculator for improved
reliability in data transfer
• IrDA data transmission/reception based on the IrDA standard
version 1.0
Smart SCI supports Smart Card (SIM) interface
Card/SIM
High- I2C bus • Four channels
function interface 2
• Continuous transmission/reception
communi- (IIC2)
cations • Start and stop conditions generated automatically in master
mode
• Selection of acknowledge output levels when receiving
• Automatic loading of acknowledge bit when transmitting
• Bit synchronization/wait function
Synchronous • One channel
serial
• Master mode or slave mode can be selected
communi-
cation unit • Standard mode or bidirectional mode can be selected
(SSU) • Full-duplex communication capability
• Consecutive serial communication capability
High-speed FSI interface • One channel
communi- (FSI)
• Supports communications between this LSI and SPI flash
cation
memory
Type Description
I/O ports H8S/2427 Group, H8S/2427R Group:
• Input-only pins: 18 (PLQP0144KA-A)
17 (PTLG0145JB-A)
• Input/output pins: 98
• Pull-up resistor pins: 40
• Open-drain pins: 98
H8S/2425 Group:
• Input-only pins: 11
• Input/output pins: 83
• Pull-up resistor pins: 40
• Open-drain pins: 83
Package H8S/2427 Group, H8S/2427R Group:
• 144-pin QFP package (PLQP0144KA-A)
(code: FP-144LV, body size: 20 × 20 mm, pin pitch: 0.50 mm)
• 145-pin TLP package (PTLG0145JB-A)
(body size: 9 × 9 mm, pin pitch: 0.65 mm)
H8S/2425 Group:
• 120-pin QFP package (PLQP0120LA-A)
(code: FP-120BV, body size: 14 × 14 mm, pin pitch: 0.40 mm)
• 120-pin QFP package (PLQP0120KA-A)
(body size: 16 × 16 mm, pin pitch: 0.50 mm)
• Pb-free package
Operating frequency/ • Operating frequency
power supply voltage 2.7-V version: 8 to 25 MHz
3-V version: 8 to 33 MHz
5-V version: 8 to 33 MHz
• Power supply voltage
2.7-V version: VCC = 2.7 to 3.6 V, AVCC = 2.7 to 3.6 V
3-V version: VCC = 3.0 to 3.6 V, AVCC = 3.0 to 3.6 V
5-V version: VCC = 4.5 to 5.5 V, AVCC = 4.5 to 5.5 V
• Supply current
2.7-V version: 35 mA typ (VCC = 3.3 V, AVCC = 3.3 V, φ = 25 MHz)
3-V version: 45 mA typ (VCC = 3.3 V, AVCC = 3.3 V, φ = 33 MHz)
5-V version: 45 mA typ (VCC = 5.0 V, AVCC = 5.0 V, φ = 33 MHz)
Operating environment −20°C to +75°C (regular specifications)
temperature (°C) −40°C to +85°C (wide-range specifications)
Operating
Product Flash Operating Environment
Type Part No. Memory Size RAM Size Voltage Temperature Package Code
H8S/2427R R4F24279NVRFQU 512 Kbytes 64 Kbytes 3.0 to 3.6 V -20 to 75°C PLQP0144KA-A
Group
R4F24278NVRFQU 512 Kbytes 48 Kbytes 3.0 to 3.6 V
Operating
Product Flash Operating Environment
Type Part No. Memory Size RAM Size Voltage Temperature Package Code
H8S/2427 R4F24279NVFQU 512 Kbytes 64 Kbytes 3.0 to 3.6 V -20 to 75°C PLQP0144KA-A
Group
R4F24278NVFQU 512 Kbytes 48 Kbytes 3.0 to 3.6 V
Operating
Product Flash Operating Environment
Type Part No. Memory Size RAM Size Voltage Temperature Package Code
H8S/2427 R4F24279DWLPV 512 Kbytes 64 Kbytes 2.7 to 3.6 V -40 to 85°C PTLG0145JB-A
Group
R4F24278DWLPV 512 Kbytes 48 Kbytes 2.7 to 3.6 V
H8S/2425 R4F24259NVFPU 512 Kbytes 64 Kbytes 3.0 to 3.6 V –20 to +75°C PLQP0120LA-A
Group
R4F24258NVFPU 512 Kbytes 48 Kbytes 3.0 to 3.6 V
Operating
Product Flash Operating Environment
Type Part No. Memory Size RAM Size Voltage Temperature Package Code
H8S/2425 R4F24256DFPU 384 Kbytes 64 Kbytes 4.5 to 5.5 V –40 to +85°C PLQP0120LA-A
Group
R4F24255DFPU 384 Kbytes 48 Kbytes 4.5 to 5.5 V
PLLVcc
PLLVss
VCL
PD7/D15
PD6/D14
PD5/D13
PD4/D12
PD3/D11
PD2/D10
Vcc
Vcc
Vcc
Vcc
Vss
Vss
Vss
Vss
Vss
Vss
Vss
Vss
PD1/D9
PD0/D8
PE7/D7
PE6/D6
PE5/D5
PE4/D4
PE3/D3
PE2/D2
PE1/D1
PE0/D0
Port D Port E
MD2
MD1
PA7/A23/IRQ7-A/SSO0-B/FSIDO
MD0
EXTAL PA6/A22/IRQ6-A/SSI0-B/FSIDI
XTAL PA5/A21/IRQ5-A/SSCK0-B/FSICK
Port A
EMLE PA4/A20/IRQ4-A/SCS0-B/FSISS
System
STBY PA3/A19/SCK4-B
clock
Bus controller
Port B
PB4/A12/TIOCA7
PF7/φ
PB0/A8/TIOCA6
PF3/LWR/SSO0-C DMAC
PC7/A7/TIOCB11
PF2/LCAS*2/DQML*1/IRQ15-A/SSI0-C ROM
PC6/A6/TIOCA11
PF1/UCAS*2/DQMU*1/IRQ14-A/SSCK0-C (flash memory)
PC5/A5/TIOCB10
Port C
PF0/WAIT-A/ADTRG0-B/SCS0-C
PC4/A4/TIOCA10
PG6/BREQ-A PC3/A3/TIOCD9
PG5/BACK-A EXDMAC PC2/A2/TIOCC9
PC1/A1/TIOCB9
Port G
PG4/BREQO-A
PG3/CS3/RAS3*2/CAS*1 PC0/A0/TIOCA9-A
PG2/CS2/RAS2*2/RAS*1 RAM WDT
PG1/CS1 P35/OE-B*2/CKE-B*1/SCK1/SCL0
PG0/CS0 SCI × 5 channels P34/SCK0/SCK4-A/SDA0
Port 3
P33/RxD1/SCL1
P65/IRQ13-A/DACK1/DACK3/TMO1-A P32/RxD0/IrRxD/SDA1
P64/IRQ12-A/DACK0/DACK1/TMO0-A IIC2 × 4 channels P31/TxD1
Port 6
Port 5
P85/IRQ5-B/PO5-B/TIOCB4-B/TMO1-B/SCK3/EDACK3/TIOCA9-B (total of 16 channels for two units) P52/BACK-B/IRQ2-A/PO4-B/TIOCA4-B/TMO0-B/SCK2
PPG
P84/IRQ4-B/EDACK2 P51/BREQ-B/IRQ1-A/PO2-B/TIOCC3-B/TMCI0-B/RxD2/SCL3
P83/IRQ3-B/PO3-B/TIOCD3-B/TMCI1-B/RxD3/ETEND3 P50/BREQO-B/IRQ0-A/PO0-B/TIOCA3-B/TMRI0-B/TxD2/SDA3
Port 8
SSU
P82/IRQ2-B/ETEND2
TMR × 2 channels
P81/IRQ1-B/PO1-B/TIOCB3-B/TMRI1-B/TxD3/EDREQ3
P80/IRQ0-B/EDREQ2
P47/AN7_0
P46/AN6_0
P45/AN5_0
P44/AN4_0
P43/AN3_0
P42/AN2_0
P41/AN1_0
P40/AN0_0
PH3/CS7/OE-A*2/CKE-A*1/IRQ7-B
PH2/CS6/IRQ6-B
PH1/CS5/RAS5*2/SDRAMφ*1
PH0/CS4/RAS4*2/WE*1
P20/IRQ8-B/PO0-A/TIOCA3-A
P21/IRQ9-B/PO1-A/TIOCB3-A
P22/IRQ10-B/PO2-A/TIOCC3-A
P23/IRQ11-B/PO3-A/TIOCD3-A/TxD4-A
P24/IRQ12-B/PO4-A/TIOCA4-A/RxD4-A
P25/WAIT-B/IRQ13-B/PO5-A/TIOCB4-A
P26/IRQ14-B/PO6/TIOCA5/SDA2/ADTRG1
P27/IRQ15-B/PO7/TIOCB5/SCL2
P97/AN15_1
P96/AN14_1
P95/AN13_1/DA3
P94/AN12_1/DA2
P93/AN11_1
P92/AN10_1
P91/AN9_1
P90/AN8_1
PJ2*3
PJ1
PJ0
AVcc
AVss
Vref
PD7/D15/AD15
PD6/D14/AD14
PD5/D13/AD13
PD4/D12/AD12
PD3/D11/AD11
PD2/D10/AD10
PD1/D9/AD9
PD0/D8/AD8
PE7/D7/AD7
PE6/D6/AD6
PE5/D5/AD5
PE4/D4/AD4
PE3/D3/AD3
PE2/D2/AD2
PE1/D1/AD1
PE0/D0/AD0
PLLVCC
PLLVSS
VCC
VCC
VCC
VCC
VSS
VSS
VSS
VSS
VSS
VSS
VCL
Port D Port E
MD2
MD1
PA7/A23/CS7/IRQ7-A/SSO0-B/FSIDO
MD0
EXTAL PA6/A22/IRQ6-A/SSI0-B/FSIDI
XTAL PA5/A21/IRQ5-A/SSCK0-B/FSICK
Port A
EMLE PA4/A20/IRQ4-A/SCS0-B/FSISS
STBY System PA3/A19/SCK4-B
RES clock PA2/A18/RxD4-B
Clock
PB7/A15/TIOCB8/TCLKH
pulse PB6/A14/TIOCA8
generator
PB5/A13/TIOCB7/TCLKG
Port B
PB4/A12/TIOCA7
Bus controller
PF7/φ PB3/A11/TIOCD6/TCLKF
PF4/HWR PB0/A8/TIOCA6
PF3/LWR/SSO0-C DMAC
PF2/CS6/LCAS*/SSI0-C PC7/A7/TIOCB11
ROM PC6/A6/TIOCA11
PF1/CS5/UCAS*/SSCK0-C
(flash memory) PC5/A5/TIOCB10
PF0/WAIT-A/OE-A*/ADTRG0-B/SCS0-C
Port C
PC4/A4/TIOCA10
PG6/BREQ-A PC3/A3/TIOCD9
PG5/BACK-A PC2/A2/TIOCC9
WDT
PG4/BREQO-A/CS4 PC1/A1/TIOCB9
Port G
PG3/CS3/RAS3* PC0/A0/TIOCA9-A
PG2/CS2/RAS2* RAM SCI × 5 channels
P35/OE-B*/SCK1/SCL0
PG1/CS1
P34/SCK0/SCK4-A/SDA0
PG0/CS0
Port 3
P33/RxD1/SCL1
IIC2 × 4 channels
P32/RxD0/IrRxD/SDA1
P31/TxD1
P85/PO5-B/TIOCB4-B/TMO1-B/SCK3/TIOCA9-B 8-bit D/A converter
Port 8
Port 5
PPG P52/BACK-B/IRQ2-A/PO4-B/TIOCA4-B/TMO0-B/SCK2
P51/BREQ-B/IRQ1-A/PO2-B/TIOCC3-B/TMCI0-B/RxD2/SCL3
SSU
P50/BREQO-B/IRQ0-A/PO0-B/TIOCA3-B/TMRI0-B/TxD2/SDA3
TMR × 2 channels
AVCC
AVSS
Vref
P63/IRQ11-A/TEND1/TEND3/TEND5/TMCI1-A
P62/IRQ10-A/TEND0/TEND1/TEND4/TMCI0-A
P61/IRQ9-A/DREQ1/DREQ3/DREQ5/TMRI1-A
P60/IRQ8-A/DREQ0/DREQ1/DREQ4/TMRI0-A
PF1/UCAS*4/DQMU*1/IRQ14-A/SSCK0-C
PF2/LCAS*4/DQML*1/IRQ15-A/SSI0-C
P65/IRQ13-A/DACK1/DACK3/TMO1-A
P64/IRQ12-A/DACK0/DACK1/TMO0-A
PF0/WAIT-A/ADTRG0-B/SCS0-C
PF3/LWR/SSO0-C
PD7/D15/AD15
PD6/D14/AD14
PD5/D13/AD13
PD4/D12/AD12
PD3/D11/AD11
PD2/D10/AD10
PD1/D9/AD9
PD0/D8/AD8
PF6/AS/AH
PF4/HWR
PG1/CS1
PG0/CS0
PF5/RD
PLLVss
PLLVcc
EXTAL
PF7/φ
STBY
XTAL
RES
PJ1
PJ0
Vss
Vcc
Vcc
Vss
108
107
106
105
104
103
102
101
100
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
75
74
73
PG2/CS2/RAS2*4/RAS*1 109 72 Vcc
PG3/CS3/RAS3*4/CAS*1 110 71 PE7/D7/AD7
AVcc 111 70 Vss
Vref 112 69 PE6/D6/AD6
P40/AN0_0 113 68 PE5/D5/AD5
P41/AN1_0 114 67 PE4/D4/AD4
P42/AN2_0 115 66 PE3/D3/AD3
P43/AN3_0 116 65 PE2/D2/AD2
P44/AN4_0 117 64 PE1/D1/AD1
P45/AN5_0 118 63 PE0/D0/AD0
P46/AN6_0 119 62 PJ2
P47/AN7_0 120 61 P85/IRQ5-B/PO5-B/TIOCB4-B/TMO1-B/SCK3/EDACK3/TIOCA9-B
P90/AN8_1 121 60 P84/IRQ4-B/EDACK2
P91/AN9_1 122 59 P83/IRQ3-B/PO3-B/TIOCD3-B/TMCI1-B/RxD3/ETEND3
P92/AN10_1 123 58 P27/IRQ15-B/PO7/TIOCB5/SCL2
P93/AN11_1 124 H8S/2427 Group, 57 P26/IRQ14-B/PO6/TIOCA5/SDA2/ADTRG1
P94/AN12_1/DA2 125 56 P25/WAIT-B/IRQ13-B/PO5-A/TIOCB4-A
P95/AN13_1/DA3 H8S/2427R Group 55 P24/IRQ12-B/PO4-A/TIOCA4-A/RxD4-A
126
P96/AN14_1 127 PLQP0144KA-A 54 P23/IRQ11-B/PO3-A/TIOCD3/TxD4-A
P97/AN15_1 128 FP-144LV 53 P22/IRQ10-B/PO2-A/TIOCC3-A
AVss 129 52 P21/IRQ9-B/PO1-A/TIOCB3-A
(Top view)
PG4/BREQO-A/ETCK*5 130 51 P20/IRQ8-B/PO0-A/TIOCA3-A
PG5/BACK-A/ETMS*5 131 50 Vss
PG6/BREQ-A/ETDI*5 132 49 P17/PO15/TIOCB2/TCLKD/EDRAK3/SCS0-A
P50/BREQO-B/IRQ0-A/PO0-B/TIOCA3-B/TMRI0-B/TxD2/SDA3 133 48 P16/PO14/TIOCA2/EDRAK2/SSCK0-A
P51/BREQ-B/IRQ1-A/PO2-B/TIOCC3-B/TMCI0-B/RxD2/SCL3 134 47 P15/PO13/TIOCB1/TCLKC/SSI0-A
P52/BACK-B/IRQ2-A/PO4-B/TIOCA4-B/TMO0-B/SCK2 135 46 P14/PO12/TIOCA1/SSO0-A
P53/IRQ3-A/ADTRG0-A/ETRST*5 136 45 P13/PO11/TIOCD0/TCLKB
P35/OE-B*4/CKE-B*1/SCK1/SCL0 137 44 P12/PO10/TIOCC0/TCLKA
P34/SCK0/SCK4-A/SDA0 138 43 P11/PO9/TIOCB0
P33/RxD1/SCL1 139 42 P10/PO8/TIOCA0
P32/RxD0/IrRxD/SDA1 140 41 VCL*3
P31/TxD1 141 40 NMI
P30/TxD0/IrTxD 142 39 WDTOVF/ETDO*5
MD0 143 38 PH3/CS7/OE-A*4/CKE-A*1/IRQ7-B
MD1 144 37 PH2/CS6/IRQ6-B
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
1
2
3
4
5
6
7
8
9
MD2
Vss
P80/IRQ0-B/EDREQ2
Vcc
PC0/A0/TIOCA9-A
PC1/A1/TIOCB9
PC2/A2/TIOCC9
PC3/A3/TIOCD9
PC4/A4/TIOCA10
Vss
PC5/A5/TIOCB10
PC6/A6/TIOCA11
PC7/A7/TIOCB11
PB0/A8/TIOCA6
PB1/A9/TIOCB6
PB2/A10/TIOCC6/TCLKE
PB3/A11/TIOCD6/TCLKF
Vss
PB4/A12/TIOCA7
PB5/A13/TIOCB7/TCLKG
PB6/A14/TIOCA8
PB7/A15/TIOCB8/TCLKH
PA0/A16
PA1/A17/TxD4-B
Vss
PA2/A18/RxD4-B
PA3/A19/SCK4-B
PA4/A20/IRQ4-A/SCS0-B/FSISS
PA5/A21/IRQ5-A/SSCK0-B/FSICK
PA6/A22/IRQ6-A/SSI0-B/FSIDI
PA7/A23/IRQ7-A/SSO0-B/FSIDO
EMLE*2
P81/IRQ1-B/PO1-B/TIOCB3-B/TMRI1-B/TxD3/EDREQ3
P82/IRQ2-B/ETEND2
PH0/CS4/RAS4*4/WE*1
PH1/CS5/RAS5*4/SDRAMφ*1
41
0.1 μF
(recommended value)
Figure 1.4 Pin Assignments for H8S/2427 Group and H8S/2427R Group
PF0/WAIT-A/OE-A*3/ADTRG0-B/SCS0-C
P83/PO3-B/TIOCD3-B/TMCI1-B/RxD3
P81/PO1-B/TIOCB3-B/TMRI1-B/TxD3
PF1/CS5/UCAS*3/SSCK0-C
PF2/CS6/LCAS*3/SSI0-C
PF3/LWR/SSO0-C
PF6/AS/AH
PF4/HWR
PG1/CS1
PG0/CS0
PD7/D15
PD6/D14
PD5/D13
PD4/D12
PD3/D11
PD2/D10
PF5/RD
PLLVCC
PD1/D9
PD0/D8
PLLVSS
EXTAL
PF7/φ
STBY
XTAL
RES
VCC
VCC
VSS
VSS
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
PG2/CS2/RAS2*3 91 60 VCC
PG3/CS3/RAS3*3 92 59 PE7/D7
AVCC 93 58 VSS
Vref 94 57 PE6/D6
P40/IRQ0-B/AN0_0 95 56 PE5/D5
P41/IRQ1-B/AN1_0 96 55 PE4/D4
P42/IRQ2-B/AN2_0 97 54 PE3/D3
P43/IRQ3-B/AN3_0 98 53 PE2/D2
P44/IRQ4-B/AN4_0 99 52 PE1/D1
P45/IRQ5-B/AN5_0 100 51 PE0/D0
P46/IRQ6-B/AN6_0 101 50 P85/PO5-B/TIOCB4-B/TMO1-B/SCK3/TIOCA9-B
P47/IRQ7-B/AN7_0 102 49 P27/PO7/TIOCB5/SCL2
P94/AN12_1/DA2 103 48 P26/PO6/TIOCA5/SDA2/ADTRG1
104 H8S/2425 Group 47 P25/WAIT-B/PO5-A/TIOCB4-A/TMO1-A
P95/AN13_1/DA3
AVSS 105 PLQ0120LA-A 46 P24/PO4-A/TIOCA4-A/TMO0-A/RxD4-A
PG4/BREQO-A/CS4/ETCK*4 106 PLQP0120KA-A 45 P23/PO3-A/TIOCD3-A/TMCI1-A/TxD4-A
PG5/BACK-A/ETMS*4 107 44 P22/PO2-A/TIOCC3-A/TMCI0-A
108
FP-120BV 43 P21/PO1-A/TIOCB3-A/TMRI1-A
PG6/BREQ-A/ETDI*4
P50/BREQO-B/IRQ0-A/PO0-B/TIOCA3-B/TMRI0-B/TxD2/SDA3 109 (Top view) 42 P20/PO0-A/TIOCA3-A/TMRI0-A
P51/BREQ-B/IRQ1-A/PO2-B/TIOCC3-B/TMCI0-B/RxD2/SCL3 110 41 P17/PO15/TIOCB2/TCLKD/SCS0-A
P52/BACK-B/IRQ2-A/PO4-B/TIOCA4-B/TMO0-B/SCK2 111 40 P16/PO14/TIOCA2/SSCK0-A
P53/IRQ3-A/ADTRG0-A/ETRST*4 112 39 P15/DACK1/DACK3/PO13/TIOCB1/TCLKC/SSI0-A
P35/OE-B*3/SCK1/SCL0 113 38 P14/DACK0/DACK1/PO12/TIOCA1/SSO0-A
P34/SCK0/SCK4-A/SDA0 114 37 P13/TEND1/TEND3/TEND5/PO11/TIOCD0/TCLKB
P33/RxD1/SCL1 115 36 P12/TEND0/TEND1/TEND4/PO10/TIOCC0/TCLKA
P32/RxD0/IrRxD/SDA1 116 35 P11/DREQ1/DREQ3/DREQ5/PO9/TIOCB0
P31/TxD1 117 34 P10/DREQ0/DREQ1/DREQ4/PO8/TIOCA0
P30/TxD0/IrTxD 118 33 VCL*2
MD0 119 32 NMI
MD1 120 31 WDTOVF/ETDO*4
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
MD2
VCC
PC0/A0/TIOCA9-A
PC1/A1/TIOCB9
PC2/A2/TIOCC9
PC3/A3/TIOCD9
PC4/A4/TIOCA10
VSS
PC5/A5/TIOCB10
PC6/A6/TIOCA11
PC7/A7/TIOCB11
PB0/A8/TIOCA6
PB1/A9/TIOCB6
PB2/A10/TIOCC6/TCLKE
PB3/A11/TIOCD6/TCLKF
PB4/A12/TIOCA7
VSS
PB5/A13/TIOCB7/TCLKG
PB6/A14/TIOCA8
PB7/A15/TIOCB8/TCLKH
PA0/A16
VSS
PA1/A17/TxD4-B
PA2/A18/RxD4-B
PA3/A19/SCK4-B
PA4/A20/IRQ4-A/SCS0-B/FSISS
PA5/A21/IRQ5-A/SSCK0-B/FSICK
PA6/A22/IRQ6-A/SSI0-B/FSIDI
PA7/A23/CS7/IRQ7-A/SSO0-B/FSIDO
EMLE*1
33
0.1 μF
(recommended value)
Notes: 1. Emulator enable pin. In normal operating mode, this pin should be fixed low.
Driving this pin high in the flash-memory version enables the on-chip emulation function.
When the on-chip emulation function is in use, pins P53, PG4, PG5, PG6, and WDTOVF are used exclusively as the on-chip emulator pins.
2. The VCL pin should be connected to an external capacitor.
3. Not included in the 5-V version.
4. This pin is dedicated to the on-chip emulator. This pin is enabled when the EMLE pin is high.
1 2 3 4 5 6 7 8 9 10 11 12 13
A Vss MD1 MD0 P32 P35 P50 AVss P94 P90 P44 P40 PG2 PG3
B MD2 Vcc P31 P34 P51 PG4 P93 P47 P45 P42 AVcc Vref PG1
C PC0 P80 PC1 P30 P33 P52 PG5 P92 P46 P43 P41 PG0 P65
D PC4 PC2 PC3 P53 PG6 P97 P96 P95 P91 P63 PJ0 P64 STBY
K EMLE PA6 P82 PA4 P15 P16 P27 P83 PE0 PE4 PD7 PD6 P61
L PH0 P81 VCL P12 P17 P20 P21 P26 Vss PE3 PD4 PD2 PD5
M PH1 PH3 WDTOVF P11 P13 P22 P24 P85 PE2 PE6 Vss PD3 PD0
N NMI PH2 P10 P14 Vss P23 P25 P84 PE1 PE5 PE7 Vcc PD1
Figure 1.6 Pin Assignments for H8S/2427 Group and H8S/2427R Group
Table 1.3 Pin Assignments in Each Operating Mode of H8S/2427 Group and H8S/2427R
Group
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
1 1 1 1
SDRAMφ* SDRAMφ* SDRAMφ* SDRAMφ*
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
2 2 2
85 H12 PF1/UCAS* / PF1/UCAS* / PF1/UCAS* / PF1/UCAS*2/ PF1/IRQ14-A/ NC
1 1 1
DQMU* / DQMU* / DQMU* / DQMU*1/ SSCK0-C
IRQ14-A/ IRQ14-A/ IRQ14-A/ IRQ14-A/
SSCK0-C SSCK0-C SSCK0-C SSCK0-C
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
89 G12 RD RD RD RD PF5 NC
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
Flash
Mode 3, 5, 7
Memory
Programmer
PLQP0144KA-A PTLG0145JB-A Mode 1 Mode 2 Mode 4 EXPE = 1 EXPE = 0 Mode
⎯ E5 NC NC NC NC NC NC
74 RD RD RD RD PF5 NC
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
Power VCC 4, 72, 98, B2, N12, E11 2, 60, 83, Input For connection to the power supply.
supply 99 E13 84 VCC pins should be connected to the
system power supply.
VSS 2, 10, 18, A1, E2, F4, H1 8, 17, 22, Input For connection to ground. VSS pins
25, 50, 70, 95, N5, M11, E10 58, 80, 87 should be connected to the system
102 F11, L9 power supply (0 V).
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
System RES 92 G11 77 Input Reset pin. When this pin is driven
control low, the chip is reset.
Address A23 to A0 31 to 26, J3, K2, J1, K4 29 to 23, Output These pins output an address.
bus 24 to 19, 21 to 18,
H3, J2, J4, G3
17 to 11, 16 to 9,
9 to 5 H2, G1, H4, G4 7 to 3
F1, G2, F3, E4
E1, F2, E3, D1
Data bus D15 to D0 80 to 73, K11, K12, L13 68 to 61, Input/ These pins constitute a bidirectional
71, 59, output data bus. When an address/data
L11, M12, L12
69 to 63 57 to 51 multiplexed I/O space is accessed,
N13, M13, N11 an address is also output.
M11, N10, L9
Address/ AD15 to 80 to 73, K11, K12, L13, 68 to 61, Input/ These pins output an address, and
data AD0 71, L11, M12, L12, 59, output input or output data.
multiplexed 69 to 63 N13, M13, N11, 57 to 51
bus M10, N10, K10,
L10, M9, N9, K9
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
Bus CS7 to 38 to 35, M2, N2, M1, L1, 29, 71, 70, 106, Output Signals that select division areas 7
control CS0 110 to 107 A13, A12, B13, 92 to 89 to 0 in the external address space
C12
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
Bus DQMU* 1
85 H12 ⎯ Output Upper data mask enable signal for
control accessing the 16-bit continuous
synchronous DRAM space. Also
functions as the data mask enable
signal for accessing the 8-bit
continuous synchronous DRAM
space.
RAS2*3 109 A12 91 Output Row address strobe signal for the
DRAM when the DRAM interface is
RAS3*3 110 A13 92
set.
RAS4*2*3 35 L1 ⎯ Row address strobe signal when
RAS5*2*3 36 M1 ⎯ areas 2 to 5 are set as the
continuous DRAM space.
RAS*1 109 A12 ⎯ Output Row address strobe signal for the
synchronous DRAM when the
synchronous DRAM interface is set.
CKE-A* 1
38 M2 ⎯ Output Clock enable signal when the
synchronous DRAM interface is set.
CKE-B*1 137 A5 ⎯
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
IRQ15-A to 86, 85, H10, H12 ⎯ Input These pins request a maskable
IRQ8-A*2 106 to 104, interrupt.
C13, D12
83 to 81
The input pins of IRQn-A and IRQn-
D10, J10
B are selected by the IRQ pin select
K13, J12 register (ITSR) of the interrupt
IRQ7-A to 31 to 28, J3, K2, J1 29 to 26, controller.
IRQ0-A 136 to 133 112 to 109 (n = 0 to 15 for the H8S/2427 Group
K4, D4, C6
and H8S/2427R Group, n = 0 to 7
B5, A6 for the H8S/2425 Group)
IRQ15-B to 58 to 51 K7, L8, N7 ⎯
IRQ8-B*2
M7, N6, M6, L7,
L6
DREQ0/ 81 J12 34
DREQ1/
DREQ4
TEND0/ 83 J10 36
TEND1/
TEND4
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
TIOCD3-B 59 K8 85
TIOCB4-B 61 M8 50
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
PO5-B 61 M8 50
PO4-B 135 C6 111
PO3-B 59 K8 85
8-bit timer TMO0-A 105 D12 46 Output Waveform output pins with output
(TMR) compare function.
TMO1-A 106 C13 47
TMO0-B 135 C6 111
TMO1-B 61 M8 50
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
I2C bus SCL3 134 B5 110 Input/ I2C clock input/output pins.
interface 2 output
SCL2 58 K7 49
(IIC2)
SCL1 139 C5 115
SCL0 137 A5 113
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
AN7_0 to 120 to 113 B8, C9, B9 102 to 95 Input Analog input pins.
AN0_0
A10, C10, B10
C11, A11
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
A/D AVCC 111 B11 93 Input Analog power-supply pin for the A/D
converter, converter and D/A converter. When
D/A the A/D converter and D/A
converter converter are not used, this pin
should be connected to the system
power supply (VCC).
AVSS 129 A7 105 Input Ground pin for the A/D converter
and D/A converter. This pin should
be connected to the system power
supply (VSS).
Vref 112 B12 94 Input 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
power supply (VCC).
I/O ports P17 to P10 49 to 42 L5, K6, K5, N4 41 to 34 Input/ 8-bit input/output pins.
output
M5, L4, M4, N3
P35 to P30 137 to 142 A5, B4, C5 113 to 118 Input/ 6-bit input/output pins.
output
A4, B3, C4
P47 to P40 120 to 113 B8, C9, B9 102 to 95 Input 8-bit input pins.
P53 toP50 136 to 133 D4, C6, B5 112 to 109 Input/ 4-bit input/output pins.
output
A6
P65 to 106 to 104, C13, D12, D10 ⎯ Input/ 6-bit input/output pins.
P60*2 83 to 81 output
J10, K13, J12
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
P97*2, 128 to 121 D6, D7, D8 104, 103 Input 8-bit input/output pins in the
P96*2, H8S/2427 Group and H8S/2427R
A8, B7, C8
P95, P94, Group.
P93 to D9, A9
2-bit input/output pins in the
P90*2
H8S/2425 Group.
J4, G3
PB7 to 22 to 19, H2, G1, H4, G4 20 to 18, Input/ 8-bit input/output pins.
PB0 17 to 14 16 to 12 output
F1, G2, F3, E4
N13, M13
Pin No.
PLQ0120LA-A
Type Symbol PLQP0144KA-A PTLG0145JB-A PLQP0120KA-A I/O Function
I/O ports PG6 to 132 to 130, D5, C7, B6 108 to 106, Input/ 7-bit input/output pins.
PG0 110 to 107 92 to 89 output
A13, A12
B13, C12
Section 2 CPU
The H8S/2600 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/2600 CPU has sixteen 16-bit
general registers, can address a 16-Mbyte linear address space, and is ideal for realtime control.
This section describes the H8S/2600 CPU. The usable modes and address spaces differ depending
on the product. For details on each product, refer to section 3, MCU Operating Modes.
2.1 Features
• Upward-compatible with H8/300 and H8/300H CPUs
Can execute H8/300 and H8/300H CPUs object programs
• General-register architecture
Sixteen 16-bit general registers also usable as sixteen 8-bit registers or eight 32-bit registers
• Sixty-nine basic instructions
8/16/32-bit arithmetic and logic instructions
Multiply and divide instructions
Powerful bit-manipulation instructions
Multiply-and-accumulate instruction
• Eight addressing modes
Register 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 space
Program: 16 Mbytes
Data: 16 Mbytes
• High-speed operation
All frequently-used instructions execute in one or two states
8/16/32-bit register-register add/subtract: 1 state
8 × 8-bit register-register multiply: 2 states
• Power-down state
Transition to power-down state by SLEEP instruction
CPU clock speed selection
The differences between the H8S/2600 CPU and the H8S/2000 CPU are as shown below.
• Register configuration
The MAC register is supported only by the H8S/2600 CPU.
• Basic instructions
The four instructions MAC, CLRMAC, LDMAC, and STMAC are supported only by the
H8S/2600 CPU.
• The number of execution states of the MULXU and MULXS instructions
Execution States
Instruction Mnemonic H8S/2600 H8S/2000
MULXU MULXU.B Rs, Rd 2* 12
MULXU.W Rs, ERd 2* 20
MULXS MULXS.B Rs, Rd 3* 13
MULXS.W Rs, ERd 3* 21
CLRMAC CLRMAC 1* Not supported
LDMAC LDMAC ERs, MACH 1*
LDMAC ERs, MACL 1*
STMAC STMAC MACH, ERd 1*
STMAC MACL, ERd 1*
Note: * The number of execution states is incremented following a MAC instruction.
In addition, there are differences in address space, CCR and EXR register functions,
power-down modes, etc., depending on the model.
In comparison to the H8/300 CPU, the H8S/2600 CPU has the following enhancements.
In comparison to the H8/300H CPU, the H8S/2600 CPU has the following enhancements.
The exception vector table and stack have the same structure as in the H8/300 CPU.
• Address Space
The H8S/2600 CPU provides linear access to a maximum 64-Kbyte address space.
• Extended Registers (En)
The extended registers (E0 to E7) can be used as 16-bit registers, or as the upper 16-bit
segments of 32-bit registers.
When En is used as a 16-bit register it can contain any value, even when the corresponding
general register (Rn) is used as an address register. If the general register is referenced in the
register indirect addressing mode with pre-decrement (@–Rn) or post-increment (@Rn+) and a
carry or borrow occurs, however, the value in the corresponding extended register (En) will be
affected.
• Instruction Set
All instructions and addressing modes can be used. Only the lower 16 bits of effective
addresses (EA) are valid.
• Exception Vector Table and Memory Indirect Branch Addresses
In normal mode the top area starting at H'0000 is allocated to the exception vector table. One
branch address is stored per 16 bits. The exception vector table in normal mode is shown in
figure 2.1. For details of the exception vector table, see section 5, Exception Handling.
The memory indirect addressing mode (@@aa:8) employed in the JMP and JSR instructions
uses an 8-bit absolute address included in the instruction code to specify a memory operand
that contains a branch address. In normal mode the operand is a 16-bit word operand,
providing a 16-bit branch address. Branch addresses can be stored in the top area from H'0000
to H'00FF. Note that this area is also used for the exception vector table.
• Stack Structure
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. EXR is not pushed onto the stack
in interrupt control mode 0. For details, see section 5, Exception Handling.
H'0000
Reset exception vector
H'0001
H'0002
(Reserved for system use)
H'0003
H'0004
H'0005
(Reserved for system use)
H'0006 Exception
H'0007 vector table
H'0008
Exception vector 1
H'0009
H'000A
Exception vector 2
H'000B
SP PC SP EXR*1
(16 bits) Reserved*1 *3
(SP*2 ) CCR
CCR*3
PC
(16 bits)
• Address Space
Linear access is provided to a 16-Mbyte maximum address space.
• Extended Registers (En)
The extended registers (E0 to E7) can be used as 16-bit registers, or as the upper 16-bit
segments of 32-bit registers or address registers.
• Instruction Set
All instructions and addressing modes can be used.
• Exception Vector Table and Memory Indirect Branch Addresses
In advanced mode the top area starting at H'00000000 is allocated to the exception vector table
in 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.3). For details of the exception vector table, see section 5, Exception
Handling.
H'00000000 Reserved
H'0000000B
(Reserved for system use)
H'0000000C
H'00000010 Reserved
Exception vector 1
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 part of
this range is also used for the exception vector table.
• Stack Structure
In advanced mode, when the program counter (PC) is pushed onto the stack in a subroutine
call, and the PC, 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.4. EXR is not
pushed onto the stack in interrupt control mode 0. For details, see section 5, Exception
Handling.
SP EXR*1
SP Reserved Reserved*1 *3
(SP*2 ) CCR
PC
(24 bits) PC
(24 bits)
H'0000 H'00000000
64 Kbytes 16 Mbytes
Cannnot be
used in this LSI
H'FFFFFFFF
2.4 Registers
The H8S/2600 CPU has the internal registers shown in figure 2.6. There are two types of registers:
general registers and control registers. Control registers are a 24-bit program counter (PC), an 8-
bit extended register (EXR), an 8-bit condition code register (CCR), and a 64-bit multiply-
accumulate register (MAC).
7 6 5 4 3 2 1 0
EXR T - - - - I2 I1 I0
7 6 5 4 3 2 1 0
CCR I UI H U N Z V C
63 41 32
Sign extension MACH
MAC
MACL
31 0
[Legend]
SP: Stack pointer H: Half-carry flag
PC: Program counter U: User bit
EXR: Extended register N: Negative flag
T: Trace bit Z: Zero flag
I2 to I0: Interrupt mask bits V: Overflow flag
CCR: Condition-code register C: Carry flag
I: Interrupt mask bit MAC: Multiply-accumulate register
UI: User bit or interrupt mask bit*
The H8S/2600 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. Figure 2.7 illustrates the
usage of the general registers. When the general registers are used as 32-bit registers or address
registers, they are designated by the letters ER (ER0 to ER7).
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.
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.8 shows the
stack.
Free area
SP (ER7)
Stack area
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.)
EXR is an 8-bit register that can be manipulated by the LDC, STC, ANDC, ORC, and XORC
instructions. When these instructions except for the STC instruction is executed, all interrupts
including NMI will be masked for three states after execution is completed.
This 8-bit register contains internal CPU status information, including an interrupt mask bit (I) and
half-carry (H), negative (N), zero (Z), overflow (V), and carry (C) flags.
Operations can be performed on the CCR bits by the LDC, STC, ANDC, ORC, and XORC
instructions. The N, Z, V, and C flags are used as branching conditions for conditional branch
(Bcc) instructions.
This 64-bit register stores the results of multiply-and-accumulate operations. It consists of two 32-
bit registers denoted MACH and MACL. The lower 10 bits of MACH are valid; the upper bits are
a sign extension.
When the reset exception handling loads the start address from the vector address, PC is
initialized, the T bit in EXR is cleared to 0, and the I bits in EXR and CCR are set to 1. However,
the general registers and the other CCR bits are not initialized. The initial value of SP (ER7) is
undefined. SP should therefore be initialized by using the MOV.L instruction immediately after a
reset.
7 0
1-bit data RnL Don't care 7 6 5 4 3 2 1 0
7 4 3 0
4-bit BCD data RnH Upper Lower Don't care
7 4 3 0
4-bit BCD data RnL Don't care Upper Lower
7 0
Byte data RnH Don't care
MSB LSB
7 0
Byte data RnL Don't care
MSB LSB
Word data Rn
15 0
MSB LSB
Word data En
15 0
MSB LSB
MSB En Rn LSB
Legend:
ERn : General register ER
En : General register E
Rn : General register R
RnH : General register RH
RnL : General register RL
MSB : Most significant bit
LSB : Least significant bit
Figure 2.10 shows the data formats in memory. The H8S/2600 CPU can access word data and
longword data in memory, but word or longword data must begin at an even address. If an attempt
is made to access word or longword data at an odd address, no address error occurs but the least
significant bit of the address is regarded as 0, so the access starts at the preceding address. This
also applies to instruction fetches.
When SP (ER7) is used as an address register to access the stack, the operand size should be word
size or longword size.
7 0
1-bit data Address L 7 6 5 4 3 2 1 0
Address 2N+2
Tables 2.3 to 2.10 summarize the instructions in each functional category. The notation used in
tables 2.3 to 2.10 is defined below.
Symbol Description
Rd General register (destination)*
Rs General register (source)*
Rn General register*
ERn General register (32-bit register)
MAC Multiply-accumulate register (32-bit register)
(EAd) Destination operand
(EAs) Source operand
EXR Extended 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
Symbol Description
→ 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).
The H8S/2600 Series instructions consist of 2-byte (1-word) units. An instruction consists of an
operation field (op), a register field (r), an effective address extension (EA), and a condition field
(cc).
• Operation Field
Indicates the function of the instruction, the addressing mode, and the operation to be carried
out on the operand. The operation field always includes the first four bits of the instruction.
Some instructions have two operation fields.
• Register Field
Specifies a general register. Address registers are specified by 3 bits, data registers by 3 bits or
4 bits. Some instructions have two register fields. Some have no register field.
• Effective Address Extension
8, 16, or 32 bits specifying immediate data, an absolute address, or a displacement.
• Condition Field
Specifies the branching condition of Bcc instructions.
op rn rm
MOV.B @(d:16, Rn), Rm, etc.
EA (disp)
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.
The register field of the instruction code 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 registers. ER0 to ER7 can be specified as 32-bit registers.
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).
A 16-bit or 32-bit displacement contained in the instruction is added to an address register (ERn)
specified by the register field of the instruction code, and the sum gives the address of a memory
operand. A 16-bit displacement is sign-extended when added.
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.
The instruction code contains the absolute address of a memory operand. The absolute address
may be 8 bits long (@aa:8), 16 bits long (@aa:16), 24 bits long (@aa:24), or 32 bits long
(@aa:32). Table 2.12 indicates the accessible absolute address ranges.
To access data, the absolute address should be 8 bits (@aa:8), 16 bits (@aa:16), or 32 bits
(@aa:32) long. For an 8-bit absolute address, the upper 24 bits are all assumed to be 1 (H'FFFF).
For a 16-bit absolute address, the upper 16 bits are a sign extension. 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).
The instruction code 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.
This mode is used in the Bcc and BSR instructions. An 8-bit or 16-bit displacement contained in
the instruction code 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.
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 branch address.
The upper bits of the absolute address are all assumed to be 0, so the address range is 0 to 255
(H'0000 to H'00FF in normal mode, H'000000 to H'0000FF in advanced mode).
In normal mode the memory operand is a word operand and the branch address is 16 bits long. In
advanced mode the memory operand is a longword operand, the first byte of which is assumed to
be 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 5, Exception Handling.
If an odd address is specified in word or longword memory access, or as a branch address, the
least significant bit is regarded as 0, causing data to be accessed or instruction code to be fetched
at the address preceding the specified address. (For further information, see section 2.5.2, Memory
Data Formats.)
Table 2.13 indicates how effective addresses are calculated in each addressing mode. In normal
mode the upper 8 bits of the effective address are ignored in order to generate a 16-bit address.
No Addressing Mode and Instruction Format Effective Address Calculation Effective Address (EA)
1 Register direct (Rn)
Operand is general register contents.
op rm rn
op r
op r 1, 2, or 4
No Addressing Mode and Instruction Format Effective Address Calculation Effective Address (EA)
5 Absolute address
@aa:8 31 24 23 8 7 0
op abs Don't care H'FFFF
@aa:16 31 24 23 16 15 0
op abs Don't care Sign extension
@aa:24 31 24 23 0
op abs Don't care
@aa:32
op 31 24 23 0
abs Don't care
6 Immediate
#xx:8/#xx:16/#xx:32
Operand is immediate data.
op IMM
7 Program-counter relative 23 0
@(d:8,PC)/@(d:16,PC) PC contents
op disp 23 0
Sign
extension disp
31 24 23 0
Don't care
• Normal mode*
31 8 7 0
op abs
H'000000 abs
15 0 31 24 23 16 15 0
Memory contents Don't care H'00
• Advanced mode
31 8 7 0
op abs
H'000000 abs 31 24 23 0
31 0 Don't care
Memory contents
• Reset State
The CPU and on-chip peripheral modules are all initialized and stop. 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. For details, refer to section 5, Exception Handling.
The reset state can also be entered by a watchdog timer overflow.
• Exception-Handling State
The exception-handling state is a transient state that occurs when the CPU alters the normal
processing flow due to an exception source, such as, a reset, trace, interrupt, or trap instruction.
The CPU fetches a start address (vector) from the exception vector table and branches to that
address. For further details, refer to section 5, Exception Handling.
• Program Execution State
In this state the CPU executes program instructions in sequence.
• Bus-Released State
In a product which has a bus master other than the CPU, such as a direct memory access
controller (DMAC) and a data transfer controller (DTC), the bus-released state occurs when
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 operations.
• Program stop state
This is a power-down state in which the CPU stops operating. The program stop state occurs
when a SLEEP instruction is executed or the CPU enters hardware standby mode. For further
details, refer to section 25, Power-Down Modes.
SS EEP tion
es
SL truc
qu
BY
ins
st
SS EP i
re
SL
ue
=0
s
BY nst
g
eq
bu
E
lin
lin
sr
nd
nd
of
= 1 ruct
Bu
ha
ha
d
En
io n
ion
pt
pt
ce
ce
io
Bus-released state Sleep mode
ex
ex
n
or
of t
f
ues
d
st
q
En
ue t re
rrup
q
Inte
Re
RES = High
STBY = High,
RES = Low Hardware standby
Reset state*1
mode*2
Reset state
Power down state*3
Notes: 1. From any state except hardware standby mode, a transition to the reset state occurs whenever the RES pin
goes low. A transition can also be made to the reset state when the watchdog timer overflows.
2. In every state, when the STBY pin becomes low, the hardware standby mode is entered.
3. For details, refer to section 25, Power-Down Modes.
The BSET, BCLR, BNOT, BST, and BIST instructions are used to read data in byte-wise, operate
the data in bit-wise, and write the result of the bit-wise operation in bit-wise again. Therefore,
special care is necessary to use these instructions for the registers and the ports that include write-
only bit.
The BCLR instruction can be used to clear the flags in the internal I/O registers to 0. In this time,
if it is obvious that the flag has been set to 1 in the interrupt handler, there is no need to read the
flag beforehand.
Modes 1, 2, and 4 are externally expanded modes in which the CPU can access an external
memory and peripheral devices. In an externally expanded mode, the external address space can
be designated as an 8-bit or 16-bit address space for each area by the bus controller at the
beginning of program execution. If a 16-bit address space is designated for any one area, the 16-
bit bus mode is selected. If an 8-bit address space is designated for all areas, the 8-bit bus mode is
selected.
Mode 7 is a single-chip activation expanded mode in which the CPU can switch to access an
external memory and peripheral devices at the beginning of program execution.
Mode 3 is a boot mode in which the flash memory can be programmed or erased. For details on
the boot mode, refer to section 23, Flash Memory.
Mode 5 is a user boot mode in which the flash memory can be programmed or erased. For details
on the user boot mode, refer to section 23, Flash Memory.
The settings for pins MD2 to MD0 should not be changed during LSI operation.
SYSCR selects saturation operation for the MAC instruction, controls CPU access to the flash
memory control registers, sets the external bus mode, and enables or disables on-chip RAM.
3.3.1 Mode 1
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is disabled.
Ports A to C function as an address bus, ports D and E function as a data bus, and parts of ports F
to H function as bus control signals.
The initial bus mode immediately 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.
3.3.2 Mode 2
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is disabled.
Ports A to C function as an address bus, ports D and E function as a data bus, and parts of ports F
to H function as bus control signals.
The initial bus mode immediately after a reset is 8 bits, with 8-bit access to all areas. However, if
16-bit access is designated for any one of the areas by the bus controller, the bus mode switches to
16 bits and port E functions as a data bus.
3.3.3 Mode 3
This mode is a boot mode of the flash memory. This mode is the same as mode 7, except for the
programming and erasure of the flash memory. Mode 3 is only available in the flash memory
version.
3.3.4 Mode 4
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled.
The program in the on-chip ROM connected to the first half of area 0 is executed.
Ports A to C function as input ports immediately after a reset, but can be set to function as an
address bus depending on each port register setting. Port D functions as a data bus and parts of
ports F to H function as bus control signals. For details on function switching of ports A to C, see
section 11, I/O Ports.
The initial bus mode immediately after a reset is 8 bits, with 8-bit access to all areas. However, if
16-bit access is designated for any one of the areas by the bus controller, the bus mode switches to
16 bits and port E functions as a data bus.
In the flash memory version, user program mode is entered by clearing the CBIDB bit to 0 or
setting the FMCMDEN bit in FLMCR1 to 1.
3.3.5 Mode 5
This mode is a user boot mode of the flash memory. This mode is the same as mode 7, except for
the programming and erasure of the flash memory. Mode 5 is only available in the flash memory
version.
3.3.6 Mode 7
The CPU can access a 16-Mbyte address space in advanced mode. The on-chip ROM is enabled,
and the LSI starts up in single-chip mode. External address spaces cannot be used in single-chip
mode.
The initial mode immediately after a reset is single-chip mode, with all I/O ports available for use
as input/output ports. However, setting the EXPE bit in SYSCR to 1 switches the mode to an
externally expanded mode in which the external address spaces are enabled. When an externally
expanded mode is selected, all areas are initially designated as a 16-bit access space. The functions
of pins in ports A to H are the same as those in an externally expanded mode with on-chip ROM
enabled.
In the flash memory version, user program mode is entered by clearing the CBIDB bit to 0 or
setting the FMCMDEN bit in FLMCR1 to 1.
On-chip ROM
H'080000
H'F00000
Data flash area
H'F02000
H'FD8000 H'FD8000
Reserved area*4 Reserved area*4
H'FEC000 H'FEC000
On-chip RAM/External address space/
Reserved area*1*5
On-chip RAM/Reserved area*3*5
H'FF0000 H'FF0000
On-chip RAM/External address space*1 On-chip RAM*3
H'FFC000 H'FFC000
Reserved area*4 Reserved area*4
H'FFD000 H'FFD000
External address space/
External address space
Reserved area*2*4
H'FFE800 H'FFE800
Reserved area*4 Reserved area*4
H'FFF800 H'FFF800
Internal I/O registers Internal I/O registers
H'FFFF00 H'FFFF00
External address space/
External address space
Reserved area*2*4
H'FFFF20 H'FFFF20
Internal I/O registers Internal I/O registers
H'FFFFFF H'FFFFFF
Notes: 1. This area is specified as the external address space by clearing the RAME bit in SYSCR to 0.
2. This area is specified as the external address space when EXPE = 1 and the reserved area when EXPE = 0.
3. On-chip RAM is used for flash memory programming. The RAME bit in SYSCR should not be cleared to 0.
4. A reserved area should not be accessed.
5. Area from H'FEC000 to H'FF0000 in the H8S/24278, H8S/24278R, and H8S/24258 is reserved and should not be accessed.
Figure 3.1 Memory Map in Each Operating Mode (ROM: 512-Kbyte Version) (1):
H8S/24279, H8S/24279R, H8S/24278, H8S/24278R, H8S/24259, and H8S/24258
H'080000 H'080000
H'F00000 H'F00000
Data flash area Data flash area
H'F02000 H'F02000
H'FD8000 H'FD8000
Reserved area*4 Reserved area*4
H'FEC000 H'FEC000
On-chip RAM/External address space/
Reserved area*1*5 On-chip RAM/Reserved area*5*6
H'FF0000 H'FF0000
On-chip RAM/External address space*1 On-chip RAM*6
H'FFC000 H'FFC000
Reserved area*4 Reserved area*4
H'FFD000 H'FFD000
External address space/
External address space Reserved area*2*4
H'FFE800 H'FFE800
Reserved area*4 Reserved area*4
H'FFF800 H'FFF800
Internal I/O registers Internal I/O registers
H'FFFF00 H'FFFF00
External address space/
External address space
Reserved area*2*4
H'FFFF20 H'FFFF20
Internal I/O registers Internal I/O registers
H'FFFFFF H'FFFFFF
Notes: 1. This area is specified as the external address space by clearing the RAME bit in SYSCR to 0.
2. This area is specified as the external address space when EXPE = 1 and the reserved area when EXPE = 0.
3. While EXPE = 1, this area is specified as the external address space when RAME = 0 and the on-chip RAM area
when RAME = 1. While EXPE = 0, this area is specified as the on-chip RAM area.
4. A reserved area should not be accessed.
5. Area from H'FEC000 to H'FF0000 in the H8S/24278, H8S/24278R, and H8S/24258 is reserved and should not be accessed.
6. On-chip RAM is used for flash memory programming. The RAME bit in SYSCR should not be cleared to 0.
Figure 3.2 Memory Map in Each Operating Mode (ROM: 512-Kbyte Version) (2):
H8S/24279, H8S/24279R, H8S/24278, H8S/24278R, H8S/24259, and H8S/24258
On-chip ROM
H'080000
H'F00000
Data flash area
H'F02000
H'FD8000
Reserved area*4
H'FEC000
On-chip RAM/External address space/
Reserved area*3*5
H'FF0000
On-chip RAM/External address space*3
H'FFC000
Reserved area*4
H'FFD000
External address space/
Reserved area*2*4
H'FFE800
Reserved area*4
H'FFF800
Internal I/O registers
H'FFFF00
External address space/
Reserved area*2*4
H'FFFF20
Internal I/O registers
H'FFFFFF
Notes: 1. This area is specified as the external address space by clearing the RAME bit in SYSCR to 0.
2. This area is specified as the external address space when EXPE = 1 and the reserved area when EXPE = 0.
3. While EXPE = 1, this area is specified as the external address space when RAME = 0 and the on-chip RAM area
when RAME = 1. While EXPE = 0, this area is specified as the on-chip RAM area.
4. A reserved area should not be accessed.
5. Area from H'FEC000 to H'FF0000 in the H8S/24278, H8S/24278R, and H8S/24258 is reserved and should not be accessed.
Figure 3.3 Memory Map in Each Operating Mode (ROM: 512-Kbyte Version) (3):
H8S/24279, H8S/24279R, H8S/24278, H8S/24278R, H8S/24259, and H8S/24258
On-chip ROM
H'060000
Reserved area*4
H'080000
H'F00000
Data flash area
H'F02000
H'FD8000 H'FD8000
Reserved area*4 Reserved area*4
H'FEC000 H'FEC000
On-chip RAM/External address space/
Reserved area*1*5 On-chip RAM/Reserved area*3*5
H'FF0000 H'FF0000
On-chip RAM/External address space*1 On-chip RAM*3
H'FFC000 H'FFC000
Reserved area*4 Reserved area*4
H'FFD000 H'FFD000 External address space/
External address space Reserved area*2*4
H'FFE800 H'FFE800
Reserved area*4 Reserved area*4
H'FFF800 H'FFF800
Internal I/O registers Internal I/O registers
H'FFFF00 H'FFFF00 External address space/
External address space Reserved area*2*4
H'FFFF20 H'FFFF20
Internal I/O registers Internal I/O registers
H'FFFFFF H'FFFFFF
Notes: 1. This area is specified as the external address space by clearing the RAME bit in SYSCR to 0.
2. This area is specified as the external address space when EXPE = 1 and the reserved area when EXPE = 0.
3. On-chip RAM is used for flash memory programming. The RAME bit in SYSCR should not be cleared to 0.
4. A reserved area should not be accessed.
5. Area from H'FEC000 to H'FF0000 in the H8S/24275, H8S/24275R, and H8S/24255 is reserved and should not be accessed.
Figure 3.4 Memory Map in Each Operating Mode (ROM: 384-Kbyte Version) (1):
H8S/24276, H8S/24276R, H8S/24275, H8S/24275R, H8S/24256, and H8S/24255
H'000000 H'000000
H'060000 H'060000
Reserved area*4 Reserved area*4
H'080000 H'080000
H'F00000 H'F00000
Data flash area Data flash area
H'F02000 H'F02000
H'FD8000 H'FD8000
Reserved area*4 Reserved area*4
H'FEC000 H'FEC000
On-chip RAM/External address space/
Reserved area*1*5 On-chip RAM/Reserved area*5*6
H'FF0000 H'FF0000
On-chip RAM/External address space*1 On-chip RAM*6
H'FFC000 H'FFC000
Reserved area*4 Reserved area*4
H'FFD000 H'FFD000
External address space/
External address space Reserved area*2*4
H'FFE800 H'FFE800
Reserved area*4 Reserved area*4
H'FFF800 H'FFF800
Internal I/O registers Internal I/O registers
H'FFFF00 H'FFFF00
External address space/
External address space
Reserved area*2*4
H'FFFF20 H'FFFF20
Internal I/O registers Internal I/O registers
H'FFFFFF H'FFFFFF
Notes: 1. This area is specified as the external address space by clearing the RAME bit in SYSCR to 0.
2. This area is specified as the external address space when EXPE = 1 and the reserved area when EXPE = 0.
3. While EXPE = 1, this area is specified as the external address space when RAME = 0 and the on-chip RAM area
when RAME = 1. While EXPE = 0, this area is specified as the on-chip RAM area.
4. A reserved area should not be accessed.
5. Area from H'FEC000 to H'FF0000 in the H8S/24275, H8S/24275R, and H8S/24255 is reserved and should not be accessed.
6. On-chip RAM is used for flash memory programming. The RAME bit in SYSCR should not be cleared to 0.
Figure 3.5 Memory Map in Each Operating Mode (ROM: 384-Kbyte Version) (2):
H8S/24276, H8S/24276R, H8S/24275, H8S/24275R, H8S/24256, and H8S/24255
On-chip ROM
H'060000
Reserved area*4
H'080000
H'F00000
Data flash area
H'F02000
H'FD8000
Reserved area*4
H'FEC000
On-chip RAM/External address space/
Reserved area*3*5
H'FF0000
On-chip RAM/External address space*3
H'FFC000
Reserved area*4
H'FFD000
External address space/
Reserved area*2*4
H'FFE800
Reserved area*4
H'FFF800
Internal I/O registers
H'FFFF00
External address space/
Reserved area*2*4
H'FFFF20
Internal I/O registers
H'FFFFFF
Notes: 1. This area is specified as the external address space by clearing the RAME bit in SYSCR to 0.
2. This area is specified as the external address space when EXPE = 1 and the reserved area when EXPE = 0.
3. While EXPE = 1, this area is specified as the external address space when RAME = 0 and the on-chip RAM area
when RAME = 1. While EXPE = 0, this area is specified as the on-chip RAM area.
4. A reserved area should not be accessed.
5. Area from H'FEC000 to H'FF0000 in the H8S/24275, H8S/24275R, and H8S/24255 is reserved and should not be accessed.
Figure 3.6 Memory Map in Each Operating Mode (ROM: 384-Kbyte Version) (3):
H8S/24276, H8S/24276R, H8S/24275, H8S/24275R, H8S/24256, and H8S/24255
Section 4 Resets
The internal state and pins are initialized by a reset. Figure 4.1 shows the reset targets to be
initialized.
Pin reset
RES RSTCSR is initialized.
Note that some registers are not initialized by any of the resets. The following describes the CPU
internal registers.
The PC, one of the CPU internal registers, is initialized by loading the start address from vector
addresses with the reset exception handling. At this time, the T bit in EXR is cleared to 0 and the I
bits in EXR and CCR are set to 1. The general registers and other bits in CCR are not initialized.
The initial value of the SP (ER7) is undefined. The SP should be initialized using the MOV.L
instruction immediately after a reset. For details, see section 2, CPU. For other registers that are
not initialized by a reset, see register descriptions in each section.
When a reset is canceled, the reset exception handling is started. For the reset exception handling,
see section 5, Exception Handling.
TCSR selects the clock source to be input to TCNT of the watchdog timer, and the timer mode.
For details on the watchdog timer reset, see section 15, Watchdog Timer (WDT).
RSTCSR controls the generation of the internal reset signal when TCNT overflows, and selects
the type of internal reset signal. RSTCSR is initialized to H'1F by a reset signal from the RES pin,
but not by the WDT internal reset signal caused by overflows. For details on the watchdog timer
reset, see section 15, Watchdog Timer (WDT).
When the RES pin is driven low, all the processing in progress is aborted and the LSI enters a
reset state. In order to firmly reset the LSI by pin reset, the RES pin should be held low at least for
10 ms at a power-on. When a reset is input during operation, the RES pin should be held low at
least for 2 ms. Resetting the LSI initializes the internal state of the CPU and the registers of the
on-chip peripheral modules.
When the RSTE bit in RSTCSR is set to 1, if the TCNT overflows, a watchdog timer reset is
issued for 518 system clocks.
For details on the watchdog timer reset, see section 15, Watchdog Timer (WDT).
No
RSTCSR.WOVF = 1
Yes
Vector Address*1
Exception Source Vector Number Normal Mode*2 Advanced Mode
Power-on reset 0 H'0000 to H'0001 H'0000 to H'0003
3
Manual reset* 1 H'0002 to H'0003 H'0004 to H'0007
Reserved for system use 2 H'0004 to H'0005 H'0008 to H'000B
3 H'0006 to H'0007 H'000C to H'000F
Illegal instruction 4 H'0008 to H'0019 H'0010 to H'0013
Trace 5 H'000A to H'000B H'0014 to H'0017
Interrupt (direct transition)*3 6 H'000C to H'000D H'0018 to H'001B
Interrupt (NMI) 7 H'000E to H'000F H'001C to H'001F
Trap instruction (#0) 8 H'0010 to H'0011 H'0020 to H'0023
(#1) 9 H'0012 to H'0013 H'0024 to H'0027
(#2) 10 H'0014 to H'0015 H'0028 to H'002B
(#3) 11 H'0016 to H'0017 H'002C to H'002F
Reserved for system use 12 H'0018 to H'0019 H'0030 to H'0033
13 H'001A to H'001B H'0034 to H'0037
14 H'001C to H'001D H'0038 to H'003B
15 H'001E to H'001F H'003C to H'003F
External interrupt IRQ0 16 H'0020 to H'0021 H'0040 to H'0043
IRQ1 17 H'0022 to H'0023 H'0044 to H'0047
IRQ2 18 H'0024 to H'0025 H'0048 to H'004B
IRQ3 19 H'0026 to H'0027 H'004C to H'004F
IRQ4 20 H'0028 to H'0029 H'0050 to H'0053
IRQ5 21 H'002A to H'002B H'0054 to H'0057
IRQ6 22 H'002C to H'002D H'0058 to H'005B
Vector Address*1
Exception Source Vector Number Normal Mode*2 Advanced Mode
External interrupt IRQ7 23 H'002E to H'002F H'005C to H'005F
5
IRQ8* 24 H'0030 to H'0031 H'0060 to H'0063
5
IRQ9* 25 H'0032 to H'0033 H'0064 to H'0067
5
IRQ10* 26 H'0034 to H'0035 H'0068 to H'006B
5
IRQ11* 27 H'0036 to H'0037 H'006C to H'006F
5
IRQ12* 28 H'0038 to H'0039 H'0070 to H'0073
5
External interrupt IRQ13* 29 H'003A to H'003B H'0074 to H'0077
IRQ14*5 30 H'003C to H'003D H'0078 to H'007B
5
IRQ15* 31 H'003E to H'003F H'007C to H'007F
4
Internal interrupt* 32 H'0040 to H'0041 H'0080 to H'0083
⎜ ⎜ ⎜
187 H'0176 to H'0177 H'02EC to H'02EF
Notes: 1. Lower 16 bits of the address.
2. Not available in this LSI.
3. Not available in this LSI. It is reserved for system use.
4. For details of internal interrupt vectors, see section 6.5, Interrupt Exception Handling
Vector Table.
5. Reserved for system use in the H8S/2425 Group.
5.3 Reset
A reset has the highest exception priority. When the RES pin goes low, all processing halts and
this LSI enters the reset. To ensure that this LSI is reset, hold the RES pin low for at least 10 ms at
power-up. To reset this LSI during operation, hold the RES pin low for at least 2 ms. A reset
initializes the internal state of the CPU and the registers of on-chip peripheral modules. This LSI
can also be reset by overflow of the watchdog timer. For details see section 15, Watchdog Timer
(WDT). The interrupt control mode is 0 immediately after reset.
When the RES pin goes high after being held low for the necessary time, this LSI starts reset
exception handling as follows:
1. The internal state of the CPU and the registers of the on-chip peripheral modules are
initialized, the T bit is cleared to 0 in EXR, and the I bit is set to 1 in EXR and CCR.
2. The reset exception handling vector address is read and transferred to the PC, and program
execution starts from the address indicated by the PC.
RES
Internal read
signal
Internal write
High
signal
(1)(3) Reset exception handling vector address (when reset, (1)=H'000000, (3)=H'000002)
(2)(4) Start address (contents of reset exception handling vector address)
(5) Start address ((5)=(2)(4))
(6) First program instruction
Figure 5.1 Reset Sequence (Advanced Mode with On-chip ROM Enabled)
* * *
φ
RES
RD
(1)(3) Reset exception handling vector address (when reset, (1)=H'000000, (3)=H'000002)
(2)(4) Start address (contents of reset exception handling vector address)
(5) Start address ((5)=(2)(4))
(6) First program instruction
Note: * Seven program wait states are inserted.
Figure 5.2 Reset Sequence (Advanced Mode with On-chip ROM Disabled)
If an interrupt is accepted after a reset but before the stack pointer (SP) is initialized, the PC and
CCR will not be saved correctly, leading to a program crash. To prevent this, all interrupt requests,
including NMI, are disabled immediately after a reset. Since the first instruction of a program is
always executed immediately after the reset state ends, make sure that this instruction initializes
the stack pointer (example: MOV.L #xx: 32, SP).
After reset release, MSTPCR is initialized to H'0FFF, EXMSTPCR is initialized to H'FFFF, and
all modules except the DMAC, EXDMAC, and DTC enter the module stop state.
Consequently, on-chip peripheral module registers cannot be read or written to. Register reading
and writing is enabled when the module stop state is exited.
If the T bit in EXR is set to 1, trace mode is activated. In trace mode, a trace exception occurs on
completion of each instruction. Trace mode is not affected by interrupt masking. Table 5.3 shows
the state of CCR and EXR after execution of trace exception handling. Trace mode is canceled by
clearing the T bit in EXR to 0. The T bit saved on the stack retains its value of 1, and when control
is returned from the trace exception handling routine by the RTE instruction, trace mode resumes.
Trace exception handling is not carried out after execution of the RTE instruction.
Interrupts are accepted even within the trace exception handling routine.
Table 5.3 Status of CCR and EXR after Trace Exception Handling
CCR EXR
Interrupt Control Mode I UI I2 to I0 T
0 Trace exception handling cannot be used.
2 1 ⎯ ⎯ 0
[Legend]
1: Set to 1
0: Cleared to 0
⎯: Retains value prior to execution
1. The values in the program counter (PC), condition code register (CCR), and extended register
(EXR) are saved in the stack.
2. The interrupt mask bit is updated and the T bit is cleared to 0.
3. A vector address corresponding to the interrupt source is generated, the start address is loaded
from the vector table to the PC, and program execution starts from that address.
1. The values in the program counter (PC), condition code register (CCR), and extended register
(EXR) are saved in the stack.
2. The interrupt mask bit is updated and the T bit is cleared to 0.
3. A vector address corresponding to the interrupt source is generated, the start address is loaded
from the vector table to the PC, and program execution starts from that address.
The TRAPA instruction fetches a start address from a vector table entry corresponding to a vector
number from 0 to 3, as specified in the instruction code.
Table 5.4 shows the status of CCR and EXR after execution of trap instruction exception handling.
Table 5.4 Status of CCR and EXR after Trap Instruction Exception Handling
CCR EXR
Interrupt Control Mode I UI I2 to I0 T
0 1 ⎯ ⎯ ⎯
2 1 ⎯ ⎯ 0
Legend:
1: Set to 1
0: Cleared to 0
⎯: Retains value prior to execution
1. The values in the PC, CCR, and EXR are saved in the stack.
2. The interrupt mask bit is updated and the T bit is cleared to 0.
3. An exception handling vector table address corresponding to the exception is generated, the
start address of the exception service routine is loaded from the vector table to the PC, and
program execution starts from that address.
Table 5.5 shows the status of CCR and EXR after execution of illegal instruction exception
handling.
Table 5.5 Status of CCR and EXR after Illegal Instruction Exception Handling
CCR EXR
Interrupt Control Mode I UI T I2 to I0
0 1 ⎯ ⎯ ⎯
2 1 ⎯ 0 ⎯
Legend:
1: Set to 1
0: Cleared to 0
⎯: Retains value prior to execution
Illegal instruction codes will not be searched for in the fields that do not affect instruction
definitions, such as the EA extension or register fields. Instruction codes for an instruction formed
with several words are detected independently, and combined instruction codes are not detected.
Undefined instruction codes must not be executed. The general register contents after execution of
an undefined instruction code or illegal instruction exception handling cannot be guaranteed. The
stack pointer during illegal instruction exception handling and the PC value that will be saved are
also not guaranteed.
Normal Modes*2
SP EXR
Reserved*1
SP CCR CCR
CCR*1 CCR*1
PC (16 bits) PC (16 bits)
Advanced Modes
SP EXR
Reserved*1
SP CCR CCR
PC (24 bits) PC (24 bits)
Setting SP to an odd value may lead to a malfunction. Figure 5.4 shows an example of operation
when the SP value is odd.
Address
Note: This diagram illustrates an example in which the interrupt control mode is 0, in advanced mode.
6.1 Features
• Two interrupt control modes
Any 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 IPR
An interrupt priority register (IPR) is 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.
• 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 for IRQn-A and IRQn-B.
Note: n = 15 to 0 for the H8S/2427 Group and H8S/2427R Group
n = 7 to 0 for the H8S/2425 Group
• DTC and DMAC control
DTC and DMAC activations are performed by means of interrupts.
Internal
interrupt I
CCR
sources
I2 to I0
SWDTEND EXR
to FSIRXI
IPR
Interrupt controller
[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
INTCR selects the interrupt control mode, and the detected edge for NMI.
IPR are fourteen 16-bit readable/writable registers that set priorities (levels 7 to 0) for interrupts
other than NMI. The correspondence between interrupt sources and IPR settings is shown in table
6.2 (Interrupt Sources, Vector Addresses, and Interrupt Priorities). 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. IPR should be read in word size.
ISCR select the source that generates an interrupt request at pins IRQ15 to IRQ0.
• ISCRL
12 IRQ12F*
2
0 R/(W)*
1 [Clearing conditions]
11 IRQ11F*
2
0 R/(W)*
1 • Cleared by reading IRQnF flag when IRQnF =
2 1 1, then writing 0 to IRQnF flag
10 IRQ10F* 0 R/(W)*
2 1 • When interrupt exception handling is executed
9 IRQ9F* 0 R/(W)*
2 1
when low-level detection is set and IRQn input
8 IRQ8F* 0 R/(W)*
is high
1
7 IRQ7F 0 R/(W)*
• When IRQn interrupt exception handling is
1
6 IRQ6F 0 R/(W)* executed when falling, rising, or both-edge
1
5 IRQ5F 0 R/(W)* detection is set
1
4 IRQ4F 0 R/(W)* • When the DTC is activated by an IRQn
1
3 IRQ3F 0 R/(W)* interrupt, and the DISEL bit in MRB of the DTC
2 IRQ2F 0 R/(W)*
1 is cleared to 0
1
1 IRQ1F 0 R/(W)*
1
0 IRQ0F 0 R/(W)*
Notes: 1. Only 0 can be written, to clear the flag.
2. These bits are reserved in the H8S/2425 Group.
• H8S/2425 Group
SSIER selects the IRQ pins used to recover from the software standby state.
The H8S/2427 Group and H8S/2427R Group have seventeen external interrupts: NMI and IRQ15
to IRQ0. The H8S/2425 Group has nine external interrupts: NMI and IRQ7 to IRQ0. These
interrupts can be used to restore the chip from software standby mode.
NMI Interrupt: Nonmaskable interrupt request (NMI) is the highest-priority interrupt, and is
always accepted by the CPU regardless of the interrupt control mode or the status of the CPU
interrupt mask bits. The NMIEG bit in INTCR can be used to select whether an interrupt is
requested at a rising edge or a falling edge on the NMI pin.
• Using ISCR, it is possible to select whether an interrupt is generated by a low level, falling
edge, rising edge, or both edges, at the IRQn pin.
• Enabling or disabling of IRQn interrupt requests can be selected with IER.
• The interrupt priority level can be set with IPR.
• The status of IRQn interrupt requests is indicated in ISR. ISR flags can be cleared to 0 by
software.
When IRQn interrupt requests occur at low level of the IRQn pin, the corresponding IRQ pin
should be held low until an interrupt handling starts. Then the corresponding IRQ pin should be
set to high in the interrupt handling routine and clear the IRQnF bit in ISR to 0. Interrupts may not
be executed when the corresponding IRQ pin is set to high before the interrupt handling starts.
Detection of IRQn interrupts does not depend on whether the relevant pin has been set for input or
output. However, when a pin is used as an external interrupt input pin, do not clear the
corresponding DDR to 0 and use the pin as an I/O pin for another function.
IRQnE
IRQnSCB, IRQnSCA
IRQnF
IRQn interrupt request
Edge/level S Q
detection circuit
IRQn input R
Clear signal
Note: n = 0 to 15 for H8S/2427 Group and H8S/2427R Group, n = 0 to 7 for H8S/2425 Group
The sources for internal interrupts from on-chip peripheral modules have the following features:
• For each on-chip peripheral module there are flags that indicate the interrupt request status,
and enable bits that select enabling or disabling of these interrupts. They can be controlled
independently. When the enable bit is set to 1, an interrupt request is issued to the interrupt
controller.
• The interrupt priority level can be set by means of IPR.
• 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 request, it is not affected by the interrupt
control mode or CPU interrupt mask bit.
For default priorities, the lower the vector number, the higher the priority. When interrupt control
mode 2 is set, priorities among modules can be set by means of the IPR. Modules set at the same
priority will conform to their default priorities. Priorities within a module are fixed.
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
TGI3C 58 H'00E8 O ⎯
TGI3D 59 H'00EC O ⎯
TCI3V 60 H'00F0 ⎯ ⎯
63 H'00FC Low ⎯ ⎯
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
TCI4V 66 H'0108 ⎯ ⎯
TCI4U 67 H'010C ⎯ ⎯
TCI5V 70 H'0118 ⎯ ⎯
TCI5U 71 H'011C ⎯ ⎯
CMIB0 73 H'0124 O ⎯
OVI0 74 H'0128 ⎯ ⎯
OVI1 78 H'0138 ⎯ ⎯
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
RXI0 89 H'0164 O O
TXI0 90 H'0168 O O
TEI0 91 H'016C ⎯ ⎯
RXI1 93 H'0174 O O
TXI1 94 H'0178 O O
TEI1 95 H'017C ⎯ ⎯
RXI2 97 H'0184 O ⎯
TXI2 98 H'0188 O ⎯
TEI2 99 H'018C ⎯ ⎯
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
IIC2_0 IICI0 116 H'01D0 IPRK6 to IPRK4 High ⎯ ⎯
Reserved for 117 H'01D4 ⎯ ⎯
system use
IIC2_1 IICI1 118 H'01D8 ⎯ ⎯
Reserved for 119 H'01DC ⎯ ⎯
system use
TPU_6 TGI6A 120 H'01E0 IPRK2 to IPRK0 O ⎯
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
TPU_11 TGI11A 142 H'0238 IPRM14 to IPRM12 High O ⎯
148 H'0250 ⎯ ⎯
149 H'0254 ⎯ ⎯
151 H'025C ⎯ ⎯
152 H'0260 ⎯ ⎯
161 H'0284 ⎯ ⎯
162 H'0288 ⎯ ⎯
163 H'028C ⎯ ⎯
164 H'0290 ⎯ ⎯
165 H'0294 ⎯ ⎯
FSI PSITEI 166 H'0298 IPRN6 to IPRN4 ⎯ ⎯
Vector
1
Address*
Origin of
Interrupt Interrupt Vector Advanced DTC DMAC
Source Source Number Mode IPR Priority Activation Activation
⎯ Reserved for 170 H'02A8 IPRN2 to IPRN0 High ⎯ ⎯
system use ⎯ ⎯
171 H'02AC
172 H'02B0 ⎯ ⎯
173 H'02B4 ⎯ ⎯
174 H'02B8 ⎯ ⎯
175 H'02BC ⎯ ⎯
176 H'02C0 ⎯ ⎯
177 H'02C4 ⎯ ⎯
⎯ Reserved for 178 H'02C8 ⎯ ⎯ ⎯
system use ⎯ ⎯
179 H'02CC
180 H'02D0 ⎯ ⎯
181 H'02D4 ⎯ ⎯
182 H'02D8 ⎯ ⎯
183 H'02DC ⎯ ⎯ ⎯
184 H'02E0 ⎯ ⎯
185 H'02E4 ⎯ ⎯
186 H'02E8 ⎯ ⎯
In interrupt control mode 0, interrupt requests except for NMI are masked by the I bit of CCR in
the CPU. Figure 6.3 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. If the I bit is set to 1, only an NMI interrupt is accepted, and other interrupt requests are held
pending. If the I bit is cleared, an interrupt request is accepted.
3. Interrupt requests are sent to the interrupt controller, the highest-ranked interrupt according to
the priority system is accepted, and other interrupt requests are held pending.
4. When the CPU accepts an interrupt request, it starts interrupt exception handling after
execution of the current instruction has been completed.
5. The PC and CCR are saved to the stack area by interrupt exception handling. The PC saved on
the stack shows the address of the first instruction to be executed after returning from the
interrupt handling routine.
6. Next, the I bit in CCR is set to 1. This masks all interrupts except NMI.
7. The CPU generates a vector address for the accepted interrupt and starts execution of the
interrupt handling routine at the address indicated by the contents of the vector address in the
vector table.
No
Interrupt generated
Yes
Yes
NMI
No
No
I=0 Pending
Yes
No
IRQ0
Yes No
IRQ1
Yes
SSTXI
Yes
I←1
In interrupt control mode 2, mask control is done in eight levels for interrupt requests except for
NMI by comparing the EXR interrupt mask level (I2 to I0 bits) in the CPU and the IPR setting.
Figure 6.4 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 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 6.2 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 the CPU accepts an interrupt request, it starts interrupt exception handling after
execution of the current instruction has been completed.
5. The PC, CCR, and EXR are saved to the stack area by interrupt exception handling. The PC
saved on the stack shows the address of the first instruction to be executed after returning from
the interrupt handling routine.
6. The T bit in EXR is cleared to 0. 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. The CPU generates a vector address for the accepted interrupt and starts execution of the
interrupt handling routine at the address indicated by the contents of the vector address in the
vector table.
No
Interrupt generated
Yes
Yes
NMI
No
No
Level 7 interrupt
Yes No
Level 6 interrupt
Mask level 6 No
Yes No
or below Level 1 interrupt
Yes No
Mask level 5 Yes
or below
Yes No
Mask level 0
Yes
Clear T bit to 0
Interrupt
acceptance
Interrupt
request signal
Internal
read signal
Interrupt Exception Handling Sequence
Internal
write signal
(1) Instruction prefetch address (Not executed. (6) (8) Saved PC and saved CCR
Table 6.4 shows interrupt response times - the interval between generation of an interrupt request
and execution of the first instruction in the interrupt handling routine. The execution status
symbols used in table 6.4 are explained in table 6.5. This LSI is capable of fast word transfer to
on-chip memory, and have the program area in on-chip ROM and the stack area in on-chip RAM,
enabling high-speed processing.
Object of Access
External Device
8 Bit Bus 16 Bit Bus
Internal 2-State 3-State 2-State 3-State
Symbol Memory Access Access Access Access
Instruction fetch SI 1 4 6+2m 2 3+m
Branch address read SJ
Stack manipulation SK
[Legend]
m: Number of wait states in an external device access.
The DTC and DMAC can be activated by an interrupt. In this case, the following options are
available:
For details of interrupt requests that can be used to activate the DTC and DMAC, see table 6.2 and
section 10, Data Transfer Controller (DTC) and section 8, DMA Controller (DMAC).
When an interrupt enable bit is cleared to 0 to mask interrupts, the masking becomes effective
after execution of the instruction. When an interrupt enable bit is cleared to 0 by an instruction
such as BCLR or MOV, if an interrupt is generated during execution of the instruction, the
interrupt concerned will still be enabled on completion of the instruction, and so interrupt
exception handling for that interrupt will be executed on completion of the instruction. However,
if there is an interrupt request of higher priority than that interrupt, interrupt exception handling
will be executed for the higher-priority interrupt, and the lower-priority interrupt will be ignored.
The same also applies when an interrupt source flag is cleared to 0. Figure 6.6 shows an example
in which the TCIEV bit in the TPU's TIER_0 register is cleared to 0. The above conflict will not
occur if an enable bit or interrupt source flag is cleared to 0 while the interrupt is masked.
Internal
TIER_0 address
address bus
Internal
write signal
TCIEV
TCFV
TCIV
interrupt signal
Instructions that disable interrupts are LDC, ANDC, ORC, and XORC. After any of these
instructions is executed, all interrupts including NMI are disabled and the next instruction is
always executed. When the I bit is set by one of these instructions, the new value becomes valid
two states after execution of the instruction ends.
There are times when interrupt acceptance is disabled by the interrupt controller. The interrupt
controller disables interrupt acceptance for a 3-state period after the CPU has updated the mask
level with an LDC, ANDC, ORC, or XORC instruction.
Interrupt operation differs between the EEPMOV.B instruction and the EEPMOV.W instruction.
With the EEPMOV.B instruction, an interrupt request (including NMI) issued during the transfer
is not accepted until the transfer is completed.
With the EEPMOV.W instruction, if an interrupt request is issued during the transfer, interrupt
exception handling starts at a break in the transfer cycle. The PC value saved on the stack in this
case is the address of the next instruction. Therefore, if an interrupt is generated during execution
of an EEPMOV.W instruction, the following coding should be used.
L1: EEPMOV.W
MOV.W R4,R4
BNE L1
When the ITSR setting is changed, an edge occurs internally and the IRQnF bit* of ISR may be
set to 1 at the unintended timing if the selected pin level before the change is different from the
selected pin level after the change. If the IRQn* interrupt request is enabled, the interrupt
exception handling is executed. To prevent the unintended interrupt, ITSR setting should be
changed while the IRQn* interrupt request is disabled, then the IRQnF* bit should be cleared to 0.
Depending on the pin status following a reset, IRQnF* may be set to 1. Therefore, always read
ISR and clear it to 0 after resets.
The bus controller also has a bus arbitration function, and controls the operation of the bus
mastership⎯the CPU, DMA controller (DMAC), EXDMA controller (EXDMAC)*, and data
transfer controller (DTC). A block diagram of the bus controller is shown in figure 7.1.
7.1 Features
• Manages external address space in area units
Manages the external address space divided into eight areas of 2 Mbytes
Bus specifications can be set independently for each area
Burst ROM, DRAM*1, synchronous DRAM*2, and address/data multiplexed I/O interfaces can
be set
• Basic bus interface
Chip select signals (CS0 to CS7) can be output for areas 0 to 7
8-bit access or 16-bit access can be selected for each area
2-state access or 3-state access can be selected for each area
Program wait cycles can be inserted for each area
Extension cycles can be inserted while CS is asserted for each area
Wait cycles can be inserted by the WAIT pin
The negation timing of the read strobe signal (RD) can be modified
• Burst ROM interface
Burst ROM interface can be set independently for areas 0 and 1
• Address/data multiplexed I/O interface
Address/data multiplexed I/O interface can be set for areas 6 and 7
• DRAM interface*1
DRAM interface can be set for areas 2 to 5
• Synchronous DRAM interface*2
Continuous synchronous DRAM space can be set for areas 2 to 5
WAIT
BREQ
External bus controller BACK
BREQO
Control registers
Internal data bus
ABWCR ASTCR DRAMCR
CSACRH CSACRL
BROMCRH BROMCRL
BCR
MPXCR
[Legend]
ABWCR: Bus width control register
ASTCR: Access state control register
WTCRAH, WTCRAL,
WTCRBH, and WTCRBL: Wait control registers AH, AL, BH, and BL
RDNCR: Read strobe timing control register
CSACRH and CSACRL: CS assertion period control registers H and L
BROMCRH: Area 0 burst ROM interface control register
BROMCRL : Area 1 burst ROM interface control register
BCR: Bus control register
MPXCR: Address/data multiplexed I/O control register
DRAMCR: DRAM control register*2
DRACCRH and DRACCRL: DRAM access control registers H and L*2
REFCR: Refresh control register*2
RTCNT: Refresh timer counter*2
RTCOR: Refresh time constant register*2 Notes: 1. Not supported by the H8S/2425 Group.
2. Not supported by the 5-V version.
ABWCR designates each area in the external address space as either 8-bit access space or 16-bit
access space.
ASTCR designates each area in the external address space as either 2-state access space or 3-state
access space.
7.3.3 Wait Control Registers AH, AL, BH, and BL (WTCRAH, WTCRAL, WTCRBH,
and WTCRBL)
WTCRA and WTCRB select the number of program wait states for each area in the external
address space.
Note: * The synchronous DRAM interface is not supported by the H8S/2427 Group and
H8S/2425 Group.
• WTCRAH
• WTCRAL
• WTCRBH
• WTCRBL
RDNCR selects the read strobe signal (RD) negation timing in a basic bus interface read access.
Bus cycle
T1 T2 T3
RD
RDNn = 0
Data
RD
RDNn = 1
Data
Figure 7.2 Read Strobe Negation Timing (Example of 3-State Access Space)
CSACRH and CSACRL select whether or not the assertion period of the basic bus interface chip
select signals (CSn) and address signals is to be extended. Extending the assertion period of the
CSn and address signals allows flexible interfacing to external I/O devices.
• CSACRH
• CSACRL
Bus cycle
Th T1 T2 T3 Tt
Address
CS
RD
Read
Data
HWR, LWR
Write
Data
BROMCRH and BROMCRL are used to make burst ROM interface settings. Area 0 and area 1
burst ROM interface settings can be made independently in BROMCRH and BROMCRL,
respectively.
BCR is used for idle cycle settings, selection of the external bus released state protocol, enabling
or disabling of the write data buffer function, and enabling or disabling of WAIT pin input.
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group. The DRAM interface is not supported by the 5-V version.
Bus cycle
Tp Tr Tc1 Tc2
RAST = 0 RAS
RAST = 1 RAS
UCAS, LCAS
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group. The DRAM interface is not supported by the 5-V version.
SDRAMφ
RAS
SDWCD = 0
CAS
WE
CKE
High
DQMU, DQML
Data bus
Tp Tr Tc1 Tc2
RAS
SDWCD = 1
CAS
WE
CKE
High
DQMU, DQML
Data bus
Figure 7.5 CAS Latency Control Cycle Disable Timing during Continuous Synchronous
DRAM Space Write Access (for CAS Latency 2)
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group. The DRAM interface is not supported by the 5-V version.
RTCNT is an 8-bit readable/writable up-counter. RTCNT counts up using the internal clock
selected by bits RTCK2 to RTCK0 in REFCR.
When RTCNT matches RTCOR (compare match), the CMF flag in REFCR is set to 1 and
RTCNT is cleared to H'00. If the RFSHE bit in REFCR is set to 1 at this time, a refresh cycle is
started. If the RFSHE bit is cleared to 0 and the CMIE bit in REFCR is set to 1, a compare match
interrupt (CMI) is generated.
RTCNT is initialized to H'00 by a reset and in hardware standby mode. It is not initialized in
software standby mode.
RTCOR is an 8-bit readable/writable register that sets the period for compare match operations
with RTCNT.
The values of RTCOR and RTCNT are constantly compared, and if they match, the CMF flag in
REFCR is set to 1 and RTCNT is cleared to H'00.
RTCOR is initialized to H'FF by a reset and in hardware standby mode. It is not initialized in
software standby mode.
The bus controller divides the 16-Mbyte address space into eight areas, 0 to 7, in 2-Mbyte units,
and performs bus control for external address space in area units. Chip select signals (CS0 to CS7)
can be output for each area. In normal mode, a part of area 0, 64-Kbyte address space, is
controlled. Figure 7.6 shows an outline of the memory map.
H'000000
Area 0
(2 Mbytes)
H'1FFFFF
H'200000
Area 1
(2 Mbytes)
H'3FFFFF
H'400000
Area 2
(2 Mbytes)
H'5FFFFF
H'600000
Area 3
(2 Mbytes)
H'7FFFFF
H'800000
Area 4
(2 Mbytes)
H'9FFFFF
H'A00000
Area 5
(2 Mbytes)
H'BFFFFF
H'C00000
Area 6
(2 Mbytes)
H'DFFFFF
H'E00000
Area 7
(2 Mbytes)
H'FFFFFF
The external address space bus specifications consist of five elements: bus width, number of
access states, number of program wait states, read strobe timing, and chip select (CS) assertion
period extension states. The bus width and number of access states for on-chip memory and
internal I/O registers are fixed, and are not affected by the bus controller.
A bus width of 8 or 16 bits can be selected with ABWCR. An area for which an 8-bit bus is
selected functions as an 8-bit access space, and an area for which a 16-bit bus is selected functions
as a 16-bit access space. If all areas are designated as 8-bit access space, 8-bit bus mode is set; if
any area is designated as 16-bit access space, 16-bit bus mode is set.
Two or three access states can be selected with ASTCR. An area for which 2-state access is
selected functions as a 2-state access space, and an area for which 3-state access is selected
functions as a 3-state access space. With the DRAM or synchronous DRAM interface and burst
ROM interface, the number of access states may be determined without regard to the setting of
ASTCR.
When 2-state access space is designated, wait insertion is disabled. When 3-state access space is
designated, it is possible to insert program waits by means of the WTCRA and WTCRB, and
external waits by means of the WAIT pin.
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group. The DRAM interface is not supported by the 5-V version.
When 3-state access space is designated by ASTCR, the number of program wait states to be
inserted automatically is selected with WTCRA and WTCRB. From 0 to 7 program wait states can
be selected. Table 7.2 shows the bus specifications (bus width, and number of access states and
program wait states) for each basic bus interface area.
Table 7.2 Bus Specifications for Each Area (Basic Bus Interface)
RDNCR can be used to select either of two negation timings (at the end of the read cycle or one
half-state before the end of the read cycle) for the read strobe (RD) used in the basic bus interface
space.
Some external I/O devices require a setup time and hold time between address and CS signals and
strobe signals such as RD, HWR, and LWR. CSACR can be used to insert states in which only the
CS, AS, and address signals are asserted before and after a basic bus space access cycle.
The memory interfaces in this LSI comprise a basic bus interface that allows direct connection of
ROM, SRAM, and so on; an address/data multiplexed I/O interface that allows direct connection
of peripheral LSIs that require address/data multiplexing, a DRAM interface that allows direct
connection of DRAM; a synchronous DRAM interface that allows direct connection of
synchronous DRAM; and a burst ROM interface that allows direct connection of burst ROM. The
interface can be selected independently for each area.
An area for which the basic bus interface is designated functions as normal space. An area for
which the address/data multiplexed I/O interface is designated functions as address/data
multiplexed I/O space, an area for which the DRAM interface is designated functions as DRAM
space, an area for which the synchronous DRAM interface is designated functions as continuous
synchronous DRAM space, and an area for which the burst ROM interface is designated functions
as burst ROM space.
The initial state of each area is basic bus interface, 3-state access space. The initial bus width is
selected according to the operating mode.
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group. The DRAM interface is not supported by the 5-V version.
(1) Area 0
Area 0 includes on-chip ROM in expanded mode with on-chip ROM enabled and the space
excluding on-chip ROM is external address space, and in expanded mode with on-chip ROM
disabled, all of area 0 is external address space.
When area 0 external space is accessed, the CS0 signal can be output.
Either the basic bus interface or burst ROM interface can be selected for the memory interface of
area 0.
(2) Area 1
When area 1 external address space is accessed, the CS1 signal can be output.
Either the basic bus interface or burst ROM interface can be selected for the memory interface of
area 1.
(3) Areas 2 to 5
When area 2 to 5 external space is accessed, signals CS2 to CS5 can be output.
The basic bus interface, DRAM interface, or synchronous DRAM interface can be selected for the
memory interface of areas 2 to 5. With the DRAM interface, signals CS2 to CS5 are used as RAS2
to RAS5 signals, respectively.
If areas 2 to 5 are designated as continuous DRAM space, large-capacity (e.g. 64-Mbit) DRAM
can be connected. In this case, the CS2 signal is used as the RAS signal for the continuous DRAM
space.
If areas 2 to 5 are designated as continuous synchronous DRAM space, large-capacity (e.g. 64-
Mbit) synchronous DRAM can be connected. In this case, the CS2, CS3, CS4, and CS5 pins are
used as the RAS, CAS, WE, and SDRAMφ signals for the continuous synchronous DRAM space,
respectively. The OE pin is used as the CKE signal.
(4) Area 6
When area 6 external space is accessed, the CS6 signal can be output.
Either the basic bus interface or address/data multiplexed I/O interface can be used for the
memory interface of area 6.
(5) Area 7
Area 7 includes the on-chip RAM and internal/O registers. In externally expanded mode, the space
excluding the on-chip RAM and internal I/O registers is external address space. The on-chip RAM
is enabled when the RAME bit is set to 1 in the system control register (SYSCR); when the
RAME bit is cleared to 0, the on-chip RAM is disabled and the corresponding addresses are in
external address space.
When area 7 external address space is accessed, the CS7 signal can be output.
Either the basic bus interface or address/data multiplexed I/O interface can be used for the
memory interface of area 7.
This LSI can output chip select signals (CS0 to CS7) for areas 0 to 7. The signal outputs low when
the corresponding external space area is accessed. Figure 7.7 shows an example of CS0 to CS7
signals output timing.
Enabling or disabling of CS0 to CS7 signals output is set by the data direction register (DDR) bit
for the port corresponding to the CS0 to CS7 pins.
In expanded mode with on-chip ROM disabled, the CS0 pin is placed in the output state after a
reset. Pins CS1 to CS7 are placed in the input state after a reset and so the corresponding DDR bits
and PFCR0 bits should be set to 1 when outputting signals CS1 to CS7.
In expanded mode with on-chip ROM enabled, pins CS0 to CS7 are all placed in the input state
after a reset and so the corresponding DDR bits and PFCR0 bits should be set to 1 when
outputting signals CS0 to CS7.
When areas 2 to 5 are designated as DRAM*1 space, outputs CS2 to CS5 are used as RAS2 to
RAS5 signals, respectively. When areas 2 to 5 are designated as continuous DRAM space, CS2
output is used as RAS signal.
When areas 2 to 5 are designated as continuous synchronous DRAM space*2 in the H8S/2427R,
outputs CS2, CS3, CS4, and CS5 are used as RAS, CAS, WE, and SDRAMφ signals.
Notes: The A23E bit in PFCR1 should be cleared to 0 when CS7 signal is output in the H8S/2425
Group.
Bus cycle
T1 T2 T3
CSn
Data sizes for the CPU and other internal bus masters are byte, word, and longword. The bus
controller has a data alignment function, and when accessing external address space, controls
whether the upper data bus (D15 to D8) or lower data bus (D7 to D0) is used according to the bus
specifications for the area being accessed (8-bit access space or 16-bit access space) and the data
size.
Figure 7.8 illustrates data alignment control for the 8-bit access space. With the 8-bit access space,
the upper data bus (D15 to D8) is always used for accesses. The amount of data that can be
accessed at one time is one byte: a word access is performed as two byte accesses, and a longword
access, as four byte accesses.
Byte size
Figure 7.8 Access Sizes and Data Alignment Control (8-Bit Access Space)
Figure 7.9 illustrates data alignment control for the 16-bit access space. With the 16-bit access
space, the upper data bus (D15 to D8) and lower data bus (D7 to D0) are used for accesses. The
amount of data that can be accessed at one time is one byte or one word, and a longword access is
executed as two word accesses.
In byte access, whether the upper or lower data bus is used is determined by whether the address is
even or odd. The upper data bus is used for an even address, and the lower data bus for an odd
address.
Word size
Figure 7.9 Access Sizes and Data Alignment Control (16-Bit Access Space)
Table 7.3 shows the data buses used and valid strobes for the access spaces.
In a read, the RD signal is valid for both the upper and the lower half of the data bus. In a write,
the HWR signal is valid for the upper half of the data bus, and the LWR signal for the lower half.
Figure 7.10 shows the bus timing for an 8-bit, 2-state access space. When an 8-bit access space is
accessed, the upper half (D15 to D8) of the data bus is used. The LWR pin is always fixed high.
Wait states can be inserted.
Bus cycle
T1 T2
Address bus
CSn
AS
RD
D7 to D0 Invalid
HWR
LWR High
Write
D15 to D8 Valid
High impedance
D7 to D0
Notes: 1. n = 0 to 7
2. When RDNn = 0
Figure 7.11 shows the bus timing for an 8-bit, 3-state access space. When an 8-bit access space is
accessed, the upper half (D15 to D8) of the data bus is used. The LWR pin is always fixed high.
Wait states can be inserted.
Bus cycle
T1 T2 T3
Address bus
CSn
AS
RD
D7 to D0 Invalid
HWR
LWR High
Write
D15 to D8 Valid
High impedance
D7 to D0
Notes: 1. n = 0 to 7
2. When RDNn = 0
Figures 7.12 to 7.14 show bus timings for a 16-bit, 2-state access space. When a 16-bit access
space is accessed, the upper half (D15 to D8) of the data bus is used for even addresses, and the
lower half (D7 to D0) for odd addresses. Wait states cannot be inserted.
Bus cycle
T1 T2
Address bus
CSn
AS
RD
D7 to D0 Invalid
HWR
LWR High
Write
D15 to D8 Valid
High impedance
D7 to D0
Notes: 1. n = 0 to 7
2. When RDNn = 0
Figure 7.12 Bus Timing for 16-Bit, 2-State Access Space (Even Address Byte Access)
Bus cycle
T1 T2
Address bus
CSn
AS
RD
D7 to D0 Valid
HWR High
LWR
Write
High impedance
D15 to D8
D7 to D0 Valid
Notes: 1. n = 0 to 7
2. When RDNn = 0
Bus cycle
T1 T2
Address bus
CSn
AS
RD
D7 to D0 Valid
HWR
LWR
Write
D15 to D8 Valid
D7 to D0 Valid
Notes: 1. n = 0 to 7
2. When RDNn = 0
Figures 7.15 to 7.17 show bus timings for a 16-bit, 3-state access space. When a 16-bit access
space is accessed, the upper half (D15 to D8) of the data bus is used for even addresses, and the
lower half (D7 to D0) for odd addresses. Wait states can be inserted.
Bus cycle
T1 T2 T3
Address bus
CSn
AS
RD
D7 to D0 Invalid
HWR
LWR High
Write
D15 to D8 Valid
High impedance
D7 to D0
Notes: 1. n = 0 to 7
2. When RDNn = 0
Bus cycle
T1 T2 T3
Address bus
CSn
AS
RD
D7 to D0 Valid
HWR High
LWR
Write
High impedance
D15 to D8
D7 to D0 Valid
Notes: 1. n = 0 to 7
2. When RDNn = 0
Bus cycle
T1 T2 T3
Address bus
CSn
AS
RD
D7 to D0 Valid
HWR
LWR
Write
D15 to D8 Valid
D7 to D0 Valid
Notes: 1. n = 0 to 7
2. When RDNn = 0
When accessing external space, this LSI can extend the bus cycle by inserting one or more wait
states (Tw). There are two ways of inserting wait states: program wait insertion and pin wait
insertion using the WAIT pin.
From 0 to 7 wait states can be inserted automatically between the T2 state and T3 state on an
individual area basis in 3-state access space, according to the settings in WTCRA and WTCRB.
Setting the WAITE bit to 1 in BCR enables wait input by means of the WAIT pin. When external
space is accessed in this state, a program wait is first inserted in accordance with the settings in
WTCRA and WTCRB. If the WAIT pin is low at the rising edge of φ in the last T2 or Tw state,
another Tw state is inserted. If the WAIT pin is held low, Tw states are inserted until it goes high.
This is useful when inserting seven or more Tw states, or when changing the number of Tw states to
be inserted for different external devices. The WAITE bit setting applies to all areas. Figure 7.18
shows an example of wait state insertion timing.
The settings after a reset are: 3-state access, insertion of 7 program wait states, and WAIT input
disabled.
WAIT
Address bus
CSn
AS
RD
Read
Read
Data bus data
HWR, LWR
Write
Data bus Write data
The read strobe (RD) timing can be changed for individual areas by setting bits RDN7 to RDN0 to
1 in RDNCR. Figure 7.19 shows an example of the timing when the read strobe timing is changed
in basic bus 3-state access space.
When the DMAC or EXDMAC is used in single address mode, note that if the RD timing is
changed by setting RDNn to 1, the RD timing will change relative to the rise of DACK or
EDACK.
Bus cycle
T1 T2 T3
Address bus
CSn
AS
RD
RDNn = 0
Data bus
RD
RDNn = 1
Data bus
DACK,
EDACK
Some external I/O devices require a setup time and hold time between address and CS signals and
strobe signals such as RD, HWR, and LWR. Settings can be made in the CSACR register to insert
states in which only the CS, AS, and address signals are asserted before and after a basic bus space
access cycle. Extension of the CS assertion period can be set for individual areas. With the CS
assertion extension period in write access, the data setup and hold times are less stringent since the
write data is output to the data bus.
Figure 7.20 shows an example of the timing when the CS assertion period is extended in basic bus
3-state access space.
Bus cycle
Th T1 T2 T3 Tt
Address bus
CSn
AS
Read RD
(when
RDNn = 0)
Data bus Read data
HWR, LWR
Write
Data bus Write data
Figure 7.20 Example of Timing when Chip Select Assertion Period Is Extended
Both extension state Th inserted before the basic bus cycle and extension state Tt inserted after the
basic bus cycle, or only one of these, can be specified for individual areas. Insertion or non-
insertion can be specified for the Th state with the upper 8 bits (CSXH7 to CSXH0) in the CSACR
register, and for the Tt state with the lower 8 bits (CSXT7 to CSXT0).
In the address/data multiplexed I/O interface, areas 6 and 7 are designated as the address/data
multiplexed I/O space by setting the MPXE bit in MPXCR to 1.
With the address/data multiplexed I/O space, the data bus and address bus are multiplexed. Table
7.4 shows the relation between the bus width and corresponding address output.
8 bits Address A7 A6 A5 A4 A3 A2 A1 A0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
The bus width of the address/data multiplexed I/O space can be specified for either 8-bit access
space or 16-bit access space by the ABW7 and ABW6 bits in ABWCRA. For the 8-bit access
space, AD15 to AD8 are valid for both address and data. For the 16-bit access space, AD15 to
AD0 are valid for both address and data. If the address/data multiplexed I/O space is accessed, the
corresponding address will be output to the address bus. For details on access size and data
alignment, see section 7.5.1, Data Size and Data Alignment.
In the address/data multiplexed I/O space, a hold signal (AH) that indicates the timing for latching
the address is output. The AH output pin is multiplexed with the AS output pin. When the external
address space is specified as the address/data multiplexed I/O space, the multiplexed pin functions
as the AH output pin. Note however that the multiplexed pin will function as the AS output pin
until the address/data multiplexed I/O space is specified.
The bus cycle in the address/data multiplexed I/O interface consists of an address cycle and a data
cycle. The data cycle is based on the basic bus interface timing specified by ABWCR, ASTCR,
WTCRAH, RDNCR, and CSACR.
Figure 7.21 shows the bus timing for an 8-bit, 2-state data access space. When an 8-bit access
space is accessed, the upper halves (AD15 to AD8) of both the address bus and data bus are used.
Wait states cannot be inserted in the data cycle.
Tma1 Tma2 T1 T2
Address bus
CSn
AH
RD
Read
AD15 to AD8 Read
Address
data
HWR
LWR
Write
Notes: 1. n = 6, 7
2. When RDNn = 0
Figure 7.21 Bus Timing for 8-Bit, 2-State Data Access Space
Figure 7.22 shows the bus timing for an 8-bit, 3-state data access space. When an 8-bit access
space is accessed, the upper halves (AD15 to AD8) of both the address bus and data bus are used.
Wait states can be inserted in the data cycle.
Tma1 Tma2 T1 T2 T3
Address bus
CSn
AH
RD
Read
Read
AD15 to AD8 Address data
HWR
LWR
Write
Notes: 1. n = 6, 7
2. When RDNn = 0
Figure 7.22 Bus Timing for 8-Bit, 3-State Data Access Space
Figures 7.23 to 7.25 show bus timings for a 16-bit, 2-state data access space. When a 16-bit access
space is accessed, the entire address bus (AD15 to AD0) is used for all addresses, and the upper
half (AD15 to AD8) of the data bus is used for even addresses and the lower half (AD7 to AD0) of
the data bus is used for odd addresses. Wait states cannot be inserted in the data cycle.
Tma1 Tma2 T1 T2
Address bus
CSn
AH
RD
Read
Read AD15 to AD8 Address
data
HWR
LWR
Write
AD15 to AD8 Address Write data
Notes: 1. n = 6, 7
2. When RDNn = 0
Figure 7.23 Bus Timing for 16-Bit, 2-State Data Access Space (Even Address Byte Access)
Tma1 Tma2 T1 T2
Address bus
CSn
AH
RD
HWR
LWR
Write
AD15 to AD8 Address
Notes: 1. n = 6, 7
2. When RDNn = 0
Figure 7.24 Bus Timing for 16-Bit, 2-State Data Access Space
(Odd Address Byte Access)
Tma1 Tma2 T1 T2
Address bus
CSn
AH
RD
Read
AD15 to AD8 Address
Read data
HWR
LWR
Write
AD15 to AD8 Address Write data
Notes: 1. n = 6, 7
2. When RDNn = 0
Figure 7.25 Bus Timing for 16-Bit, 2-State Data Access Space
(Word Access)
Figures 7.26 to 7.28 show bus timings for a 16-bit, 3-state data access space. When a 16-bit access
space is accessed, the entire address bus (AD15 to AD0) is used for all addresses, and the upper
half (AD15 to AD8) of the data bus is used for even addresses and the lower half (AD7 to AD0) of
the data bus is used for odd addresses. Wait states can be inserted in the data cycle.
Tma1 Tma2 T1 T2 T3
Address bus
CSn
AH
RD
Address Read
Read AD15 to AD8 data
HWR
LWR
Write
AD15 to AD8 Address Write data
Notes: 1. n = 6, 7
2. When RDNn = 1
Figure 7.26 Bus Timing for 16-Bit, 3-State Data Access Space
(Even Address Byte Access)
Tma1 Tma2 T1 T2 T3
Address bus
CSn
AH
RD
Read
AD7 to AD0 Address data
HWR
LWR
Write
AD15 to AD8 Address
Notes: 1. n = 6, 7
2. When RDNn = 1
Figure 7.27 Bus Timing for 16-Bit, 3-State Data Access Space
(Odd Address Byte Access)
Tma1 Tma2 T1 T2 T3
Address bus
CSn
AH
RD
Address Read
Read AD15 to AD8 data
Read
AD7 to AD0 Address
data
HWR
LWR
Write
AD15 to AD8 Address Write data
Notes: 1. n = 6, 7
2. When RDNn = 1
Figure 7.28 Bus Timing for 16-Bit, 3-State Data Access Space
(Word Access)
A single address wait cycle Tmaw can be inserted between Tma1 and Tma2 cycles by setting the
ADDEX bit in MPXCR to 1. Figure 7.29 shows the access timing when the address cycle is three
cycles.
Address bus
CSn
AH
RD
Read
Read AD15 to AD8 Address
data
HWR
LWR
Write
AD15 to AD8 Address Write data
Notes: 1. n = 6, 7
2. When RDNn = 0
In the data cycle, program wait insertion and pin wait insertion by the WAIT pin are enabled in the
same way as in the basic bus interface. For details, refer to section 7.5.4, Wait Control. Wait
control settings do not affect the address cycles.
In the address/data multiplexed I/O interface, the read strobe timing of data cycles can be modified
in the same way as in the basic bus interface. For details, refer to section 7.5.5, Read Strobe (RD)
Timing. Figure 7.30 shows an example when the read strobe timing is modified.
Tma1 Tma2 T1 T2
Address bus
CSn
AH
RD
RDNn = 0
Address Read
AD15 to AD8
data
RD
RDNn = 1
Read
AD15 to AD8 Address data
Note: n = 6, 7
In the address/data multiplexed I/O interface, extension cycles can be inserted before and after the
data cycle. For details, see section 7.5.6, Extension of Chip Select (CS) Assertion Period. Figure
7.31 shows an example of the timing when the chip select assertion period is extended in the data
cycle.
Tma1 Tma2 Th T1 T2 Tt
Address bus
CSn
AH
RD
HWR
LWR
Write
AD15 to AD8 Address Write data
Notes: 1. n = 6, 7
2. When RDNn = 0
Figure 7.31 Example of Timing when Chip Select Assertion Period Is Extended
in Data Cycle
When consecutively reading from the same area connected to a peripheral LSI whose output
floating time is long, data outputs from the peripheral LSI may conflict with address outputs from
this LSI. The data conflict can be avoided by inserting the CS assertion period extension cycle
after the access cycle. Figure 7.32 shows an example of the operation. In the figure, both bus
cycles A and B are read access cycles to the same area which is address/data multiplexed I/O
space. (a) shows an example of conflict occurring between data outputs from the peripheral LSI
whose output floating time is long and address outputs from this LSI because the CS assertion
period extension cycle is not inserted. (b) shows an example of the data conflict being avoided by
inserting the CS assertion period extension cycle.
φ φ
CS CS
AH AH
RD RD
Address/data Address/data
bus bus
Data conflict
Output floating time is long
(a) Without CS assertion period extension cycle (b) With CS assertion period extension cycle
(CSXTn = 0) (CSXTn = 1)
Areas 2 to 5 are designated as DRAM space by setting bits RMTS2 to RMTS0 in DRAMCR. The
relation between the settings of bits RMTS2 to RMTS0 and DRAM space is shown in table 7.5.
Possible DRAM space settings are: one area (area 2), two areas (areas 2 and 3), four areas (areas 2
to 5), and continuous area (areas 2 to 5).
Table 7.5 Relation between Settings of Bits RMTS2 to RMTS0 and DRAM Space
With continuous DRAM space, RAS2 is valid. The bus specifications (bus width, number of wait
states, etc.) for continuous DRAM space conform to the settings for area 2.
With DRAM space, the row address and column address are multiplexed. In address multiplexing,
the size of the shift of the row address is selected with bits MXC2 to MXC0 in DRAMCR. Table
7.6 shows the relation between the settings of MXC2 to MXC0 and the shift size.
The MXC2 bit should be cleared to 0 when the DRAM interface is used.
Table 7.6 Relation between Settings of Bits MXC2 to MXC0 and Address Multiplexing
Shift A23 to
MXC2 MXC1 MXC0 Size A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
Row 0 0 0 8 bits A23 to A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8
address A16
1 9 bits A23 to A15 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9
A16
1 0 10 bits A23 to A15 A14 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10
A16
1 11 bits A23 to A15 A14 A13 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11
A16
[Legend]
×: Don't care.
If a bit in ABWCR corresponding to an area designated as DRAM space is set to 1, that area is
designated as 8-bit DRAM space; if the bit is cleared to 0, the area is designated as 16-bit DRAM
space. In 16-bit DRAM space, ×16-bit configuration DRAM can be connected directly.
In 8-bit DRAM space the upper half of the data bus, D15 to D8, is enabled, while in 16-bit DRAM
space both the upper and lower halves of the data bus, D15 to D0, are enabled.
Access sizes and data alignment are the same as for the basic bus interface: see section 7.5.1, Data
Size and Data Alignment.
Table 7.7 shows the pins used for DRAM interfacing and their functions.
With DRAM
Pin Setting Name I/O Function
HWR WE Write enable Output Write enable for DRAM space
access
CS2 RAS2 Row address strobe 2 Output Row address strobe when area
2 is designated as DRAM space
or row address strobe when
areas 2 to 5 are designated as
continuous DRAM space
CS3 RAS3 Row address strobe 3 Output Row address strobe when area
3 is designated as DRAM space
CS4 RAS4 Row address strobe 4 Output Row address strobe when area
4 is designated as DRAM space
CS5 RAS5 Row address strobe 5 Output Row address strobe when area
5 is designated as DRAM space
UCAS UCAS Upper column address Output Upper column address strobe for
strobe 16-bit DRAM space access or
column address strobe for 8-bit
DRAM space access
LCAS LCAS Lower column address Output Lower column address strobe
strobe signal for 16-bit DRAM space
access
RD, OE OE Output enable Output Output enable signal for DRAM
space access
WAIT WAIT Wait Input Wait request signal
A15 to A0 A15 to A0 Address pins Output Row address/column address
multiplexed output
D15 to D0 D15 to D0 Data pins I/O Data input/output pins
Figure 7.33 shows the basic access timing for DRAM space.
The four states of the basic timing consist of one precharge cycle state (Tp), one row address
output cycle state (Tr), and two column address output cycle states (Tc1 and Tc2).
Tp Tr Tc1 Tc2
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
When DRAM space is accessed, the RD signal is output as the OE signal for DRAM. When
connecting DRAM provided with an EDO page mode, the OE signal should be connected to the
(OE) pin of the DRAM. Setting the OEE bit to 1 in DRAMCR enables the OE signal for DRAM
space to be output from a dedicated OE pin. In this case, the OE signal for DRAM space is output
from both the RD pin and the (OE) pin, but in external read cycles for other than DRAM space,
the signal is output only from the RD pin.
The column address output cycle can be changed from 2 states to 3 states by setting the CAST bit
to 1 in DRAMCR. Use the setting that gives the optimum specification values (CAS pulse width,
etc.) according to the DRAM connected and the operating frequency of this LSI. Figure 7.34
shows an example of the timing when a 3-state column address output cycle is selected.
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
Figure 7.34 Example of Access Timing with 3-State Column Address Output Cycle
(RAST = 0)
If the RAST bit is set to 1 in DRAMCR, the RAS signal goes low from the beginning of the Tr
state, and the row address hold time and DRAM read access time are changed relative to the fall of
the RAS signal. Use the optimum setting according to the DRAM connected and the operating
frequency of this LSI. Figure 7.35 shows an example of the timing when the RAS signal goes low
from the beginning of the Tr state.
Tp Tr Tc1 Tc2
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
Figure 7.35 Example of Access Timing when RAS Signal Goes Low from Beginning
of Tr State (CAST = 0)
If a row address hold time or read access time is necessary, making a setting in bits RCD1 and
RCD0 in DRACCR allows from one to three Trw states, in which row address output is maintained,
to be inserted between the Tr cycle, in which the RAS signal goes low, and the Tc1 cycle, in which
the column address is output. Use the setting that gives the optimum row address signal hold time
relative to the falling edge of the RAS signal according to the DRAM connected and the operating
frequency of this LSI. Figure 7.36 shows an example of the timing when one Trw state is set.
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
Figure 7.36 Example of Timing with One Row Address Output Maintenance State
(RAST = 0, CAST = 0)
When DRAM is accessed, a RAS precharge time must be secured. With this LSI, one Tp state is
always inserted when DRAM space is accessed. From one to four Tp states can be selected by
setting bits TPC1 and TPC0 in DRACCR. Set the optimum number of Tp cycles according to the
DRAM connected and the operating frequency of this LSI. Figure 7.37 shows the timing when
two Tp states are inserted. The setting of bits TPC1 and TPC0 is also valid for Tp states in refresh
cycles.
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
There are two ways of inserting wait states in a DRAM access cycle: program wait insertion and
pin wait insertion using the WAIT pin.
Wait states are inserted to extend the CAS assertion period in a read access to DRAM space, and
to extend the write data setup time relative to the falling edge of CAS in a write access.
When the bit in ASTCR corresponding to an area designated as DRAM space is set to 1, from 0 to
7 wait states can be inserted automatically between the Tc1 state and Tc2 state, according to the
settings in WTCR.
When the WAITE bit in BCR is set to 1 and the ASTCR bit is set to 1, wait input by means of the
WAIT pin is enabled. When DRAM space is accessed in this state, a program wait (Tw) is first
inserted. If the WAIT pin is low at the rising edge of φ in the last Tc1 or Tw state, another Tw state is
inserted. If the WAIT pin is held low, Tw states are inserted until it goes high.
Figures 7.38 and 7.39 show examples of wait cycle insertion timing in the case of 2-state and 3-
state column address output cycles.
Tp Tr Tc1 Tw Tw Tc2
WAIT
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read
OE (RD)
Data bus
UCAS, LCAS
WE (HWR)
Write
OE (RD) High
Data bus
WAIT
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read
OE (RD)
Data bus
UCAS, LCAS
WE (HWR)
Write
OE (RD) High
Data bus
When DRAM with a ×16-bit configuration is connected, the 2-CAS access method is used for the
control signals needed for byte access. Figure 7.40 shows the control timing for 2-CAS access,
and figure 7.41 shows an example of 2-CAS DRAM connection.
Tp Tr Tc1 Tc2
RASn (CSn)
UCAS
LCAS High
WE (HWR)
OE (RD) High
High impedance
Lower data bus
Note: n = 2 to 5
D15 to D0 D15 to D0
With DRAM, in addition to full access (normal access) in which data is accessed by outputting a
row address for each access, a fast page mode is also provided which can be used when making
consecutive accesses to the same row address. This mode enables fast (burst) access of data by
simply changing the column address after the row address has been output. Burst access can be
selected by setting the BE bit to 1 in DRAMCR.
Figures 7.42 and 7.43 show the operation timing for burst access. When there are consecutive
access cycles for DRAM space, the CAS signal and column address output cycles (two states)
continue as long as the row address is the same for consecutive access cycles. The row address
used for the comparison is set with bits MXC2 to MXC0 in DRAMCR.
RASn (CSn)
UCAS, LCAS
WE (HWR) High
OE (RD)
Read
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
RASn (CSn)
UCAS, LCAS
WE (HWR) High
OE (RD)
Read
Data bus
WE (HWR)
Data bus
Note: n = 2 to 5
The bus cycle can also be extended in burst access by inserting wait states. The wait state insertion
method and timing are the same as for full access. For details see section 7.7.9, Wait Control.
Even when burst operation is selected, it may happen that access to DRAM space is not
continuous, but is interrupted by access to another space. In this case, if the RAS signal is held low
during the access to the other space, burst operation can be resumed when the same row address in
DRAM space is accessed again.
If a transition is made to the all-module-clocks-stopped mode in the RAS down state, the clock
will stop with RAS low. To enter the all-module-clocks-stopped mode with RAS high, the
RCDM bit must be cleared to 0 before executing the SLEEP instruction.
Address bus Row address Column address 1 External address Column address 2
RASn (CSn)
UCAS, LCAS
RD
OE
Data bus
Note: n = 2 to 5
• RAS Up Mode
To select RAS up mode, clear the RCDM bit to 0 in DRAMCR. Each time access to DRAM
space is interrupted and another space is accessed, the RAS signal goes high again. Burst
operation is only performed if DRAM space is continuous. Figure 7.45 shows an example of
the timing in RAS up mode.
Address bus Row address Column address 1 Column address 2 External address
RASn (CSn)
UCAS, LCAS
RD
OE
Data bus
Note: n = 2 to 5
This LSI is provided with a DRAM refresh control function. CAS-before-RAS (CBR) refreshing
is used. In addition, self-refreshing can be executed when the chip enters the software standby
state.
Refresh control is enabled when any area is designated as DRAM space in accordance with the
setting of bits RMTS2 to RMTS0 in DRAMCR.
With CBR refreshing, RTCNT counts up using the input clock selected by bits RTCK2 to RTCK0
in REFCR, and when the count matches the value set in RTCOR (compare match), refresh control
is performed. At the same time, RTCNT is reset and starts counting up again from H'00.
Refreshing is thus repeated at fixed intervals determined by RTCOR and bits RTCK2 to RTCK0.
Set a value in RTCOR and bits RTCK2 to RTCK0 that will meet the refreshing interval
specification for the DRAM used.
When bits RTCK2 to RTCK0 in REFCR are set, RTCNT starts counting up. RTCNT and RTCOR
settings should therefore be completed before setting bits RTCK2 to RTCK0. RTCNT operation is
shown in figure 7.46, compare match timing in figure 7.47, and CBR refresh timing in figure 7.48.
When the CBRM bit in REFCR is cleared to 0, access to external space other than DRAM space is
performed in parallel during the CBR refresh period.
RTCNT
RTCOR
H'00
Refresh request
RTCNT N H'00
RTCOR N
CSn (RASn)
UCAS, LCAS
A setting can be made in bits RCW1 and RCW0 in REFCR to delay RAS signal output by one to
three cycles. Use bits RLW1 and RLW0 in REFCR to adjust the width of the RAS signal. The
settings of bits RCW1, RCW0, RLW1, and RLW0 are valid only in refresh operations.
Figure 7.49 shows the timing when bits RCW1 and RCW0 are set.
CSn (RASn)
UCAS, CAS
Depending on the DRAM used, modification of the WE signal may not be permitted during the
refresh period. In this case, the CBRM bit in REFCR should be set to 1. The bus controller will
then insert refresh cycles in appropriate breaks between bus cycles. Figure 7.50 shows an example
of the timing when the CBRM bit is set to 1. In this case the CS signal is not controlled, and
retains its value prior to the start of the refresh period.
A23 to A0
CS
AS
RD
HWR (WE)
Refresh period
RAS
CAS
(2) Self-Refreshing
A self-refresh mode (battery backup mode) is provided for DRAM as a kind of standby mode. In
this mode, refresh timing and refresh addresses are generated within the DRAM.
To select self-refreshing, set the RFSHE bit and SLFRF bit to 1 in REFCR. When a SLEEP
instruction is executed to enter software standby mode, the CAS and RAS signals are output and
DRAM enters self-refresh mode, as shown in figure 7.51.
When software standby mode is exited, the SLFRF bit is cleared to 0 and self-refresh mode is
exited automatically. If a CBR refresh request occurs when making a transition to software
standby mode, CBR refreshing is executed, and then self-refresh mode is entered.
When using self-refresh mode, the OPE bit must not be cleared to 0 in the SBYCR register.
RASn (CSn)
UCAS, LCAS
WE (HWR)
High
Note: n = 2 to 5
In some DRAMs provided with a self-refresh mode, the RAS signal precharge time immediately
after self-refreshing is longer than the normal precharge time. A setting can be made in bits
TPCS2 to TPCS0 in REFCR to make the precharge time immediately after self-refreshing from 1
to 7 states longer than the normal precharge time. In this case, too, normal precharging is
performed according to the setting of bits TPC1 and TPC0 in DRACCR, and therefore a setting
should be made to give the optimum post-self-refresh precharge time, including this time. Figure
7.52 shows an example of the timing when the precharge time immediately after self-refreshing is
extended by 2 states.
Address bus
RASn (CSn)
UCAS, LCAS
High
OE (RD)
WE (HWR)
Data bus
Note: n = 2 to 5
Figure 7.52 Example of Timing when Precharge Time after Self-Refreshing Is Extended
by 2 States
In this LSI, if the ACSE bit is set to 1 in MSTPCRH, and then a SLEEP instruction is executed
with the setting for all peripheral module clocks to be stopped (MSTPCR = H'FFFF, EXMSTPCR
= H'FFFF) or for operation of the 8-bit timer module alone (MSTPCR = H'FFFE, EXMSTPCR =
H'FFFF), and a transition is made to the sleep state, the all-module-clocks-stopped mode is
entered, in which the bus controller and I/O port clocks are also stopped. As the bus controller
clock is also stopped in this mode, CBR refreshing is not executed. If DRAM is connected
externally and DRAM data is to be retained in sleep mode, the ACSE bit must be cleared to 0 in
MSTPCRH.
7.7.13 DMAC and EXDMAC Single Address Transfer Mode and DRAM Interface
When burst mode is selected on the DRAM interface, the DACK and EDACK output timing can
be selected with the DDS and EDDS bits in DRAMCR. When DRAM space is accessed in DMAC
or EXDMAC single address mode at the same time, these bits select whether or not burst access is
to be performed.
Burst access is performed by determining the address only, irrespective of the bus master. With
the DRAM interface, the DACK or EDACK output goes low from the Tc1 state.
Figure 7.53 shows the DACK or EDACK output timing for the DRAM interface when DDS = 1 or
EDDS = 1.
Tp Tr Tc1 Tc2
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
DACK or EDACK
Note: n = 2 to 5
When DRAM space is accessed in DMAC or EXDMAC single address transfer mode, full access
(normal access) is always performed. With the DRAM interface, the DACK or EDACK output
goes low from the Tr state.
In modes other than DMAC or EXDMAC single address transfer mode, burst access can be used
when accessing DRAM space.
Figure 7.54 shows the DACK or EDACK output timing for the DRAM interface when DDS = 0 or
EDDS = 0.
RASn (CSn)
UCAS, LCAS
WE (HWR) High
Read OE (RD)
Data bus
WE (HWR)
Data bus
DACK or EDACK
Note: n = 2 to 5
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group.
Areas 2 to 5 are designated as continuous synchronous DRAM space by setting bits RMTS2 to
RMTS0 in DRAMCR. The relation between the settings of bits RMTS2 to RMTS0 and
synchronous DRAM space is shown in table 7.8. Possible synchronous DRAM interface settings
are and continuous area (areas 2 to 5).
Table 7.8 Relation between Settings of Bits RMTS2 to RMTS0 and Synchronous DRAM
Space
With continuous synchronous DRAM space, CS2, CS3, CS4 pins are used as RAS, CAS, WE
signal. The OE pin of the DRAM is used as the CKE signal, and the CS5 pin is used as
synchronous DRAM clock (SDRAMφ). The bus specifications for continuous synchronous
DRAM space conform to the settings for area 2. The pin wait and program wait for the continuous
synchronous DRAM are invalid.
Commands for the synchronous DRAM can be specified by combining RAS, CAS, WE, and
address-precharge-setting command (Precharge-sel) output on the upper column addresses.
Commands that are supported by this LSI are NOP, auto-refresh (REF), self-refresh (SELF), all
bank precharge (PALL), row address strobe bank-active (ACTV), read (READ), write (WRIT),
and mode-register write (MRS). Commands for bank control cannot be used.
With continuous synchronous DRAM space, the row address and column address are multiplexed.
In address multiplexing, the size of the shift of the row address is selected with bits MXC2 to
MXC0 in DRAMCR. The address-precharge-setting command (Precharge-sel) can be output on
the upper column address. Table 7.9 shows the relation between the settings of MXC2 to MXC0
and the shift size. The MXC2 bit should be set to 1 when the synchronous DRAM interface is
used.
Table 7.9 Relation between Settings of Bits MXC2 to MXC0 and Address Multiplexing
1 9 A23 to A15 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9
bits A16
1 0 10 A23 to A15 A14 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10
bits A16
1 11 A23 to A15 A14 A13 A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11
bits A16
1 ⎯ A23 to P P P P P P A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
A16
1 0 ⎯ A23 to P P P P P A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
A16
[Legend]
×: Don't care.
P: Precharge-sel
In 8-bit continuous synchronous DRAM space the upper half of the data bus, D15 to D8, is
enabled, while in 16-bit continuous synchronous DRAM space both the upper and lower halves of
the data bus, D15 to D0, are enabled.
Access sizes and data alignment are the same as for the basic bus interface: see section 7.5.1, Data
Size and Data Alignment.
Table 7.10 shows pins used for the synchronous DRAM interface and their functions.
Set the OEE bit in DRAMCR to 1 when the CKE signal is output.
With
Synchronous
Pin DRAM Setting Name I/O Function
CS2 RAS Row address strobe Output Row address strobe when
areas 2 to 5 are designated
as continuous synchronous
DRAM space
CS3 CAS Column address strobe Output Column address strobe when
areas 2 to 5 are designated
as continuous synchronous
DRAM space
CS4 WE Write enable Output Write enable strobe when
areas 2 to 5 are designated
as continuous synchronous
DRAM space
CS5 SDRAMφ Clock Output Clock only for synchronous
DRAM
OE CKE Clock enable Output Clock enable signal when
areas 2 to 5 are designated
as continuous synchronous
DRAM space
UCAS DQMU Upper data mask enable Output Upper data mask enable for
16-bit continuous
synchronous DRAM space
access/data mask enable for
8-bit continuous synchronous
DRAM space access
LCAS DQML Lower data mask enable Output Lower data mask enable
signal for 16-bit continuous
synchronous DRAM space
access
A15 to A0 A15 to A0 Address pins Output Row address/column address
multiplexed output pins
D15 to D0 D15 to D0 Data pins I/O Data input/output pins
The synchronous clock (SDRAMφ) is output from the CS5 pin. SDRAMφ is output with the same
phase and timing as φ. Figure 7.55 shows the relationship between φ and SDRAMφ.
tcyc
SDRAMφ
The four states of the basic timing consist of one Tp (precharge cycle) state, one Tr (row address
output cycle) state, and the Tc1 and two Tc2 (column address output cycle) states.
When areas 2 to 5 are set for the continuous synchronous DRAM space, settings of the WAITE bit
of BCR, RAST, CAST, RCDM bits of DRAMCR, and the CBRM bit of REFCR are ignored.
Tp Tr Tc1 Tc2
SDRAMφ
RAS
CAS
WE
Read
CKE High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
CAS latency is controlled by settings of the W22 to W20 bits of WTCRB. Set the CAS latency
count, as shown in table 7.11, by the setting of synchronous DRAM. Depending on the setting, the
CAS latency control cycle (Tc1) is inserted. WTCRB can be set regardless of the setting of the
AST2 bit of ASTCR. Figure 7.57 shows the CAS latency control timing when synchronous
DRAM of CAS latency 3 is connected.
The initial value of W22 to W20 is H'7. Set the register according to the CAS latency of
synchronous DRAM to be connected.
SDRAMφ
RAS
CAS
WE
Read
CKE
High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
When the command interval specification from the ACTV command to the next READ/WRIT
command cannot be satisfied, 1 to 3 states (Trw) that output the NOP command can be inserted
between the Tr cycle that outputs the ACTV command and the Tc1 cycle that outputs the column
address by setting the RCD1 and RCD0 bits of DRACCR. Use the optimum setting for the wait
time according to the synchronous DRAM connected and the operating frequency of this LSI.
Figure 7.58 shows an example of the timing when the one Trw state is set.
SDRAMφ
RAS
CAS
WE
Read
CKE
High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
Figure 7.58 Example of Access Timing when Row Address Output Hold State Is 1 State
(RCD1 = 0, RCD0 = 1, SDWCD = 0, CAS Latency 2)
When the interval specification from the PALL command to the next ACTV/REF command
cannot be satisfied, from one to four Tp states can be selected by setting bits TPC1 and TPC0 in
DRACCR. Set the optimum number of Tp cycles according to the synchronous DRAM connected
and the operating frequency of this LSI. Figure 7.59 shows the timing when two Tp states are
inserted.
The setting of bits TPC1 and TPC0 is also valid for Tp states in refresh cycles.
SDRAMφ
RAS
CAS
WE
Read
CKE
High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
By setting the SDWCD bit of the DRACCR to 1, the CAS latency control cycle (Tc1) that is
inserted by the WTCRB register in the write access of the synchronous DRAM can be disabled.
Disabling the CAS latency control cycle can reduce the write-access cycle count as compared to
synchronous DRAM read access. Figure 7.60 shows the write access timing when the CAS
latency control cycle is disabled.
Tp Tr Tc1 Tc2
SDRAMφ
RAS
CAS
WE
CKE
High
DQMU, DQML
Data bus
Figure 7.60 Example of Write Access Timing when CAS Latency Control Cycle Is Disabled
(SDWCD = 1)
When synchronous DRAM with a ×16-bit configuration is connected, DQMU and DQML are
used for the control signals needed for byte access.
Figures 7.61 and 7.62 show the control timing for DQM, and figure 7.63 shows an example of
connection of byte control by DQMU and DQML.
SDRAMφ
RAS
CAS
WE
CKE
High
DQMU
DQML High
SDRAMφ
RAS
CAS
WE
CKE
High
DQMU
High
DQML
OE (CKE) CKE
I/O PORT CS
With synchronous DRAM, in addition to full access (normal access) in which data is accessed by
outputting a row address for each access, burst access is also provided which can be used when
making consecutive accesses to the same row address. This access enables fast access of data by
simply changing the column address after the row address has been output. Burst access can be
selected by setting the BE bit to 1 in DRAMCR.
DQM has the 2-cycle latency when synchronous DRAM is read. Therefore, the DQM signal
cannot be specified to the Tc2 cycle data output if the Tc1 cycle is executed for second or
following column address when the CAS latency is set to 1 to issue the READ command. Do not
set the BE bit to 1 when synchronous DRAM of CAS latency 1 is connected.
Figure 7.64 shows the operation timing for burst access. When there are consecutive access cycles
for continuous synchronous DRAM space, the column address output cycles continue as long as
the row address is the same for consecutive access cycles. The row address used for the
comparison is set with bits MXC2 to MXC0 in DRAMCR.
SDRAMφ
RAS
CAS
WE
Read
CKE
High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
Even when burst operation is selected, it may happen that access to continuous synchronous
DRAM space is not continuous, but is interrupted by access to another space. In this case, if the
row address active state is held during the access to the other space, the read or write command
can be issued without ACTV command generation similarly to DRAM RAS down mode.
To select RAS down mode, set the BE bit to 1 in DRAMCR regardless of the RCDM bit settings.
The operation corresponding to DRAM RAS up mode is not supported by this LSI.
Note, however, the next continuous synchronous DRAM space access is a full access if:
There is synchronous DRAM in which time of the active state of each bank is restricted. If it is not
guaranteed that other row address are accessed in a period in which program execution ensures the
value (software standby, sleep, etc.), auto refresh or self refresh must be set, and the restrictions of
the maximum active state time of each bank must be satisfied. When refresh is not used, programs
must be developed so that the bank is not in the active state for more than the specified time.
Column Row
Address bus address 1 address Column address 1 External address Column address 2
Row
Precharge-sel address External address
RAS
CAS
WE
CKE
High
DQMU, DQML
Data bus
This LSI is provided with a synchronous DRAM refresh control function. Auto refreshing is used.
In addition, self-refreshing can be executed when the chip enters the software standby state.
Refresh control is enabled when any area is designated as continuous synchronous DRAM space
in accordance with the setting of bits RMTS2 to RMTS0 in DRAMCR.
With auto refreshing, RTCNT counts up using the input clock selected by bits RTCK2 to RTCK0
in REFCR, and when the count matches the value set in RTCOR (compare match), refresh control
is performed. At the same time, RTCNT is reset and starts counting up again from H'00.
Refreshing is thus repeated at fixed intervals determined by RTCOR and bits RTCK2 to RTCK0.
Set a value in RTCOR and bits RTCK2 to RTCK0 that will meet the refreshing interval
specification for the synchronous DRAM used.
When bits RTCK2 to RTCK0 are set, RTCNT starts counting up. RTCNT and RTCOR settings
should therefore be completed before setting bits RTCK2 to RTCK0. Auto refresh timing is shown
in figure 7.66.
Since the refresh counter operation is the same as the operation in the DRAM interface, see
section 7.7.12, Refresh Control.
When the continuous synchronous DRAM space is set, access to external address space other than
continuous synchronous DRAM space cannot be performed in parallel during the auto refresh
period, since the setting of the CBRM bit of REFCR is ignored.
SDRAMφ
Address bus
Precharge-sel
RAS
CAS
WE
CKE
High
When the interval specification from the PALL command to the REF command cannot be
satisfied, setting the RCW1 and RCW0 bits of REFCR enables one to three wait states to be
inserted after the TRp cycle that is set by the TPC1 and TPC0 bits of DRACCR. Set the optimum
number of waits according to the synchronous DRAM connected and the operating frequency of
this LSI. Figure 7.67 shows the timing when one wait state is inserted. Since the setting of bits
TPC1 and TPC0 of DRACCR is also valid in refresh cycles, the command interval can be
extended by the RCW1 and RCW0 bits after the precharge cycles.
SDRAMφ
Address bus
Precharge-sel
RAS
CAS
WE
CKE
High
When the interval specification from the REF command to the ACTV cannot be satisfied, setting
the RLW1 and RLW0 bits of REFCR enables one to three wait states to be inserted in the refresh
cycle. Set the optimum number of waits according to the synchronous DRAM connected and the
operating frequency of this LSI. Figure 7.68 shows the timing when one wait state is inserted.
SDRAMφ
Address bus
Precharge-sel
RAS
CAS
WE
CKE
High
(2) Self-Refreshing
A self-refresh mode (battery backup mode) is provided for synchronous DRAM as a kind of
standby mode. In this mode, refresh timing and refresh addresses are generated within the
synchronous DRAM.
To select self-refreshing, set the RFSHE bit to 1 in REFCR. When a SLEEP instruction is
executed to enter software standby mode, the SELF command is issued, as shown in figure 7.69.
When software standby mode is exited, the SLFRF bit in REFCR is cleared to 0 and self-refresh
mode is exited automatically. If an auto refresh request occurs when making a transition to
software standby mode, auto refreshing is executed, and then self-refresh mode is entered.
When using self-refresh mode, the OPE bit must not be cleared to 0 in SBYCR.
SDRAMφ
Address bus
Precharge-sel
RAS
CAS
WE
CKE
In some synchronous DRAMs provided with a self-refresh mode, the interval between clearing
self-refreshing and the next command is specified. A setting can be made in bits TPCS2 to TPCS0
in REFCR to make the precharge time after self-refreshing from 1 to 7 states longer than the
normal precharge time. In this case, too, normal precharging is performed according to the setting
of bits TPC1 and TPC0 in DRACCR, and therefore a setting should be made to give the optimum
post-self-refresh precharge time, including this time. Figure 7.70 shows an example of the timing
when the precharge time after self-refreshing is extended by 2 states.
Software
standby TRc2 TRp3 TRp1 TRc2 Tp Tr Tc1 Tcl Tc2
SDRAMφ
Precharge-sel Row
address
RAS
CAS
WE
CKE
DQMU, DQML
Data bus
Figure 7.70 Example of Timing when Precharge Time after Self-Refreshing Is Extended
by 2 States (TPCS2 to TPCS0 = H'2, TPC1 = 0, TPC0 = 0, CAS Latency 2)
In this LSI, if the ACSE bit is set to 1 in MSTPCRH, and then a SLEEP instruction is executed
with the setting for all peripheral module clocks to be stopped (MSTPCR = H'FFFF, EXMSTPCR
= H'FFFF) or for operation of the 8-bit timer module alone (MSTPCR = H'FFFE, EXMSTPCR =
H'FFFF), and a transition is made to the sleep state, the all-module-clocks-stopped mode is
entered, in which the bus controller and I/O port clocks are also stopped.
As the bus controller clock is also stopped in this mode, auto refreshing is not executed. If
synchronous DRAM is connected to the external address space and DRAM data is to be retained
in sleep mode, the ACSE bit must be cleared to 0 in MSTPCR.
When a transition is made to normal software standby, the PALL command is not output. If
synchronous DRAM is connected and DRAM data is to be retained in software standby, self-
refreshing must be set.
To use synchronous DRAM, mode must be set after power-on. To set mode, set the RMTS2 to
RMTS0 bits in DRAMCR to H'5 and enable the synchronous DRAM mode register setting. After
that, access the continuous synchronous DRAM space in bytes. When the value to be set in the
synchronous DRAM mode register is X, value X is set in the synchronous DRAM mode register
by writing to the continuous synchronous DRAM space of address H'400000 + X for 8-bit bus
configuration synchronous DRAM and by writing to the continuous synchronous DRAM space of
address H'400000 + 2X for 16-bit bus configuration synchronous DRAM.
The value of the address signal is fetched at the issuance time of the MRS command as the setting
value of the mode register in the synchronous DRAM. Mode of burst read/burst write in the
synchronous DRAM is not supported by this LSI. For setting the mode register of the synchronous
DRAM, set the burst read/single write with the burst length of 1. Figure 7.71 shows the setting
timing of the mode in the synchronous DRAM.
Tp Tr Tc1 Tc2
SDRAMφ
RAS
CAS
WE
CKE
High
7.8.15 DMAC and EXDMAC Single Address Transfer Mode and Synchronous DRAM
Interface
When burst mode is selected on the synchronous DRAM interface, the DACK and EDACK output
timing can be selected with the DDS and EDDS bits in DRAMCR. When continuous synchronous
DRAM space is accessed in DMAC/EXDMAC single address mode at the same time, these bits
select whether or not burst access is to be performed. The establishment time for the read data can
be extended in the clock suspend mode irrespective of the settings of the DDS and EDDS bits.
When DDS = 1 or EDDS = 1: Burst access is performed by determining the address only,
irrespective of the bus master. With the synchronous DRAM interface, the DACK or EDACK
output goes low from the Tc1 state.
Figure 7.72 shows the DACK or EDACK output timing for the synchronous DRAM interface
when DDS = 1 or EDDS = 1.
SDRAMφ
RAS
CAS
WE
Read
CKE
High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
DACK or EDACK
In modes other than DMAC or EXDMAC single address transfer mode, burst access can be used
when accessing continuous synchronous DRAM space.
Figure 7.73 shows the DACK or EDACK output timing for connecting the synchronous DRAM
interface when DDS = 0 or EDDS = 0.
SDRAMφ
RAS
CAS
WE
Read
CKE
High
DQMU, DQML
Data bus
RAS
CAS
WE
Write
CKE
High
DQMU, DQML
Data bus
DACK or EDACK
If the CKSPE bit is set to 1 in DRACCR when the continuous synchronous DRAM space is read-
accessed in DMAC/EXDMAC single address mode, the establishment time for the read data can
be extended by clock suspend mode. The number of states for insertion of the read data extension
cycle (Tsp) is set in bits RDXC1 and RDXC0 in DRACCR. Be sure to set the OEE bit to 1 in
DRAMCR when the read data will be extended. The extension of the read data is not in
accordance with the bits DDS and EDDS.
Figure 7.74 shows the timing chart when the read data is extended by two cycles.
SDRAMφ
Column Row
Address bus address address Column address
Row
Precharge-sel address
RAS
CAS
WE
CKE
DQMU, DQML
Data bus
DACK or EDACK
Figure 7.74 Example of Timing when the Read Data Is Extended by Two States
(DDS = 1, or EDDS = 1, RDXC1 = 0, RDXC0 = 1, CAS Latency 2)
Areas 1 and 0 can be designated as burst ROM space by means of bits BSRM1 and BSRM0 in
BROMCR. Continuous burst accesses of 4, 8, 16, or 32 words can be performed, according to the
setting of the BSWD11 and BSWD10 bits in BROMCR. From 1 to 8 states can be selected for
burst access.
In burst ROM space, burst access covers only CPU read accesses.
The number of access states in the initial cycle (full access) on the burst ROM interface is
determined by the basic bus interface settings in ASTCR, ABWCR, WTCRA, WTCRB, and
CSACRH. When area 0 or area 1 is designated as burst ROM space, the settings in RDNCR and
CSACRL are ignored.
From 1 to 8 states can be selected for the burst cycle, according to the settings of bits BSTS02 to
BSTS00 and BSTS12 to BSTS10 in BROMCR. Wait states cannot be inserted. Burst access of up
to 32 words is performed, according to the settings of bits BSTS01, BSTS00, BSTS11, and
BSTS10 in BROMCR.
The basic access timing for burst ROM space is shown in figures 7.75 and 7.76.
T1 T2 T3 T1 T2 T1 T2
CSn
AS
RD
Data bus
Note: n = 1 and 0
T1 T2 T1 T1
CSn
AS
RD
Data bus
Note: n = 1 and 0
As with the basic bus interface, either program wait insertion or pin wait insertion using the WAIT
pin can be used in the initial cycle (full access) on the burst ROM interface. See section 7.5.4,
Wait Control. Wait states cannot be inserted in a burst cycle.
When a write access to burst ROM space is executed, burst access is interrupted at that point and
the write access is executed in line with the basic bus interface settings. Write accesses are not
performed in burst mode even though burst ROM space is designated.
7.10.1 Operation
When this LSI accesses external address space, it can insert an idle cycle (Ti) between bus cycles
in the following three cases: (1) when read accesses in different areas occur consecutively, (2)
when a write cycle occurs immediately after a read cycle, and (3) when a read cycle occurs
immediately after a write cycle. Insertion of a 1-state or 2-state idle cycle can be selected with the
IDLC bit in BCR. By inserting an idle cycle it is possible, for example, to avoid data collisions
between ROM, etc., with a long output floating time, and high-speed memory, I/O interfaces, and
so on.
If consecutive reads in different areas occur while the ICIS1 bit is set to 1 in BCR, an idle cycle is
inserted at the start of the second read cycle.
Figure 7.77 shows an example of the operation in this case. In this example, bus cycle A is a read
cycle for ROM with a long output floating time, and bus cycle B is a read cycle for SRAM, each
being located in a different area. In (a), an idle cycle is not inserted, and a collision occurs in bus
cycle B between the read data from ROM and that from SRAM. In (b), an idle cycle is inserted,
and a data collision is prevented.
T1 T2 T3 T1 T2 T1 T2 T3 Ti T1 T2
φ φ
CS (area B) CS (area B)
RD RD
Data collision
Long output floating time Idle cycle
If an external write occurs after an external read while the ICIS0 bit is set to 1 in BCR, an idle
cycle is inserted at the start of the write cycle.
Figure 7.78 shows an example of the operation in this case. In this example, bus cycle A is a read
cycle for ROM with a long output floating time, and bus cycle B is a CPU write cycle. In (a), an
idle cycle is not inserted, and a collision occurs in bus cycle B between the read data from ROM
and the CPU write data. In (b), an idle cycle is inserted, and a data collision is prevented.
T1 T2 T3 T1 T2 T1 T2 T3 Ti T1 T2
φ φ
CS (area A) CS (area A)
CS (area B) CS (area B)
RD RD
HWR HWR
If an external read occurs after an external write while the ICIS2 bit is set to 1 in BCR, an idle
cycle is inserted at the start of the read cycle.
Figure 7.79 shows an example of the operation in this case. In this example, bus cycle A is a CPU
write cycle and bus cycle B is a read cycle from an external device. In (a), an idle cycle is not
inserted, and a collision occurs in bus cycle B between the CPU write data and read data from an
external device. In (b), an idle cycle is inserted, and a data collision is prevented.
T1 T2 T3 T1 T2 T1 T2 T3 Ti T1 T2
φ φ
CS (area A) CS (area A)
CS (area B) CS (area B)
RD RD
(4) Relationship between Chip Select (CS) Signal and Read (RD) Signal
Depending on the system’s load conditions, the RD signal may lag behind the CS signal. An
example is shown in figure 7.80. In this case, with the setting for no idle cycle insertion (a), there
may be a period of overlap between the bus cycle A RD signal and the bus cycle B CS signal.
Setting idle cycle insertion, as in (b), however, will prevent any overlap between the RD and CS
signals. In the initial state after reset release, idle cycle insertion (b) is set.
T1 T2 T3 T1 T2 T1 T2 T3 Ti T1 T2
φ φ
CS (area A) CS (area A)
CS (area B) CS (area B)
RD RD
Figure 7.80 Relationship between Chip Select (CS) and Read (RD)
(5) Idle Cycle in Case of DRAM Space Access after Normal Space Access
In a DRAM space access following a normal space access, the settings of bits ICIS2, ICIS1,
ICIS0, and IDLC in BCR are valid. However, in the case of consecutive reads in different areas,
for example, if the second read is a full access to DRAM space, only a Tp cycle is inserted, and a
Ti cycle is not. The timing in this case is shown in figure 7.81.
T1 T2 T3 Tp Tr Tc1 Tc2
φ
Address bus
RD
Data bus
In burst access in RAS down mode, the settings of bits ICIS2, ICIS1, ICIS0, and IDLC are valid
and an idle cycle is inserted. The timing in this case is illustrated in figures 7.82 and 7.83.
Address bus
RD
RAS
UCAS, LCAS
Data bus
Idle cycle
Address bus
RD
HWR
RAS
UCAS, LCAS
Data bus
Idle cycle
(6) Idle Cycle in Case of Continuous Synchronous DRAM Space Access after Normal
Space Access
In a continuous synchronous DRAM space access following a normal space access, the settings of
bits ICIS2, ICIS1, ICIS0, and IDLC in BCR are valid. However, in the case of consecutive reads
in different areas, for example, if the second read is a full access to continuous synchronous
DRAM space, only Tp cycle is inserted, and Ti cycle is not. The timing in this case is shown in
figure 7.84.
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group.
Column Row
Address bus address address Column address
Row
Precharge-sel
address
RAS
CAS
WE
CKE
DQMU, DQML
RD
Data bus
Figure 7.84 Example of Synchronous DRAM Full Access after External Read
(CAS Latency 2)
In burst access in RAS down mode, the settings of bits ICIS2, ICIS1, ICIS0, and IDLC are valid
and an idle cycle is inserted. However, in read access, note that the timings of DQMU and DQML
differ according to the settings of the IDLC bit. The timing in this case is illustrated in figures 7.85
and 7.86. In write access, DQMU and DQML are not in accordance with the settings of the IDLC
bit. The timing in this case is illustrated in figure 7.87.
Address bus Column Row Column address 1 External address Column address 2
address 1 address
RAS
CAS
WE
CKE
High
DQMU, DQML
RD
HWR, LWR
High
Data bus
Idle cycle
Address bus Column Row Column address 1 External address Column address 2
address 1 address
RAS
CAS
WE
CKE
High
DQMU, DQML
RD
HWR, LWR
High
Data bus
Idle cycle
Column Row
Address bus address address Column address 1 External address Column address 2
RAS
CAS
WE
CKE
High
DQMU, DQML
RD
HWR, LWR
High
Data bus
Idle cycle
(7) Idle Cycle in Case of Normal Space Access after DRAM Space Access
While the DRMI bit is cleared to 0 in DRACCR, idle cycle insertion after DRAM space access is
disabled. Idle cycle insertion after DRAM space access can be enabled by setting the DRMI bit to
1. The conditions and number of states of the idle cycle to be inserted are in accordance with the
settings of bits ICIS1, ICIS0, and IDLC in BCR are valid. Figures 7.88 and 7.89 show examples of
idle cycle operation when the DRMI bit is set to 1.
When the DRMI bit is cleared to 0, an idle cycle is not inserted after DRAM space access even if
bits ICIS1 and ICIS0 are set to 1.
Address bus
RD
RAS
UCAS, LCAS
Data bus
Idle cycle
Address bus
RD
HWR, LWR
RAS
UCAS, LCAS
Data bus
Idle cycle
While the ICIS2 bit is set to 1 in BCR and a normal space read access occurs after DRAM space
write access, idle cycle is inserted in the first read cycle. The number of states of the idle cycle to
be inserted is in accordance with the setting of the IDLC bit. It does not depend on the DRMI bit
in DRACCR. Figure 7.90 shows an example of idle cycle operation when the ICIS2 bit is set to 1.
Address bus
RD
HWR, LWR
RAS
UCAS, LCAS
Data bus
Idle cycle
Figure 7.90 Example of Idle Cycle Operation after DRAM Write Access
(IDLC = 0, ICIS1 = 0, RAST = 0, CAST = 0)
(8) Idle Cycle in Case of Normal Space Access after Continuous Synchronous DRAM
Space Access:
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group.
(a) Normal space access after a continuous synchronous DRAM space read access
While the DRMI bit is cleared to 0 in DRACCR, idle cycle insertion after continuous synchronous
DRAM space read access is disabled. Idle cycle insertion after continuous synchronous DRAM
space read access can be enabled by setting the DRMI bit to 1. The conditions and number of
states of the idle cycle to be inserted are in accordance with the settings of bits ICIS1, ICIS0, and
IDLC in RCR. Figure 7.91 shows an example of idle cycle operation when the DRMI bit is set to
1. When the DRMI bit is cleared to 0, an idle cycle is not inserted after continuous synchronous
DRAM space read access even if bits ICIS1 and ICIS0 are set to 1.
Address bus Column Row Column address 1 External address Column address 2
address 1 address
Row
Precharge-sel address External address
RAS
CAS
WE
CKE
High
DQMU, DQML
RD
Data bus
Idle cycle
Figure 7.91 Example of Idle Cycle Operation after Continuous Synchronous DRAM Space
Read Access (Read between Different Area) (IDLC = 0, CAS Latency 2)
(b) Normal space access after a continuous synchronous DRAM space write access
If a normal space read cycle occurs after a continuous synchronous DRAM space write access
while the ICIS2 bit is set to 1 in BCR, idle cycle is inserted at the start of the read cycle. The
number of states of the idle cycle to be inserted is in accordance with the setting of bit IDLC. It is
not in accordance with the DRMI bit in DRACCR.
Figure 7.92 shows an example of idle cycle operation when the ICIS2 bit is set to 1.
Address bus Column Row Column address 1 External address Column address 2
address 1 address
Row
Precharge-sel address External address
RAS
CAS
WE
CKE
High
DQMU, DQML
RD
HWR, LWR
Data bus
Idle cycle
Figure 7.92 Example of Idle Cycle Operation after Continuous Synchronous DRAM Space
Write Access (IDLC = 0, ICIS1 = 0, SDWCD = 1, CAS Latency 2)
Table 7.12 shows whether there is an idle cycle insertion or not in the case of mixed accesses to
normal space and DRAM space/continuous synchronous DRAM space.
Table 7.12 Idle Cycles in Mixed Accesses to Normal Space and DRAM Continuous
Synchronous DRAM Space
Previous Access Next Access ICIS2 ICIS1 ICIS0 DRMI IDLC Idle cycle
Normal space read Normal space read ⎯ 0 ⎯ ⎯ ⎯ Disabled
(different area)
⎯ 1 ⎯ ⎯ 0 1 state inserted
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous 0 Disabled
2
synchronous DRAM*
⎯ 1 ⎯ ⎯ 0 1 state inserted
space read
1 2 states inserted
Normal space write ⎯ ⎯ 0 ⎯ ⎯ Disabled
⎯ ⎯ 1 ⎯ 0 1 state inserted
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous 0 Disabled
2
synchronous DRAM*
⎯ ⎯ 1 ⎯ 0 1 state inserted
space write
1 2 states inserted
1
DRAM* /continuous Normal space read ⎯ 0 ⎯ ⎯ ⎯ Disabled
synchronous ⎯ 1 ⎯ 0 ⎯ Disabled
2
DRAM* space read
1 0 1 state inserted
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous 0 Disabled
2
synchronous DRAM*
⎯ 1 ⎯ 0 ⎯ Disabled
space read
1 0 1 state inserted
1 2 states inserted
Normal space write ⎯ ⎯ 0 ⎯ ⎯ Disabled
⎯ ⎯ 1 0 ⎯ Disabled
1 0 1 state inserted
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous 0 Disabled
2
synchronous DRAM*
⎯ ⎯ 1 0 ⎯ Disabled
space write
1 0 1 state inserted
1 2 states inserted
Previous Access Next Access ICIS2 ICIS1 ICIS0 DRMI IDLC Idle cycle
Normal space write Normal space read 0 ⎯ ⎯ ⎯ ⎯ Disabled
1 ⎯ ⎯ ⎯ 0 1 state inserted
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous 0 Disabled
2
synchronous DRAM*
1 ⎯ ⎯ ⎯ 0 1 state inserted
space read
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous Normal space read 0 Disabled
synchronous
2 1 ⎯ ⎯ ⎯ 0 1 state inserted
DRAM* space write
1 2 states inserted
⎯ ⎯ ⎯ ⎯
1
DRAM* /continuous 0 Disabled
2
synchronous DRAM*
1 ⎯ ⎯ ⎯ 0 1 state inserted
space read
1 2 states inserted
Notes: 1. The DRAM interface is not supported by the 5-V version.
2. Not supported by the H8S/2427 Group and H8S/2425 Group.
Setting the DRMI bit in DRACCR to 1 enables an idle cycle to be inserted in the case of
consecutive read and write operations in DRAM/continuous synchronous DRAM space burst
access. Figures 7.93 and 7.94 show an example of the timing for idle cycle insertion in the case of
consecutive read and write accesses to DRAM/continuous synchronous DRAM space.
Address bus
RASn (CSn)
UCAS, LCAS
WE (HWR)
OE (RD)
Data bus
Figure 7.93 Example of Timing for Idle Cycle Insertion in Case of Consecutive Read and
Write Accesses to DRAM Space in RAS Down Mode
Row
Precharge-sel address
RAS
CAS
WE
CKE
High
DQMU, DQML
Data bus
Idle cycle
Figure 7.94 Example of Timing for Idle Cycle Insertion in Case of Consecutive Read and
Write Accesses to Continuous Synchronous DRAM Space in RAS Down Mode
(SDWCD = 1, CAS Latency 2)
Figure 7.95 shows an example of the timing when the write data buffer function is used. When this
function is used, if an external address space write or DMA single address mode transfer continues
for three states or longer and there is an internal access next, an external write only is executed in
the first two states, but from the next state onward an internal access (on-chip memory or internal
I/O register read/write) is executed in parallel with the external address space write rather than
waiting until it ends.
CSn
External space
write
HWR, LWR
D15 to D0
Figure 7.95 Example of Timing when Write Data Buffer Function Is Used
7.12.1 Operation
In externally expanded mode, the bus can be released to an external device by setting the BRLE
bit to 1 in BCR. Driving the BREQ pin low issues an external bus request to this LSI. When the
BREQ pin is sampled, at the prescribed timing the BACK pin is driven low, and the address bus,
data bus, and bus control signals are placed in the high-impedance state, establishing the external
bus released state.
In the external bus released state, internal bus masters except the EXDMAC*1 can perform
accesses using the internal bus. When an internal bus master wants to make an external access, it
temporarily defers initiation of the bus cycle, and waits for the bus request from the external bus
master to be canceled. If a refresh request is generated in the external bus released state, or if a
SLEEP instruction is executed to place the chip in software standby mode or all-module-clocks-
stopped mode, refresh control and software standby or all-module-clocks-stopped control is
deferred until the bus request from the external bus master is canceled.
If the BREQOE bit is set to 1 in BCR, the BREQO pin can be driven low when any of the
following requests are issued, to request cancellation of the bus request externally.
When the BREQ pin is driven high, the BACK pin is driven high at the prescribed timing and the
external bus released state is terminated.
If an external bus release request and external access occur simultaneously, the order of priority is
as follows:
(High) External bus release > External access by internal bus master (Low)
If a refresh request*2 and external bus release request occur simultaneously, the order of priority is
as follows:
Table 7.14 shows pin states in the external bus released state.
Figure 7.96 shows the timing for transition to the bus released state.
External
access cycle External bus released state CPU cycle
T1 T2
High impedance
Address bus
High impedance
Data bus
High impedance
AS
High impedance
RD
High impedance
HWR, LWR
BREQ
BACK
BREQO
Note: The refresh control function is not supported by the 5-V version.
Figure 7.97 shows the timing for transition to the bus released state with the synchronous DRAM
interface.
External
access cycle External bus released state CPUcycle
T1 T2
SDRAMφ
High impedance
Address bus
High impedance
Data bus
High impedance
Precharge-sel
High impedance
RAS
High impedance
CAS
High impedance
WE
High impedance
DQMU, DQML
BREQ
BACK
BREQO
Figure 7.97 Bus Release State Transition Timing when Synchronous DRAM Interface
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group.
There are four bus masters⎯the CPU, DTC, DMAC, and EXDMAC*⎯that perform read/write
operations when they have possession of the bus. Each bus master requests the bus by means of a
bus request signal. The bus arbiter determines priorities at the prescribed timing, and permits use
of the bus by means of a bus request acknowledge signal. The selected bus master then takes
possession of the bus and begins its operation.
7.13.1 Operation
The bus arbiter detects the bus masters’ bus request signals, and if the bus is requested, sends a
bus request acknowledge signal to the bus master. If there are bus requests from more than one
bus master, the bus request acknowledge signal is sent to the one with the highest priority. When a
bus master receives the bus request acknowledge signal, it takes possession of the bus until that
signal is canceled.
An internal bus access by internal bus masters except the EXDMAC*2, external bus release, a
refresh, and an external bus access by the EXDMAC*2 can be executed in parallel.
If an external bus release request, a refresh request*1, and an external access by an internal bus
master occur simultaneously, the order of priority is as follows:
(High) External bus release > External access by internal bus master except EXDMAC*2 (Low)
As a refresh*1 when the CBRM bit in REFCR is cleared to 0 and an external access other than to
DRAM space by an internal bus master can be executed simultaneously, there is no relative order
of priority for these two operations.
Even if a bus request is received from a bus master with a higher priority than that of the bus
master that has acquired the bus and is currently operating, the bus is not necessarily transferred
immediately. There are specific timings at which each bus master can relinquish the bus.
(1) CPU
The CPU is the lowest-priority bus master, and if a bus request is received from the DTC, DMAC,
or EXDMAC*, the bus arbiter transfers the bus to the bus master that issued the request. The
timing for transfer of the bus is as follows:
• The bus is transferred at a break between bus cycles. However, if a bus cycle is executed in
discrete operations, as in the case of a longword-size access, the bus is not transferred between
the component operations.
• With bit manipulation instructions such as BSET and BCLR, the sequence of operations is:
data read (read), relevant bit manipulation operation (modify), write-back (write). The bus is
not transferred during this read-modify-write cycle, which is executed as a series of bus cycles.
• If the CPU is in sleep mode, the bus is transferred immediately.
(2) DTC
The DTC sends the bus arbiter a request for the bus when an activation request is generated.
The DTC can release the bus after a vector read, a register information read (3 states), a single data
transfer, or a register information write (3 states). It does not release the bus during a register
information read (3 states), a single data transfer, or a register information write (3 states).
(3) DMAC
The DMAC sends the bus arbiter a request for the bus when an activation request is generated.
In the case of an external request in short address mode or normal mode, and in cycle steal mode,
the DMAC releases the bus after a single transfer.
In block transfer mode, it releases the bus after transfer of one block, and in burst mode, after
completion of the transfer. However, in the event of an EXDMAC* or external bus release
request, which have a higher priority than the DMAC, the bus may be transferred to the bus master
even if block or burst transfer is in progress.
(4) EXDMAC
The EXDMAC sends the bus arbiter a request for the bus when an activation request is generated.
As the EXDMAC is used exclusively for transfers to and from the external bus, if the bus is
transferred to the EXDMAC, internal accesses by other internal bus masters are still executed in
parallel.
In normal transfer mode or cycle steal transfer mode, the EXDMAC releases the bus after a single
transfer.
In block transfer mode, it releases the bus after transfer of one block, and in burst transfer mode,
after completion of the transfer. By setting the BGUP bit to 1 in EDMDR, it is possible to specify
temporary release of the bus in the event of an external access request from an internal bus master.
For details see section 9, EXDMA Controller (EXDMAC).
When the BREQ pin goes low and an external bus release request is issued while the BRLE bit is
set to 1 in BCR, a bus request is sent to the bus arbiter.
In this LSI, if the ACSE bit is set to 1 in MSTPCR, and then a SLEEP instruction is executed with
the setting for all peripheral module clocks to be stopped (MSTPCR = H'FFFF, EXMSTPCR =
H'FFFF) or for operation of the 8-bit timer module alone (MSTPCR = H'FFFE, EXMSTPCR =
H'FFFF), and a transition is made to the sleep state, the all-module-clocks-stopped mode is entered
in which the clock is also stopped for the bus controller and I/O ports. In this state, the external
bus release function is halted. To use the external bus release function in sleep mode, the ACSE
bit in MSTPCR must be cleared to 0. Conversely, if a SLEEP instruction to place the chip in all-
module-clocks-stopped mode is executed in the external bus released state, the transition to all-
module-clocks-stopped mode is deferred and performed until after the bus is recovered.
In this LSI, internal bus master operation does not stop even while the bus is released, as long as
the program is running in on-chip ROM, etc., and no external access occurs. If a SLEEP
instruction to place the chip in software standby mode is executed while the external bus is
released, the transition to software standby mode is deferred and performed after the bus is
recovered.
Also, since clock oscillation halts in software standby mode, if BREQ goes low in this mode,
indicating an external bus release request, the request cannot be answered until the chip has
recovered from the software standby state.
CBR refreshing*1/auto refreshing*2 cannot be executed while the external bus is released. Setting
the BREQOE bit to 1 in BCR beforehand enables the BREQO signal to be output when a CBR
refresh*1/auto refresh*2 request is issued.
Notes: 1. The CBR refreshing control is not supported by the 5-V version.
2. The auto refresh control function is not supported by the H8S/2427 Group and
H8S/2425 Group.
In the continuous synchronous DRAM space, insertion of the wait state by the WAIT pin is
disabled regardless of the setting of the WAITE bit in BCR.
This LSI cannot carry out the bank control of the synchronous DRAM. All banks are selected.
The burst read/burst write mode of the synchronous DRAM is not supported. When setting the
mode register of the synchronous DRAM, set to the burst read/single write and set the burst length
to 1.
When connecting a synchronous DRAM having CAS latency of 1, set the BE bit to 0 in the
DRAMCR.
Note: The synchronous DRAM interface is not supported by the H8S/2427 Group and H8S/2425
Group.
8.1 Features
• Selectable as short address mode or full address mode
Short address mode
⎯ Maximum of 4 channels can be used
⎯ Dual address mode or single address mode can be selected
⎯ In dual address mode, one of the two addresses, transfer source and transfer destination, is
specified as 24 bits and the other as 16 bits
⎯ In single address mode, transfer source or transfer destination address only is specified as
24 bits
⎯ In single address mode, transfer can be performed in one bus cycle
⎯ Choice of sequential mode, idle mode, or repeat mode for dual address mode and single
address mode
Full address mode
⎯ Maximum of 2 channels can be used
⎯ Transfer source and transfer destination addresses as specified as 24 bits
⎯ Choice of normal mode or block transfer mode
• 16-Mbyte address space can be specified directly
• Byte or word can be set as the transfer unit
• Activation sources: internal interrupt, external request, and auto-request (depending on transfer
mode)
Six compare match/input capture interrupts of 16-bit timer-pulse unit (TPU).
⎯ Transmit data empty interrupt and receive data full interrupt of serial communication
interface (SCI_0, SCI_1)
⎯ Conversion end interrupt of A/D converter (A/D_0)
⎯ External request
⎯ Auto-request
• Module stop state can be set
Channel 0
MAR0
RXI0
TXI1 IOAR0
RXI1 ETCR0
ADI0
MAR1
Channel 1
Control logic
IOAR1
ETCR1
Channel 2
IOAR2
External pins
DREQ0-1 ETCR2
DREQ3-5
Channel 3
MAR3
TEND0-1
IOAR3
TEND3-5
DACK0-1 ETCR3
DACK3 DMACRS0-3 Channel 4 SAR4
Interrupt signals DMACRF4-5 DAR4
DMTEND0 DMAECRS0-3
DMTEND1 ETCRA4
DMTEND2 DMAECRF4-5 ETCRB4
DMTEND3 DMARCR0-5 SAR5
Channel 5
DMTEND4
DMEEND4 DRSEL DAR5
DMTEND5 DMATCR ETCRA5
DMEEND5 DMABCR ETCRB5
Data buffer
[Legend]
DMAECR: DMA enable control register
DMACR: DMA control register
DMARCR: DMA register control register
MAR: Memory address register
IOAR: I/O address register
SAR: Source address register
DAR: Destination address register
ETCR: Transfer count register
DMATCR: DMA terminal control register
DMABCR: DMA band control register
DRSEL: DMA register select register
Pin
H8S/2427 Group,
H8S/2427R
Channel Pin Name Symbol I/O Function Group H8S/2425 Group
Pin
H8S/2427 Group,
H8S/2427R
Channel Pin Name Symbol I/O Function Group H8S/2425 Group
Vector Address
Vector DTC DMAC
Interrupt Source Name Number Advanced Mode IPR Priority Activation Activation
Vector Address
DTC DMAC
Interrupt Source Name Vector Number Advanced Mode IPR Priority Activation Activation
DMEEND4 83 H'014C O ⎯
Among the DMAC registers, the DTE, DTME, DTIE, and DMIE bits can always be written to.
The other bits can be written to only when the DTE bit or DTME bit is 0 with no data transfer in
progress on the relevant channel.
Different registers are available depending on whether common register enabled mode or common
register disabled mode is used. Unavailable registers must not be accessed in each mode.
Availability
Common Register Common Register
Enabled Mode Disabled Mode
Register Name (DMCOMMD = 1) (DMCOMMD = 0)
Module configuration register O O
(MDLCFGCR)
Memory address registers 0 to 3 (MAR0 O O
to MAR3)
I/O address registers 0 to 3 (IOAR0 to O O
IOAR3)
Transfer count registers 0 to 3 (ETCR0 to O O
ETCR3)
DMA control registers S0 to S3 O O
(DMACRS0 to DMACRS3)
Source address registers 4, 5 (SAR4, O O
SAR5)
Destination address registers 4, 5 (DAR4, O O
DAR5)
Transfer count registers A4, A5 O O
(ETCRA4, ETCRA5)
Transfer count registers B4, B5 O O
(ETCRB4, ETCRB5)
DMA control registers F4, F5 (DMACRF4, O O
DMACRF5)
DMA enable control registers S0 to S3 × O
(DMAECRS0 to DMAECRS3)
DMA enable control registers F4, F5 × O
(DMAECRF4, DMAECRF5)
DMA register control registers 0 to 5 × O
(DMARCR0 to DMARCR5)
DMA band control register H (DMABCRH) O ×
DMA band control register L (DMABCRL) O ×
DMA terminal control register (DMATCR) O ×
DMA register select register (DRSEL) O ×
[Legend]
O: The register is available.
×: The register is unavailable; must not be accessed.
MAR is a 32-bit readable/writable register that specifies the source address (transfer source
address) or destination address (transfer destination address) of channels 0, 1, 2, and 3.
Whether MAR functions as the source address register or the destination address register can be
selected by means of the DTDIR bit in DMACRS.
MAR is incremented or decremented each time a byte or word transfer is executed, so that the
address specified by MAR is automatically updated.
IOAR is a 16-bit readable/writable register that specifies the lower 16 bits of the source address
(transfer source address) or destination address (transfer destination address). The upper 8 bits of
the transfer address are automatically set to H'FF.
Whether IOAR functions as the source address register or the destination address register can be
selected by means of the DTDIR bit in DMACRS.
IOAR is not incremented or decremented each time a data transfer is executed, so the address
specified by IOAR is fixed.
ETCR is a 16-bit readable/writable register that specifies the number of transfers of channels 0, 1,
2, and 3.
The function of ETCR in sequential mode and idle mode differs from that in repeat mode.
In sequential mode and idle mode, ETCR functions as a 16-bit transfer counter. ETCR is
decremented by 1 each time a data transfer is performed, and when the count reaches H'0000, the
DTE bit in DMAECRS is cleared, and transfer ends.
In repeat mode, ETCR functions as an 8-bit transfer counter (ETCRL) and a transfer count holding
register (ETCRH). ETCRL is decremented by 1 each time a data transfer is performed, and when
the count reaches H'00, ETCRL is loaded with the value in ETCRH. At this point, MAR is
automatically restored to the value it had when the data transfer was started. The DTE bit in
DMAECRS is not cleared, and so data transfers can be performed repeatedly until the DTE bit is
cleared.
When using DMARCR to set registers, even though bits corresponding to the DTE bit in
DMAECRS or DMAECRF are 0, they will be set to 1 after all registers have been set.
SAR is a 32-bit readable/writable register that specifies the source address (transfer source
address) of channels 4 and 5.
SAR is incremented or decremented each time a byte or word transfer is executed, so that the
source memory address is automatically updated.
DAR is a 32-bit readable/writable register that specifies the destination address (transfer
destination address) of channels 4 and 5.
DAR is incremented or decremented each time a byte or word transfer is executed, so that the
destination memory address is automatically updated.
ETCRA and ETCRB are 16-bit readable/writable registers that specify the number of transfers of
channels 4 and 5.
The function of ETCRA and ETCRB in normal mode differs from that in block transfer mode.
In normal mode, ETCRA functions as a 16-bit transfer counter. ETCRA is decremented by 1 each
time a data transfer is performed, and when the count reaches H'0000, transfer ends. ETCRB
cannot be used in normal mode
In block transfer mode, ETCRA functions as an 8-bit block size counter (ETCRAL) and a block
size holding register (ETCRAH). ETCRAL is decremented by 1 each time a data transfer of one
byte or one word is performed, and when the count reaches H'00, ETCRAL is loaded with the
value in ETCRAH. So by setting the block size in ETCRAH and ETCRAL, it is possible to
repeatedly transfer blocks consisting of any desired number of bytes or words.
In block transfer mode, ETCRB functions as a 16-bit block transfer counter. ETCRB is
decremented by 1 each time a block is transferred, and transfer ends when the count reaches
H'0000.
DRSEL controls reading and writing of common registers DMABCR and DMATCR. DRSEL
must be set before reading from or writing to DMABCR and DMATCR.
DRSEL can be written to only in common register enabled mode (DMCOMMD = 1).
DMABCR controls the operation of each DMAC channel. The bit functions in the DMABCR
registers differ according to the transfer mode.
DMABCRH and DMABCRL can be written to only in common register enabled mode
(DMCOMMD = 1).
• DMABCRH
Initial
Bit Bit Name Value R/W Description
15 FAE1 0 R/W Full Address Enable 1
This bit is read as 1 when the RSEL5 bit in DRSEL
is 1. This bit is read as 0 when the RSEL5 bit in
DRSEL is 0.
0: Short address mode (channels 2 and 3 are used)
1: Full address mode (channel 5 is used)
14 FAE0 0 R/W Full Address Enable 0
This bit is read as 1 when the RSEL4 bit in DRSEL
is 1. This bit is read as 0 when the RSEL4 bit in
DRSEL is 0.
0: Short address mode (channels 0 and 1 are used)
1: Full address mode (channel 4 is used)
13 SAE1 0 R/W Single Address Enable 1
Specifies whether channel 3 is to be used for
transfer in dual address mode or single address
mode.
0: Dual address mode
1: Single address mode
Initial
Bit Bit Name Value R/W Description
12 SAE0 0 R/W Single Address Enable 0
Specifies whether channel 1 is to be used for
transfer in dual address mode or single address
mode.
0: Dual address mode
1: Single address mode
11 DTA3 0 R/W Data Transfer Acknowledge 3
10 DTA2 0 R/W Data Transfer Acknowledge 2
9 DTA1 0 R/W Data Transfer Acknowledge 1
8 DTA0 0 R/W Data Transfer Acknowledge 0
These bits enable or disable clearing when DMA
transfer is performed for the internal interrupt source
selected by the DTF3 to DTF0 bits in DMACRS.
If the DTA bit is set to 1 when DTE = 1, the internal
interrupt source is cleared automatically by DMA
transfer. When DTE = 1 and DTA = 1, the internal
interrupt source does not issue an interrupt request
to the CPU or DTC.
If the DTA bit is cleared to 0 when DTE = 1, the
internal interrupt source is not cleared when a
transfer is performed, and can issue an interrupt
request to the CPU or DTC in parallel. In this case,
the interrupt source should be cleared by the CPU
or DTC transfer.
When DTE = 0, the internal interrupt source issues
an interrupt request to the CPU or DTC regardless
of the DTA bit setting.
• DMABCRL
Initial
Bit Bit Name Value R/W Description
7 DTE3 0 R/W Data Transfer Enable 3
6 DTE2 0 R/W Data Transfer Enable 2
5 DTE1 0 R/W Data Transfer Enable 1
4 DTE0 0 R/W Data Transfer Enable 0
This bit is used to enable or disable the DMA data
transfer by the activation source selected by the
DTF3 to DTF0 bits in DMACRS.
When DTE = 0, data transfer is disabled and the
activation source is ignored. If the activation source
is an internal interrupt, an interrupt request is
issued to the CPU or DTC.
If the DTE bit is cleared to 0 when DTIE = 1, the
DMAC regards this as indicating the end of a
transfer, and issues a transfer end interrupt request
to the CPU or DTC.
When DTE = 1, data transfer is enabled and the
DMAC waits for a request by the activation source.
When a request is issued by the activation source,
transfer is executed.
[Clearing conditions]
• When initialization is performed
• When the specified number of transfers have
been completed in a transfer mode other than
repeat mode
• When 0 is written to the DTE bit to forcibly
suspend the transfer, or for a similar reason
[Setting condition]
• When 1 is written to the DTE bit after reading
DTE = 0
Initial
Bit Bit Name Value R/W Description
3 DTIE3 0 R/W Data Transfer End Interrupt Enable 3
2 DTIE2 0 R/W Data Transfer End Interrupt Enable 2
1 DTIE1 0 R/W Data Transfer End Interrupt Enable 1
0 DTIE0 0 R/W Data Transfer End Interrupt Enable 0
These bits enable or disable an interrupt to the
CPU or DTC when transfer ends. If the DTIE bit is
set to 1 when DTE = 0, the DMAC regards this as
indicating the end of a transfer, and issues a
transfer end interrupt request to the CPU or DTC.
A transfer end interrupt can be canceled either by
clearing the DTIE bit to 0 in the interrupt handling
routine, or by performing processing to continue
transfer by setting the transfer counter and address
register again, and then setting the DTE bit to 1.
• DMABCRH
Initial
Bit Bit Name Value R/W Description
15 FAE1 1 R Full Address Enable 1
This bit is read as 1 when the RSEL5 bit in DRSEL
is 1. This bit is read as 0 when the RSEL5 bit in
DRSEL is 0.
0: Short address mode (channels 2 and 3 are used)
1: Full address mode (channel 5 is used)
14 FAE0 1 R Full Address Enable 0
This bit is read as 1 when the RSEL4 bit in DRSEL
is 1. This bit is read as 0 when the RSEL4 bit in
DRSEL is 0.
0: Short address mode (channels 0 and 1 are used)
1: Full address mode (channel 4 is used)
Initial
Bit Bit Name Value R/W Description
13, 12 ⎯ All 0 R Reserved
These bits are always read as 0 and cannot be
modified.
11 DTA5 0 R/W Data Transfer Acknowledge 5
These bits enable or disable clearing when DMA
transfer is performed for the internal interrupt
source selected by the DTF3 to DTF0 bits in
DMACRF of channel 5.
It the DTA5 bit is set to 1 when DTE5 = 1, the
internal interrupt source is cleared automatically by
DMA transfer. When DTE5 = 1 and DTA5 = 1, the
internal interrupt source does not issue an interrupt
request to the CPU or DTC.
It the DTA5 bit is cleared to 0 when DTE5 = 1, the
internal interrupt source is not cleared when a
transfer is performed, and can issue an interrupt
request to the CPU or DTC in parallel. In this case,
the interrupt source should be cleared by the CPU
or DTC transfer.
When DTE5 = 0, the internal interrupt source issues
an interrupt request to the CPU or DTC regardless
of the DTA5 bit setting.
The state of the DTME5 bit does not affect the
above operations.
10 ⎯ 0 R Reserved
This bit is always read as 0 and cannot be modified.
Initial
Bit Bit Name Value R/W Description
9 DTA4 0 R/W Data Transfer Acknowledge 4
These bits enable or disable clearing when DMA
transfer is performed for the internal interrupt
source selected by the DTF3 to DTF0 bits in
DMACRF of channel 4.
It the DTA4 bit is set to 1 when DTE4 = 1, the
internal interrupt source is cleared automatically by
DMA transfer. When DTE4 = 1 and DTA4 = 1, the
internal interrupt source does not issue an interrupt
request to the CPU or DTC.
It the DTA4 bit is cleared to 0 when DTE4 = 1, the
internal interrupt source is not cleared when a
transfer is performed, and can issue an interrupt
request to the CPU or DTC in parallel. In this case,
the interrupt source should be cleared by the CPU
or DTC transfer.
When DTE4 = 0, the internal interrupt source issues
an interrupt request to the CPU or DTC regardless
of the DTA4 bit setting.
The state of the DTME4 bit does not affect the
above operations.
8 ⎯ 0 R Reserved
This bit is always read as 0 and cannot be modified.
• DMABCRL
Initial
Bit Bit Name Value R/W Description
7 DTME5 0 R/W Data Transfer Master Enable 5
Together with the DTE5 bit, this bit controls
enabling or disabling of data transfer on channel 5.
When both the DTME5 bit and DTE5 bit are set to
1, transfer is enabled for channel 5.
If channel 5 is in the middle of a burst mode
transfer when an NMI interrupt is generated, the
DTME5 bit is cleared to 0, the transfer is
interrupted, and bus mastership is passed to the
CPU. When the DTME5 bit is subsequently set to 1
again, the interrupted transfer is resumed. In block
transfer mode, however, the DTME5 bit is not
cleared by an NMI interrupt, and transfer is not
interrupted.
[Clearing conditions]
• When initialization is performed
• When NMI is input in burst mode
• When 0 is written to the DTME5 bit
[Setting condition]
• When 1 is written to DTME5 after reading
DTME5 = 0
Initial
Bit Bit Name Value R/W Description
6 DTE5 0 R/W Data Transfer Enable 5
Enables or disables DMA transfer for the activation
source selected by the DTF3 to DTF0 bits in
DMACRF5.
When DTE5 = 0, data transfer is disabled and the
activation source is ignored. If the activation source
is an internal interrupt, an interrupt request is
issued to the CPU or DTC. If the DTE5 bit is
cleared to 0 when DTIE5 = 1, the DMAC regards
this as indicating the end of a transfer, and issues a
transfer end interrupt request to the CPU or DTC.
When DTE5 = 1 and DTME5 = 1, data transfer is
enabled and the DMAC waits for a request by the
activation source. When a request is issued by the
activation source, transfer is executed.
[Clearing conditions]
• When initialization is performed
• When the specified number of transfers have
been completed
• When 0 is written to the DTE5 bit to forcibly
suspend the transfer, or for a similar reason
[Setting condition]
• When 1 is written to the DTE5 bit after reading
DTE5 = 0
Initial
Bit Bit Name Value R/W Description
5 DTME4 0 R/W Data Transfer Master Enable 4
Together with the DTE4 bit, this bit controls
enabling or disabling of data transfer on channel 4.
When both the DTME4 bit and DTE4 bit are set to
1, transfer is enabled for channel 4.
If channel 4 is in the middle of a burst mode
transfer when an NMI interrupt is generated, the
DTME4 bit is cleared to 0, the transfer is
interrupted, and bus mastership is passed to the
CPU. When the DTME4 bit is subsequently set to 1
again, the interrupted transfer is resumed. In block
transfer mode, however, the DTME4 bit is not
cleared by an NMI interrupt, and transfer is not
interrupted.
[Clearing conditions]
• When initialization is performed
• When NMI is input in burst mode
• When 0 is written to the DTME4 bit
[Setting condition]
• When 1 is written to DTME4 after reading
DTME4 = 0
Initial
Bit Bit Name Value R/W Description
4 DTE4 0 R/W Data Transfer Enable 4
Enables or disables DMA transfer for the activation
source selected by the DTF3 to DTF0 bits in
DMACRS.
When DTE4 = 0, data transfer is disabled and the
activation source is ignored. If the activation source
is an internal interrupt, an interrupt request is
issued to the CPU or DTC. If the DTE4 bit is
cleared to 0 when DTIE0 = 1, the DMAC regards
this as indicating the end of a transfer, and issues a
transfer end interrupt request to the CPU or DTC.
When DTE4 = 1 and DTME4 = 1, data transfer is
enabled and the DMAC waits for a request by the
activation source. When a request is issued by the
activation source, DMA transfer is executed.
[Clearing conditions]
• When initialization is performed
• When the specified number of transfers have
been completed
• When 0 is written to the DTE4 bit to forcibly
suspend the transfer, or for a similar reason
[Setting condition]
• When 1 is written to the DTE4 bit after reading
DTE4 = 0
3 DMIE5 0 R/W Data Transfer Interrupt Enable 5
Enables or disables an interrupt to the CPU or DTC
when transfer on channel 5 has been interrupted. If
the DTME5 bit is cleared to 0 when DMIE5 = 1, the
DMAC regards this as indicating the break in a
transfer, and issues a transfer break interrupt
request to the CPU or DTC.
A transfer break interrupt can be canceled either by
clearing the DMIE5 bit to 0 in the interrupt handling
routine, or by performing processing to continue
transfer by setting the DTME5 bit to 1.
Initial
Bit Bit Name Value R/W Description
2 DTIE5 0 R/W Data Transfer End Interrupt Enable 5
Enables or disables an interrupt to the CPU or DTC
when transfer on channel 5 ends. If the DTE5 bit is
cleared to 1 when DTIE5 = 1, the DMAC regards
this as indicating the end of a transfer, and issues a
transfer end interrupt request to the CPU or DTC.
A transfer end interrupt can be canceled either by
clearing the DTIE5 bit to 0 in the interrupt handling
routine, or by performing processing to continue
transfer by setting the transfer counter and address
register again, and then setting the DTE5 bit to 1.
1 DMIE4 0 R/W Data Transfer Interrupt Enable 4
Enables or disables an interrupt to the CPU or DTC
when transfer on channel 4 has been interrupted. If
the DTME4 bit is cleared to 0 when DMIE4 = 1, the
DMAC regards this as indicating the break in a
transfer, and issues a transfer break interrupt
request to the CPU or DTC.
A transfer break interrupt can be canceled either by
clearing the DMIE4 bit to 0 in the interrupt handling
routine, or by performing processing to continue
transfer by setting the DTME4 bit to 1.
0 DTIE4 0 R/W Data Transfer End Interrupt Enable 4
Enables or disables an interrupt to the CPU or DTC
when transfer on channel 4 ends. If the DTE4 bit is
cleared to 0 when DTIE4 = 1, the DMAC regards
this as indicating the end of a transfer, and issues a
transfer end interrupt request to the CPU or DTC.
A transfer end interrupt can be canceled either by
clearing the DTIE4 bit to 0 in the interrupt handling
routine, or by performing processing to continue
transfer by setting the transfer counter and address
register again, and then setting the DTE4 bit to 1.
DMATCR controls enabling or disabling of output from the DMAC transfer end pin. A port can
be set for output automatically and a transfer end signal output, by setting the appropriate bits. The
TEND pin is available only for channels 1 and 3 in short address mode. Except for block transfer
mode, a transfer end signal asserts in the transfer cycle in which the transfer counter reaches 0
regardless of the activation source. In block transfer mode, a transfer end signal asserts in the
transfer cycle in which the block size counter reaches 0.
DMATCR can be written to only in common register enabled mode (DMCOMMD = 1).
Initial
Bit Bit Name Value R/W Description
7, 6 ⎯ All 0 ⎯ Reserved
These bits are always read as 0 and cannot be
modified.
5 TEE1 0 R/W Transfer End Pin Enable 1
Enables or disables output from the transfer end pin
3 (TEND3) when FAE1 = 0 and from the transfer
end pin 5 (TEND5) when FAE1 = 1.
0: TEND3 or TEND5 pin output is disabled
1: TEND3 or TEND5 pin output is enabled
4 TEE0 0 R/W Transfer End Pin Enable 0
Enables or disables output from the transfer end pin
1 (TEND1) when FAE0 = 0 and from the transfer
end pin 4 (TEND4) when FAE0 = 1.
0: TEND1 or TEND4 pin output is disabled
1: TEND1 or TEND4 pin output is enabled
3 to 0 ⎯ All 0 ⎯ Reserved
These bits are always read as 0 and cannot be
modified.
Initial
Bit Bit Name Value R/W Description
7 to 1 ⎯ All 0 R/W Reserved
Although these bits are readable and writable, write 0 to these
bits.
0 DMCOMMD 1 R/W Common Register Enabled Mode Enable
Switches DMAC channels and registers. Accordingly, pin
functions and interrupt vectors are also changed.
Set this bit first of all the DMAC registers; do not set this bit
while the DMAC is operating (including transfer wait state).
1: Common register enabled mode
A maximum of four channels in short address mode or a
maximum of two channels in full address mode can be
used for transfer.
DMABCR controls operations of each DMAC channel, and
DMATCR enables or disables outputs from DMAC transfer
end pins.
0: Common register disabled mode
A maximum of four channels in short address mode and a
maximum of two channels in full address mode can be
used for transfer (six channels in total).
DMAECRS0 to DMAECRS3, DAMECRF4, and
DAMECRF5 control operations of each DMAC channel,
and enable or disable outputs from DMAC transfer end
pins.
Full Address
Short Address Mode Mode
Internal ADI0 O O O O O O O O × O
interrupts
TXI0 O O O O O O O O × O
RXI0 O O O O O O O O × O
TXI1 O O O O O O O O × O
RXI1 O O O O O O O O × O
TGI0A O O O O O O O O × O
TGI1A O O O O O O O O × O
TGI2A O O O O O O O O × O
TGI3A O O O O O O O O × O
TGI4A O O O O O O O O × O
TGI5A O O O O O O O O × O
Full Address
Short Address Mode Mode
External DREQ × O × O O O × × O O
requests pin
falling
edge
input
DREQ × O × O O O × × O O
pin
low-
level
input
Auto-request × × × × × × × × O ×
[Legend]
O: Can be specified
×: Cannot be specified
An interrupt request selected as a DMAC activation source can also simultaneously generate an
interrupt request for the CPU or DTC. For details, see section 6, Interrupt Controller.
With activation by an internal interrupt request, the DMAC accepts the interrupt request
independently of the interrupt controller. Consequently, interrupt controller priority settings are
irrelevant.
If the DMAC is activated by a CPU interrupt source or an interrupt request that is not used as a
DTC activation source (DTA = 1), the interrupt request flag is cleared automatically by the DMA
transfer. With ADI, TXI, and RXI interrupts, however, the interrupt source flag is not cleared
unless the relevant register is accessed in a DMA transfer. If the same interrupt is used as an
activation source for more than one channel, the interrupt request flag is cleared when the highest-
priority channel is activated. Transfer requests for other channels are held pending in the DMAC,
and activation is carried out in order of priority.
When DTE = 0 after completion of a transfer, an interrupt request from the selected activation
source is not sent to the DMAC, regardless of the DTA bit setting. In this case, the relevant
interrupt request is sent to the CPU or DTC.
When an interrupt request signal for DMAC activation is also used for an interrupt request to the
CPU or DTC activation (DTA = 0), the interrupt request flag is not cleared by the DMAC.
If an external request (DREQ pin) is specified as a DMAC activation source, the relevant port
should be set to input mode in advance*. Level sensing or edge sensing can be used for external
requests.
External request operation in normal mode of short address mode or full address mode is
described below.
When edge sensing is selected, a byte or word is transferred each time a high-to-low transition is
detected on the DREQ pin. The next data transfer may not be performed if the next edge is input
before data transfer is completed.
When level sensing is selected, the DMAC stands by for a transfer request while the DREQ pin is
held high. While the DREQ pin is held low, transfers continue in succession, with the bus being
released each time a byte or word is transferred. If the DREQ pin goes high in the middle of a
transfer, the transfer is interrupted and the DMAC stands by for a transfer request.
In common register enabled mode, external requests are available only for channels 1, 3, 4, and 5.
External requests must not be simultaneously specified as the activation sources for channels 1
and 4. External requests must not be simultaneously specified as the activation sources for
channels 3 and 5.
In common register disabled mode, external requests are available only for channels 0, 1, 4, and 5.
External requests must not be simultaneously specified as the activation sources for channels 0
and 4. External requests must not be simultaneously specified as the activation sources for
channels 1 and 5.
Note: * If the relevant port is set as an output pin for another function, DMA transfers using the
channel in question cannot be guaranteed.
Auto-request is activated by register setting only, and transfer continues to the end. With auto-
request activation, cycle steal mode or burst mode can be selected.
In cycle steal mode, the DMAC releases the bus to another bus master each time a byte or word is
transferred. DMA and CPU cycles are usually repeated alternately. In burst mode, the DMAC
keeps possession of the bus until the end of the transfer so that transfer is performed continuously.
8.5 Operation
Sequential mode can be specified by clearing the MDS bit in DMACRS to 0. In sequential mode,
MAR is updated after each byte or word transfer in response to a single transfer request, and this is
executed the number of times specified in ETCR. One address is specified by MAR, and the other
by IOAR. The transfer direction can be specified by the DTDIR bit in DMACRS.
Function
Register DTDIR = 0 DTDIR = 1 Initial Setting Operation
23 0 Source Destination Start address of Incremented/
MAR address address transfer destination decremented every
register register or transfer source transfer
23 15 0 Destination Source Start address of Fixed
H'FF IOAR address address transfer source or
register register transfer destination
15 0 Transfer counter Number of transfers Decremented every
ETCR transfer; transfer
ends when count
reaches H'0000
MAR specifies the start address of the transfer source or transfer destination as 24 bits. MAR is
incremented or decremented by 1 or 2 each time a byte or word is transferred. IOAR specifies the
lower 16 bits of the other address.
[Legend]
Address T = L
Address B = L + (–1)DTID · (2DTSZ · (N – 1))
Where: L = Value set in MAR
Address B
N = Value set in ETCR
The number of transfers is specified as 16 bits in ETCR. ETCR is decremented by 1 each time a
data transfer is executed, and when its value reaches H'0000, the DTE bit in DMABCR in
common register enabled mode or the DTE bit in DMAECRS in common register disabled mode
is cleared and data transfer ends. If the DTIE bit is set to 1 at this time, an interrupt request is sent
to the CPU or DTC. The maximum number of transfers, when H'0000 is set in ETCR, is 65,536.
Transfer requests (activation sources) consist of A/D converter conversion end interrupts, external
requests, SCI transmit data empty and receive data full interrupts, and TPU channel 0 to 5
compare match/input capture A interrupts.
Figures 8.3 and 8.4 show an example of the setting procedure for sequential mode in common
register enabled mode and common register disabled mode, respectively.
Set DMABCRH [3] [4] Set the transfer source address and transfer destination
address in MAR and IOAR.
Sequential mode
Sequential mode
In common register enabled mode, idle mode can be specified by setting the MDS bit in
DMACRS and the DTIE bit in DMABCRL to 1. In common register disabled mode, idle mode
can be specified by setting the MDS bit in DMACRS and the IDLE bit in DMAECRS to 1.In idle
mode, one byte or word is transferred in response to a single transfer request, and this is executed
the number of times specified in ETCR. One address is specified by MAR, and the other by
IOAR. The transfer direction can be specified by the DTDIR bit in DMACRS. Table 8.5
summarizes register functions in idle mode.
Function
Register DTDIR = 0 DTDIR = 1 Initial Setting Operation
23 0 Source Destination Start address of Fixed
MAR address address transfer destination
register register or transfer source
23 15 0 Destination Source Start address of Fixed
H'FF IOAR address address transfer source or
register register transfer destination
15 0 Transfer counter Number of transfers Decremented every
ETCR transfer; transfer
ends when count
reaches H'0000
MAR specifies the start address of the transfer source or transfer destination as 24 bits. MAR is
neither incremented nor decremented by a data transfer. IOAR specifies the lower 16 bits of the
other address.
The number of transfers is specified as 16 bits in ETCR. ETCR is decremented by 1 each time a
transfer is executed, and when its value reaches H'0000, the DTE bit in DMABCR in common
register enabled mode or the DTE bit in DMAECRS in common register disabled mode is cleared
and data transfer ends. If the DTIE bit is set to 1 at this time, an interrupt request is sent to the
CPU or DTC. The maximum number of transfers, when H'0000 is set in ETCR, is 65,536.
Transfer requests (activation sources) consist of A/D converter conversion end interrupts, external
requests, SCI transmit data empty and receive data full interrupts, and TPU channel 0 to 5
compare match/input capture A interrupts.
Figures 8.6 and 8.7 show an example of the setting procedure for idle mode in common register
enabled mode and common register disabled mode, respectively.
Idle mode
Figure 8.6 Example of Idle Mode Setting Procedure (Common Register Enabled Mode)
Idle mode
Figure 8.7 Example of Idle Mode Setting Procedure (Common Register Disabled Mode)
In common register enabled mode, repeat mode can be specified by setting the MDS bit in
DMACRS to 1, and clearing the DTIE bit in DMABCRL to 0. In common register disabled mode,
repeat mode can be specified by setting the MDS bit in DMACRS to 1, and clearing the IDLE bit
in DMAECRS to 0. In repeat mode, MAR is updated after each byte or word transfer in response
to a single transfer request, and this is executed the number of times specified in ETCRL. On
completion of the specified number of transfers, MAR and ETCRL are automatically restored to
their original settings and operation continues. One address is specified by MAR, and the other by
IOAR. The transfer direction can be specified by the DTDIR bit in DMACRS. Table 8.6
summarizes register functions in repeat mode.
Function
Register DTDIR = 0 DTDIR = 1 Initial Setting Operation
23 0 Source Destination Start address of Incremented/
MAR address address transfer destination decremented every
register register or transfer source transfer.
Initial setting is
restored when the
value reaches
H'0000
23 15 0 Destination Source Start address of Fixed
H'FF IOAR address address transfer source or
register register transfer destination
MAR specifies the start address of the transfer source or transfer destination as 24 bits. MAR is
incremented or decremented by 1 or 2 each time a byte or word is transferred. IOAR specifies the
lower 16 bits of the other address. The number of transfers is specified as 8 bits by ETCRH and
ETCRL. The maximum number of transfers, when H'00 is set in both ETCRH and ETCRL, is 256.
In repeat mode, ETCRL functions as the transfer counter, and ETCRH is used to hold the number
of transfers. ETCRL is decremented by 1 each time a data transfer is executed, and when its value
reaches H'00, it is loaded with the value in ETCRH. At the same time, the value set in MAR is
restored in accordance with the values of the DTSZ and DTID bits in DMACRS. The MAR
restoration operation is as shown below.
In repeat mode, operation continues until the DTE bit in DMABCR in common register enabled
mode or the DTE bit in DMAECRS in common register disabled mode is cleared. To end the
transfer operation, therefore, the DTE bit should be cleared to 0. A transfer end interrupt request is
not sent to the CPU or DTC. By setting the DTE bit to 1 again after it has been cleared, the
operation can be restarted from the transfer after that terminated when the DTE bit was cleared.
[Legend]
Address T = L
Address B = L + (–1)DTID · (2DTSZ · (N – 1))
Where: L = Value set in MAR
Address B
N = Value set in ETCR
Transfer requests (activation sources) consist of A/D converter conversion end interrupts, external
requests, SCI transmit data empty and receive data full interrupts, and TPU channel 0 to 5
compare match/input capture A interrupts.
Figures 8.9 and 8.10 show an example of the setting procedure for repeat mode in common
register enabled mode and common register disabled mode, respectively.
Repeat mode
Figure 8.9 Example of Repeat Mode Setting Procedure (Common Register Enabled Mode)
Set DMAECRS [2] [4] Set the number of transfers in both ETCRH and ETCRL.
Repeat mode
Single address mode can only be specified for channels 1 and 3 in common register enabled mode,
or for channels 0 and 1 in common register disabled mode. Single address mode can be specified
by setting the SAE bit in DMABCR in common register enabled mode or the SAE bit in
DMAECRS in common register disabled mode to 1 in short address mode.
One address is specified by MAR, and the other is set automatically to the data transfer
acknowledge pin (DACK). The transfer direction can be specified by the DTDIR bit in DMACRS.
Table 8.7 summarizes register functions in single address mode.
Function
Register DTDIR = 0 DTDIR = 1 Initial Setting Operation
23 0 Source Destination Start address of See sections 8.5.2,
MAR address address transfer destination Sequential Mode,
register register or transfer source 8.5.3, Idle Mode,
and 8.5.4, Repeat
Mode.
DACK pin Write Read (Set automatically Strobe for external
strobe strobe by SAE bit in device
DMABCRH or
DMAECRS; IOAR
is invalid)
15 0 Transfer counter Number of transfers See sections 8.5.2,
ETCR Sequential Mode,
8.5.3, Idle Mode,
and 8.5.4, Repeat
Mode.
MAR specifies the start address of the transfer source or transfer destination as 24 bits. IOAR is
invalid; in its place the strobe for external devices (DACK) is output.
Figure 8.11 illustrates operation in single address mode (when sequential mode is specified).
[Legend]
Address T = L
Address B = L + (–1)DTID · (2DTSZ · (N – 1))
Where: L = Value set in MAR
Address B
N = Value set in ETCR
Figure 8.11 Operation in Single Address Mode (when sequential mode is specified)
Figures 8.12 and 8.13 show an example of the setting procedure for single address mode (when
sequential mode is specified) in common register enabled mode and common register disabled
mode, respectively.
In common register enabled mode, normal mode can be selected by setting the RSEL4 and RSEL5
bits in DRSEL corresponding to channels 4 and 5 to 1 and clearing the BLKE bit in DMACRF to
0. In common register disabled mode, normal mode can be specified by clearing the BLKE bit in
DMACRF to 0. In normal mode, SAR and DAR are updated after data transfer of a byte or word
in response to a single transfer request, and this is executed the number of times specified in
ETCRA. The transfer source is specified by SAR, and the transfer destination by DAR. Table 8.8
summarizes register functions in normal mode.
SAR and DAR specify the start addresses of the transfer source and transfer destination,
respectively, as 24 bits. SAR and DAR can be incremented or decremented by 1 or 2 each time a
byte or word is transferred, or can be fixed. Incrementing, decrementing, or holding a fixed value
can be set separately for SAR and DAR.
The number of transfers is specified by ETCRA as 16 bits. ETCRA is decremented by 1 each time
a transfer is performed, and when its value reaches H'0000 the DTE bit in DMABCR in common
register enabled mode or the DTE bit in DMAECRF in common register disabled mode is cleared
and transfer ends. If the DTIE bit in DMABCR in common register enabled mode or the DTIE bit
in DMAECRF in common register disabled mode is set to 1 at this time, an interrupt request is
sent to the CPU or DTC. The maximum number of transfers, when H'0000 is set in ETCRA, is
65,536.
Address BA Address BB
[Legend]
Address TA = LA
Address TB = LB
Address BA = LA + SAIDE · (–1)SAID · (2DTSZ · (N – 1))
Address BB = LB + DAIDE · (–1)DAID · (2DTSZ · (N – 1))
Where: LA = Value set in SAR
LB = Value set in DAR
N = Value set in ETCRA
Transfer requests (activation sources) are external requests and auto-requests. With auto-requests,
the DMAC is only activated by register setting, and the specified number of transfers are
performed automatically. With auto-requests, cycle steal mode or burst mode can be selected. In
cycle steal mode, the bus is released to another bus master each time a transfer is performed. In
burst mode, the bus is held continuously until transfer ends.
Figures 8.15 and 8.16 show an example of the setting procedure for normal mode in common
register enabled mode and common register disabled mode, respectively.
Normal mode
Normal mode
In common register enabled mode, block transfer mode can be specified by setting the RSEL4 and
RSEL5 bits in DRSEL corresponding to channels 4 and 5 the BLKE bit in DMACRF to 1. In
common register disabled mode, normal mode can be specified by setting the BLKE bit in
DMACRF to 1. In block transfer mode, a data transfer of the specified block size is carried out in
response to a single transfer request, and this is executed for the number of times specified in
ETCRB. The transfer source is specified by SAR, and the transfer destination by DAR. Either the
transfer source or the transfer destination can be selected as a block area (an area composed of a
number of bytes or words). Table 8.9 summarizes register functions in block transfer mode.
SAR and DAR specify the start addresses of the transfer source and transfer destination,
respectively, as 24 bits. SAR and DAR can be incremented or decremented by 1 or 2 each time a
byte or word is transferred, or can be fixed. Incrementing, decrementing, or holding a fixed value
can be set separately for SAR and DAR. Whether a block is to be designated for SAR or for DAR
is specified by the BLKDIR bit in DMABCR in common register enabled mode or the BLKDIR
bit in DMAECRF in common register disabled mode.
To specify the number of transfers, if M is the size of one block (where M = 1 to 256) and N
transfers are to be performed (where N = 1 to 65,536), M is set in both ETCRAH and ETCRAL,
and N in ETCRB.
Figure 8.17 illustrates operation in block transfer mode when transfer destination is designated as
a block area.
Address TA Address TB
Nth block
Address BA
[Legend]
Address TA = LA
Address TB = LB
Address BA = LA + SAIDE · (–1)SAID · (2DTSZ · (M · N – 1))
Address BB = LB + DAIDE · (–1)DAID · (2DTSZ · (N – 1))
Where: LA = Value set in SAR
LB = Value set in DAR
N = Value set in ETCRB
M = Value set in ETCRAH and ETCRAL
Figure 8.18 illustrates operation in block transfer mode when transfer source is designated as a
block area.
Address TA Address TB
Consecutive transfer
Address BA
of M bytes or words
is performed in
response to one
request
2nd block
Nth block
Address BB
[Legend]
Address TA = LA
Address TB = LB
Address BA = LA + SAIDE · (–1)SAID · (2DTSZ · (N – 1))
Address BB = LB + DAIDE · (–1)DAID · (2DTSZ · (M · N – 1))
Where: LA = Value set in SAR
LB = Value set in DAR
N = Value set in ETCRB
M = Value set in ETCRAH and ETCRAL
ETCRB is decremented by 1 after every block transfer, and when the count reaches H'0000 the
DTE bit in DMABCR in common register enabled mode or the DTE bit in DMAECRF in
common register disabled mode is cleared and transfer ends. If the DTIE bit in DMABCR in
common register enabled mode or the DTIE bit in DMAECRF in common register disabled mode
is set to 1 at this point, an interrupt request is sent to the CPU or DTC.
Start
(DTE = DTME = 1)
No
Transfer request
Yes
Acquire bus
ETCRAL = ETCRAL – 1
No
ETCRAL = H'00
Yes
Release bus
ETCRAL = ETCRAH
No
BLKDIR = 0
Yes
DAR = DAR – DAIDE · (–1)DAID · 2DTSZ · ETCRAH
ETCRB = ETCRB – 1
No
ETCRB = H'0000
Yes
Clear DTE bit to 0
to end transfer
Transfer requests (activation sources) consist of A/D converter conversion end interrupts, external
requests, SCI transmit data empty and receive data full interrupts, and TPU channel 0 to 5
compare match/input capture A interrupts.
Figures 8.20 and 8.21 show an example of the setting procedure for block transfer mode in
common register enabled mode and common register disabled mode, respectively.
Set DMABCRH [3] [5] Set the block size in both ETCRAH and ETCRAL.
Set the number of transfers in ETCRB.
An example of the basic DMAC bus cycle timing is shown in figure 8.22. In this example, word-
size transfer is performed from 16-bit, 2-state access space to 8-bit, 3-state access space. When the
bus is transferred from the CPU to the DMAC, a source address read and destination address write
are performed. The bus is not released in response to another bus request, etc., between these read
and write operations. As like CPU cycles, DMA cycles conform to the bus controller settings.
The address is not output to the external address bus in an access to on-chip memory or an internal
I/O register.
T1 T2 T1 T2 T3 T1 T2 T3
φ
Source
address Destination address
Address bus
RD
HWR
LWR
Figure 8.23 shows a transfer example in which TEND output is enabled and byte-size short
address mode transfer (sequential/idle/repeat mode) is performed from external 8-bit, 2-state
access space to internal I/O space.
Address bus
RD
HWR
LWR
TEND
A byte or word transfer is performed for a single transfer request, and after the transfer, the bus is
released. While the bus is released, one or more bus cycles are executed by the CPU or DTC.
In the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state DMA dead
cycle is inserted after the DMA write cycle.
In repeat mode, when TEND output is enabled, TEND output goes low in the transfer end cycle.
Figure 8.24 shows a transfer example in which TEND output is enabled and word-size full address
mode transfer (cycle steal mode) is performed from external 16-bit, 2-state access space to
external 16-bit, 2-state access space.
Address bus
RD
HWR
LWR
TEND
A byte or word transfer is performed for a single transfer request, and after the transfer, the bus is
released. While the bus is released, one bus cycle is executed by the CPU or DTC.
In the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state DMA dead
cycle is inserted after the DMA write cycle.
Figure 8.25 shows a transfer example in which TEND output is enabled and word-size full address
mode transfer (burst mode) is performed from external 16-bit, 2-state access space to external 16-
bit, 2-state access space.
Address bus
RD
HWR
LWR
TEND
In burst mode, one-byte or one-word transfers are executed consecutively until transfer ends.
In the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state DMA dead
cycle is inserted after the DMA write cycle.
If a request from another higher-priority channel is generated after burst transfer starts, that
channel has to wait until the burst transfer ends.
If an NMI interrupt is generated while a channel designated for burst transfer is in the transfer
enabled state, the DTME bit in DMABCR in common register enabled mode or the DTME bit in
DMAECRF in common register disabled mode is cleared and the channel is placed in the transfer
disabled state. If burst transfer has already been activated inside the DMAC, the bus is released on
completion of a one-byte or one-word transfer within the burst transfer, and burst transfer is
suspended. If the last transfer cycle of the burst transfer has already been activated inside the
DMAC, execution continues to the end of the transfer even if the DTME bit is cleared.
Figure 8.26 shows a transfer example in which TEND output is enabled and word-size full address
mode transfer (block transfer mode) is performed from internal 16-bit, 1-state access space to
external 16-bit, 2-state access space.
DMA DMA DMA DMA DMA DMA DMA DMA DMA DMA
read write read write dead read write read write dead
Address bus
RD
HWR
LWR
TEND
Bus release Block transfer Bus release Last block transfer Bus
release
Figure 8.26 Example of Full Address Mode Transfer (Block Transfer Mode)
A one-block transfer is performed for a single transfer request, and after the transfer the bus is
released. While the bus is released, one or more bus cycles are executed by the CPU or DTC.
In the transfer end cycle of each block (the cycle in which the transfer counter reaches 0), a one-
state DMA dead cycle is inserted after the DMA write cycle. Even if an NMI interrupt is
generated during data transfer, block transfer operation is not affected until data transfer for one
block has ended.
Set the DTA bit in DMABCR in common register enabled mode or the DTA bit in DMAECRS or
DMAECRF in common register disabled mode to 1 for the channel for which the DREQ pin is
selected.
Figure 8.27 shows an example of normal mode transfer activated by the DREQ pin falling edge.
Bus release DMA read DMA write Bus release DMA read DMA write Bus release
DREQ
[1] Acceptance after transfer enabling; the DREQ pin low level is sampled on the rising edge of φ,
and the request is held.
[2] [5] The request is cleared at the next bus break, and activation is started in the DMAC.
[3] [6] Start of DMA cycle; DREQ pin high level sampling on the rising edge of φ starts.
[4] [7] When the DREQ pin high level has been sampled, acceptance is resumed after the write cycle
is completed.
(As in [1], the DREQ pin low level is sampled on the rising edge of φ, and the request is held.)
Note: In write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible.
Figure 8.27 Example of DREQ Pin Falling Edge Activated Normal Mode Transfer
DREQ pin sampling is performed every cycle, with the rising edge of the next φ cycle after the
end of the DMABCR write cycle in common register enabled mode or DMAECRS or DMAECRF
write cycle in common register disabled mode for setting the transfer enabled state as the starting
point.
When the DREQ pin low level is sampled while acceptance by means of the DREQ pin is
possible, the request is held in the DMAC. Then, when activation is initiated in the DMAC, the
request is cleared, and DREQ pin high level sampling for edge detection is started. If DREQ pin
high level sampling has been completed by the time the DMA write cycle ends, acceptance
resumes after the end of the write cycle, DREQ pin low level sampling is performed again, and
this operation is repeated until the transfer ends.
Figure 8.28 shows an example of block transfer mode transfer activated by the DREQ pin falling
edge.
DREQ
DMA Idle Read Write Dead Idle Read Write Dead Idle
control
[1] Acceptance after transfer enabling; the DREQ pin low level is sampled on the rising edge of φ,
and the request is held.
[2] [5] The request is cleared at the next bus break, and activation is started in the DMAC.
[3] [6] Start of DMA cycle; DREQ pin high level sampling on the rising edge of φ starts.
[4] [7] When the DREQ pin high level has been sampled, acceptance is resumed after the dead cycle
is completed.
(As in [1], the DREQ pin low level is sampled on the rising edge of φ, and the request is held.)
Note: In write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible.
Figure 8.28 Example of DREQ Pin Falling Edge Activated Block Transfer Mode Transfer
DREQ pin sampling is performed every cycle, with the rising edge of the next φ cycle after the
end of the DMABCR write cycle in common register enabled mode or DMAECRS or DMAECRF
write cycle in common register disabled mode for setting the transfer enabled state as the starting
point.
When the DREQ pin low level is sampled while acceptance by means of the DREQ pin is
possible, the request is held in the DMAC. Then, when activation is initiated in the DMAC, the
request is cleared, and DREQ pin high level sampling for edge detection is started. If DREQ pin
high level sampling has been completed by the time the DMA dead cycle ends, acceptance
resumes after the end of the dead cycle, DREQ pin low level sampling is performed again, and this
operation is repeated until the transfer ends.
Set the DTA bit in DMABCR in common register enabled mode or the DTA bit in DMAECRF in
common register disabled mode to 1 for the channel for which the DREQ pin is selected.
Figure 8.29 shows an example of normal mode transfer activated by the DREQ pin low level.
Bus release DMA read DMA write Bus release DMA read DMA write Bus release
DREQ
[1] Acceptance after transfer enabling; the DREQ pin low level is sampled on the rising edge of φ,
and the request is held.
[2] [5] The request is cleared at the next bus break, and activation is started in the DMAC.
[3] [6] The DMA cycle is started.
[4] [7] Acceptance is resumed after the write cycle is completed.
(As in [1], the DREQ pin low level is sampled on the rising edge of φ, and the request is held.)
Note: In write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible.
Figure 8.29 Example of DREQ Pin Low Level Activated Normal Mode Transfer
DREQ pin sampling is performed every cycle, with the rising edge of the next φ cycle after the
end of the DMABCR write cycle in common register enabled mode or DMAECRF write cycle in
common register disabled mode for setting the transfer enabled state as the starting point.
When the DREQ pin low level is sampled while acceptance by means of the DREQ pin is
possible, the request is held in the DMAC. Then, when activation is initiated in the DMAC, the
request is cleared. After the end of the write cycle, acceptance resumes, DREQ pin low level
sampling is performed again, and this operation is repeated until the transfer ends.
Figure 8.30 shows an example of block transfer mode transfer activated by DREQ pin low level.
DREQ
Address
Transfer source Transfer destination Transfer source Transfer destination
bus
DMA Idle Read Write Dead Idle Read Write Dead Idle
control
[1] Acceptance after transfer enabling; the DREQ pin low level is sampled on the rising edge of φ,
and the request is held.
[2] [5] The request is cleared at the next bus break, and activation is started in the DMAC.
[3] [6] The DMA cycle is started.
[4] [7] Acceptance is resumed after the dead cycle is completed.
(As in [1], the DREQ pin low level is sampled on the rising edge of φ, and the request is held.)
Note: In write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible.
Figure 8.30 Example of DREQ Pin Low Level Activated Block Transfer Mode Transfer
DREQ pin sampling is performed every cycle, with the rising edge of the next φ cycle after the
end of the DMABCR write cycle in common register enabled mode or DMAECRF write cycle in
common register disabled mode for setting the transfer enabled state as the starting point.
When the DREQ pin low level is sampled while acceptance by means of the DREQ pin is
possible, the request is held in the DMAC. Then, when activation is initiated in the DMAC, the
request is cleared. After the end of the dead cycle, acceptance resumes, DREQ pin low level
sampling is performed again, and this operation is repeated until the transfer ends.
Figure 8.31 shows a transfer example in which TEND output is enabled and byte-size single
address mode transfer (read) is performed from external 8-bit, 2-state access space to an external
device.
DMA
DMA read DMA read DMA read DMA read dead
Address bus
RD
DACK
TEND
Figure 8.32 shows a transfer example in which TEND output is enabled and word-size single
address mode transfer (read) is performed from external 8-bit, 2-state access space to an external
device.
DMA
DMA read DMA read DMA read dead
Address bus
RD
DACK
TEND
A byte or word transfer is performed for a single transfer request, and after the transfer, the bus is
released. While the bus is released, one or more bus cycles are executed by the CPU or DTC.
In the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state DMA dead
cycle is inserted after the DMA write cycle.
Figure 8.33 shows a transfer example in which TEND output is enabled and byte-size single
address mode transfer (write) is performed from an external device to external 8-bit, 2-state access
space.
DMA
DMA write DMA write DMA write DMA write dead
Address bus
HWR
LWR
DACK
TEND
Figure 8.34 shows a transfer example in which TEND output is enabled and word-size single
address mode transfer (write) is performed from an external device to external 8-bit, 2-state access
space.
DMA
DMA write DMA write DMA write dead
Address bus
HWR
LWR
DACK
TEND
A byte or word transfer is performed for a single transfer request, and after the transfer, the bus is
released. While the bus is released, one or more bus cycles are executed by the CPU or DTC.
In the transfer end cycle (the cycle in which the transfer counter reaches 0), a one-state DMA dead
cycle is inserted after the DMA write cycle.
Set the DTA bit in DMABCR in common register enabled mode or the DTA bit in DMAECRS in
common register disabled mode to 1 for the channel for which the DREQ pin is selected.
Figure 8.35 shows an example of single address mode transfer activated by the DREQ pin falling
edge.
Bus release DMA single Bus release DMA single Bus release
DREQ
DACK
DMA
Idle Single Idle Single Idle
control
[1] Acceptance after transfer enabling; the DREQ pin low level is sampled on the rising edge of φ,
and the request is held.
[2] [5] The request is cleared at the next bus break, and activation is started in the DMAC.
[3] [6] Start of DMA cycle; DREQ pin high level sampling on the rising edge of φ starts.
[4] [7] When the DREQ pin high level has been sampled, acceptance is resumed after the single
cycle is completed.
(As in [1], the DREQ pin low level is sampled on the rising edge of φ, and the request is held.)
Note: In write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible.
Figure 8.35 Example of DREQ Pin Falling Edge Activated Single Address Mode Transfer
DREQ pin sampling is performed every cycle, with the rising edge of the next φ cycle after the
end of the DMABCR write cycle in common register enabled mode or DMAECRS write cycle in
common register disabled mode for setting the transfer enabled state as the starting point.
When the DREQ pin low level is sampled while acceptance by means of the DREQ pin is
possible, the request is held in the DMAC. Then, when activation is initiated in the DMAC, the
request is cleared, and DREQ pin high level sampling for edge detection is started. If DREQ pin
high level sampling has been completed by the time the DMA single cycle ends, acceptance
resumes after the end of the single cycle, DREQ pin low level sampling is performed again, and
this operation is repeated until the transfer ends.
Set the DTA bit in DMABCR in common register enabled mode or the DTA bit in DMAECRS in
common register disabled mode to 1 for the channel for which the DREQ pin is selected.
Figure 8.36 shows an example of single address mode transfer activated by the DREQ pin low
level.
Bus release DMA single Bus release DMA single Bus release
DREQ
DACK
[1] Acceptance after transfer enabling; the DREQ pin low level is sampled on the rising edge of φ,
and the request is held.
[2] [5] The request is cleared at the next bus break, and activation is started in the DMAC.
[3] [6] The DMAC cycle is started.
[4] [7] Acceptance is resumed after the single cycle is completed.
(As in [1], the DREQ pin low level is sampled on the rising edge of φ, and the request is held.)
Note: In write data buffer mode, bus breaks from [2] to [7] may be hidden, and not visible.
Figure 8.36 Example of DREQ Pin Low Level Activated Single Address Mode Transfer
DREQ pin sampling is performed every cycle, with the rising edge of the next φ cycle after the
end of the DMABCR write cycle in common register enabled mode or DMAECRS write cycle in
common register disabled mode for setting the transfer enabled state as the starting point.
When the DREQ pin low level is sampled while acceptance by means of the DREQ pin is
possible, the request is held in the DMAC. Then, when activation is initiated in the DMAC, the
request is cleared. After the end of the single cycle, acceptance resumes, DREQ pin low level
sampling is performed again, and this operation is repeated until the transfer ends.
DMAC internal-to-external dual address transfers and single address transfers can be executed at
high speed using the write data buffer function, enabling system throughput to be improved.
When the WDBE bit of BCR in the bus controller is set to 1, enabling the write data buffer
function, dual address transfer external write cycles or single address transfer and internal accesses
(on-chip memory or internal I/O registers) are executed in parallel. Internal accesses are
independent of the bus mastership, and DMAC dead cycles are regarded as internal accesses.
A low level can always be output from the TEND pin if the bus cycle in which a low level is to be
output from the TEND pin is an external bus cycle. However, a low level is not output from the
TEND pin if the bus cycle in which a low level is to be output from the TEND pin is an internal
bus cycle, and an external write cycle is executed in parallel with this cycle.
Figure 8.37 shows an example of dual address transfer using the write data buffer function. The
data is transferred from on-chip RAM to external memory.
Internal address
External address
HWR, LWR
TEND
Figure 8.37 Example of Dual Address Transfer Using Write Data Buffer Function
Figure 8.38 shows an example of single address transfer using the write data buffer function. In
this example, the CPU program area is in on-chip memory.
Internal address
External address
RD
DACK
Figure 8.38 Example of Single Address Transfer Using Write Data Buffer Function
When the write data buffer function is activated, the DMAC recognizes that the bus cycle
concerned has ended, and starts the next operation. Therefore, DREQ pin sampling is started one
state after the start of the DMA write cycle or single address transfer.
The DMAC channel priority order is: channel 0 > channel 1 > channel 4 > channel 2 > channel 3 >
channel 5. Table 8.10 summarizes the priority order for DMAC channels.
Channel Priority
Channel 0 High
Channel 1
Channel 4
Channel 2
Channel 3
Channel 5 Low
If transfer requests are issued simultaneously for more than one channel, or if a transfer request for
another channel is issued during a transfer, when the bus is released, the DMAC selects the
highest-priority channel from among those issuing a request according to the priority order shown
in table 8.10. During burst transfer, or when one block is being transferred in block transfer, the
channel will not be changed until the end of the transfer. Figure 8.39 shows a transfer example in
which transfer requests are issued simultaneously for channels 0, 1, and 4.
DMA
DMA read DMA write DMA read DMA write DMA read DMA write read
Address bus
RD
HWR
LWR
DMA control Idle Read Write Idle Read Write Idle Read Write Read
8.5.13 Relation between DMAC and External Bus Requests, Refresh Cycles*1,
and EXDMAC*2
When the DMAC accesses external space, contention with a refresh cycle*1, EXDMAC cycle*2, or
external bus release cycle may arise. In this case, the bus controller will suspend the transfer and
insert a refresh cycle*1, EXDMAC cycle*2, or external bus release cycle, in accordance with the
external bus priority order, even if the DMAC is executing a burst transfer or block transfer. (An
external access by the DTC or CPU, which has a lower priority than the DMAC, is not executed
until the DMAC releases the external bus.)
When the DMAC transfer mode is dual address mode, the DMAC releases the external bus after
an external write cycle. The external read cycle and external write cycle are inseparable, and so the
bus cannot be released between these two cycles.
When the DMAC accesses internal space (on-chip memory or an internal I/O register), the DMAC
cycle may be executed at the same time as a refresh cycle*1, EXDMAC cycle*2, or external bus
release cycle.
When an NMI interrupt is requested, burst mode transfer in full address mode is interrupted. An
NMI interrupt does not affect the operation of the DMAC in other modes.
In full address mode, transfer is enabled for a channel when both the DTE bit and DTME bit in
DMABCR in common register enabled mode or the DTE bit and DTME bit in DMAECRF in
common register disabled mode are set to 1. With burst mode setting, the DTME bit is cleared
when an NMI interrupt is requested.
If the DTME bit is cleared during burst mode transfer, the DMAC discontinues transfer on
completion of the 1-byte or 1-word transfer in progress, then releases the bus, which passes to the
CPU.
The channel on which transfer was interrupted can be restarted by setting the DTME bit to 1
again. Figure 8.40 shows the procedure for continuing transfer when it has been interrupted by an
NMI interrupt on a channel designated for burst mode transfer.
Yes
If the DTE bit in DMABCR in common register enabled mode or the DTE bit in DMAECRS or
DMAECRF in common register disabled mode is cleared to 0 for the channel currently operating,
the DMAC stops on completion of the 1-byte or 1-word transfer in progress. DMAC operation
resumes when the DTE bit is set to 1 again. In full address mode, the same applies to the DTME
bit in DMABCR in common register enabled mode or the DTME bit in DMAECRF in common
register disabled mode. Figure 8.41 shows the procedure for forcibly terminating DMAC
operation by software.
Forced termination
Interrupt Source
Interrupt
Interrupt Name Short Address Mode Full Address Mode Priority Order
DMTEND0/DMTEND4 Interrupt due to end of Interrupt due to end of High
transfer on channel 0 transfer on channel 4
DMTEND1/DMEEND4 Interrupt due to end of Interrupt due to break in
transfer on channel 1 transfer on channel 4
DMTEND2/DMTEND5 Interrupt due to end of Interrupt due to end of
transfer on channel 2 transfer on channel 5
DMTEND3/DMEEND5 Interrupt due to end of Interrupt due to break in
transfer on channel 3 transfer on channel 5 Low
Interrupt
Interrupt Name Interrupt Source Priority Order
DMTEND0 Interrupt due to end of transfer on channel 0 High
DMTEND1 Interrupt due to end of transfer on channel 1
DMTEND4 Interrupt due to end of transfer on channel 4
DMEEND4 Interrupt due to break in transfer on channel 4
DMTEND2 Interrupt due to end of transfer on channel 2
DMTEND3 Interrupt due to end of transfer on channel 3
DMTEND5 Interrupt due to end of transfer on channel 5
DMEEND5 Interrupt due to break in transfer on channel 5 Low
Enabling or disabling of each interrupt source is set by means of the DTIE bit in DMABCR in
common register enabled mode or the DTIE bit in DMAECRS or DMAECRF in common register
disabled mode for the corresponding channel, and interrupts from each source are sent to the
interrupt controller independently. The priority of transfer end interrupts on each channel is
decided by the interrupt controller, as shown in table 8.11.
Figure 8.42 shows a block diagram of a transfer end/transfer break interrupt. An interrupt is
always generated when the DTIE bit is set to 1 while the DTE bit in DMABCR in common
register enabled mode or the DTE bit in DMAECRS or DMAECRF in common register disabled
mode is cleared to 0.
DTE or
DTME bit
Transfer end/
transfer break interrupt
DTIE bit
In full address mode, a transfer break interrupt is generated when the DTME bit is cleared to 0
while the DTIE bit is set to 1. In both short address mode and full address mode, DMABCR in
common register enabled mode or DMAECRS or DMAECRF in common register disabled mode
should be set so as to prevent the occurrence of a combination that constitutes a condition for
interrupt generation during setting.
Except for forcible termination of the DMAC, the operating (including transfer waiting state)
channel setting should not be changed. The operating channel setting should only be changed
when transfer is disabled. Also, DMAC registers should not be written to in a DMA transfer.
DMAC register reads during operation (including the transfer waiting state) are described below.
• DMAC control starts one cycle before the bus cycle, with output of the internal address.
Consequently, MAR is updated in the bus cycle before DMA transfer. Figure 8.43 shows an
example of the update timing for DMAC registers in dual address transfer mode.
DMA
DMA read DMA write DMA read DMA write dead
DMA control Idle Read Write Idle Read Write Dead Idle
Note: In single address transfer mode, the update timing is the same as [1].
The MAR operation is post-incrementing/decrementing of the DMA internal address value.
• If a DMAC transfer cycle occurs immediately after a DMAC register read cycle, the DMAC
register is read as shown in figure 8.44.
DMA register
[1] [2]
operation
Note: The lower word of MAR is the updated value after the operation in [1].
Figure 8.44 Contention between DMAC Register Update and CPU Read
When the MSTP13 bit in MSTPCRH is set to 1, the DMAC clock stops, and the module stop state
is entered. However, 1 cannot be written to the MSTP13 bit if any of the DMAC channels is
enabled. This setting should therefore be made when DMAC operation is stopped.
When the DMAC clock stops, DMAC register accesses can no longer be made. Since the
following DMAC register settings are valid even in the module stop state, they should be
invalidated, if necessary, before a module stop.
When the WDBE bit of BCR in the bus controller is set to 1, enabling the write data buffer
function, dual address transfer external write cycles or single address transfers and internal
accesses (on-chip memory or internal I/O registers) are executed in parallel.
In common register enabled mode, the TEND output of channels 1 and 4 are switched by the
settings of bits RSEL1 and RSEL4 in DRSEL, and the TEND output of channels 3 and 5 are
switched by the settings of bits RSEL3 and RSEL5 in DRSEL.
In common register disabled mode, the TEND output of channels 0 and 4 are switched by the
setting of bit DMA_SEL0 in PFCR3, and the TEND output of channels 1 and 5 are switched by
the setting of bit DMA_SEL1 in PFCR3.
DMA setting should not be made while switching between common register enabled mode and
common register disabled mode.
If the last transfer cycle is for an internal address, note that even if low-level output at the TEND
pin has been set, a low level may not be output at the TEND pin under the following external bus
conditions since the last transfer cycle (internal bus cycle) and the external bus cycle are executed
in parallel.
1. EXDMAC cycle*1
2. Write cycle with write buffer mode enabled
3. DMAC single address cycle for a different channel with write buffer mode enabled
4. Bus release cycle
5. CBR refresh cycle
Figure 8.45 shows an example in which a low level is not output from the TEND pin in case 2
above.
If the last transfer cycle is an external address cycle, a low level is output at the TEND pin in
synchronization with the bus cycle.
However, if the last transfer cycle and a CBR refresh*2 occur simultaneously, note that although
the CBR refresh*2 and the last transfer cycle may be executed consecutively, TEND may also go
low in this case for the refresh cycle*2.
DMA DMA
read write
Internal address
External address
HWR, LWR
TEND
Not output
Figure 8.45 Example in which Low Level Is Not Output at TEND Pin
DREQ pin falling edge detection is performed in synchronization with DMAC internal operations.
The operation is as follows:
[1] Activation request wait state: Waits for detection of a low level on the DREQ pin, and
switches to [2].
[2] Transfer wait state: Waits for DMAC data transfer to become possible, and switches to [3].
[3] Activation request disabled state: Waits for detection of a high level on the DREQ pin, and
switches to [1].
After DMAC transfer is enabled, a transition is made to [1]. Thus, initial activation after transfer is
enabled is performed on detection of a low level.
At the start of activation source acceptance, a low level is detected in both DREQ pin falling edge
sensing and low level sensing. Similarly, in the case of an internal interrupt, the interrupt request is
detected. Therefore, a request is accepted from an internal interrupt or DREQ pin low level that
occurs before write to DMABCR in common register enabled mode or DMAECRS or DMAECRF
in common register disabled mode to enable transfer.
When the DMAC is activated, take any necessary steps to prevent an internal interrupt or DREQ
pin low level remaining from the end of the previous transfer, etc.
When the DTE bit in DMABCR in common register enabled mode or the DTE bit in DMAECRS
or DMAECRF in common register disabled mode is cleared to 0 at the end of a transfer or by a
forcible termination, the selected internal interrupt request will be sent to the CPU or DTC even if
the DTA bit in DMABCR in common register enabled mode or the DTA bit in DMAECRS or
DMAECRF in common register disabled mode is set to 1.
Also, if internal DMAC activation has already been initiated when operation is forcibly
terminated, the transfer is executed but flag clearing is not performed for the selected internal
interrupt even if the DTA bit is set to 1.
An internal interrupt request following the end of transfer or a forcible termination should be
handled by the CPU as necessary.
To reactivate a number of channels when multiple channels are enabled, use exclusive handling of
transfer end interrupts, and perform exclusive control of DMABCR control bits in common
register enabled mode, or DMAECRS or DMAECRF control bits in common register disabled
mode.
Note, in particular, that in cases where multiple interrupts are generated between reading and
writing of DMABCR in common register enabled mode or DMAECRS or DMAECRF in common
register disabled mode, and a DMABCR operation in common register enabled mode or
DMAECRS or DMAECRF operation in common register disabled mode is performed during new
interrupt handling, the DMABCR write data in common register enabled mode or DMAECRS or
DMAECRF write data in common register disabled mode in the original interrupt handling routine
will be incorrect, and the write may invalidate the results of the operations by the multiple
interrupts. Ensure that overlapping DMABCR operations in common register enabled mode or
DMAECRS or DMAECRF operations in common register disabled mode are not performed by
multiple interrupts, and use of a bit-manipulation instruction to prevent separation between read
and write operations.
Also, when the DTE and DTME bits are cleared by the DMAC or are written with 0, they must
first be read while cleared to 0 before the CPU can write 1 to them.
9.1 Features
• Direct specification of 16-Mbyte address space
• Selection of byte or word transfer data length
• Maximum number of transfers: 16M (16,777,215)/infinite (free-running)
• Selection of dual address mode or single address mode
• Selection of cycle steal mode or burst mode as bus mode
• Selection of normal mode or block transfer mode as transfer mode
• Two kinds of transfer requests: external request and auto-request
• An interrupt request can be sent to the CPU at the end of the specified number of transfers.
• Repeat area designation function:
• Operation in parallel with internal bus master:
• Acceptance of a transfer request and the start of transfer processing can be reported to an
external device via the EDRAK pin.
• Module stop mode can be set.
Bus controller
Data buffer
External pins
EDREQ Control logic Address buffer
[Legend]
EDSAR: EXDMA source address register
EDDAR: EXDMA destination address register
EDTCR: EXDMA transfer count register
EDMDR: EXDMA mode control register
EDACR: EXDMA address control register
Abbre-
Channel Name viation I/O Function
2 EXDMA transfer request 2 EDREQ2 Input Channel 2 external request
EXDMA transfer EDACK2 Output Channel 2 single address transfer
acknowledge 2 acknowledge
EXDMA transfer end 2 ETEND2 Output Channel 2 transfer end
EDREQ2 acceptance EDRAK2 Output Notification to external device of
acknowledge channel 2 external request
acceptance and start of transfer
processing
3 EXDMA transfer request 3 EDREQ3 Input Channel 3 external request
EXDMA transfer EDACK3 Output Channel 3 single address transfer
acknowledge 3 acknowledge
EXDMA transfer end 3 ETEND3 Output Channel 3 transfer end
EDREQ3 acceptance EDRAK3 Output Notification to external device of
acknowledge channel 3 external request
acceptance and start of transfer
processing
Among the EXDMAC registers, the EDA, EDIE, TCEIE, SARIE, and DARIE bits can always be
written to. The other bits can be written to only when the EDA bit is 0 with no data transfer in
progress on the relevant channel.
EDSAR is a 32-bit readable/writable register that specifies the transfer source address. An address
update function is provided that updates the register contents to the next transfer source address
each time transfer processing is performed. In single address mode, the EDSAR value is ignored
when a device with DACK is specified as the transfer source.
EDSAR can be read at all times by the CPU. When reading EDSAR for a channel on which
EXDMA transfer processing is in progress, a longword-size read must be executed. Do not write
to EDSAR for a channel on which EXDMA transfer is in progress. All bits in EDSAR are
initialized to 0 at a reset.
EDDAR is a 32-bit readable/writable register that specifies the transfer destination address. An
address update function is provided that updates the register contents to the next transfer
destination address each time transfer processing is performed. In single address mode, the
EDDAR value is ignored when a device with DACK is specified as the transfer destination.
EDDAR can be read at all times by the CPU. When reading EDDAR for a channel on which
EXDMA transfer processing is in progress, a longword-size read must be executed. Do not write
to EDDAR for a channel on which EXDMA transfer is in progress. All bits in EDDAR are
initialized to 0 at a reset.
EDTCR specifies the number of transfers. The function differs according to the transfer mode. Do
not write to EDTCR for a channel on which EXDMA transfer is in progress.
EDACR specifies address register incrementing/decrementing and use of the repeat area function.
9.4 Operation
In normal transfer mode, a one-byte or one-word transfer is executed in response to one transfer
request. With auto requests, burst or cycle steal transfer mode can be set. In burst transfer mode,
continuous, high-speed transfer can be performed until the specified number of transfers have
been executed or the transfer enable bit is cleared to 0.
In block transfer mode, a transfer of the specified block size is executed in response to one transfer
request. The block size can be from 1 to 256 bytes or words. Within a block, transfer can be
performed at the same high speed as in block transfer mode.
When the “no specification” setting (EDTCR = H'000000) is made for the number of transfers, the
transfer counter is halted and there is no limit on the number of transfers, allowing transfer to be
performed endlessly.
In all transfer modes, it is possible to set a repeat area comprising a power-of-two number of
bytes.
In dual address mode, both the transfer source and transfer destination are specified by registers in
the EXDMAC, and one transfer is executed in two bus cycles.
The transfer source address is set in the source address register (EDSAR), and the transfer
destination address is set in the transfer destination address register (EDDAR).
In a transfer operation, the value in external memory specified by the transfer source address is
read in the first bus cycle, and is written to the external memory specified by the transfer
destination address in the next bus cycle.
These consecutive read and write cycles are indivisible: another bus cycle (external access by an
internal bus master, refresh cycle, or external bus release cycle) does not occur between these two
cycles.
ETEND pin output can be enabled or disabled by means of the ETENDE bit in EDMDR. ETEND
is output for two consecutive bus cycles. The EDACK signal is not output.
EXDMA EXDMA
read cycle write cycle
RD
WR
ETEND
In single address mode, the EDACK signal is used instead of the source or destination address
register to transfer data directly between an external device and external memory. In this mode,
the EXDMAC accesses the transfer source or transfer destination external device by outputting the
external I/O strobe signal (EDACK), and at the same time accesses the other external device in the
transfer by outputting an address. In this way, EXDMA transfer can be executed in one bus cycle.
In the example of transfer between external memory and an external device with DACK shown in
figure 9.3, data is output to the data bus by the external device and written to external memory in
the same bus cycle.
The transfer direction, that is whether the external device with DACK is the transfer source or
transfer destination, can be specified with the SDIR bit in EDMDR. Transfer is performed from
the external memory (EDSAR) to the external device with DACK when SDIR = 0, and from the
external device with DACK to the external memory (EDDAR) when SDIR = 1.
The setting in the source or destination address register not used in the transfer is ignored.
The EDACK pin becomes valid automatically when single address mode is selected. The EDACK
pin is active-low. ETEND pin output can be enabled or disabled by means of the ETENDE bit in
EDMDR. ETEND is output for one bus cycle.
Figure 9.3 shows the data flow in single address mode, and figure 9.4 shows an example of the
timing.
External External
address bus data bus
Microcomputer
External
memory
EXDMAC
External device
with DACK
EDACK
EDREQ
Data flow
EXDMA cycle
WR
EDACK
ETEND
EXDMA cycle
RD
EDACK
In auto request mode, transfer request signals are automatically generated within the EXDMAC in
cases where a transfer request signal is not issued from outside, such as in transfer between two
memories, or between a peripheral module that is not capable of generating transfer requests and
memory. In auto request mode, transfer is started when the EDA bit is set to 1 in EDMDR.
In auto request mode, either cycle steal mode or burst mode can be selected as the bus mode.
Block transfer mode cannot be used.
In external request mode, transfer is started by a transfer request signal (EDREQ) from a device
external to this LSI. EXDMA transfer is started when EDREQ is input while EXDMA transfer is
enabled (EDA = 1).
The transfer request source need not be the data transfer source or data transfer destination.
The transfer request signal is accepted via the EDREQ pin. Either falling edge sensing or low level
sensing can be selected for the EDREQ pin by means of the EDREQS bit in EDMDR (low level
sensing when EDREQS = 0, falling edge sensing when EDREQS = 1).
Setting the EDRAKE bit to 1 in EDMDR enables a signal confirming transfer request acceptance
to be output from the EDRAK pin. The EDRAK signal is output when acceptance and transfer
processing has been started in response to a single external request. The EDRAK signal enables
the external device to determine the timing of EDREQ signal negation, and makes it possible to
provide handshaking between the transfer request source and the EXDMAC.
In external request mode, block transfer mode can be used instead of burst mode. Block transfer
mode allows continuous execution (burst operation) of the specified number of transfers (the block
size) in response to a single transfer request. In block transfer mode, the EDRAK signal is output
only once for a one-block transfer, since the transfer request via the EDREQ pin is for a block
unit.
There are two bus modes: cycle steal mode and burst mode. When the activation source is an auto
request, either cycle steal mode or burst mode can be selected. When the activation source is an
external request, cycle steal mode is used.
In cycle steal mode, the EXDMAC releases the bus at the end of each transfer of a transfer unit
(byte, word, or block). If there is a subsequent transfer request, the EXDMAC takes back the bus,
performs another transfer-unit transfer, and then releases the bus again. This procedure is repeated
until the transfer end condition is satisfied.
If a transfer request occurs in another channel during EXDMA transfer, the bus is temporarily
released, then transfer is performed on the channel for which the transfer request was issued. If
there is no external space bus request from another bus master, a one-cycle bus release interval is
inserted. For details on the operation when there are requests for a number of channels, see section
9.4.8, Channel Priority Order.
EDREQ
EDRAK
Transfer conditions:
· Single address mode, normal transfer mode
· EDREQ low level sensing
· CPU internal bus master is operating in external space
In burst mode, once the EXDMAC acquires the bus it continues transferring data, without
releasing the bus, until the transfer end condition is satisfied. There is no burst mode in external
request mode.
In burst mode, once transfer is started it is not interrupted even if there is a transfer request from
another channel with higher priority. When the burst mode channel finishes its transfer, it releases
the bus in the next cycle in the same way as in cycle steal mode.
When the EDA bit is cleared to 0 in EDMDR, EXDMA transfer is halted. However, EXDMA
transfer is executed for all transfer requests generated within the EXDMAC up until the EDA bit
was cleared to 0.
If a repeat area overflow interrupt is generated, the EDA bit is cleared to 0 and transfer is
terminated.
When the EBRE bit is set to 1 in EDMDR, the bus is released if a bus request is issued by another
bus master during burst transfer. If there is no bus request, burst transfer is executed even if the
EBRE bit is set to 1.
Transfer conditions:
Auto request mode, BGUP = 0
Transfer conditions:
Auto request mode, BGUP = 1
There are two transfer modes: normal transfer mode and block transfer mode. When the activation
source is an external request, either normal transfer mode or block transfer mode can be selected.
When the activation source is an auto request, normal transfer mode is used.
In normal transfer mode, transfer of one transfer unit is processed in response to one transfer
request. EDTCR functions as a 24-bit transfer counter.
The ETEND signal is output only for the last EXDMA transfer. The EDRAK signal is output each
time a transfer request is accepted and transfer processing is started.
Figure 9.7 shows examples of EXDMA transfer timing in normal transfer mode.
ETEND
Transfer conditions:
Dual address mode, auto request mode
EDREQ
EDRAK
EDACK
Transfer conditions:
Single address mode, external request mode
In block transfer mode, the number of bytes or words specified by the block size is transferred in
response to one transfer request. The upper 8 bits of EDTCR specify the block size, and the lower
16 bits function as a 16-bit transfer counter. A block size of 1 to 256 can be specified. During
transfer of a block, transfer requests for other higher-priority channels are held pending. When
transfer of one block is completed, the bus is released in the next cycle.
When the EBRE bit is set to 1 in EDMDR, the bus is released if a bus request is issued by another
bus master during block transfer.
Address register values are updated in the same way as in normal mode. There is no function for
restoring the initial address register values after each block transfer.
The ETEND signal is output for each block transfer in the EXDMA transfer cycle in which the
block ends. The EDRAK signal is output once for one transfer request (for transfer of one block).
Caution is required when setting the repeat area overflow interrupt of the repeat area function in
block transfer mode. See section 9.4.6, Repeat Area Function, for details.
Block transfer is aborted if an NMI interrupt is generated. See section 9.4.12, Ending EXDMA
Transfer, for details.
Figure 9.8 shows an example of EXDMA transfer timing in block transfer mode.
EDREQ
EDRAK
One-block transfer cycle
ETEND
Transfer conditions:
· Single address mode
· BGUP = 0
· Block size (EDTCR[23:16]) = 3
The EXDMAC has a function for designating a repeat area for source addresses and/or destination
addresses. When a repeat area is designated, the address register values repeat within the range
specified as the repeat area. Normally, when a ring buffer is involved in a transfer, an operation is
required to restore the address register value to the buffer start address each time the address
register value is the last address in the buffer (i.e. when ring buffer address overflow occurs), but
if the repeat area function is used, the operation that restores the address register value to the
buffer start address is performed automatically within the EXDMAC.
The repeat area function can be set independently for the source address register and the
destination address register.
The source address repeat area is specified by bits SARA4 to SARA0 in EDACR, and the
destination address repeat area by bits DARA4 to DARA0 in EDACR. The size of each repeat
area can be specified independently.
When the address register value is the last address in the repeat area and repeat area overflow
occurs, EXDMA transfer can be temporarily halted and an interrupt request sent to the CPU. If the
SARIE bit in EDACR is set to 1, when the source address register overflows the repeat area, the
IRF bit is set to 1 and the EDA bit cleared to 0 in EDMDR, and transfer is terminated. If EDIE = 1
in EDMDR, an interrupt is requested. If the DARIE bit in EDACR is set to 1, the above applies to
the destination address register.
If the EDA bit in EDMDR is set to 1 during interrupt generation, transfer is resumed. Figure 9.9
illustrates the operation of the repeat area function.
When lower 3 bits (8-byte area) of EDSAR are designated as repeat area
(SARA4 to SARA0 = 3)
External memory
: Range of
EDSAR values
H'23FFFE
H'23FFFF
H'240000 H'240000 Repeated
H'240001 H'240001
H'240002 H'240002
H'240003 H'240003
H'240004 H'240004
H'240005 H'240005
H'240006 H'240006
H'240007 H'240007
Repeat area overflow
H'240008 interrupt can be
H'240009 requested
:
Caution is required when the repeat area overflow interrupt function is used together with block
transfer mode. If transfer is always terminated when repeat area overflow occurs in block transfer
mode, the block size must be a power of two, or alternatively, the address register value must be
set so that the end of a block coincides with the end of the repeat area range.
If repeat area overflow occurs while a block is being transferred in block transfer mode, the repeat
interrupt request is held pending until the end of the block, and transfer overrun will occur. Figure
9.10 shows an example in which block transfer mode is used together with the repeat area
function.
When lower 3 bits (8-byte area) of EDSAR are designated as repeat area (SARA4 to SARA0 = 3),
and block size of 5 (EDTCR[23–16] = 5) is set in block transfer mode
H'23FFFE
H'23FFFF
H'240000 H'240000 H'240000 H'240000
H'240001 H'240001 H'240001 H'240001 Interrupt
H'240002 H'240002 H'240002 requested
Figure 9.10 Example of Repeat Area Function Operation in Block Transfer Mode
EXDMAC register values are updated as EXDMA transfer processing is performed. The updated
values depend on various settings and the transfer status. The following registers and bits are
updated: EDSAR, EDDAR, EDTCR, and bits EDA, BEF, and IRF in EDMDR,
When the EDSAR address is accessed as the transfer source, after the EDSAR value is output,
EDSAR is updated with the address to be accessed next. Bits SAT1 and SAT0 in EDACR specify
incrementing or decrementing. The address is fixed when SAT1 = 0, incremented when SAT1 = 1
and SAT0 = 0, and decremented when SAT1 = 1 and SAT0 = 1.
The size of the increment or decrement is determined by the size of the data transferred. When the
DTSIZE bit in EDMDR = 0, the data is byte-size and the address is incremented or decremented
by 1; when DTSIZE = 1, the data is word-size and the address is incremented or decremented by
2.
When a repeat area setting is made, the operation conforms to that setting. The upper part of the
address set for the repeat area function is fixed, and is not affected by address updating.
When EDSAR is read during a transfer operation, a longword access must be used. During a
transfer operation, EDSAR may be updated without regard to accesses from the CPU, and the
correct values may not be read if the upper and lower words are read separately. In a longword
access, the EXDMAC buffers the EDSAR value to ensure that the correct value is output.
When the EDDAR address is accessed as the transfer destination, after the EDDAR value is
output, EDDAR is updated with the address to be accessed next. Bits DAT1 and DAT0 in
EDACR specify incrementing or decrementing. The address is fixed when DAT1 = 0, incremented
when DAT1 = 1 and DAT0 = 0, and decremented when DAT1 = 1 and DAT0 = 1.
The size of the increment or decrement is determined by the size of the data transferred. When the
DTSIZE bit in EDMDR = 0, the data is byte-size and the address is incremented or decremented
by 1; when DTSIZE = 1, the data is word-size and the address is incremented or decremented by
2.
When a repeat area setting is made, the operation conforms to that setting. The upper part of the
address set for the repeat area function is fixed, and is not affected by address updating.
When EDDAR is read during a transfer operation, a longword access must be used. During a
transfer operation, EDDAR may be updated without regard to accesses from the CPU, and the
correct values may not be read if the upper and lower words are read separately. In a longword
access, the EXDMAC buffers the EDDAR value to ensure that the correct value is output.
When a EXDMA transfer is performed, the value in EDTCR is decremented by 1. However, when
the EDTCR value is 0, transfers are not counted and the EDTCR value does not change.
EDTCR functions differently in block transfer mode. The upper 8 bits, EDTCR[23:16], are used to
specify the block size, and their value does not change. The lower 16 bits, EDTCR[15:0], function
as a transfer counter, the value of which is decremented by 1 when a DMA transfer is performed.
However, when the EDTCR[15:0] value is 0, transfers are not counted and the EDTCR[15:0]
value does not change.
In normal transfer mode, all of the lower 24 bits of EDTCR may change, so when EDTCR is read
by the CPU during EXDMA transfer, a longword access must be used. During a transfer
operation, EDTCR may be updated without regard to accesses from the CPU, and the correct
values may not be read if the upper and lower words are read separately. In a longword access, the
EXDMAC buffers the EDTCR value to ensure that the correct value is output.
In block transfer mode, the upper 8 bits are never updated, so there is no problem with using word
access.
Do not write to EDTCR for a channel on which a transfer operation is in progress. If there is
contention between an address update associated with EXDMA transfer and a write by the CPU,
the CPU write has priority.
In the event of contention between an EDTCR update from 1 to 0 and a write (of a nonzero value)
by the CPU, the CPU write value has priority as the EDTCR value, but transfer is terminated.
Transfer does not end if the CPU writes 0 to EDTCR.
Figure 9.11 shows EDTCR update operations in normal transfer mode and block transfer mode.
23 0 23 0
–1
EDTCR 1 to H'FFFFFF 0 to H'FFFFFE
23 16 15 0 23 16 15 0
Block –1 Block
EDTCR size 1 to H'FFFF size 0 to H'FFFE
The EDA bit in EDMDR is written to by the CPU to control enabling and disabling of data
transfer, but may be cleared automatically by the EXDMAC due to the EXDMA transfer status.
There are also periods during transfer when a 0-write to the EDA bit by the CPU is not
immediately effective.
Conditions for EDA bit clearing by the EXDMAC include the following:
When transfer is halted by writing 0 to the EDA bit, the EDA bit remains at 1 during the EXDMA
transfer period. In block transfer mode, since a block-size transfer is carried out without
interruption, the EDA bit remains at 1 from the time 0 is written to it until the end of the current
block-size transfer.
In burst mode, transfer is halted for up to three EXDMA transfers following the bus cycle in
which 0 is written to the EDA bit. The EDA bit remains set to 1 from the time of the 0-write until
the end of the last EXDMA cycle.
Writes (except to the EDA bit) are prohibited to registers of a channel for which the EDA bit is set
to 1. When changing register settings after a 0-write to the EDA bit, it is necessary to confirm that
the EDA bit has been cleared to 0.
Figure 9.12 shows the procedure for changing register settings in an operating channel.
Register setting
changes completed
In block transfer mode, the specified number of transfers (equivalent to the block size) are
performed in response to a single transfer request. To ensure that the correct number of transfers is
carried out, a block-size transfer is always executed, except in the event of a reset, transition to
standby mode, or generation of an NMI interrupt.
If an NMI interrupt is generated during block transfer, operation is halted midway through a
block-size transfer and the EDA bit is cleared to 0, terminating the transfer operation. In this case
the BEF bit, which indicates the occurrence of an error during block transfer, is set to 1.
The IRF bit in EDMDR is set to 1 when an interrupt request source occurs. If the EDIE bit in
EDMDR is 1 at this time, an interrupt is requested.
The timing for setting the IRF bit to 1 is when the EDA bit in EDMDR is cleared to 0 and transfer
ends following the end of the EXDMA transfer bus cycle in which the source generating the
interrupt occurred.
If the EDA bit is set to 1 and transfer is resumed during interrupt handling, the IRF bit is
automatically cleared to 0 and the interrupt request is cleared.
The priority order of the EXDMAC channels is: channel 2 > channel 3. Table 9.3 shows the
EXDMAC channel priority order.
Channel Priority
Channel 2 High
Channel 3 Low
If transfer requests occur simultaneously for a number of channels, the highest-priority channel
according to the priority order in table 9.3 is selected for transfer.
(1) Transfer Requests from Multiple Channels (Except Auto Request Cycle Steal Mode)
If transfer requests for different channels are issued during a transfer operation, the highest-
priority channel (excluding the currently transferring channel) is selected. The selected channel
begins transfer after the currently transferring channel releases the bus. If there is a bus request
from a bus master other than the EXDMAC at this time, a cycle for the other bus master is
initiated. If there is no other bus request, the bus is released for one cycle.
Channel switching does not take place during a burst transfer or a block transfer of a single block.
Figure 9.13 shows a case in which transfer requests for channels 2 and 3 are issued
simultaneously. The example shown in the figure illustrates the handling of external requests in
the cycle steal mode.
(2) Transfer Requests from Multiple Channels in Auto Request Cycle Steal Mode
If transfer requests for different channels are issued during a transfer in auto request cycle steal
mode, the operation depends on the channel priority. If the channel that made the transfer request
is of higher priority than the channel currently performing transfer, the channel that made the
transfer request is selected.
If the channel that made the transfer request is of lower priority than the channel currently
performing transfer, that channel’s transfer request is held pending, and the currently transferring
channel remains selected.
The selected channel begins transfer after the currently transferring channel releases the bus. If
there is a bus request from a bus master other than the EXDMAC at this time, a cycle for the other
bus master is initiated. If there is no other bus request, the bus is released for one cycle.
Figure 9.14 shows examples of transfer timing in cases that include auto request cycle steal mode.
Conditions (1)
Channel 2: Auto request, cycle steal mode
Channel 3: External request, cycle steal mode, low level activation
Channel 2
EDA bit
Channel 3/
EDREQ3 pin
Conditions (2)
Channel 2: External request, cycle steal mode, low level activation
Channel 3: Auto request, cycle steal mode
Channel 2/
EDREQ2 pin
Channel 2
EDA bit
Conditions (3)
Channel 2: Auto request, cycle steal mode
Channel 3: Auto request, cycle steal mode
Channel 2
EDA bit
Channel 3
EDA bit
*: Bus release
Figure 9.15 shows an example of transfer when ETEND output is enabled, and word-size, normal
transfer mode (cycle steal mode) is performed from external 16-bit, 2-state access space to
external 16-bit, 2-state access space.
After one byte or word has been transferred, the bus is released. While the bus is released, one
CPU, DMAC, or DTC bus cycle is initiated.
Address bus
RD
HWR
LWR
ETEND
Figure 9.15 Example of Normal Transfer Mode (Cycle Steal Mode) Transfer
Figure 9.16 shows an example of transfer when ETEND output is enabled, and word-size, normal
transfer mode (burst mode) is performed from external 16-bit, 2-state access space to external 16-
bit, 2-state access space.
In burst mode, one-byte or one-word transfers are executed continuously until transfer ends.
Once burst transfer starts, requests from other channels, even of higher priority, are held pending
until transfer ends.
Address bus
RD
HWR
LWR
ETEND
If an NMI interrupt is generated while a channel designated for burst transfer is enabled for
transfer, the EDA bit is cleared and transfer is disabled. If a block transfer has already been
initiated within the EXDMAC, the bus is released on completion of the currently executing byte or
word transfer, and burst transfer is aborted. If the last transfer cycle in burst transfer has been
initiated within the EXDMAC, transfer is executed to the end even if the EDA bit is cleared.
Figure 9.17 shows an example of transfer when ETEND output is enabled, and word-size, block
transfer mode (cycle steal mode) is performed from external 16-bit, 2-state access space to
external 16-bit, 2-state access space.
One block is transferred in response to one transfer request, and after the transfer, the bus is
released. While the bus is released, one or more CPU, DMAC, or DTC bus cycles are initiated.
Address bus
RD
HWR
LWR
ETEND
Figure 9.17 Example of Block Transfer Mode (Cycle Steal Mode) Transfer
Figure 9.18 shows an example of normal mode transfer activated by the EDREQ pin falling edge.
EDREQ
Acceptance Acceptance
resumed resumed
[1] Acceptance after transfer enabling; EDREQ pin low level is sampled at rise of φ, and request is held.
[2], [5] Request is cleared at end of next bus cycle, and activation is started in EXDMAC.
[3], [6] EXDMA cycle start; EDREQ pin high level sampling is started at rise of φ.
[4], [7] When EDREQ pin high level has been sampled, acceptance is resumed after completion of write cycle.
(As in [1], EDREQ pin low level is sampled at rise of φ, and request is held.)
Figure 9.18 Example of Normal Mode Transfer Activated by EDREQ Pin Falling Edge
EDREQ pin sampling is performed in each cycle starting at the next rise of φ after the end of the
EDMDR write cycle for setting the transfer-enabled state.
When a low level is sampled at the EDREQ pin while acceptance via the EDREQ pin is possible,
the request is held within the EXDMAC. Then when activation is initiated within the EXDMAC,
the request is cleared, and EDREQ pin high level sampling for edge sensing is started. If EDREQ
pin high level sampling is completed by the end of the EXDMA write cycle, acceptance resumes
after the end of the write cycle, and EDREQ pin low level sampling is performed again; this
sequence of operations is repeated until the end of the transfer.
Figure 9.19 shows an example of block transfer mode transfer activated by the EDREQ pin falling
edge.
EDREQ
Acceptance Acceptance
resumed resumed
[1] Acceptance after transfer enabling; EDREQ pin low level is sampled at rise of φ, and request is held.
[2], [5] Request is cleared at end of next bus cycle, and activation is started in EXDMAC.
[3], [6] EXDMA cycle start; EDREQ pin high level sampling is started at rise of φ.
[4], [7] When EDREQ pin high level has been sampled, acceptance is resumed after completion of dead cycle.
(As in [1], EDREQ pin low level is sampled at rise of φ, and request is held.)
EDREQ pin sampling is performed in each cycle starting at the next rise of φ after the end of the
EDMDR write cycle for setting the transfer-enabled state.
When a low level is sampled at the EDREQ pin while acceptance via the EDREQ pin is possible,
the request is held within the EXDMAC. Then when activation is initiated within the EXDMAC,
the request is cleared, and EDREQ pin high level sampling for edge sensing is started. If EDREQ
pin high level sampling is completed by the end of the EXDMA write cycle, acceptance resumes
after the end of the write cycle, and EDREQ pin low level sampling is performed again; this
sequence of operations is repeated until the end of the transfer.
Figure 9.20 shows an example of normal mode transfer activated by the EDREQ pin low level.
EDREQ
Acceptance Acceptance
resumed resumed
[1] Acceptance after transfer enabling; EDREQ pin low level is sampled at rise of φ, and request is held.
[2], [5] Request is cleared at end of next bus cycle, and activation is started in EXDMAC.
[3], [6] EXDMA cycle is started.
[4], [7] Acceptance is resumed after completion of write cycle.
(As in [1], EDREQ pin low level is sampled at rise of φ, and request is held.)
Figure 9.20 Example of Normal Mode Transfer Activated by EDREQ Pin Low Level
EDREQ pin sampling is performed in each cycle starting at the next rise of φ after the end of the
EDMDR write cycle for setting the transfer-enabled state.
When a low level is sampled at the EDREQ pin while acceptance via the EDREQ pin is possible,
the request is held within the EXDMAC. Then when activation is initiated within the EXDMAC,
the request is cleared. At the end of the write cycle, acceptance resumes and EDREQ pin low level
sampling is performed again; this sequence of operations is repeated until the end of the transfer.
Figure 9.21 shows an example of block transfer mode transfer activated by the EDREQ pin low
level.
EDREQ
Acceptance Acceptance
resumed resumed
[1] Acceptance after transfer enabling; EDREQ pin low level is sampled at rise of φ, and request is held.
[2], [5] Request is cleared at end of next bus cycle, and activation is started in EXDMAC.
[3], [6] EXDMA cycle is started.
[4], [7] Acceptance is resumed after completion of dead cycle.
(As in [1], EDREQ pin low level is sampled at rise of φ, and request is held.)
Figure 9.21 Example of Block Transfer Mode Transfer Activated by EDREQ Pin Low Level
EDREQ pin sampling is performed in each cycle starting at the next rise of φ after the end of the
EDMDR write cycle for setting the transfer-enabled state.
When a low level is sampled at the EDREQ pin while acceptance via the EDREQ pin is possible,
the request is held within the EXDMAC. Then when activation is initiated within the EXDMAC,
the request is cleared. At the end of the write cycle, acceptance resumes and EDREQ pin low level
sampling is performed again; this sequence of operations is repeated until the end of the transfer.
Figure 9.22 shows an example of transfer when ETEND output is enabled, and byte-size, single
address mode transfer (read) is performed from external 8-bit, 2-state access space to an external
device.
Address bus
RD
EDACK
ETEND
Bus release Bus release Bus release Bus release Last Bus release
transfer
cycle
Figure 9.23 shows an example of transfer when ETEND output is enabled, and word-size, single
address mode transfer (read) is performed from external 8-bit, 2-state access space to an external
device.
Address bus
RD
EDACK
ETEND
Bus release Bus release Bus release Last transfer cycle Bus
release
After one byte or word has been transferred in response to one transfer request, the bus is released.
While the bus is released, one or more CPU, DMAC, or DTC bus cycles are initiated.
Figure 9.24 shows an example of transfer when ETEND output is enabled, and byte-size, single
address mode transfer (write) is performed from an external device to external 8-bit, 2-state access
space.
Address bus
HWR
LWR
EDACK
ETEND
Bus release Bus release Bus release Bus release Last Bus release
transfer
cycle
Figure 9.25 shows an example of transfer when ETEND output is enabled, and word-size, single
address mode transfer (write) is performed from an external device to external 8-bit, 2-state access
space.
Address bus
HWR
LWR
EDACK
ETEND
Bus release Bus release Bus release Last transfer cycle Bus
release
After one byte or word has been transferred in response to one transfer request, the bus is released.
While the bus is released, one or more CPU, DMAC, or DTC bus cycles are initiated.
Figure 9.26 shows an example of single address mode transfer activated by the EDREQ pin falling
edge.
EXDMA EXDMA
Bus release single Bus release single Bus release
EDREQ
EDACK
Acceptance Acceptance
resumed resumed
[1] Acceptance after transfer enabling; EDREQ pin low level is sampled at rise of φ, and request is held.
[2], [5] Request is cleared at end of next bus cycle, and activation is started in EXDMAC.
[3], [6] EXDMA cycle start; EDREQ pin high level sampling is started at rise of φ.
[4], [7] When EDREQ pin high level has been sampled, acceptance is resumed after completion of single cycle.
(As in [1], EDREQ pin low level is sampled at rise of φ, and request is held.)
EDREQ pin sampling is performed in each cycle starting at the next rise of φ after the end of the
EDMDR write cycle for setting the transfer-enabled state.
When a low level is sampled at the EDREQ pin while acceptance via the EDREQ pin is possible,
the request is held within the EXDMAC. Then when activation is initiated within the EXDMAC,
the request is cleared, and EDREQ pin high level sampling for edge sensing is started. If EDREQ
pin high level sampling is completed by the end of the EXDMA single cycle, acceptance resumes
after the end of the single cycle, and EDREQ pin low level sampling is performed again; this
sequence of operations is repeated until the end of the transfer.
Figure 9.27 shows an example of single address mode transfer activated by the EDREQ pin low
level.
EXDMA EXDMA
Bus release single Bus release single Bus release
EDREQ
EDACK
Acceptance Acceptance
resumed resumed
[1] Acceptance after transfer enabling; EDREQ pin low level is sampled at rise of φ, and request is held.
[2], [5] Request is cleared at end of next bus cycle, and activation is started in EXDMAC.
[3], [6] EXDMA cycle is started.
[4], [7] Acceptance is resumed after completion of single cycle.
(As in [1], EDREQ pin low level is sampled at rise of φ, and request is held.)
Figure 9.27 Example of Single Address Mode Transfer Activated by EDREQ Pin Low Level
EDREQ pin sampling is performed in each cycle starting at the next rise of φ after the end of the
EDMDR write cycle for setting the transfer-enabled state.
When a low level is sampled at the EDREQ pin while acceptance via the EDREQ pin is possible,
the request is held within the EXDMAC. Then when activation is initiated within the EXDMAC,
the request is cleared. At the end of the single cycle, acceptance resumes and EDREQ pin low
level sampling is performed again; this sequence of operations is repeated until the end of the
transfer.
When the EDA bit is set to 1 in EDMDR, an EXDMA transfer cycle is started a minimum of three
cycles later. There is a one-cycle bus release interval between the end of a one-transfer-unit
EXDMA cycle and the start of the next transfer.
If there is a transfer request for another channel of higher priority, the transfer request by the
original channel is held pending, and transfer is performed on the higher-priority channel from the
next transfer. Transfer on the original channel is resumed on completion of the higher-priority
channel transfer.
Figures 9.28 to 9.30 show operation timing examples for various conditions.
φ pin
ETEND
EDA bit 0 1 0
φ pin
CPU cycle EXDMA single CPU cycle EXDMA single CPU cycle EXDMA single CPU cycle
Bus cycle transfer cycle transfer cycle transfer cycle
EDACK
ETEND
φ pin
Current
channel
EDACK
Other
channel
transfer
request
(EDREQ)
When the EDA bit is set to 1 in EDMDR, an EXDMA transfer cycle is started a minimum of three
cycles later. Once transfer is started, it continues (as a burst) until the transfer end condition is
satisfied.
If the EBRE bit is 1 in EDMDR, the bus is transferred in the event of a bus request from another
bus master.
Transfer requests for other channels are held pending until the end of transfer on the current
channel.
Figures 9.31 to 9.34 show operation timing examples for various conditions.
φ pin
Bus cycle CPU cycle CPU cycle EXDMA EXDMA EXDMA EXDMA Repeated EXDMA EXDMA CPU cycle
read write read write read write
ETEND
EDA bit 1 0
φ pin
Bus cycle CPU cycle CPU cycle EXDMA EXDMA CPU cycle EXDMA EXDMA CPU cycle EXDMA EXDMA
read write read write read write
φ pin
EXDMA
CPU cycle CPU cycle single EXDMA EXDMA EXDMA EXDMA
Bus cycle cycle single cycle CPU cycle single cycle single cycle CPU cycle single cycle CPU cycle
EDACK
ETEND
φ pin
Bus cycle Bus release EXDMA single EXDMA single EXDMA single Other channel EXDMA cycle Bus
transfer cycle transfer cycle transfer cycle release
Bus
release
Original
channel
EDACK
Original
channel
ETEND
Other
channel
transfer
request
(EDREQ)
In external request mode, an EXDMA transfer cycle is started a minimum of three cycles after a
transfer request is accepted. The next transfer request is accepted after the end of a one-transfer-
unit EXDMA cycle. For external bus space CPU cycles, at least two bus cycles are generated
before the next EXDMA cycle.
If a transfer request is generated for another channel, an EXDMA cycle for the other channel is
generated before the next EXDMA cycle.
The EDREQ pin sensing timing is different for low level sensing and falling edge sensing. The
same applies to transfer request acceptance and transfer start timing.
Figures 9.35 to 9.38 show operation timing examples for various conditions.
φ pin
EDREQ
EDRAK
Bus release EXDMA EXDMA Bus release EXDMA EXDMA Bus release
Bus cycle read write read write
ETEND
EDA bit 1 0
φ pin
EDREQ
EDRAK
EDACK
ETEND
φ pin
EDREQ
EDRAK
EDREQ
acceptance Start of edge confirmation Start of high Start of edge confirmation Start of high Start of edge confirmation Start of high
internal transfer processing level sensing transfer processing level sensing transfer processing level sensing
processing
state
Bus cycle Bus release EXDMA single Bus release EXDMA single Bus release EXDMA single
transfer cycle transfer cycle transfer cycle
EDACK
φ pin
Relevant
channel
EDREQ
Relevant
channel
EDRAK
3 cycles 1 cycle 1 cycle
Bus cycle EXDMA Bus release EXDMA EXDMA Bus Bus EXDMA EXDMA
transfer cycle read write release Other channel transfer cycle release read write
Other
channel
EDREQ
Other
channel
EDRAK
In block transfer mode, transfer of one block is performed continuously in the same way as in
burst mode. The timing of the start of the next block transfer is the same as in normal transfer
mode.
If a transfer request is generated for another channel, an EXDMA cycle for the other channel is
generated before the next block transfer.
The EDREQ pin sensing timing is different for low level sensing and falling edge sensing. The
same applies to transfer request acceptance and transfer start timing.
Figures 9.39 to 9.44 show operation timing examples for various conditions.
φ pin
EDREQ
EDRAK
1-block-size transfer period Last block
Bus cycle Bus release EXDMA EXDMA EXDMA EXDMA EXDMA EXDMA EXDMA EXDMA EXDMA EXDMA
read write read write read write Bus release read write read write
Bus
Repeated release
ETEND Repeated
EDA bit 1 0
φ pin
EDREQ
EDRAK
1-block-size transfer period Last block
Bus cycle Bus release EXDMA single EXDMA single EXDMA single Bus release EXDMA single EXDMA single
transfer cycle transfer cycle transfer cycle transfer cycle transfer cycle
Repeated Repeated Bus
release
EDACK
ETEND
φ pin
EDREQ
EDRAK
1-block-size transfer period 1-block-size transfer period
Bus cycle CPU cycle EXDMA single EXDMA single EXDMA single EXDMA single
CPU cycle CPU cycle transfer cycle transfer cycle CPU cycle CPU cycle transfer cycle transfer cycle CPU cycle
Repeated Repeated
CPU External External External External External External
operation space space space space space space
EDACK
ETEND
φ pin
EDREQ
EDRAK
1-block-size transfer period
1 bus cycle 1 bus cycle Repeated 1 bus cycle Last transfer in block
CPU CPU CPU EXDMA EXDMA CPU EXDMA EXDMA CPU EXDMA CPU EXDMA EXDMA CPU CPU
Bus cycle cycle cycle cycle read write cycle read write cycle read cycle read write cycle cycle
ETEND
φ pin
EDREQ
EDRAK
1-block-size transfer period
Last transfer
1 bus cycle 1 bus cycle Repeated 1 bus cycle in block
CPU CPU CPU EXDMA EXDMA CPU EXDMA EXDMA CPU EXDMA CPU EXDMA EXDMA CPU CPU
Bus cycle cycle cycle cycle transfer cycle transfer cycle cycle transfer cycle transfer cycle cycle transfer cycle cycle transfer cycle transfer cycle cycle cycle
EDACK
ETEND
φ pin
EDREQ
EDRAK
1-block-size transfer period 1-block-size transfer period
Bus release EXDMA EXDMA EXDMA EXDMA Other channel transfer cycle EXDMA EXDMA EXDMA EXDMA
Bus cycle read write read write read write read write
Bus Bus
Repeated release release Repeated
ETEND
Other
channel
EDREQ
Other
channel
EDRAK
The operation for ending EXDMA transfer depends on the transfer end conditions. When
EXDMA transfer ends, the EDA bit in EDMDR changes from 1 to 0, indicating that EXDMA
transfer has ended.
When the value of EDTCR changes from 1 to 0, EXDMA transfer ends on the corresponding
channel and the EDA bit in EDMDR is cleared to 0. If the TCEIE bit in EDMDR is set at this
time, a transfer end interrupt request is generated by the transfer counter and the IRF bit in
EDMDR is set to 1.
In block transfer mode, EXDMA transfer ends when the value of bits 15 to 0 in EDTCR changes
from 1 to 0.
EXDMA transfer does not end if the EDTCR value has been 0 since before the start of transfer.
If an address overflows the repeat area when a repeat area specification has been made and repeat
interrupts have been enabled (with the SARIE or DARIE bit in EDACR), a repeat area overflow
interrupt is requested. EXDMA transfer ends, the EDA bit in EDMDR is cleared to 0, and the IRF
bit in EDMDR is set to 1.
In dual address mode, if a repeat area overflow interrupt is requested during a read cycle, the
following write cycle processing is still executed.
In block transfer mode, if a repeat area overflow interrupt is requested during transfer of a block,
transfer continues to the end of the block. Transfer end by means of a repeat area overflow
interrupt occurs between block-size transfers.
When 0 is written to the EDA bit in EDMDR by the CPU, etc., transfer ends after completion of
the EXDMA cycle in which transfer is in progress or a transfer request was accepted.
In block transfer mode, EXDMA transfer halts after completion of one-block-size transfer.
The EDA bit in EDMDR is not cleared to 0 until all transfer processing has ended. Up to that
point, the value of the EDA bit will be read as 1.
EXDMA transfer is aborted when an NMI interrupt is generated. The EDA bit is cleared to 0 in all
channels. In external request mode, EXDMA transfer is performed for all transfer requests for
which EDRAK has been output. In dual address mode, processing is executed for the write cycle
following the read cycle.
In block transfer mode, operation is aborted even in the middle of a block-size transfer. As the
transfer is halted midway through a block, the BEF bit in EDMDR is set to 1 to indicate that the
block transfer was not carried out normally.
When transfer is aborted, register values are retained, and as the address registers indicate the next
transfer addresses, transfer can be resumed by setting the EDA bit to 1 in EDMDR. If the BEF bit
is 1 in EDMDR, transfer can be resumed from midway through a block.
The EXDMAC is initialized in hardware standby mode and by a reset. EXDMA transfer is not
guaranteed in these cases.
The read and write operations in an EXDMA transfer cycle are indivisible, and a refresh cycle*,
external bus release cycle, or internal bus master (CPU, DTC, or DMAC) external space access
cycle never occurs between the two.
When read and write cycles occur consecutively, as in burst transfer or block transfer, a refresh*
or external bus release state may be inserted after the write cycle. As the internal bus masters are
of lower priority than the EXDMAC, external space accesses by internal bus masters are not
executed until the EXDMAC releases the bus.
Interrupt sources can be enabled or disabled by means of the EDIE bit in EDMDR for the relevant
channel, and can be sent to the interrupt controller independently. The relative priority order of the
channels is determined by the interrupt controller (see table 9.4).
Figure 9.45 shows the transfer end interrupt logic. A transfer end interrupt is generated whenever
the EDIE bit is set to 1 while the IRF bit is set to 1 in EDMDR.
IRF bit
Transfer end interrupt
EDIE bit
Interrupt source settings are made individually with the interrupt enable bits in the registers for the
relevant channels. The transfer counter’s transfer end interrupt is enabled or disabled by means of
the TCEIE bit in EDMDR, the source address register repeat area overflow interrupt by means of
the SARIE bit in EDACR, and the destination address register repeat area overflow interrupt by
means of the DARIE bit in EDACR. When an interrupt source occurs while the corresponding
interrupt enable bit is set to 1, the IRF bit in EDMDR is set to 1. The IRF bit is set by all interrupt
sources indiscriminately.
The transfer end interrupt can be cleared either by clearing the IRF bit to 0 in EDMDR within the
interrupt handling routine, or by re-setting the transfer counter and address registers and then
setting the EDA bit to 1 in EDMDR to perform transfer continuation processing. An example of
the procedure for clearing the transfer end interrupt and restarting transfer is shown in figure 9.46.
[1] Write set values to the registers (transfer counter, address registers, etc.).
[2] Write 1 to the EDA bit in EDMDR to restart EXDMA operation. When 1 is written to the EDA
bit, the IRF bit in EDMDR is automatically cleared to 0 and the interrupt source is cleared.
[3] The interrupt handling routine is ended with an RTE instruction, etc.
[4] Clear the IRF bit to 0 in EDMDR by first reading 1 from it, then writing 0.
[5] After the interrupt handling routine is ended with an RTE instruction, etc., interrupt masking is
cleared.
[6] Write set values to the registers (transfer counter, address registers, etc.).
[7] Write 1 to the EDA bit in EDMDR to restart EXDMA operation.
Figure 9.46 Example of Procedure for Restarting Transfer on Channel in which Transfer
End Interrupt Occurred
Except for clearing the EDA bit to 0 in EDMDR, settings should not be changed for a channel in
operation (including the transfer standby state). Transfer must be disabled before changing a
setting for an operational channel.
When the MSTP14 bit is set to 1 in MSTPCRH, the EXDMAC clock stops and the EXDMAC
enters the module stop state. However, 1 cannot be written to the MSTP14 bit when any of the
EXDMAC’s channels is enabled for transfer, or when an interrupt is being requested. Before
setting the MSTP14 bit, first clear the EDA bit in EDMDR to 0, then clear the IRF or EDIE bit in
EDMDR to 0.
When the EXDMAC clock stops, EXDMAC registers can no longer be accessed. The following
EXDMAC register settings remain valid in the module stop state, and so should be changed, if
necessary, before making the module stop transition.
Falling edge sensing on the EDREQ pin is performed in synchronization with EXDMAC internal
operations, as indicated below.
[1] Activation request standby state: Waits for low level sensing on EDREQ pin, then goes to [2].
[2] Transfer standby state: Waits for EXDMAC data transfer to become possible, then goes to [3].
[3] Activation request disabled state: Waits for high level sensing on EDREQ pin, then goes to [1].
After EXDMAC transfer is enabled, the EXDMAC goes to state [1], so low level sensing is used
for the initial activation after transfer is enabled.
At the start of activation source acceptance, low level sensing is used for both falling edge sensing
and low level sensing on the EDREQ pin. Therefore, a request is accepted in the case of a low
level at the EDREQ pin that occurs before execution of the EDMDR write for setting the transfer-
enabled state.
When the EXDMAC is activated, make sure, if necessary, that a low level does not remain at the
EDREQ pin from the previous end of transfer, etc.
When transfer is started while the IRF bit is set to 1 in EDMDR, if the EDIE bit is set to 1 in
EDMDR together with the EDA bit in EDMDR, enabling interrupt requests, an interrupt will be
requested since EDIE = 1 and IRF = 1. To prevent the occurrence of an erroneous interrupt request
when transfer starts, ensure that the IRF bit is cleared to 0 before the EDIE bit is set to 1.
If the last EXDMAC transfer cycle and a CBR refresh cycle* occur simultaneously, note that
although the CBR refresh* and the last transfer cycle may be executed consecutively, ETEND
may also go low in this case for the refresh cycle*.
10.1 Features
• Transfer possible over any number of channels
• Three transfer modes
1. Normal mode
One operation transfers one byte or one word of data.
Memory address is incremented or decremented by 1 or 2.
From 1 to 65,536 transfers can be specified.
2. Repeat mode
One operation transfers one byte or one word of data.
Memory address is incremented or decremented by 1 or 2.
Once the specified number of transfers (1 to 256) has ended, the initial state is restored, and
transfer is repeated.
3. Block transfer mode
One operation transfers one block of data.
The block size is 1 to 256 bytes or words.
From 1 to 65,536 transfers can be specified.
Either the transfer source or the transfer destination is designated as a block area.
• One activation source can trigger a number of data transfers (chain transfer)
• Direct specification of 16-Mbyte address space possible
• Activation by software is possible
• Transfer can be set in byte or word units
• A CPU interrupt can be requested for the interrupt that activated the DTC
• Read skip of the transfer information can be specified
• Writeback skip is executed for the fixed transfer source and destination addresses
• Module stop state can be set
The DTC's register information is stored in the on-chip RAM. When the DTC is used, the RAME
bit in SYSCR must be set to 1 and the MSTP33 and MSTP32 bits in RMMSTPCR must be
cleared to 0. A 32-bit bus connects the DTC to the on-chip RAM (1 Kbyte), enabling 32-bit/1-
state reading and writing of the DTC register information.
Peripheral bus
DTCCR SAR
Bus interface
External
External bus
memory
External device
(memory
mapped)
Bus controller REQ
DTCVBR ACK
[Legend]
MRA and MRB: DTC mode registers A and B
SAR: DTC source address register
DAR: DTC destination address register
CRA and CRB: DTC transfer count registers A and B
DTCERA to DTCERI: DTC enable registers A to I
DTCCR: DTC control register
DTCVBR: DTC vector base register
These six registers cannot be directly accessed from the CPU. When activated, the DTC reads a
set of register information that is stored in an on-chip RAM to the corresponding DTC registers
and transfers data. After the data transfer, it writes a set of updated register information back to the
RAM.
SAR is a 24-bit register that designates the source address of data to be transferred by the DTC.
For word-size transfer, specify an even source address.
DAR is a 24-bit register that designates the destination address of data to be transferred by the
DTC. For word-size transfer, specify an even destination address.
CRA is a 16-bit register that designates the number of times data is to be transferred by the DTC.
In normal mode, the entire CRA functions as a 16-bit transfer counter (1 to 65,536). It is
decremented by 1 every time data is transferred, and transfer ends when the count reaches H'0000.
In repeat mode or block transfer mode, the CRA is divided into two parts: the upper 8 bits
(CRAH) and the lower 8 bits (CRAL). CRAH holds the number of transfers while CRAL
functions as an 8-bit transfer counter (1 to 256). CRAL is decremented by 1 every time data is
transferred, and the contents of CRAH are sent when the count reaches H'00.
CRB is a 16-bit register that designates the number of times data is to be transferred by the DTC in
block transfer mode. It functions as a 16-bit transfer counter (1 to 65,536) that is decremented by 1
every time data is transferred, and transfer ends when the count reaches H'0000. The CRB is not
available in normal and repeat modes.
DTCER which is comprised of registers, DTCERA to DTCERI, is a register that specifies DTC
activation interrupt sources. The correspondence between interrupt sources and DTCE bits is
shown in table 10.2. For DTCE bit setting, use bit manipulation instructions such as BSET and
BCLR for reading and writing. If all interrupts are masked, multiple activation sources can be set
at one time (only at the initial setting) by writing data after executing a dummy read on the
relevant register.
DTCVBR is a 32-bit register that specifies the base address for vector table address calculation.
Bits 31 to 24 and 11 to 0 are fixed to 0 and cannot be modified.
When an interrupt has been designated a DTC activation source, existing CPU mask level and
interrupt controller priorities have no effect. If there is more than one activation source at the same
time, the DTC operates in accordance with the default priorities.
Table 10.1 shows a relationship between activation sources and DTCER clear conditions. Figure
10.2 shows a block diagram of activation source control. For details see section 6, Interrupt
Controller.
DTCER
Clear request
Select
On-chip
peripheral DTC
Selection circuit
modules
IRQ interrupt
Interrupt
request
When the DTC is activated by software, the vector address is obtained from: DTCVBR[23:0] +
H'0400 + (DTVECR[7:0] × 2). For example, if DTCVBR is H'000000 while DTVECR is H'10,
the vector address is H'000420.
The configuration of the vector address is the same in both normal mode* and advanced mode, a
2-byte unit being used in both cases. These two bytes specify the lower bits of the register
information start address.
Lower addresses
0 1 2 3
Start address of MRA SAR
register information
MRB DAR Register information
CRA CRB
Chain transfer
MRA SAR Register information
for second transfer
MRB DAR
in case of chain
CRA CRB transfer
Four bytes
Figure 10.3 Correspondence between DTC Vector Address and Register Information
Chain transfer
Figure 10.4 Correspondence between DTC Vector Address and Register Information
Table 10.2 Interrupt Sources, DTC Vector Addresses, and Corresponding DTCEs
Origin of
Activation Activation Vector DTC Vector
1
Source Source Number Address DTCE* Priority
Software Write to DTVECR DTCVBR[23:0] + ⎯ High
DTVECR H'0400 +
(DTVECR[7:0] × 2)
External pin IRQ0 16 H'0420 DTCEA7
IRQ1 17 H'0422 DTCEA6
IRQ2 18 H'0424 DTCEA5
IRQ3 19 H'0426 DTCEA4
IRQ4 20 H'0428 DTCEA3
IRQ5 21 H'042A DTCEA2
IRQ6 22 H'042C DTCEA1
IRQ7 23 H'042E DTCEA0
IRQ8*2 24 H'0430 DTCEB7
2
IRQ9* 25 H'0432 DTCEB6
2
IRQ10* 26 H'0434 DTCEB5
2
IRQ11* 17 H'0436 DTCEB4
2
IRQ12* 18 H'0438 DTCEB3
2
IRQ13* 19 H'043A DTCEB2
2
IRQ14* 30 H'043C DTCEB1
2
IRQ15* 31 H'043E DTCEB0
A/D_0 ADI0 38 H'044C DTCEC6
TPU_0 TGI0A 40 H'0450 DTCEC5
TGI0B 41 H'0452 DTCEC4
TGI0C 42 H'0454 DTCEC3
TGI0D 43 H'0456 DTCEC2
TPU_1 TGI1A 48 H'0460 DTCEC1
TGI1B 49 H'0462 DTCEC0 Low
Origin of
Activation Activation Vector DTC Vector
1
Source Source Number Address DTCE* Priority
TPU_2 TGI2A 52 H'0468 DTCED7 High
TGI2B 53 H'046A DTCED6
TPU_3 TGI3A 56 H'0470 DTCED5
TGI3B 57 H'0472 DTCED4
TGI3C 58 H'0474 DTCED3
TGI3D 59 H'0476 DTCED2
TPU_4 TGI4A 64 H'0480 DTCED1
TGI4B 65 H'0482 DTCED0
TPU_5 TGI5A 68 H'0488 DTCEE7
TGI5B 69 H'048A DTCEE6
TMR_0 CMIA0 72 H'0490 DTCEE3
CMIB0 73 H'0492 DTCEE2
TMR_1 CMIA1 76 H'0498 DTCEE1
CMIB1 77 H'049A DTCEE0
DMAC DMTEND0/ 80 H'04A0 DTCEF7
DMTEND4*3
DMTEND1/ 81 H'04A2 DTCEF6
DMEEND4*3
DMTEND2/ 82 H'04A4 DTCEF5
DMTEND4/
DMTEND5*3
DMTEND3/ 83 H'04A6 DTCEF4
DMEEND4/
DMEEND5*3
SCI_0 RXI0 89 H'04B2 DTCEF3
TXI0 90 H'04B4 DTCEF2
SCI_1 RXI1 93 H'04BA DTCEF1
TXI1 94 H'04BC DTCEF0
SCI_2 RXI2 97 H'04C2 DTCEG7
TXI2 98 H'04C4 DTCEG6
SCI_3 RXI3 101 H'04CA DTCEF5
TXI3 102 H'04CC DTCEF4 Low
Origin of
Activation Activation Vector DTC Vector
1
Source Source Number Address DTCE* Priority
SCI_4 RXI4 105 H'04D2 DTCEG3 High
TXI4 106 H'04D4 DTCEG2
A/D_1 ADI1 112 H'04E0 DTCEG1
TPU_6 TGI6A 120 H'04F0 DTCEG0
TGI6B 121 H'04F2 DTCEH7
TGI6C 122 H'04F4 DTCEH6
TGI6D 123 H'04F6 DTCEH5
TPU_7 TGI7A 125 H'04FA DTCEH4
TGI7B 126 H'04FC DTCEH3
TPU_8 TGI8A 129 H'0502 DTCEH2
TGI8B 130 H'0504 DTCEH1
TPU_9 TGI9A 133 H'050A DTCEH0
TGI9B 134 H'050C DTCEI7
TGI9C 135 H'050E DTCEI6
TGI9D 136 H'0510 DTCEI5
TPU_10 TGI10A 138 H'0514 DTCEI4
TGI10B 139 H'0516 DTCEI3
TPU_11 TGI11A 142 H'051C DTCEI2
TGI11B 143 H'051E DTCEI1
SSU SSRXI 156 H'0538 DTCEK5
SSTXI 157 H'053A DTCEK4 Low
Notes: 1. DTCE bits with no corresponding interrupt are reserved, and 0 should be written to.
When clearing the software standby state or all-module-clocks-stop mode with an
interrupt, write 0 to the corresponding DTCE bit.
2. Not supported by the H8S/2425 Group.
3. For details, see section 8, DMA Controller (DMAC).
10.5 Operation
The DTC stores register information in the on-chip RAM. When activated, the DTC reads register
information that is already stored in the on-chip RAM and transfers data on the basis of that
register information. After the data transfer, it writes updated register information back to the on-
chip RAM. Pre-storage of register information in the on-chip RAM makes it possible to transfer
data over any required number of channels. There are three transfer modes: normal mode, repeat
mode, and block transfer mode. Setting the CHNE bit to 1 makes it possible to perform a number
of transfers with a single activation (chain transfer). A setting can also be made to have chain
transfer performed only when the transfer counter value is 0. This enables DTC re-setting to be
performed by the DTC itself.
The 24-bit SAR designates the DTC transfer source address and the 24-bit DAR designates the
transfer destination address. After each transfer, SAR and DAR are independently incremented,
decremented, or left fixed.
Figure 10.5 shows a flowchart of DTC operation, and table 10.3 summarizes the chain transfer
conditions (combinations for performing the second and third transfers are omitted).
Start
Next transfer
Data transfer
CHNE = 1?
Yes
No
CHNS = 0?
Yes
No
Transfer counter = 0
or DISEL = 1? Yes Transfer
counter = 0? Yes
No
No
DISEL = 1?
Yes
No
By setting the RRS bit in DTCCR, the vector address read and transfer information read can be
skipped. The current DTC vector number is always compared with the vector number of previous
activation. If the vector numbers match when the RRS bit is 1, a DTC data transfer is performed
without reading the vector address and transfer information. If the previous activation is a chain
transfer or the transfer counter is 0, the vector address read and transfer information read are
always performed. Figure 10.6 shows the timing chart of transfer information read skip.
To modify the vector table and transfer information, temporarily clear the RRS bit to 0, modify the
vector table and transfer information, and then set the RRS bit to 1 again. When the RRS bit is
cleared to 0 or the DTCE bit is cleared to 0, the stored vector number is discarded, and the updated
vector table and transfer information are read at the next activation.
Clock
DTC request
Transfer
information
read skip
Address R W R W
Note: Transfer information read is skipped when the activation sources (vector numbers) of (1) and (2) are the same while RRS = 1.
By setting the SM1 and DM1 bits to the fixed address mode, a part of transfer information will not
be written back (writeback skipped). This function is performed regardless of the short address
mode or full address mode.
Table 10.4 shows the transfer information writeback skip condition and writeback skipped
registers. Note that CRA and CRB are always written back regardless of the short address mode or
full address mode. In addition in full address mode, the writeback of MRA and MRB are always
skipped.
In normal mode, one operation transfers one byte or one word of data. Table 10.5 lists the register
function in normal mode. From 1 to 65,536 transfers can be specified. Once the specified number
of transfers has ended, a CPU interrupt can be requested.
SAR DAR
Transfer
In repeat mode, one operation transfers one byte or one word of data. Table 10.6 lists the register
function in repeat mode. From 1 to 256 transfers can be specified. Once the specified number of
transfers has ended, the initial state of the transfer counter and the address register specified as the
repeat area is restored, and transfer is repeated. In repeat mode the transfer counter value does not
reach H'00, and therefore CPU interrupts cannot be requested when DISEL = 0.
SAR DAR
or Repeat area or
DAR SAR
Transfer
In block transfer mode, one operation transfers one block of data. Either the transfer source or the
transfer destination is designated as a block area. Table 10.7 lists the register function in block
transfer mode. The block size is 1 to 256. When the transfer of one block ends, the initial state of
the block size counter and the address register specified as the block area is restored. The other
address register is then incremented, decremented, or left fixed. From 1 to 65,536 transfers can be
specified. Once the specified number of transfers has ended, a CPU interrupt is requested.
First block
SAR DAR
or Block area or
DAR SAR
Transfer
Nth block
Setting the CHNE bit to 1 enables a number of data transfers to be performed consecutively in
response to a single transfer request. SAR, DAR, CRA, CRB, MRA, and MRB, which define data
transfers, can be set independently.
Figure 10.10 shows the operation of chain transfer. When activated, the DTC reads the register
information start address stored at the vector address, and then reads the first register information
at that start address. The CHNE bit in MRB is checked after the end of data transfer, if the value is
1, the next register information, which is located consecutively, is read and transfer is performed.
This operation is repeated until the end of data transfer of register information with CHNE = 0. It
is also possible, by setting both the CHNE bit and CHNS bit to 1, to specify execution of chain
transfer only when the transfer counter value is 0.
In the case of transfer with CHNE set to 1, an interrupt request to the CPU is not generated at the
end of the specified number of transfers or by setting of the DISEL bit to 1, and the interrupt
source flag for the activation source is not affected.
Source
Destination
Register information
CHNE=1
DTC vector Register information
address start address
Register information
CHNE=0
Source
Destination
An interrupt request is issued to the CPU when the DTC finishes the specified number of data
transfers, or a data transfer for which the DISEL bit was set to 1. In the case of interrupt
activation, the interrupt set as the activation source is generated. These interrupts to the CPU are
subject to CPU mask level and interrupt controller priority level control.
In the case of activation by software, a software activated data transfer end interrupt (SWDTEND)
is generated when the SWDTIE bit is set to 1.
When the DISEL bit is 1 and one data transfer has ended, or the specified number of transfers has
ended, after data transfer ends, the SWDTIF bit is set to 1 and an SWDTEND interrupt is
generated. The interrupt handling routine should clear the SWDTIF bit to 0.
When the DTC is activated by software, an SWDTEND interrupt is not generated during a data
transfer wait or during data transfer even if the SWDTE bit and SWDTIE bit are set to 1.
DTC activation
request
DTC
request
Data transfer
Vector read
Address Read Write
Transfer Transfer
information read information write
Figure 10.11 DTC Operation Timing (Example in Normal Mode or Repeat Mode)
DTC activation
request
DTC
request
Transfer Transfer
information read information write
DTC activation
request
DTC
request Data transfer Data transfer
Vector read
Read Write Read Write
Address
Table 10.8 lists execution status for a single DTC data transfer, and table 10.9 shows the number
of states required for each execution status.
On- On-
Chip Chip On-Chip I/O
Object to be Accessed RAM ROM Registers External Devices
Bus width 32 16 8 16 8 16
Access states 1 1 2 2 2 3 2 3
Execution Vector read SI ⎯ 1 ⎯ ⎯ 4 6+2m 2 3+m
status
Register information 1 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
read/write SJ
Byte data read SK 1 1 2 2 2 3+m 2 3+m
Word data read SK 1 1 4 2 4 6+2m 2 3+m
Byte data write SL 1 1 2 2 2 3+m 2 3+m
Word data write SL 1 1 4 2 4 6+2m 2 3+m
Internal operation SM 1
The number of execution states is calculated from the formula below. Note that Σ means the sum
of all transfers activated by one activation event (the number in which the CHNE bit is set to 1,
plus 1).
For example, when the DTC vector address table is located in on-chip ROM, normal mode is set,
and data is transferred from the on-chip ROM to an internal I/O register, the time required for the
DTC operation is 13 states. The time from activation to the end of the data write is 10 states.
The procedure for using the DTC with interrupt activation is as follows:
1. Set the MRA, MRB, SAR, DAR, CRA, and CRB register information in the on-chip RAM.
2. Set the start address of the register information in the DTC vector address.
3. Set the corresponding bit in DTCER to 1.
4. Set the enable bits for the interrupt sources to be used as the activation sources to 1. The DTC
is activated when an interrupt used as an activation source is generated.
5. After the end of one data transfer, or after the specified number of data transfers have ended,
the DTCE bit is cleared to 0 and a CPU interrupt is requested. If the DTC is to continue
transferring data, set the DTCE bit to 1.
The procedure for using the DTC with software activation is as follows:
1. Set the MRA, MRB, SAR, DAR, CRA, and CRB register information in the on-chip RAM.
2. Set the start address of the register information in the DTC vector address.
3. Check that the SWDTE bit is 0.
4. Write 1 to the SWDTE bit and the vector number to DTVECR.
5. Check the vector number written to DTVECR.
6. After the end of one data transfer, if the DISEL bit is 0 and a CPU interrupt is not requested,
the SWDTE bit is cleared to 0. If the DTC is to continue transferring data, set the SWDTE bit
to 1. When the DISEL bit is 1, or after the specified number of data transfers have ended, the
SWDTE bit is held at 1 and a CPU interrupt is requested.
An example is shown in which the DTC is used to receive 128 bytes of data via the SCI.
1. Set MRA to fixed source address (SM1 = SM0 = 0), incrementing destination address (DM1 =
1, DM0 = 0), normal mode (MD1 = MD0 = 0), and byte size (Sz = 0). The DTS bit can have
any value. Set MRB for one data transfer by one interrupt (CHNE = 0, DISEL = 0). Set the
SCI RDR address in SAR, the start address of the RAM area where the data will be received in
DAR, and 128 (H'0080) in CRA. CRB can be set to any value.
2. Set the start address of the register information at the DTC vector address.
3. Set the corresponding bit in DTCER to 1.
4. Set the SCI to the appropriate receive mode. Set the RIE bit in SCR to 1 to enable the receive
data full (RXI) interrupt. Since the generation of a receive error during the SCI reception
operation will disable subsequent reception, the CPU should be enabled to accept receive error
interrupts.
5. Each time reception of one byte of data ends on the SCI, the RDRF flag in SSR is set to 1, an
RXI interrupt is generated, and the DTC is activated. The receive data is transferred from RDR
to RAM by the DTC. DAR is incremented and CRA is decremented. The RDRF flag is
automatically cleared to 0.
6. When CRA becomes 0 after the 128 data transfers have ended, the RDRF flag is held at 1, the
DTCE bit is cleared to 0, and an RXI interrupt request is sent to the CPU. The interrupt
handling routine should perform wrap-up processing.
An example of DTC chain transfer is shown in which pulse output is performed using the PPG.
Chain transfer can be used to perform pulse output data transfer and PPG output trigger cycle
updating. Repeat mode transfer to NDR of the PPG is performed in the first half of the chain
transfer, and normal mode transfer to the TPU's TGR in the second half. This is because clearing
of the activation source and interrupt generation at the end of the specified number of transfers are
restricted to the second half of the chain transfer (transfer when CHNE = 0).
1. Perform settings for transfer to NDR of the PPG. Set MRA to source address incrementing
(SM1 = 1, SM0 = 0), fixed destination address (DM1 = DM0 = 0), repeat mode (MD1 = 0,
MD0 = 1), and word size (Sz = 1). Set the source side as a repeat area (DTS = 1). Set MRB to
chain mode (CHNE = 1, DISEL = 0). Set the data table start address in SAR, the NDRH
address in DAR, and the data table size in CRAH and CRAL. CRB can be set to any value.
2. Perform settings for transfer to the TPU's TGR. Set MRA to source address incrementing
(SM1 = 1, SM0 = 0), fixed destination address (DM1 = DM0 = 0), normal mode (MD1 = MD0
= 0), and word size (Sz = 1). Set the data table start address in SAR, the TGRA address in
DAR, and the data table size in CRA. CRB can be set to any value.
3. Locate the TPU transfer register information consecutively after the NDR transfer register
information.
4. Set the start address of the NDR transfer register information to the DTC vector address.
5. Set the bit corresponding to TGIA in DTCER to 1.
6. Set TGRA as an output compare register (output disabled) with TIOR, and enable the TGIA
interrupt with TIER.
7. Set the initial output value in PODR, and the next output value in NDR. Set bits in DDR and
NDER for which output is to be performed to 1. Using PCR, select the TPU compare match to
be used as the output trigger.
8. Set the CST bit in TSTR to 1, and start the TCNT count operation.
9. Each time a TGRA compare match occurs, the next output value is transferred to NDR and the
set value of the next output trigger period is transferred to TGRA. The activation source TGFA
flag is cleared.
10. When the specified number of transfers are completed (the TPU transfer CRA value is 0), the
TGFA flag is held at 1, the DTCE bit is cleared to 0, and a TGIA interrupt request is sent to the
CPU. Termination processing should be performed in the interrupt handling routine.
By executing a second data transfer, and performing re-setting of the first data transfer, only when
the counter value is 0, it is possible to perform 256 or more repeat transfers.
An example is shown in which a 128-Kbyte input buffer is configured. The input buffer is
assumed to have been set to start at lower address H'0000. Figure 10.14 shows the chain transfer
when the counter value is 0.
1. For the first transfer, set the normal mode for input data. Set fixed transfer source address
(G/A, etc.), CRA = H'0000 (65,536 times), and CHNE = 1, CHNS = 1, and DISEL = 0.
2. Prepare the upper 8-bit addresses of the start addresses for each of the 65,536 transfer start
addresses for the first data transfer in a separate area (in ROM, etc.). For example, if the input
buffer comprises H'200000 to H'21FFFF, prepare H'21 and H'20.
3. For the second transfer, set repeat mode (with the source side as the repeat area) for re-setting
the transfer destination address for the first data transfer. Use the upper 8 bits of DAR in the
first register information area as the transfer destination. Set CHNE = DISEL = 0. If the above
input buffer is specified as H'200000 to H'21FFFF, set the transfer counter to 2.
4. Execute the first data transfer 65,536 times by means of interrupts. When the transfer counter
for the first data transfer reaches 0, the second data transfer is started. Set the upper 8 bits of
the transfer source address for the first data transfer to H'21. The lower 16 bits of the transfer
destination address of the first data transfer and the transfer counter are H'0000.
5. Next, execute the first data transfer the 65,536 times specified for the first data transfer by
means of interrupts. When the transfer counter for the first data transfer reaches 0, the second
data transfer is started. Set the upper 8 bits of the transfer source address for the first data
transfer to H'20. The lower 16 bits of the transfer destination address of the first data transfer
and the transfer counter are H'0000.
6. Steps 4 and 5 are repeated endlessly. As repeat mode is specified for the second data transfer,
an interrupt request is not sent to the CPU.
Input circuit
Input buffer
First data
transfer register
information
Chain transfer
(counter = 0)
Second data
Upper 8 bits
transfer register
of DAR
information
An example is shown in which the DTC is used to transfer a block of 128 bytes of data by means
of software activation. The transfer source address is H'1000 and the destination address is
H'2000. The vector number is H'60 and DTCVBR is H'000000, so the vector address is H'0004C0.
1. Set MRA to incrementing source address (SM1 = 1, SM0 = 0), incrementing destination
address (DM1 = 1, DM0 = 0), block transfer mode (MD1 = 1, MD0 = 0), and byte size (Sz =
0). The DTS bit can have any value. Set MRB for one block transfer by one interrupt (CHNE =
0). Set the transfer source address (H'1000) in SAR, the destination address (H'2000) in DAR,
and 128 (H'8080) in CRA. Set 1 (H'0001) in CRB.
2. Set the start address of the register information at the DTC vector address (H'04C0).
3. Check that the SWDTE bit in DTCCR is 0. Check that there is currently no transfer activated
by software.
4. Write 1 to the SWDTE and SWDTIE bits, and the vector number (H'60) to DTVECR. The
write data is H'60.
5. Read DTVECR again and check that it is set to the vector number (H'60). If it is not, this
indicates that the write failed. This is presumably because an interrupt occurred between steps
3 and 4 and led to a different software activation. To activate this transfer, go back to step 3.
6. If the write was successful, the DTC is activated and a block of 128 bytes of data is transferred.
7. After the transfer, an SWDTEND interrupt occurs. The interrupt handling routine should clear
the SWDTIF bit to 0 and perform other wrap-up processing.
DTC operation can be disabled or enabled using the module stop control register. The initial
setting is for DTC operation to be enabled. Register access is disabled by setting the module stop
state. The module stop state cannot be set while the DTC is activated. For details, refer to section
25, Power-Down Modes.
The MRA, MRB, SAR, DAR, CRA, and CRB registers are all located in on-chip RAM. When the
DTC is used, the RAME bit in SYSCR must not be cleared to 0 and the pertinent MSTP bit in
RMMSTPCR must not be set to 1.
The transfer information start address to be specified in the vector table should be address 4n. If an
address other than address 4n is specified, the lowest 2 bits of the address are regarded as 0s.
For DTCE bit setting, use bit manipulation instructions such as BSET and BCLR. If all interrupts
are disabled, multiple activation sources can be set at one time (only at the initial setting) by
writing data after executing a dummy read on the relevant register.
When DTC transfer is activated by a DMAC transfer end interrupt, regardless of the transfer
counter and DISEL bit, the DMAC's DTE bit is not subject to DTC control, and the write data has
priority. Consequently, an interrupt request may not be sent to the CPU when the DTC transfer
counter reaches 0.
When chain transfer is used, clearing of the activation source or DTCER is performed when the
last of the chain of data transfers is executed. SCI and high-speed A/D converter
interrupt/activation sources, on the other hand, are cleared when the DTC reads or writes to the
prescribed register. Therefore, when the DTC is activated by an interrupt or activation source, if a
read/write of the relevant register is not included in the last chained data transfer, the interrupt or
activation source will be retained.
Ports A to E have a built-in pull-up MOS function and a pull-up MOS control register (PCR) to
control the on/off state of the input pull-up MOS.
Ports 1 to 3, 5 to 8, and A to J include an open-drain control register (ODR) that controls the
on/off state of the output buffer PMOS.
Ports 1 to 3 and 5 to 8 can drive a single TTL load and 30-pF capacitive load. Ports A to J can
drive a single TTL load and 50-pF capacitive load.
Ports 1 and 2 are Schmitt-triggered inputs. The other ports are Schmitt-triggered inputs when used
as IRQ inputs, 16-bit timer pulse unit (TPU) inputs, 8-bit timer (TMR) inputs, and I2C bus
interface (IIC) inputs.
Port 1 General I/O port also P17/PO15/TIOCB2/TCLKD/EDRAK3/ P17/PO15/ P17, ⎯ All output ⎯
functioning as SCS0-A TIOCB2/ TIOCB2, pin
PPG outputs, TCLKD/ TCLKD functions
TPU I/Os, SCS0-A
EXDMAC outputs,
P16/PO14/TIOCA2/EDRAK2/SSCK0-A P16/PO14/ P16,
and SSU I/Os
TIOCA2/ TIOCA2
SSCK0-A
P15/PO13/TIOCB1/TCLKC/SSI0-A P15,
TIOCB1
P14/PO12/TIOCA1/SSO0-A P14,
TIOCA1
Port 2 General I/O port also P27/IRQ15-B/PO7/TIOCB5/SCL2 All input pin ⎯ All output Ο
functioning as functions pin
PPG outputs, functions
P26/IRQ14-B/PO6/TIOCA5/SDA2/ADTRG1 P26,
TPU I/Os, interrupt
IRQ14-B,
inputs, SCI I/Os,
2
TIOCA5,
I C I/Os,
SDA2
A/D converter inputs,
and bus control signal P25/WAIT-B/IRQ13-B/PO5-A/TIOCB4-A P25/ P25,
I/Os IRQ13-B/ IRQ13-B,
PO5-A/ TIOCB4-A
TIOCB4-A
P24/IRQ12-B/PO4-A/TIOCA4-A/RxD4-A P24,
IRQ12-B,
TIOCA4-A
P21/IRQ9-B/PO1-A/TIOCB3-A
P20/IRQ8-B/PO0-A/TIOCA3-A
Port 3 General I/O port also P35/OE-B*2/CKE-B*1/SCK1/SCL0 P35/SCK1/ SCL0 ⎯ All output Ο
functioning as SCL0 pin
SCI I/Os, I2C I/Os, functions
and bus control signal other than
I/Os OE-B*2
and CKE-
B*1
P31/TxD1 ⎯ ⎯
P30/TxD0/IrTxD
P43/AN3_0
P42/AN2_0
P41/AN1_0
P40/AN0_0
P62/IRQ10-A/TEND0/TEND1/TEND4/TMCI0-A IRQ10-A,
TMCI0-A
P61/IRQ9-A/DREQ1/DREQ3/DREQ5/TMRI1-A IRQ9-A,
TMRI1-A
P60/IRQ8-A/DREQ0/DREQ1/DREQ4/TMRI0-A IRQ11-A,
TMRI0-A
Port 8 General I/O port also P85/IRQ5-B/PO5-B/TIOCB4-B/TIOCA9-B/ P85/IRQ5-B/ IRQ5-B, ⎯ All output ⎯
functioning as TMO1-B/SCK3/EDACK3 PO5-B/ TIOCB4-B, pin
EXDMAC I/Os, TIOCB4-B/ TIOCA9-B functions
PPG outputs, TIOCA9-B/
TPU I/Os, TMR I/Os, TMO1-B/
SCI I/Os and interrupt SCK3
inputs
P84/IRQ4-B/EDACK2 P84/IRQ4-B IRQ4-B
P92/AN10_1
P91/AN9_1
P90/AN8_1
Port A General I/O port also PA7/A23/IRQ7-A/ PA7/A23/IRQ7-A/ PA7/IRQ7-A/ IRQ7-A Ο All output ⎯
functioning as SSO0-B/FSIDO SSO0-B/FSIDO SSO0-B/ pin
address outputs, FSIDO functions
interrupt inputs, SSU other than
PA6/A22/IRQ6-A/ PA6/A22/IRQ6-A/ PA6/IRQ6-A/ IRQ6-A
I/Os, SCI I/Os, and address
SSI0-B/FSIDI SSI0-B/FSIDI SSI0-B/FSIDI
FSI I/Os outputs
PA5/A21/IRQ5-A/ PA5/A21/IRQ5-A/ PA5/IRQ5-A/ IRQ5-A
SSCK0-B/FSICK SSCK0-B/FSICK SSCK0-B/
FSICK
Port B General I/O port also A15 PB7/A15 PB7/TIOCB8/ TIOCB8/ Ο All output ⎯
functioning as TCLKH TCLKH pin
address outputs and functions
A14 PB6/A14 PB6/TIOCA8 TIOCA8
TPU I/Os other than
A13 PB5/A13 PB5/TIOCB7/ TIOCB7/ address
TCLKG TCLKG outputs
Port C General I/O port also A7 PC7/A7 PC7/TIOCB11 TIOCB11 Ο All output ⎯
functioning as pin
A6 PC6/A6 PC6/TIOCA11 TIOCA11
address outputs and functions
TPU I/Os A5 PC5/A5 PC5/TIOCB10 TIOCB10 other than
address
A4 PC4/A4 PC4/TIOCA10 TIOCA10
outputs
A3 PC3/A3 PC3/TIOCD9 TIOCD9
D8/AD8 PD0
PE0/D0/AD0 PE0
Port H General I/O port also PH3/CS7/OE-A*2/CKE-A*1/IRQ7-B PH3/IRQ7-B IRQ7-B ⎯ All output ⎯
functioning as pin
interrupt inputs and functions
bus control signal other than
I/Os CS7,
OE-A*2
and
CKE-A*1
P14/DACK0/DACK1/PO12/TIOCA1/SSO0-A P14,
TIOCA1
Port 2 General I/O port P27/PO7/TIOCB5/SCL2 All input pin ⎯ All output O
also functioning functions pin
as PPG outputs, functions
P26/PO6/TIOCA5/SDA2/ADTRG1 P26,
TPU I/Os,
TIOCA5,
SCI I/Os,
SDA2
TMR I/Os,
2
I C I/Os, P25/WAIT-B/PO5-A/TIOCB4-A/TMO1-A P25/PO5-A/ P25,
A/D converter TIOCB4-A/ TIOCB4-A
inputs, and bus TMO1-A
control signal P24/PO4-A/TIOCA4-A/TMO0-A/RxD4-A P24,
I/Os TIOCA4-A
P21/PO1-A/TIOCB3-A/TMRI1-A
P20/PO0-A/TIOCA3-A/TMRI0-A
P31/TxD1 ⎯ ⎯
P30/TxD0/IrTxD
P43/IRQ3-B/AN3_0 IRQ3-B
P42/IRQ2-B/AN2_0 IRQ2-B
P41/IRQ1-B/AN1_0 IRQ1-B
P40/IRQ0-B/AN0_0 IRQ0-B
Port A General I/O port PA7/A23/CS7/ PA7/A23/CS7/IRQ7-A/ PA7/IRQ7-A/ IRQ7-A O All output ⎯
also functioning IRQ7-A/SSO0-B/ SSO0-B/FSIDO SSO0-B/ pin
as address FSIDO FSIDO functions
outputs, SSU other than
PA6/A22/IRQ6-A/ PA6/A22/IRQ6-A/ PA6/IRQ6-A/ IRQ6-A
I/Os, SCI I/Os, address
FSIDI/SSI0-B SSI0-B/FSIDI SSI0-B/FSIDI
FSI I/Os, and bus outputs and
control signal PA5/A21/IRQ5-A/ PA5/A21/IRQ5-A/ PA5/IRQ5-A/ IRQ5-A CS7
outputs SSCK0-B/FSICK SSCK0-B/FSICK SSCK0-B/
FSICK
Port B General I/O port A15 PB7/A15 PB7/TIOCB8/ TIOCB8/ Ο All output ⎯
also functioning TCLKH TCLKH pin
as address functions
A14 PB6/A14 PB6/TIOCA8 TIOCA8
outputs and TPU other than
I/Os A13 PB5/A13 PB5/TIOCB7/ TIOCB7/ address
TCLKG TCLKG outputs
A12 PB4/A12 PB4/TIOCA7 TIOCA7
D9/AD9 PD1
D8/AD8 PD0
PE1/D1/AD1 PE1
PE0/D0/AD0 PE0
11.1 Port 1
Port 1 is an 8-bit I/O port that also has other functions. Port 1 has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of P1DDR specify input or output for the pins of port 1.
5 P15DR 0 R/W
4 P14DR 0 R/W
3 P13DR 0 R/W
2 P12DR 0 R/W
1 P11DR 0 R/W
0 P10DR 0 R/W
Port 1 pins also function as the pins for PPG outputs, TPU I/Os, EXDMAC outputs (H8S/2427
Group, H8S/2427R Group), SSU I/Os, and DMAC I/Os (H8S/2425 Group). The correspondence
between the register specification and the pin functions is shown below.
• P17/PO15/TIOCB2/TCLKD/EDRAK3/SCS0-A
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 2 settings (by bits MD3 to MD0 in TMDR_2, bits IOB3 to
IOB0 in TIOR_2, and bits CCLR1 and CCLR0 in TCR_2), bits TPSC2 to TPSC0 in TCR_0
and TCR_5, bit NDER15 in NDERH of the PPG, bit EDRAKE in EDMDR_3 of the
EXDMAC, bits MSS, CSS1, and CSS0 in SSCRH and bit SSUMS in SSCRL of the SSU, bits
SCS0S1 and SCS0S0 in PFCR5, and bit P17DDR.
SSU settings (1) in table below (2) in table (4) in table (3) in table
below below below
EDRAKE ⎯ ⎯
TPU channel 2 (1) in table (2) in table below ⎯
settings below
P17DDR ⎯ 0 1 1 0*6 0*6 ⎯
NDER15 ⎯ ⎯ 0 1 ⎯
Pin function TIOCB2 P17 P17 PO15 SCS0-A SCS0-A SCS0-A
output input output output input*3*7 I/O*5*7 output*4*7
1
TIOCB2 input*
2
TCLKD input*
Notes: 1. TIOCB2 input when MD3 to MD0 = B'0000 or B'01xx and IOB3 = 1.
2. TCLKD input when the setting for either TCR_0 or TCR_5 is TPSC2 to TPSC0 = B'111.
TCLKD input when phase counting mode is set for channels 2 and 4.
3. When using as SCS0-A input, set SCS0S1 and SCS0S0 in PFCR5 to B'00 before other
register setting.
4. When using as SCS0-A output, set SCS0S1 and SCS0S0 in PFCR5 to B'00 before
other register setting.
5. When using as SCS0-A input/output, set SCS0S1 and SCS0S0 in PFCR5 to B'00
before other register setting.
6. P17DDR = 0 when the SSU pin is used as input.
7. Do not set up for SSU unless SCS0S1 and SCS0S0 = B'00 in RFCR5.
Use as I/O port or TPU pin.
• P16/PO14/TIOCA2/EDRAK2/SSCK0-A
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 2 settings (by bits MD3 to MD0 in TMDR_2, bits IOA3 to
IOA0 in TIOR_2, and bits CCLR1 and CCLR0 in TCR_2), bit NDER14 in NDERH of the
PPG, bit EDRAKE in EDMDR_2 of the EXDMAC, bits MSS and SCKS in SSCRH and bit
SSUMS in SSCRL of the SSU, bits SSCK0S1 and SSCK0S0 in PFCR5, and bit P16DDR.
SSU settings (1) (2) (1) (3) (1) (2) (1) (3)
SSUMS 0 1
MSS 0 1 0 1
SCKS 0 1 0 1 0 1 0 1
Pin state ⎯ SSCK ⎯ SSCK ⎯ SSCK ⎯ SSCK
input output input output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Note: See tables 20.4 to 20.6.
• P15/PO13/TIOCB1/TCLKC/SSI0-A
The pin function is switched as shown below according to the combination of the TPU channel
1 settings (by bits MD3 to MD0 in TMDR_1, bits IOB3 to IOB0 in TIOR_1, and bits CCLR1
and CCLR0 in TCR_1), bits TPSC2 to TPSC0 in TCR_0, TCR_2, TCR_4, and TCR_5, bit
NDER13 in NDERH of the PPG, bits MSS and BIDE in SSCRH, bit SSUMS in SSCRL, and
bits TE and RE in SSER of the SSU, bits SSI0S1 and SSI0S0 in PFCR5, and bit P15DDR.
SSU (1) (1) (3) (3) (2) (1) (2) (1) (1) (1) (1) (2) (1) (2) (2) (1) (2)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ ⎯ SSI SSI SSI ⎯ SSI ⎯ ⎯ ⎯ ⎯ SSI ⎯ SSI SSI ⎯ SSI
output output input input input input input input
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• P14/PO12/TIOCA1/SSO0-A
The pin function is switched as shown below according to the combination of the TPU channel
1 settings (by bits MD3 to MD0 in TMDR_1, bits IOA3 to IOA0 in TIOR_1, and bits CCLR1
and CCLR0 in TCR_1), bit NDER12 in NDERH of the PPG, bits MSS and BIDE in SSCRH,
bit SSUMS in SSCRL, and bits TE and RE in SSER of the SSU, bits SSO0S1 and SSO0S0 in
PFCR5, and bit P14DDR.
SSU (1) (2) (1) (2) (1) (3) (3) (2) (3) (2) (3) (1) (3) (3) (1) (3) (3)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ SSO ⎯ SSO ⎯ SSO SSO SSO SSO SSO SSO ⎯ SSO SSO ⎯ SSO SSO
input input output output input output input output output output output output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• P13/PO11/TIOCD0/TCLKB
The pin function is switched as shown below according to the combination of the TPU channel
0 settings (by bits MD3 to MD0 in TMDR_0, bits IOD3 to IOD0 in TIORL_0, and bits
CCLR2 to CCLR0 in TCR_0), bits TPSC2 to TPSC0 in TCR_0 to TCR_2, bit NDER11 in
NDERH of the PPG, and bit P13DDR.
• P12/PO10/TIOCC0/TCLKA
The pin function is switched as shown below according to the combination of the TPU channel
0 settings (by bits MD3 to MD0 in TMDR_0, bits IOC3 to IOC0 in TIORL_0, and bits CCLR2
to CCLR0 in TCR_0), bits TPSC2 to TPSC0 in TCR_0 to TCR_5, bit NDER10 in NDERH of
the PPG, and bit P12DDR.
• P11/PO9/TIOCB0
The pin function is switched as shown below according to the combination of the TPU channel
0 settings (by bits MD3 to MD0 in TMDR_0, bits IOB3 to IOB0 in TIORH_0, and bits
CCLR2 to CCLR0 in TCR_0), bit NDER9 in NDERH of the PPG, and bit P11DDR.
• P10/PO8/TIOCA0
The pin function is switched as shown below according to the combination of the TPU channel
0 settings (by bits MD3 to MD0 in TMDR_0, bits IOA3 to IOA0 in TIORH_0, and bits
CCLR2 to CCLR0 in TCR_0), bit NDER8 in NDERH of the PPG, and bit P10DDR.
• P17/PO15/TIOCB2/TCLKD/SCS0-A
The pin function is switched as shown below according to the combination of the TPU channel
2 settings (by bits MD3 to MD0 in TMDR_2, bits IOB3 to IOB0 in TIOR_2, and bits CCLR1
and CCLR0 in TCR_2), bits TPSC2 to TPSC0 in TCR_0 and TCR_5, bit NDER15 in NDERH
of the PPG, bits MSS, CSS1, and CSS0 in SSCRH and bit SSUMS in SSCRL of the SSU, bits
SCS0S1 and SCS0S0 in PFCR5, and bit P17DDR.
SSU settings (1) in table below (2) in table (4) in table (3) in table
below below below
TPU channel 2 (1) in table (2) in table below ⎯
settings below
P17DDR ⎯ 0 1 1 0*6 0*6 ⎯
NDER15 ⎯ ⎯ 0 1 ⎯
Pin function TIOCB2 P17 P17 PO15 SCS0-A SCS0-A SCS0-A
output input output output input*3*7 I/O*5*7 output*4*7
1
TIOCB2 input*
2
TCLKD input*
Notes: 1. TIOCB2 input when MD3 to MD0 = B'0000 or B'01xx and IOB3 = 1.
2. TCLKD input when the setting for either TCR_0 or TCR_5 is TPSC2 to TPSC0 = B'111.
TCLKD input when phase counting mode is set for channels 2 and 4.
3. When using as SCS0-A input, set SCS0S1 and SCS0S0 in PFCR5 to B'00 before other
register setting.
4. When using as SCS0-A output, set SCS0S1 and SCS0S0 in PFCR5 to B'00 before
other register setting.
5. When using as SCS0-A input/output, set SCS0S1 and SCS0S0 in PFCR5 to B'00
before other register setting.
6. P17DDR = 0 when the SSU pin is used as input.
7. Do not set up for SSU unless SSO0S1 and SSO0S0 = B'00 in RFCR5.
Use as I/O port or TPU pin.
• P16/PO14/TIOCA2/SSCK0-A
The pin function is switched as shown below according to the combination of the TPU channel
2 settings (by bits MD3 to MD0 in TMDR_2, bits IOA3 to IOA0 in TIOR_2, and bits CCLR1
and CCLR0 in TCR_2), bit NDER14 in NDERH of the PPG, bits MSS and SCKS in SSCRH
and bit SSUMS in SSCRL of the SSU, bits SSCK0S1 and SSCK0S0 in PFCR5, and bit
P16DDR.
SSU settings (1) (2) (1) (3) (1) (2) (1) (3)
SSUMS 0 1
MSS 0 1 0 1
SCKS 0 1 0 1 0 1 0 1
Pin state ⎯ SSCK ⎯ SSCK ⎯ SSCK ⎯ SSCK
input output input output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Note: See tables 20.4 to 20.6.
• P15/DACK1/DACK3/PO13/TIOCB1/TCLKC/SSI0-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bit SAE1 in DMABCRH, and bit SAE in DMAECRS1 of the DMAC, TPU
channel 1 settings (by bits MD3 to MD0 in TMDR_1, bits IOB3 to IOB0 in TIOR_1, and bits
CCLR1 and CCLR0 in TCR_1), bits TPSC2 to TPSC0 in TCR_0, TCR_2, TCR_4, and
TCR_5, bit NDER13 in NDERH of the PPG, bits MSS and BIDE in SSCRH, bit SSUMS in
SSCRL, and bits TE and RE in SSER of the SSU, bits SSI0S1 and SSI0S0 in PFCR5, and bit
P15DDR.
SSU (1) (1) (3) (3) (2) (1) (2) (1) (1) (1) (1) (2) (1) (2) (2) (1) (2)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ ⎯ SSI SSI SSI ⎯ SSI ⎯ ⎯ ⎯ ⎯ SSI ⎯ SSI SSI ⎯ SSI
output output input input input input input input
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• P14/DACK0/DACK1/PO12/TIOCA1/SSO0-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bit SAE0 in DMABCRH, and bit SAE in DMAECRS0 of the DMAC, TPU
channel 1 settings (by bits MD3 to MD0 in TMDR_1, bits IOA3 to IOA0 in TIOR_1, and bits
CCLR1 and CCLR0 in TCR_1), bit NDER12 in NDERH of the PPG, bits MSS and BIDE in
SSCRH, bit SSUMS in SSCRL, and bits TE and RE in SSER of the SSU, bits SSO0S1 and
SSO0S0 in PFCR5, and bit P14DDR.
SSU (1) (2) (1) (2) (1) (3) (3) (2) (3) (2) (3) (1) (3) (3) (1) (3) (3)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ SSO ⎯ SSO ⎯ SSO SSO SSO SSO SSO SSO ⎯ SSO SSO ⎯ SSO SSO
input input output output input output input output output output output output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port)..
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• P13/TEND1/TEND3/TEND5/PO11/TIOCD0/TCLKB
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bits RSEL5, RSEL3, and RSEL2 in DRSEL, bit TEE1 in DMATCR, bit TEE
in DMAECRS1, and bit TEE in DMAECRF5 of the DMAC, TPU channel 0 settings (by bits
MD3 to MD0 in TMDR_0, bits IOD3 to IOD0 in TIORL_0, and bits CCLR2 to CCLR0 in
TCR_0), bits TPSC2 to TPSC0 in TCR_0 to TCR_2, bit NDER11 in NDERH and bit
DMA_SEL1 in PFCR3 of the PPG, and bit P13DDR.
DMAC (1) in table below (2) in table (3) in table (4) in table
settings below below below
TPU (1) in table (2) in table below ⎯ ⎯ ⎯
channel 0 below
settings
P13DDR ⎯ 0 1 ⎯ ⎯ ⎯
NDER11 ⎯ ⎯ 0 ⎯ ⎯ ⎯ ⎯
Pin TIOCD0 P13 input P13 output PO11 TEND1 TEND3 TEND5
function output output output output output
1
TIOCD0 input*
2
TCLKB input*
Notes: 1. TIOCD0 input when MD3 to MD0 = B'0000 and IOD3 to IOD0 = B'10xx.
2. TCLKB input when the setting for any of TCR_0 to TCR_2 is TPSC2 to TPSC0 = B'101.
TCLKB input when phase counting mode is set for channels 1 and 5.
DMAC settings (1) (1) (4) (1) (3) (1) (2) (1) (4)
DMCOMMD 1 0
RSEL5, RSEL3, B'000 B'100 B'01x x
RSEL2
TEE1 x 0 1 0 1 x
DMA_SEL1 x x x x x 0 1
DMAECRS1.TEE x x x x x 0 1 x
DMAECRF5.TEE x x x x x x x 0 1
Output function ⎯ ⎯ TEND5 ⎯ TEND3 ⎯ TEND1 ⎯ TEND5
output output output output
[Legend]
⎯: Not used as the DMAC pin (can be used as an I/O port).
x: Don't care
• P12/TEND0/TEND1/TEND4/PO10/TIOCC0/TCLKA
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bits RSEL4, RSEL1, and RSEL0 in DRSEL, bit TEE0 in DMATCR, bit TEE
in DMAECRS0, and bit TEE in DMAECRF4 of the DMAC, TPU channel 0 settings (by bits
MD3 to MD0 in TMDR_0, bits IOC3 to IOC0 in TIORL_0, and bits CCLR2 to CCLR0 in
TCR_0), bits TPSC2 to TPSC0 in TCR_0 to TCR_5, bit NDER10 in NDERH and bit
DMASEL0 in PFCR3 of the PPG, and bit P12DDR.
DMAC settings (1) in table below (2) in table (3) in table (4) in table
below below below
TPU channel 0 (1) in table (2) in table below ⎯ ⎯ ⎯
settings below
P12DDR ⎯ 0 1 ⎯ ⎯ ⎯
NDER10 ⎯ ⎯ 0 1 ⎯ ⎯ ⎯
Pin function TIOCC0 P12 input P12 PO10 TEND0 TEND1 TEND4
output output output output output output
1
TIOCC0 input*
2
TCLKA input*
DMAC settings (1) (1) (4) (1) (3) (1) (2) (1) (4)
DMCOMMD 1 0
RSEL4, RSEL1, B'000 B'100 B'01x x
RSEL0
TEE0 x 0 1 0 1 x
DMA_SEL0 x x x x x 0 1
DMAECRS0.TEE x x x x x 0 1 x
DMAECRF4.TEE x x x x x x x 0 1
Output function ⎯ ⎯ TEND4 ⎯ TEND1 ⎯ TEND0 ⎯ TEND4
output output output output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
x: Don't care
• P11/DREQ1/DREQ3/DREQ5/PO9/TIOCB0
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR of the DMAC, the TPU channel 0 settings (by bits MD3 to MD0 in TMDR_0,
bits IOB3 to IOB0 in TIORH_0, and bits CCLR2 to CCLR0 in TCR_0), bit NDER9 in
NDERH of the PPG, and bit P11DDR.
• P10/DREQ0/DREQ1/DREQ4/PO8/TIOCA0
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR of the DMAC, the TPU channel 0 settings (by bits MD3 to MD0 in TMDR_0,
bits IOA3 to IOA0 in TIORH_0, and bits CCLR2 to CCLR0 in TCR_0), bit NDER8 in
NDERH of the PPG, and bit P10DDR.
11.2 Port 2
Port 2 is an 8-bit I/O port that also has other functions. Port 2 has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of P2DDR specify input or output for the pins of port 2. P2DDR cannot be
read; if it is, an undefined value will be read.
5 P25DR 0 R/W
4 P24DR 0 R/W
3 P23DR 0 R/W
2 P22DR 0 R/W
1 P21DR 0 R/W
0 P20DR 0 R/W
Port 2 pins also function as the pins for PPG outputs, TPU I/Os, interrupt inputs (H8S/2427
Group, H8S/2427R Group), 8-bit timer I/Os (H8S/2425 Group), I2C I/Os, and bus control signal
inputs. The correspondence between the register specification and the pin functions is shown
below.
• P27/PO7/TIOCB5/IRQ15-B/SCL2
The pin function is switched as shown below according to the combination of the TPU channel
5 settings (by bits MD3 to MD0 in TMDR_5, bits IOB3 to IOB0 in TIOR_5, and bits CCLR1
and CCLR0 in TCR_5), bit NDER7 in NDERL of the PPG, bit ICE in ICCRA_2 of the I2C, bit
P27DDR, and bit ITS15 in ITSR of the interrupt controller.
ICE 0 1
TPU channel 5 (1) in table (2) in table below ⎯
settings below
P27DDR ⎯ 0 1 1 ⎯
NDER7 ⎯ ⎯ 0 1 ⎯
Pin function TIOCB5 output P27 input P27 output PO7 output SCL2 I/O
1
TIOCB5 input*
IRQ15-B interrupt input*2
Notes: 1. TIOCB5 input when MD3 to MD0 = B'0000 or B'01xx and IOB3 = 1.
2. IRQ15-B input when the ITS15 bit in ITSR is 1.
3. NMOS open-drain output regardless of P27ODR.
• P26/PO6/TIOCA5/IRQ14-B/SDA2/ADTRG1
The pin function is switched as shown below according to the combination of the TPU channel
5 settings (by bits MD3 to MD0 in TMDR_5, bits IOA3 to IOA0 in TIOR_5, and bits CCLR1
and CCLR0 in TCR_5), bit NDER6 in NDERL of the PPG, bits TRGS1, TRGS0, and
EXTRGS in ADCR_1 of the ADC, bit ICE in ICCRA_2 of the I2C, bit P26DDR, and bit ITS14
in ITSR of the interrupt controller.
ICE 0 1
TPU channel 5 (1) in table (2) in table below ⎯
settings below
P26DDR ⎯ 0 1 1 ⎯
NDER6 ⎯ ⎯ 0 1 ⎯
Pin function TIOCA5 P26 input P26 output PO6 output SDA2 I/O*5
output 1
TIOCA5 input*
IRQ14-B interrupt input*2
ADTRG1 input*
4
• P25/PO5-A/TIOCB4-A/IRQ13-B/WAIT-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit WAITE in BCR of the bus controller, TPU channel 4 settings (by bits
MD3 to MD0 in TMDR_4, bits IOB3 to IOB0 in TIOR_4, and bits CCLR1 and CCLR0 in
TCR_4), bit NDER5 in NDERL of the PPG, bits PPGS and TPUS in PFCR3, bit WAITS in
PFCR4, bit P25DDR, and bit ITS13 in ITSR of the interrupt controller.
• Mode 3, 5, 7 (EXPE = 0)
WAITE ⎯
TPU channel 4 (1) in table below (2) in table below
settings
P25DDR ⎯ 0 0 1
NDER5 ⎯ ⎯ ⎯ 0
4
Pin function TIOCB4-A output* P25 input P25 output PO5-A output*3
TIOCB4-A input*1*4
IRQ13-B interrupt input*
2
Notes: 1. TIOCB4-A input when MD3 to MD0 = B'0000 or B'01xx and IOB3 to IOB0 = B'10xx.
2. IRQ13-B input when the ITS13 bit in ITSR is 1.
3. When using as PO5-A output, set PPGS in PFCR3 to 0 before other register setting.
4. When using as TIOCB4-A input/output, set TPUS in PFCR3 to 0 before other register
setting.
5. WAIT-B input when the WAITS bit in PFCR4 is 1. Not used as WAIT-B input when
WAITS is 0.
• P24/IRQ12-B/PO4-A/TIOCA4-A/RxD4-A
The pin function is switched as shown below according to the combination of the TPU channel
4 settings (by bits MD3 to MD0 in TMDR_4, bits IOA3 to IOA0 in TIOR_4, and bits CCLR1
and CCLR0 in TCR_4), bit NDER4 in NDERL of the PPG, bit RE in SCR_4 of the SCI, bits
PPGS and TPUS in PFCR3, bit RXD4S in PFCR4, bit P24DDR, and bit ITS12 in ITSR of the
interrupt controller.
• P23/IRQ11-B/PO3-A/TIOCD3-A/TxD4-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOD3 to IOD0 in TIORL_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER3 in NDERL of the PPG, bit TE in SCR_4 of the SCI,
bits PPGS and TPUS in PFCR3, bit TXD4S in PFCR4, bit P23DDR, and bit ITS11 in ITSR of
the interrupt controller.
Notes: 1. TIOCD3-A input when MD3 to MD0 = B'0000 and IOD3 to IOD0 = B'10xx.
2. IRQ11-B input when the ITS11 bit in ITSR is 1.
3. When using as PO3-A output, set PPGS in PFCR3 to 0 before other register setting.
4. When using as TIOCD3-A input/output, set TPUS in PFCR3 to 0 before other register
setting.
5. When using as TxD4-A output, set TXD4S in PFCR4 to 0 before other register setting.
• P22/IRQ10-B /PO2-A/TIOCC3-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOC3 to IOC0 in TIORL_3, and bits CCLR2
to CCLR0 in TCR_3), bit NDER2 in NDERL of the PPG, bits PPGS and TPUS in PFCR3, bit
P22DDR, and bit ITS10 in ITSR of the interrupt controller.
• P21/IRQ9-B/PO1-A/TIOCB3-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOB3 to IOB0 in TIORH_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER1 in NDERL of the PPG, bits PPGS and TPUS in
PFCR3, bit P21DDR, and bit ITS9 in ITSR of the interrupt controller.
Notes: 1. TIOCB3-A input when MD3 to MD0 = B'0000 and IOB3 to IOB0 = B'10xx.
2. IRQ9-B input when the ITS9 bit in ITSR is 1.
3. When using as PO1-A output, set PPGS in PFCR3 to 0 before other register setting.
4. When using as TIOCB3-A input/output, set TPUS in PFCR3 to 0 before other register
setting.
• P20/PO0-A/TIOCA3-A/IRQ8-B
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOA3 to IOA0 in TIORH_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER0 in NDERL of the PPG, bits PPGS and TPUS in
PFCR3, bit P20DDR, and bit ITS8 in ITSR of the interrupt controller.
• P27/PO7/TIOCB5/SCL2
The pin function is switched as shown below according to the combination of the TPU channel
5 settings (by bits MD3 to MD0 in TMDR_5, bits IOB3 to IOB0 in TIOR_5, and bits CCLR1
and CCLR0 in TCR_5), bit NDER7 in NDERL of the PPG, bit ICE in ICCRA_2 of the I2C,
and bit P27DDR.
ICE 0 1
TPU channel 5 (1) in table (2) in table below ⎯
settings below
P27DDR ⎯ 0 1 1 ⎯
NDER7 ⎯ ⎯ 0 1 ⎯
Pin function TIOCB5 output P27 input P27 output PO7 output SCL2 I/O*2
1
TIOCB5 input*
Notes: 1. TIOCB5 input when MD3 to MD0 = B'0000 or B'01xx and IOB3 = 1.
2. NMOS open-drain output regardless of P27ODR.
• P26/PO6/TIOCA5/SDA2/ADTRG1
The pin function is switched as shown below according to the combination of the TPU channel
5 settings (by bits MD3 to MD0 in TMDR_5, bits IOA3 to IOA0 in TIOR_5, and bits CCLR1
and CCLR0 in TCR_5), bit NDER6 in NDERL of the PPG, bits TRGS1, TRGS0, and
EXTRGS in ADCR_1 of the ADC, bit ICE in ICCRA_2 of the I2C, and bit P26DDR.
ICE 0 1
TPU channel 5 (1) in table (2) in table below ⎯
settings below
P26DDR ⎯ 0 1 1 ⎯
NDER6 ⎯ ⎯ 0 1 ⎯
Pin function TIOCA5 P26 input P26 output PO6 output SDA2 I/O*4
output 1
TIOCA5 input*
ADTRG1 input*
3
• P25/WAIT-B/PO5-A/TIOCB4-A/TMO1-A
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit WAITE in BCR of the bus controller, TPU channel 4 settings (by bits
MD3 to MD0 in TMDR_4, bits IOB3 to IOB0 in TIOR_4, and bits CCLR1 and CCLR0 in
TCR_4), bits OS3 to OS0 in TCSR_1 of the 8-bit timer, bit NDER5 in NDERL of the PPG,
bits PPGS, TPUS, and TMRS in PFCR3, bit WAITS in PFCR4, and bit P25DDR.
WAITE 0 1
TPU channel 4 (1) in table (2) in table below ⎯
settings below
OS3 to OS0 ⎯ All 0 Not all 0 ⎯
P25DDR ⎯ 0 1 1 ⎯ ⎯
NDER5 ⎯ ⎯ 0 1 ⎯ ⎯
Pin function TIOCB4-A P25 input P25 output PO5-A TMO1-A WAIT-B
3 2
output* output* output*4 input*5
TIOCB4-A input*1*3
• Mode 3, 5, 7 (EXPE = 0)
WAITE ⎯
TPU channel 4 (1) in table (2) in table below
settings below
OS3 to OS0 ⎯ All 0 Not all 0
P25DDR ⎯ 0 1 1 ⎯
NDER5 ⎯ ⎯ 0 1 ⎯
Pin function TIOCB4-A P25 input P25 output PO5-A output*2 TMO1-A output*4
output*3 TIOCB4-A input*1*3
Notes: 1. TIOCB4-A input when MD3 to MD0 = B'0000 or B'01xx and IOB3 to IOB0 = B'10xx.
2. When using as PO5-A output, set PPGS in PFCR3 to 0 before other register setting.
3. When using as TIOCB4-A input/output, set TPUS in PFCR3 to 0 before other register
setting.
4. When using as TMO1-A output, set TMRS in PFCR3 to 0 before other register setting.
5. WAIT-B input when the WAITS bit in PFCR4 is 1. Not used as WAIT-B input when
WAITS is 0.
• P24/PO4-A/TIOCA4-A/TMO0-A/RxD4-A
The pin function is switched as shown below according to the combination of bits OS3 to OS0
in TCSR_0 of the 8-bit timer, TPU channel 4 settings (by bits MD3 to MD0 in TMDR_4, bits
IOA3 to IOA0 in TIOR_4, and bits CCLR1 and CCLR0 in TCR_4), bit NDER4 in NDERL of
the PPG, bit RE in SCR_4 of the SCI, bits PPGS, TRUS and TMRS in PRCR3, bit RXD4S in
PFCR4, and bit P24DDR.
• P23/PO3-A/TIOCD3-A/TMCI1-A/TxD4-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOD3 to IOD0 in TIORL_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER3 in NDERL of the PPG, bit TE in SCR_4 of the SCI,
bits PPGS, TRUS and TMRS in PRCR3, bit TXD4S in PFCR4 and bit P23DDR.
• P22/PO2-A/TIOCC3-A/TMCI0-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOC3 to IOC0 in TIORL_3, and bits CCLR2
to CCLR0 in TCR_3), bit NDER2 in NDERL of the PPG, bits PPGS, TPUS and TMRS in
PFCR3, and bit P22DDR.
• P21/PO1-A/TIOCB3-A/TMRI1-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOB3 to IOB0 in TIORH_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER1 in NDERL of the PPG, bits PPGS, TPUS and
TMRS in PFCR3 and bit P21DDR.
• P20/PO0-A/TIOCA3-A/TMRI0-A
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOA3 to IOA0 in TIORH_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER0 in NDERL of the PPG, bits PPGS, TPUS and
TMRS in PFCR3 and bit P20DDR.
11.3 Port 3
Port 3 is a 6-bit I/O port that also has other functions. Port 3 has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of P3DDR specify input or output for the pins of port 3. P3DDR cannot be
read; if it is, an undefined value will be read.
3 P33DR 0 R/W
2 P32DR 0 R/W
1 P31DR 0 R/W
0 P30DR 0 R/W
Port 3 pins also function as the pins for SCI I/Os, I2C I/Os, and bus control signal outputs. The
correspondence between the register specification and the pin functions is shown below.
• P35/OE-B*3/CKE-B*2/SCK1/SCL0
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit ICE in ICCRA_0 of the I2C, bit C/A in SMR_1 and bits CKE0 and CKE1
in SCR_1 of the SCI, bits OEE and RMTS2 to RMTS0 in DRAMCR of the bus controller, bit
OES in PFCR2, and bit P35DDR.
OEE 0 1
OES ⎯ 1 0
ICE 0 1 0 1 ⎯
CKE1 0 1 ⎯ 0 1 ⎯ ⎯
C/A 0 1 ⎯ ⎯ 0 1 ⎯ ⎯ ⎯
CKE0 0 1 ⎯ ⎯ ⎯ 0 1 ⎯ ⎯ ⎯ ⎯
P35DDR 0 1 ⎯ ⎯ ⎯ ⎯ 0 1 ⎯ ⎯ ⎯ ⎯ ⎯
Pin P35 P35 SCK1 SCK1 SCK1 SCL0 P35 P35 SCK1 SCK1 SCK1 SCL0 OE-B CKE-B
function input output output output input I/O*1 input output output output input I/O*1 output*3 output*2
• Mode 3, 5, 7 (EXPE = 0)
OEE 0
OES ⎯
RMTS2 to ⎯
RMTS0
ICE 0 1
CKE1 0 1 ⎯
C/A 0 1 ⎯ ⎯
CKE0 0 1 ⎯ ⎯ ⎯
P35DDR 0 1 ⎯ ⎯ ⎯ ⎯
Pin function P35 P35 SCK1 SCK1 SCK1 SCL0
1
input output output output input I/O*
Notes: 1. NMOS open-drain output regardless of P35ODR.
2. Not supported in the H8S/2427 and H8S/2425 Groups.
3. Not supported in the 5-V version.
• P34/SCK0/SCK4-A/SDA0
The pin function is switched as shown below according to the combination of bit ICE in
ICCRA_0 of the I2C, bits C/A in SMR_0 and SCR_4, bits CKE0 and CKE1 in SCR_0 and
SCR_4 of the SCI, bit SCK4S in PFCR4 and bit P34DDR.
ICE 0 1
CKE1 0 1 ⎯
C/A 0 1 ⎯ ⎯
CKE0 0 1 ⎯ ⎯ ⎯
P34DDR 0 1 ⎯ ⎯ ⎯ ⎯
Pin function P34 P34 SCK0/ SCK0/ SCK0/ SDA0
input output SCK4-A SCK4-A SCK4-A I/O*2
output*2*3 output*2*3 input*3
Notes: 1. NMOS open-drain output regardless of P34ODR.
2. Simultaneous output of SCK0 and SCK4 cannot be set.
3. SCK4-A input/output when the SCK4S bit in PFCR4 is 0.
• P33/RxD1/SCL1
The pin function is switched as shown below according to the combination of bit ICE in
ICCRA_1 of the I2C, bit RE in SCR_1 of the SCI, and bit P33DDR.
ICE 0 1
RE 0 1 ⎯
P33DDR 0 1 ⎯ ⎯
Pin function P33 input P33 output RxD1 input SCL1 I/O
Note: * NMOS open-drain output regardless of P33ODR.
• P32/RxD0/IrRxD/SDA1
The pin function is switched as shown below according to the combination of bit ICE in
ICCRA_1 of the I2C, bit RE in SCR_0 of the SCI, and bit P32DDR.
ICE 0 1
RE 0 1 ⎯
P32DDR 0 1 ⎯ ⎯
Pin function P32 input P32 output RxD0/IrRxD input SDA1 I/O
Note: * NMOS open-drain output regardless of P32ODR.
• P31/TxD1
The pin function is switched as shown below according to the combination of bit TE in SCR_1
of the SCI and bit P31DDR.
TE 0 1
P31DDR 0 1 ⎯
Pin function P31 input P31 output TxD1 output
• P30/TxD0/IrTxD
The pin function is switched as shown below according to the combination of bit TE in SCR_0
of the SCI and bit P30DDR.
TE 0 1
P30DDR 0 1 ⎯
Pin function P30 input P30 output TxD0/IrTxD output
11.4 Port 4
Port 4 is an 8-bit input-only port that also has other functions, such as analog input pins. Port 4 has
the following register.
PORT4 is an 8-bit read-only register that shows the pin states of port 4. PORT4 cannot be
modified.
Port 4 also functions as the pins for A/D converter analog inputs and interrupt inputs (the
H8S/2425 Group). The correspondence between pins is as follows.
• P47/IRQ7-B/AN7_0
Pin function AN7_0 input
IRQ7-B interrupt input*
• P46/IRQ6-B/AN6_0
Pin function AN6_0 input
IRQ6-B interrupt input*
• P45/IRQ5-B/AN5_0
Pin function AN5_0 input
IRQ5-B interrupt input*
• P44/IRQ4-B/AN4_0
Pin function AN4_0 input
IRQ4-B interrupt input*
• P43/IRQ3-B/AN3_0
Pin function AN3_0 input
IRQ3-B interrupt input*
• P42/IRQ2-B/AN2_0
Pin function AN2_0 input
IRQ2-B interrupt input*
• P41/IRQ1-B/AN1_0
Pin function AN1_0 input
IRQ1-B interrupt input*
• P40/IRQ0-B/AN0_0
Pin function AN0_0 input
IRQ0-B interrupt input*
Note: * IRQn input when the ITSn bit in ITSR is 1. (n = 7 to 0)
11.5 Port 5
Port 5 is a 4-bit I/O port. Port 5 has the following registers. For the port function control registers,
refer to section 11.18, Port Function Control Registers.
The individual bits of P5DDR specify input or output for the pins of port 5. P5DDR cannot be
read; if it is, an undefined value will be read.
Port 5 pins also function as the pins for SCI I/Os, A/D converter inputs, interrupt inputs, I2C I/Os,
bus control signal I/Os, PPG outputs, TPU I/Os, and 8-bit timer I/Os. The correspondence between
the register specification and the pin functions is shown below.
• P53/IRQ3-A/ADTRG0-A
The pin function is switched as shown below according to the combination of bits TRGS1,
TRGS0, and EXTRGS in ADCR_0 of the ADC, bit P53DDR, and bit ITS3 in ITSR of the
interrupt controller.
P53DDR 0 1
Pin function P53 input P53 output
ADTRG0-A input*1
IRQ3-A interrupt input*
2
Notes: 1. ADTRG0-A input when the EXTRGS bit in ADCR0 is 0, and TRGS1 = TRGS0 = 1.
2. IRQ3-A input when the ITS3 bit in ITSR is 0.
• P52/SCK2/IRQ2-A/BACK-B/PO4-B/TIOCA4-B/TMO0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit BRLE in BCR of the bus controller, bits OS3 to OS0 in TCSR of the 8-bit
timer, bits MD3 to MD0 in TMDR_4 of the TPU, bits IOA3 to IOA0 in TIOR_4, TPU channel
4 settings by bits CCLR1 and CCLR0 in TCR_4, bit NDER4 in NDERL of the PPG, bit C/A
in SMR_2 and bits CKE0 and CKE1 in SCR_2 of the SCI, bits PPGS, TPUS, and TMRS in
PFCR3, bit BACKS in PFCR4, bit P52DDR, and bit ITS2 in ITSR of the interrupt controller.
BRLE ⎯
BACKS
TPU channel (1) in table (2) in table below
4 settings below
OS3 to OS0 ⎯ All 0 Not all 0
CKE1 ⎯ 0 1 ⎯
C/A ⎯ 0 1 ⎯ ⎯
CKE0 ⎯ 0 1 ⎯ ⎯ ⎯
P52DDR ⎯ 0 1 1 ⎯ ⎯ ⎯ ⎯
NDER4 ⎯ ⎯ 0 1 ⎯ ⎯ ⎯ ⎯
Pin function TIOCA4-B P52 P52 PO4-B SCK2 SCK2 SCK2 TMO0-B
5 4 6
output* input output output* output output input output*
1 5
TIOCA4-B input* *
IRQ2-A interrupt input*
2
• P51/RxD2/IRQ1-A/SCL3/BREQ-B/PO2-B/TIOCC3-B/TMCI0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit BRLE in BCR of the bus controller, bit ICE in ICCRA_3 of the I2C, bits
MD3 to MD0 in TMDR_3 of the TPU, bits IOC3 to IOC0 in TIORL_3, TPU channel 3
settings by bits CCLR2 to CCLR0 in TCR_3, bit NDER2 in NDERL of the PPG, bit RE in
SCR_2 of the SCI, bit P51DDR, bits PPGS, TPUS and TMRS in PFCR3, bit BREQS in
PFCR4 and bit ITS1 in ITSR of the interrupt controller.
3 8
TMCI0-B input* *
BRLE ⎯
BREQS
ICE 0 1
TPU channel 3 (1) in table (2) in table below ⎯
settings below
RE ⎯ 0 1 ⎯
P51DDR ⎯ 0 1 1 ⎯ ⎯
NDER2 ⎯ ⎯ 0 1 ⎯ ⎯
Pin function TIOCC3-B P51 input P51 output PO2-B RxD2 input SCL3 I/O*5
output*7 output*6
1 7
TIOCC3-B input* *
IRQ1-A interrupt input* 2
TMCI0-B input*3*8
• P50/TxD2/IRQ0-A/SDA3/BREQO-B/PO0-B/TIOCA3-B/TMRI0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit BRLE in BCR of the bus controller, bit BREQOE, bit ICE in ICCRA_3 of
the I2C, bits MD3 to MD0 in TMDR_3 of the TPU, bits IOA3 to IOA0 in TIORH_3, TPU
channel 3 settings by bits CCLR2 to CCLR0 in TCR_3, bit NDER0 in NDERL of the PPG, bit
TE in SCR_2 of the SCI, bits PPGS, TPUS, and TMRS in PFCR3, bit BREQOS in PFCR4, bit
P50DDR, and bit ITS0 in ITSR of the interrupt controller.
BRLE 0 1
BREQOE ⎯ BREQOE = 0 or BREQOE = 1
BREQOS BREQOE = 1 and BREQOS = 0 and
BREQOS = 1
ICE 0 1 0 1 ⎯
TPU (1) in table (2) in table below ⎯ (1) in table (2) in table below ⎯ ⎯
channel 3 below below
settings
TE ⎯ 0 1 ⎯ ⎯ 0 1 ⎯ ⎯
P50DDR ⎯ 0 1 1 ⎯ ⎯ ⎯ 0 1 1 ⎯ ⎯ ⎯
NDER0 ⎯ ⎯ 0 1 ⎯ ⎯ ⎯ ⎯ 0 1 ⎯ ⎯ ⎯
Pin TIOCA3-B P50 P50 PO0-B TxD2 SDA3 TIOCA3-B P50 P50 PO0-B TxD2 SDA3 BREQO-B
function output*3 input output output*2 output I/O*5 output*3 input output output*2 output I/O*5 output
TIOCA3-B input*3 TIOCA3-B input*3
IRQ0-A interrupt input* 1
TMRI0-B input*4
BRLE ⎯
BREQOE ⎯
BREQOS ⎯
ICE 0 1
TPU channel 3 (1) in table (2) in table below ⎯
settings below
TE ⎯ 0 1 ⎯
P50DDR ⎯ 0 1 1 ⎯ ⎯
NDER0 ⎯ ⎯ 0 1 ⎯ ⎯
6 5
Pin function TIOCA3-B P50 input P50 output PO0-B output* TxD2 output SDA3* I/O
7
output* TIOCA3-B input* *
1 7
3 8
TMRI0-B input* *
BRLE ⎯
BREQOE ⎯
BREQOS ⎯
ICE 0 1
TPU channel 3 (1) in table (2) in table below ⎯
settings below
TE ⎯ 0 1 ⎯
P50DDR ⎯ 0 1 1 ⎯ ⎯
NDER0 ⎯ ⎯ 0 1 ⎯ ⎯
6 5
Pin function TIOCA3-B P50 input P50 output PO0-B output* TxD2 output SDA3* I/O
7
output* TIOCA3-B input* *
1 7
3 8
TMRI0-B input* *
Notes: 1. TIOCA3-B input when MD3 to MD0 = B'0000 and IOA3 to IOA0 = B'10xx.
2. IRQ0-A input when the ITS0 bit in ITSR is 0.
3. When used as the counter reset input pin for the TMR, the external reset should be selected
using the CCLR1 and CCLR0 bits in TCR_0 and TMRIS bit in TCCR_0 after the TMRS bit in
PFCR3 is set to 1.
5. NMOS open-drain output regardless of P50ODR.
6. When using as PO0-B output, set PPGS in PFCR3 to 1 before other register setting.
7. When using as TIOCA3-B input/output, set TPUS in PFCR3 to 1 before other register
setting.
8. When using as TMRI0-B input, set TMRS in PFCR3 to 1 before other register setting.
11.6 Port 6
Note: Port 6 is not supported in the H8S/2425 Group.
Port 6 is a 6-bit I/O port that also has other functions. Port 6 has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of P6DDR specify input or output for the pins of port 6. P6DDR cannot be
read; if it is, an undefined value will be read.
3 P63DR 0 R/W
2 P62DR 0 R/W
1 P61DR 0 R/W
0 P60DR 0 R/W
Port 6 pins also function as 8-bit timer I/Os, interrupt inputs, and DMAC I/Os. The
correspondence between the register specification and the pin functions is shown below.
• P65/IRQ13-A/DACK1/DACK3/TMO1-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bit SAE1 in DMABCRH, and bit SAE in DMAECRS1 of the DMAC, bits
OS3 to OS0 in TCSR_1 of the 8-bit timer, bit TMRS in PFCR3, bit P65DDR, and bit ITS13 in
ITSR of the interrupt controller.
DMCOMMD ⎯ 0 1
SAE1 0 ⎯ 1
SAE 0 1 ⎯
OS3 to OS0 All 0 Not all 0 ⎯ ⎯
P65DDR 0 1 ⎯ ⎯ ⎯
Pin function P65 input P65 output TMO1-A DACK1 DACK3
2
output* output output
IRQ13-A interrupt input*1
Notes: 1. IRQ13-A input when the ITS13 bit in ITSR is 0.
2. When using as TMO1-A output, set TMRS in PFCR3 to 0 before other register setting.
• P64/IRQ12-A/DACK0/DACK1/TMO0-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bit SAE0 in DMABCRH, and bit SAE in DMAECRS0 of the DMAC, bits
OS3 to OS0 in TCSR_0 of the 8-bit timer, bit TMRS in PFCR3, bit P64DDR, and bit ITS12 in
ITSR of the interrupt controller.
DMCOMMD ⎯ 0 1
SAE0 0 ⎯ 1
SAE 0 1 ⎯
OS3 to OS0 All 0 Not all 0 ⎯ ⎯
P64DDR 0 1 ⎯ ⎯ ⎯
Pin function P64 input P64 output TMO0-A DACK0 DACK1
output*2 output output
IRQ12-A interrupt input*
1
• P63/IRQ11-A/TEND1/TEND3/TEND5/TMCI1-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bits RSEL5, RSEL3, and RSEL2 in DRSEL, bit TEE1 in DMATCR, bit TEE
in DMAECRS1, and bit TEE in DMAECRF5 of the DMAC, bits TMRS and DMA_SEL1 in
PFCR3, bit P63DDR, and bit ITS11 in ITSR of the interrupt controller.
DMAC settings (1) in table below (2) in table (3) in table (4) in table
below below below
P63DDR 0 1 ⎯ ⎯ ⎯
Pin function P63 input P63 output TEND1 TEND3 TEND5
output output output
IRQ11-A interrupt input*1
2 3
TMCI1-A input* *
Notes: 1. IRQ11-A input when the ITS11 bit in ITSR is 0.
2. When used as the external clock input for the TMR, its pin function should be specified
to the external clock input by the CKS2 to CKS0 bits in TCR_1 after the TMRS bit in
PFCR3 is cleared to 0.
3. When using as TMCI1-A input, set TMRS in PFCR3 to 0 before other register setting.
DMAC settings (1) (1) (4) (1) (3) (1) (2) (1) (4)
DMCOMMD 1 0
RSEL5, RSEL3, B'000 B'100 B'01x x
RESEL2
TEE1 x 0 1 0 1 x
DMA_SEL1 x x x x x 0 1
DMAECRS1.TEE x x x x x 0 1 x
DMAECRF5.TEE x x x x x x x 0 1
Output function ⎯ ⎯ TEND5 ⎯ TEND3 ⎯ TEND1 ⎯ TEND5
output output output output
[Legend]
⎯: Not used as the DMAC pin (can be used as an I/O port).
x: Don't care
• P62/IRQ10-A/TEND0/TEND1/TEND4/TMCI0-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR, bits RSEL4, RSEL1, and RSEL0 in DRSEL, bit TEE0 in DMATCR, bit TEE
in DMAECRS0, and bit TEE in DMAECRF4 of the DMAC, bits TMRS and DMA_SEL0 in
PFCR3, bit P62DDR, and bit ITS10 in ITSR of the interrupt controller.
DMAC settings (1) in table below (2) in table (3) in table (4) in table
below below below
P62DDR 0 1 ⎯ ⎯ ⎯
Pin function P62 input P62 output TEND0 TEND1 TEND4
output output output
IRQ10-A interrupt input*1
2 3
TMCI0-A input* *
Notes: 1. IRQ10-A input when the ITS10 bit in ITSR is 0.
2. When used as the external clock input for the TMR, its pin function should be specified
to the external clock input by the CKS2 to CKS0 bits in TCR_0 after the TMRS bit in
PFCR3 is cleared to 0.
3. When using as TMCI0-A input, set TMRS in PFCR3 to 0 before other register setting.
DMAC settings (1) (1) (4) (1) (3) (1) (2) (1) (4)
DMCOMMD 1 0
RSEL4, RSEL1, B'000 B'100 B'01x x
RSEL0
TEE0 x 0 1 0 1 x
DMA_SEL0 x x x x x 0 1
DMAECRS0.TEE x x x x x 0 1 x
DMAECRF4.TEE x x x x x x x 0 1
Output function ⎯ ⎯ TEND4 ⎯ TEND1 ⎯ TEND0 ⎯ TEND4
output output output output
[Legend]
⎯: Not used as the DMAC pin (can be used as an I/O port).
x: Don't care
• P61/IRQ9-A/DREQ1/DREQ3/ DREQ5/TMRI1-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR of the DMAC, bit TMRS in PFCR3, bit P61DDR, and bit ITS9 in ITSR of the
interrupt controller.
P61DDR 0 1
Pin function P61 input P61 output
1 3
TMRI1-A input* *
DREQ1 input*5
DREQ3 input*4
DREQ5 input
IRQ9-A interrupt input*
2
Notes: 1. When used as the counter reset input for the TMR, both the CCLR1 and CCLR0 bits in
TCR_1 should be set to 1 after the TMRS bit in PFCR3 is cleared to 0.
2. IRQ9-A input when the ITS9 bit in ITSR is 0.
3. When using as TMRI1-A input, set TMRS in PFCR3 to 0 before other register setting.
4. DREQ3 input when bit DMCOMMD in MDLCFGCR is 1.
5. DREQ1 input when bit DMCOMMD in MDLCFGCR is 0.
• P60/IRQ8-A/DREQ0/DREQ1/DREQ4/TMRI0-A
The pin function is switched as shown below according to the combination of bit DMCOMMD
in MDLCFGCR of the DMAC, bit TMRS in PFCR3, bit P60DDR, and bit ITS8 in ITSR of the
interrupt controller.
P60DDR 0 1
Pin function P60 input P60 output
TMRI0-A input*1*3
DREQ0 input*5
DREQ1 input*4
DREQ4 input
IRQ8-A interrupt input*2
Notes: 1. When used as the counter reset input for the TMR, both the CCLR1 and CCLR0 bits in
TCR_0 should be set to 1 after the TMRS bit in PFCR3 is cleared to 0.
2. IRQ8-A input when the ITS8 bit in ITSR is 0.
3. When using as TMRI0-A input, set TMRS in PFCR3 to 0 before other register setting.
4. DREQ1 input when bit DMCOMMD in MDLCFGCR is 1.
5. DREQ0 input when bit DMCOMMD in MDLCFGCR is 0.
11.7 Port 8
Port 8 is a 6-bit I/O port that also has other functions. Port 8 has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of P8DDR specify input or output for the pins of port 8. P8DDR cannot be
read; if it is, an undefined value will be read.
0 P80DDR 0 W
0 P80 ⎯* R
Note: * Determined by the states of pins P85 to P80.
0 P80ODR 0 R/W
Port 8 pins also function as SCI I/Os, interrupt inputs, EXDMAC I/Os, PPG outputs, TPU I/Os,
and 8-bit timer I/Os. The correspondence between the register specification and the pin functions
is shown below.
• P85/EDACK3/IRQ5-B/SCK3/PO5-B/TIOCB4-B/TIOCA9-B/TMO1-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 4 settings (by bits MD3 to MD0 in TMDR_4, bits IOB3 to
IOB0 in TIOR_4, and bits CCLR1 and CCLR0 in TCR_4), TPU channel 9 settings (by bits
MD3 to MD0 in TMDR_9, bits IOB3 to IOB0 in TIOR_9, and bits CCLR2 to CCLR0 in
CR_9), bits OS3 to OS0 in TCSR_1 of the 8-bit timer, bit NDER5 in NDERL of the PPG, bit
AMS in EDMDR_3 of the EXDMAC, bit C/A in SMR_3 and bits CKE0 and CKE1 in SCR_3
of the SCI, bits EDACKRS and TPUS2 in PFCR2, bits PPGS, TPUS, and TMRS in PFCR3,
bit P85DDR, and bit ITS5 in ITSR of the interrupt controller.
AMS ⎯ 0 1 ⎯
CKE1 ⎯ 0 1 ⎯ ⎯
C/A ⎯ 0 1 ⎯ ⎯ ⎯
CKE0 ⎯ 0 1 ⎯ ⎯ ⎯ ⎯
P85DDR ⎯ 0 1 1 ⎯ ⎯ ⎯ ⎯ ⎯
NDER5 ⎯ ⎯ 0 1 ⎯ ⎯ ⎯ ⎯ ⎯
Pin function TIOCB4-B/ P85 input P85 output PO5-B SCK3 SCK3 SCK3 EDACK3 TMO1-B
TIOCA9-B output*5 output output input output*8 output*7
6
output*
TIOCB4-B/TIOCA9-B input*2*3*6
• P84/IRQ4-B/EDACK2
The pin function is switched as shown below according to the combination of bit AMS in
EDMDR_2 of the EXDMAC, bit P84DDR, and bit ITS4 in ITSR of the interrupt controller.
• P83/ETEND3/IRQ3-B/RxD3/PO3-B/TIOCD3-B/TMCI1-B
The pin function is switched as shown below according to the combination of bit ETENDE in
EDMDR_3 of the EXDMAC, bit RE in SCR_3 of the SCI, TPU channel 3 settings (by bits
MD3 to MD0 in TMDR_3, bits IOD3 to IOD0 in TIORL_3, and bits CCLR2 to CCLR0 in
TCR_3), bit NDER3 in NDERL of the PPG, bits PPGS, TPUS, and TMRS in PFCR3, bit
P83DDR, and bit ITS3 in ITSR of the interrupt controller.
• P82/IRQ2-B/ETEND2
The pin function is switched as shown below according to the combination of bit ETENDE in
EDMDR_2 of the EXDMAC, bit P82DDR, and bit ITS2 in ITSR of the interrupt controller.
• P81/EDREQ3/IRQ1-B/TxD3/PO1-B/TIOCB3-B/TMRI1-B
The pin function is switched as shown below according to the combination of bit TE in SCR_3
of the SCI, TPU channel 3 settings (by bits MD3 to MD0 in TMDR_3, bits IOB3 to IOB0 in
TIORH_3, and bits CCLR2 to CCLR0 in TCR_3), bit NDER1 in NDERL of the PPG, bits
PPGS, TPUS, and TMRS in PFCR3, bit P81DDR, and bit ITS1 in ITSR of the interrupt
controller.
• P80/IRQ0-B/EDREQ2
The pin function is switched as shown below according to the combination of bit P80DDR and
bit ITS0 in ITSR of the interrupt controller.
P80DDR 0 1
Pin function P80 input P80 output
EDREQ2 input
IRQ0-B interrupt input*
Note: * IRQ0-B input when the ITS0 bit in ITSR is 1.
• P85/SCK3/PO5-B/TIOCB4-B/TIOCA9-B/TMO1-B
The pin function is switched as shown below according to the combination of the TPU channel
4 settings (by bits MD3 to MD0 in TMDR_4, bits IOB3 to IOB0 in TIOR_4, and bits CCLR1
and CCLR0 in TCR_4), the TPU channel 9 settings (by bits MD3 to MD0 in TMDR_9, bits
IOB3 to IOB0 in TIOR_9, and bits CCLR1 and CCLR0 in TCR_9), bits OS3 to OS0 in
TCSR_1 of the 8-bit timer, bit NDER5 in NDERL of the PPG, bit C/A in SMR_3 and bits
CKE0 and CKE1 in SCR_3 of the SCI, bit TPUS2 in PFCR2, bits PPGS, TPUS, and TMRS in
PFCR3, and bit P85DDR.
• P83/PO3-B/TIOCD3-B/TMCI1-B/RxD3
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOD3 to IOD0 in TIORL_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER3 in NDERL of the PPG, bit RE in SCR_3 of the
SCI, bits PPGS, TPUS, and TMRS in PFCR3, and bit P83DDR.
• P81/PO1-B/TIOCB3-B/TMRI1-B/TxD3
The pin function is switched as shown below according to the combination of the TPU channel
3 settings (by bits MD3 to MD0 in TMDR_3, bits IOB3 to IOB0 in TIORH_3, and bits
CCLR2 to CCLR0 in TCR_3), bit NDER1 in NDERL of the PPG, bit TE in SCR_3 of the SCI,
bits PPGS, TPUS, and TMRS in PFCR3, and bit P81DDR.
11.8 Port 9
Port 9 is an 8-bit input-only port that also has other functions. Port 9 has the following register.
Port 9 also functions as the pins for A/D converter analog inputs and D/A converter analog
outputs. The correspondence between pins is as follows.
• P97/AN15_1
Pin function AN15_1 input
• P96/AN14_1
Pin function AN14_1 input
• P95/AN13_1/DA3
Pin function AN13_1 input
DA3 output
• P94/AN12_1/DA2
Pin function AN12_1 input
DA2 output
• P93/AN11_1
Pin function AN11_1 input
• P92/AN10_1
Pin function AN10_1 input
• P91/AN9_1
Pin function AN9_1 input
• P90/AN8_1
Pin function AN8_1 input
• P95/AN13_1/DA3
Pin function AN13_1 input
DA3 output
• P94/AN12_1/DA2
Pin function AN12_1 input
DA2 output
11.9 Port A
Port A is an 8-bit I/O port that also has other functions. Port A has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of PADDR specify input or output for the pins of port A. PADDR cannot be
read; if it is, an undefined value will be read.
Initial
Bit Bit Name Value R/W Description
7 PA7DDR 0 W • Modes 1 and 2
6 PA6DDR 0 W Pins PA4 to PA0 are address outputs.
5 PA5DDR 0 W For pins PA6 and PA5, when the corresponding bit of A22E
and A21E is set to 1, setting a PADDR bit to 1 makes the
4 PA4DDR 0 W
corresponding pin an address output, while clearing the bit to
3 PA3DDR 0 W 0 makes the corresponding pin an input port. Clearing one of
2 PA2DDR 0 W bits A22E and A21E to 0 makes the corresponding pin an I/O
1 PA1DDR 0 W port, and its function can be switched with PADDR.
Initial
Bit Bit Name Value R/W Description
7 PA7DDR 0 W • Modes 3. 5. 7 (when EXPE = 1) and 4
6 PA6DDR 0 W For pins PA6 to PA0, when the corresponding bit of A22E to
5 PA5DDR 0 W A16E is set to 1, setting a PADDR bit to 1 makes the
corresponding pin an address output, while clearing the bit to
4 PA4DDR 0 W 0 makes the corresponding pin an input port. Clearing one of
3 PA3DDR 0 W bits A22E to A16E to 0 makes the corresponding pin an I/O
2 PA2DDR 0 W port, and its function can be switched with PADDR.
5 PA5DR 0 R/W
4 PA4DR 0 R/W
3 PA3DR 0 R/W
2 PA2DR 0 R/W
1 PA1DR 0 R/W
0 PA0DR 0 R/W
PAPCR controls on/off of the input pull-up MOS for port A. Bits 7 to 5 are valid in modes 1 and 2
and all the bits are valid in modes 3, 4, 5 and 7.
Port A pins also function as the pins for address outputs, interrupt inputs, FSI I/Os, SSU I/Os, SCI
I/Os, and bus control signal outputs. The correspondence between the register specification and
the pin functions is shown below.
• PA7/A23/CS7*6/IRQ7-A/FSIDO/SSO0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits MSS and BIDE in SSCRH, bit SSUMS in SSCRL, and bits TE and RE
in SSER of the SSU, bits SSO0S1 and SSO0S0 in PFCR5, bit FSIE in FSICR, bit CS7E in
PFCR0 (the H8S/2425 Group), bit A23E in PFCR1, bit PA7DDR, and bit ITS7 in ITSR of the
interrupt controller.
• Modes 1, 2, 4, and 3, 5, 7 (EXPE = 1)
A23E 0 1
⎯
6
CS7E* 0 1
FSIE 0 1 ⎯ ⎯
SSU settings (1) in table below (2) in (3) in ⎯ ⎯ ⎯
table table
below below
⎯ ⎯
4
PA7DDR 0 1 0* 0 1 0 1
Pin function PA7 input PA7 SSO0-B SSO0-B FSIDO PA7 input CS7 PA7 input A23
2 5 3 5
output input* * output* * output output output
IRQ7-A interrupt input*
1
A23E ⎯
⎯
6
CS7E*
FSIE 0 1
SSU settings (1) in table below (2) in table (3) in table ⎯
below below
PA7DDR 0 1 0*4 ⎯ ⎯
Pin function PA7 input PA7 output SSO0-B SSO0-B FSIDO output
2 5
input* * output*3*5
IRQ7-A interrupt input*
1
SSU (1) (2) (1) (2 (1) (3) (3) (2) (3) (2) (3) (1) (3) (3) (1) (3) (3)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ SSO ⎯ SSO ⎯ SSO SSO SSO SSO SSO SSO ⎯ SSO SSO ⎯ SSO SSO
input input output output input output input output output output output output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• PA6/A22/IRQ6-A/FSIDI/SSI0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits MSS and BIDE in SSCRH, bit SSUMS in SSCRL, and bits TE and RE
in SSER of SSU, bit A22E in PFCR1, bit FSIE in FSICR, bits SSI0S1 and SSI0S0 in PFCR5,
bit PA6DDR, and bit ITS6 in ITSR of the interrupt controller.
A22E 0 1
FSIE 0 1 ⎯
SSU settings (1) in table below (2) in table (3) in table ⎯ ⎯
below below
PA6DDR 0 1 0*4 ⎯ ⎯ 0 1
Pin function PA6 input PA6 SSI0-B SSI0-B FSIDI PA6 input A22 output
2 5
output input* * output*3*5 input
IRQ6-A interrupt input*
1
• Modes 3, 5, 7 (EXPE = 0)
A22E ⎯
FSIE 0 1
SSU settings (1) in table below (2) in table (3) in table ⎯
below below
PA6DDR 0 1 0*4 ⎯ ⎯
Pin function PA6 input PA6 output SSI0-B SSI0-B FSIDI input
input*2*5 output*3*5
IRQ6-A interrupt input*1
Notes: 1. IRQ6-A input when the ITS6 bit in ITSR is 0.
2. When using as SSI0-B input, set SSI0S1 and SSI0S0 in PFCR5 to B'01 before other
register setting.
3. When using as SSI0-B output, set SSI0S1 and SSI0S0 in PFCR5 to B'01 before other
register setting.
4. PA6DDR = 0 when the SSU pin is used as input.
5. Do not set up for SSU unless SSI0S1 and SSI0S0 = B'01 in RFCR5.
Use as I/O port.
SSU (1) (1) (3) (3) (2) (1) (2) (1) (1) (1) (1) (2) (1) (2) (2) (1) (2)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ ⎯ SSI SSI SSI ⎯ SSI ⎯ ⎯ ⎯ ⎯ SSI ⎯ SSI SSI ⎯ SSI
output output input input input input input input
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• PA5/A21/IRQ5-A/FSICK/SSCK0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits MSS and SCKS in SSCRH and bit SSUMS in SSCRL of the SSU, bit
A21E in PFCR1, bit FSIE in FSICR, bits SSCK0S1 and SSCK0S0 in PFCR5, bit PA5DDR,
and bit ITS5 in ITSR of the interrupt controller
• Modes 1, 2, 4, and 3, 5, 7 (EXPE = 1)
A21E 0 1
FSIE 0 1 ⎯
SSU settings (1) in table below (2) in table (3) in table ⎯ ⎯
below below
PA5DDR 0 1 0*4 ⎯ ⎯ 0 1
Pin function PA5 input PA5 SSI0-B SSI0-B FSICK PA5 input A21 output
2 5
output input* * output*3*5 output
IRQ5-A interrupt input*1
• Mode 3, 5, 7 (EXPE = 0)
A21E ⎯
FSIE 0 1
SSU settings (1) in table below (2) in table (3) in table ⎯
below below
PA5DDR 0 1 0*4 ⎯ ⎯
Pin function PA5 input PA5 output SSI0-B SSI0-B FSICK output
input*2*5 output*3*5
IRQ5-A interrupt input*
1
SSU settings (1) (2) (1) (3) (1) (2) (1) (3)
SSUMS 0 1
MSS 0 1 0 1
SCKS 0 1 0 1 0 1 0 1
Pin state ⎯ SSCK ⎯ SSCK ⎯ SSCK ⎯ SSCK
input output input output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Note: See tables 20.4 to 20.6.
• PA4/A20/IRQ4-A/FSISS/SCS0-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits MSS, CSS1, and CSS0 in SSCRH and bit SSUMS in SSCRL of the
SSU, bit A20E in PFCR1, bit FSIE in FSICR, bits SCS0S1 and SCS0S0 in PECE5, bit
PA4DDR, and bit ITS4 in ITSR of the interrupt controller.
• Modes 3, 5, 7 (EXPE = 0)
A20E ⎯
FSIE 0 1
SSU settings (1) in table below (2) in table (4) in table (3) in table ⎯
below below below
PA4DDR 0 1 0*5 0*5 ⎯ ⎯
Pin function PA4 input PA4 output SCS0-B SCS0-B SCS0-B FSISS
input*2*6 I/O*4*6 output*3*6 output
IRQ4-A interrupt input*
1
• PA3/A19/SCK4-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit C/A in SMR_4 and bits CKE0 and CKE1 in SCR_4 of the SCI, bit A19E
in PFCR1, bit SCK4S in PFCR4, and bit PA3DDR.
Operating 1, 2 4
mode
EXPE ⎯ ⎯
A19E ⎯ 0 1
CKE1 ⎯ 0 1 ⎯
C/A ⎯ 0 1 ⎯ ⎯
CKE0 ⎯ 0 1 ⎯ ⎯ ⎯
PA3DDR ⎯ 0 1 ⎯ ⎯ ⎯ 0 1
Pin function A19 PA3 PA3 SCK4-B SCK4-B SCK4-B PA3 A19
output input output output* output* input* input output
Operating 3, 5, 7
mode
EXPE 0 1
A19E ⎯ 0 1
CKE1 0 1 0 1 ⎯
C/A 0 1 ⎯ 0 1 ⎯ ⎯
CKE0 0 1 ⎯ ⎯ 0 1 ⎯ ⎯ ⎯
PA3DDR 0 1 ⎯ ⎯ ⎯ 0 1 ⎯ ⎯ ⎯ 0 1
Pin function PA3 PA3 SCK4-B SCK4-B SCK4-B PA3 PA3 SCK4-B SCK4-B SCK4-B PA3 A19
input output output* output* input* input output output* output* input* input output
• PA2/A18/RxD4-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit RE in SCR_4 of the SCI, bit A18E in PFCR1, bit RXD4S in PFCR4, and
bit PA2DDR.
Operating 1, 2 4 3, 5, 7
mode
EXPE ⎯ ⎯ 0 1
A18E ⎯ 0 1 ⎯ 0 1
RE ⎯ 0 1 ⎯ 0 1 0 1 ⎯
PA2DDR ⎯ 0 1 ⎯ 0 1 0 1 ⎯ 0 1 ⎯ 0 1
Pin function A18 PA2 PA2 RxD4-B PA2 A18 PA2 PA2 RxD4-B PA2 PA2 RxD4-B PA2 A18
output input output input* input output input output input* input output input* input output
• PA1/A17/TxD4-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit TE in SCR_4 of the SCI, bit A17E in PFCR1, bit TXD4S in PFCR4, and
bit PA1DDR.
Operating 1, 2 4 3, 5, 7
mode
EXPE ⎯ ⎯ 0 1
A17E ⎯ 0 1 ⎯ 0 1
TE ⎯ 0 1 ⎯ 0 1 0 1 ⎯
PA1DDR ⎯ 0 1 ⎯ 0 1 0 1 ⎯ 0 1 ⎯ 0 1
Pin function A17 PA1 PA1 TxD4-B PA1 A17 PA1 PA1 TxD4-B PA1 PA1 TxD4-B PA1 A17
output input output output* input output input output output* input output output* input output
• PA0/A16
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit A16E in PFCR1, and bit PA0DDR.
Operating mode 1, 2 4 3, 5, 7
EXPE ⎯ ⎯ 0 1
A16E ⎯ 0 1 ⎯ 0 1
PA0DDR ⎯ 0 1 0 1 0 1 0 1 0 1
Pin function A16 PA0 PA0 PA0 A16 PA0 PA0 PA0 PA0 PA0 A16
output input output input output input output input output input output
Port A has a built-in input pull-up MOS function that can be controlled by software. This input
pull-up MOS function can be used by pins PA7 to PA5 in modes 1 and 2, and by all pins in modes
3, 4, 5 and 7. The input pull-up MOS can be specified as on or off on a bit-by-bit basis.
Table 11.3 summarizes the input pull-up MOS states. The input pull-up MOS should not be turned
on when the SCI and FSI are used.
11.10 Port B
Port B is an 8-bit I/O port that also has other functions. Port B has the following registers.
The individual bits of PBDDR specify input or output for the pins of port B. PBDDR cannot be
read; if it is, an undefined value will be read.
5 PB5DR 0 R/W
4 PB4DR 0 R/W
3 PB3DR 0 R/W
2 PB2DR 0 R/W
1 PB1DR 0 R/W
0 PB0DR 0 R/W
PBPCR controls on/off of the input pull-up MOS for port B. PBPCR is valid in modes 3, 4, 5 and
7.
Port B pins also function as the pins for TPU I/Os and address outputs. The correspondence
between the register specification and the pin functions is shown below.
• PB7/A15/TIOCB8/TCLKH
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 8 settings (by bits MD3 to MD0 in TMDR_8, bits IOB3 to
IOB0 in TIOR_8, and bits CCLR1 and CCLR0 in TCR_8), bits TPSC2 to TPSC0 in TCR_6
and TCR_11, and bit PB7DDR.
• PB6/A14/TIOCA8
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 8 settings (by bits MD3 to MD0 in TMDR_8, bits IOA3 to
IOA0 in TIOR_8, and bits CCLR1 and CCLR0 in TCR_8), and bit PB6DDR.
• PB5/A13/TIOCB7/TCLKG
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 7 settings (by bits MD3 to MD0 in TMDR_7, bits IOB3 to
IOB0 in TIOR_7, and bits CCLR1 and CCLR0 in TCR_7), bits TPSC2 to TPSC0 in TCR_6,
TCR_8, TCR_10, and TCR_11, and bit PB5DDR.
• PB4/A12/TIOCA7
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 7 settings (by bits MD3 to MD0 in TMDR_7, bits IOA3 to
IOA0 in TIOR_7, and bits CCLR1 and CCLR0 in TCR_7), and bit PB4DDR.
• PB3/A11/TIOCD6/TCLKF
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 6 settings (by bits MD3 to MD0 in TMDR_6, bits IOD3 to
IOD0 in TIORL_6, and bits CCLR2 to CCLR0 in TCR_6), bits TPSC2 to TPSC0 in TCR_6 to
TCR_8, and bit PB3DDR.
• PB2/A10/TIOCC6/TCLKE
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 6 settings (by bits MD3 to MD0 in TMDR_6, bits IOC3 to
IOC0 in TIORL_6, and bits CCLR2 to CCLR0 in TCR_6), bits TPSC2 to TPSC0 in TCR_6 to
TCR_11, and bit PB2DDR.
• PB1/A9/TIOCB6
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 6 settings (by bits MD3 to MD0 in TMDR_6, bits IOB3 to
IOB0 in TIORH_6, and bits CCLR2 to CCLR0 in TCR_6), and bit PB1DDR.
• PB0/A8/TIOCA6
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 6 settings (by bits MD3 to MD0 in TMDR_6, bits IOA3 to
IOA0 in TIORH_6, and bits CCLR2 to CCLR0 in TCR_6), and bit PB0DDR.
Port B has a built-in input pull-up MOS function that can be controlled by software. This input
pull-up MOS function can be used in modes 3, 4, 5, and 7. The input pull-up MOS can be
specified as on or off on a bit-by-bit basis.
In modes 4 and 7, when a PBDDR bit is cleared to 0, setting the corresponding PBPCR bit to 1
turns on the input pull-up MOS for that pin.
11.11 Port C
Port C is an 8-bit I/O port that also has other functions. Port C has the following registers.
The individual bits of PCDDR specify input or output for the pins of port C. PCDDR cannot be
read; if it is, an undefined value will be read.
5 PC5DR 0 R/W
4 PC4DR 0 R/W
3 PC3DR 0 R/W
2 PC2DR 0 R/W
1 PC1DR 0 R/W
0 PC0DR 0 R/W
PCPCR controls on/off of the input pull-up MOS for port C. PCPCR is valid in modes 3, 4, 5, and
7.
Port C pins also function as the pins for TPU I/Os and address outputs. The correspondence
between the register specification and the pin functions is shown below.
• PC7/A7/TIOCB11
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 11 settings (by bits MD3 to MD0 in TMDR_11, bits IOB3 to
IOB0 in TIOR_11, and bits CCLR1 and CCLR0 in TCR_11), and bit PC7DDR.
• PC6/A6/TIOCA11
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 11 settings (by bits MD3 to MD0 in TMDR_11, bits IOA3 to
IOA0 in TIOR_11, and bits CCLR1 and CCLR0 in TCR_11), and bit PC6DDR.
• PC5/A5/TIOCB10
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 10 settings (by bits MD3 to MD0 in TMDR_10, bits IOB3 to
IOB0 in TIOR_10, and bits CCLR1 and CCLR0 in TCR_10), and bit PC5DDR.
• PC4/A4/TIOCA10
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 10 settings (by bits MD3 to MD0 in TMDR_10, bits IOA3 to
IOA0 in TIOR_10, and bits CCLR1 and CCLR0 in TCR_10), and bit PC4DDR.
• PC3/A3/TIOCD9
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 9 settings (by bits MD3 to MD0 in TMDR_9, bits IOD3 to
IOD0 in TIORL_9, and bits CCLR2 to CCLR0 in TCR_9), and bit PC3DDR.
• PC2/A2/TIOCC9
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 9 settings (by bits MD3 to MD0 in TMDR_9, bits IOC3 to
IOC0 in TIORL_9, and bits CCLR2 to CCLR0 in TCR_9), and bit PC2DDR.
• PC1/A1/TIOCB9
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 9 settings (by bits MD3 to MD0 in TMDR_9, bits IOB3 to
IOB0 in TIORH_9, and bits CCLR2 to CCLR0 in TCR_9), and bit PC1DDR.
• PC0/A0/TIOCA9-A
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, TPU channel 9 settings (by bits MD3 to MD0 in TMDR_9, bits IOA3 to
IOA0 in TIORH_9, and bits CCLR2 to CCLR0 in TCR_9), and bit PC0DDR.
Port C has a built-in input pull-up MOS function that can be controlled by software. This input
pull-up MOS function can be used in modes 3, 4, 5, and 7. The input pull-up MOS can be
specified as on or off on a bit-by-bit basis.
In modes 3, 4, 5, and 7, when a PCDDR bit is cleared to 0, setting the corresponding PCPCR bit to
1 turns on the input pull-up MOS for that pin.
11.12 Port D
Port D is an 8-bit I/O port that also has other functions. Port D has the following registers.
The individual bits of PDDDR specify input or output for the pins of port D. PDDDR cannot be
read; if it is, an undefined value will be read.
5 PD5DR 0 R/W
4 PD4DR 0 R/W
3 PD3DR 0 R/W
2 PD2DR 0 R/W
1 PD1DR 0 R/W
0 PD0DR 0 R/W
PDPCR controls on/off of the input pull-up MOS for port D. PDPCR is valid in modes 3, 5, and 7.
Port D pins also function as the pins for data I/Os and address outputs. The correspondence
between the register specification and the pin functions is shown below.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
MPXE 0 1 ⎯ 0 1
PDnDDR ⎯ 0 1 ⎯
Pin function Data I/O Address PDn input PDn output Data I/O Address
output/ output/
data I/O data I/O
[Legend]
n = 7 to 0
Port D has a built-in input pull-up MOS function that can be controlled by software. This input
pull-up MOS function can be used in modes 3, 5, and 7. The input pull-up MOS can be specified
as on or off on a bit-by-bit basis.
In modes 3, 5, and 7, when a PDDDR bit is cleared to 0, setting the corresponding PDPCR bit to 1
turns on the input pull-up MOS for that pin.
11.13 Port E
Port E is an 8-bit I/O port that also has other functions. Port E has the following registers.
The individual bits of PEDDR specify input or output for the pins of port E. PEDDR cannot be
read; if it is, an undefined value will be read.
5 PE5DR 0 R/W
4 PE4DR 0 R/W
3 PE3DR 0 R/W
2 PE2DR 0 R/W
1 PE1DR 0 R/W
0 PE0DR 0 R/W
PEPCR controls on/off of the input pull-up MOS for port E. PEPCR is valid in 8-bit bus mode.
Port E pins also function as the pins for data I/Os and address outputs. The correspondence
between the register specification and the pin functions is shown below.
Operating 1, 2, 4 3, 5, 7
mode
Bus mode All areas are At least one ⎯ All areas are At least one area
8-bit space area is 16-bit 8-bit space is 16-bit space
space
EXPE ⎯ ⎯ 0 1 1
MPXE ⎯ 0 1 ⎯ ⎯ 0 1
PEnDDR 0 1 ⎯ 0 1 0 1 ⎯
Pin function PEn PEn Data Address PEn PEn PEn PEn Data Address
input output I/O output/ input output input output I/O output/
data I/O data I/O
[Legend]
n = 7 to 0
Port E has a built-in input pull-up MOS function that can be controlled by software. This input
pull-up MOS function can be used in 8-bit bus mode or modes 3, 5, and 7. The input pull-up MOS
can be specified as on or off on a bit-by-bit basis. In 8-bit bus mode or modes 3, 5, and 7, when a
PEDDR bit is cleared to 0, setting the corresponding PEPCR bit to 1 turns on the input pull-up
MOS for that pin.
11.14 Port F
Port F is an 8-bit I/O port that also has other functions. Port F has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of PFDDR specify input or output for the pins of port F. PFDDR cannot be
read; if it is, an undefined value will be read.
5 PF5DR 0 R/W
4 PF4DR 0 R/W
3 PF3DR 0 R/W
2 PF2DR 0 R/W
1 PF1DR 0 R/W
0 PF0DR 0 R/W
6 PF6ODR 0 R/W
CS6* , or OE-A* * output, setting a PFODR bit to 1
2 2
Port F pins also function as the pins for SSU I/Os, A/D converter inputs, interrupt inputs, bus
control signal I/Os, and system clock outputs. The correspondence between the register
specification and the pin functions is shown below.
• PF7/φ
The pin function is switched as shown below according to bit PF7DDR.
Operating 1, 2, 3, 4, 5, 7
mode
PF7DDR 0 1
Pin function PF7 input φ output
• PF6/AS/AH
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit MPXE in MPXCR of the bus controller, bit ASOE in PFCR2, and bit
PF6DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
ASOE 1 0 ⎯ 1 0
PF6DDR ⎯ 0 1 0 1 ⎯ 0 1
Pin function AS/AH* PF6 PF6 PF6 PF6 AS/AH* PF6 PF6
output input output input output output input output
Note: * AH output when MPXE = 1, and AS output when MPXE = 0.
• PF5/RD
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, and bit PF5DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
PF5DDR ⎯ 0 1 ⎯
Pin function RD output PF5 input PF5 output RD output
• PF4/HWR
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, and bit PF4DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
PF4DDR ⎯ 0 1 ⎯
Pin function HWR output PF4 input PF4 output HWR output
• PF3/LWR/SSO0-C
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits MSS and BIDE in SSCRH, bit SSUMS in SSCRL, and bits TE and RE
in SSER of the SSU, bit LWROE in PFCR2, bits SSOS1 and SSOS0 in PFCR5, and bit
PF3DDR.
SSU (1) (2) (1) (2) (1) (3) (3) (2) (3) (2) (3) (1) (3) (3) (1) (3) (3)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ SSO ⎯ SSO ⎯ SSO SSO SSO SSO SSO SSO ⎯ SSO SSO ⎯ SSO SSO
input input output output input output input output output output output output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
• Modes 3, 5, 7 (EXPE = 0)
Areas 2 to 5 ⎯
SSU settings (1) in table below (2) in table below (3) in table below
⎯
4
PF2DDR 0 1 0*
2 5
Pin function PF2 input PF2 output SSI0-C input* * SSI0-C output*3*5
IRQ15-A interrupt input*1
Notes: 1. IRQ15-A input when the ITS15 bit in ITSR is 0.
2. When using as SSI0-C input, set SSI0S1 and SSI0S0 in PFCR5 to B'10 before other
register setting.
3. When using as SSI0-C output, set SSI0S1 and SSI0S0 in PFCR5 to B'10 before other
register setting.
4. PF2DDR = 0 when the SSU pin is used as input.
5. Do not set up for SSU unless SSI0S1 and SSI0S0 = B'10 in RFCR5.
Use as I/O port.
6. Not supported in the 5-V version.
7. Not supported in the H8S/2427 Group.
SSU (1) (1) (3) (3) (2) (1) (2) (1) (1) (1) (1) (2) (1) (2) (2) (1) (2)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ ⎯ SSI SSI SSI ⎯ SSI ⎯ ⎯ ⎯ ⎯ SSI ⎯ SSI SSI ⎯ SSI
output output input input input input input input
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
Areas 2 to 5 Any DRAM space All DRAM space areas are 8-bit bus space,
area is 16-bit bus or areas 2 to 5 are all normal space
space
CS6E ⎯ 0 1
SSU settings ⎯ (1) in table below (2) in (3) in ⎯
table table
below below
PF2DDR ⎯ 0 1 0*3 ⎯ 0 1
LCAS* output CS6
5
Pin function PF2 PF2 SSI0-C SSI0-C PF2
1 4 2 4
input output input* * output* * input output
Areas 2 to 5 ⎯
CS6E ⎯
SSU settings (1) in table below (2) in table below (3) in table below
⎯
3
PF2DDR 0 1 0*
1 4
Pin function PF2 input PF2 output SSI0-C input* * SSI0-C output*2*4
Notes: 1. When using as SSI0-C input, set SSI0S1 and SSI0S0 in PFCR5 to B'10 before other
register setting.
2. When using as SSI0-C output, set SSI0S1 and SSI0S0 in PFCR5 to B'10 before other
register setting.
3. PF2DDR = 0 when the SSU pin is used as input.
4. Do not set up for SSU unless SSI0S1 and SSI0S0 = B'10 in RFCR5.
Use as I/O port.
5. Not supported in the 5-V version.
SSU (1) (1) (3) (3) (2) (1) (2) (1) (1) (1) (1) (2) (1) (2) (2) (1) (2)
settings
1
SSUMS 0 0 1*
2
BIDE 0 1* 0
MSS 0 1 0 1 0 1
TE 0 1 0 1 0 1 0 1 0 1 0 1
RE 0 1 0 1 1 0 1 1 0 1 0 1 0 1 1 0 1
Pin state ⎯ ⎯ SSI SSI SSI ⎯ SSI ⎯ ⎯ ⎯ ⎯ SSI ⎯ SSI SSI ⎯ SSI
output output input input input input input input
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Notes: See tables 20.4 to 20.6.
1. Do not set BIDE to 1 when SSUMS = 1 in SSU.
2. Do not specify that TE = RE = 1 when operating with BIDE = 1 (bidirectional mode).
Areas 2 to 5 ⎯
SSU settings (1) in table below (2) in table below (3) in table below
⎯
4
PF1DDR 0 1 0*
Pin function PF1 input PF1 output SSCK0-C input*2 SSCK0-C output*3
IRQ14-A interrupt input*
1
SSU settings (1) (2) (1) (3) (1) (2) (1) (3)
SSUMS 0 1
MSS 0 1 0 1
SCKS 0 1 0 1 0 1 0 1
Pin state Port I/O SSCK Port I/O SSCK Port I/O SSCK Port I/O SSCK
input output input output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Note: See tables 20.4 to 20.6.
Areas 2 to 5 ⎯
CS5E ⎯
SSU settings (1) in table below (2) in table below (3) in table below
⎯
3
PF1DDR 0 1 0*
SSCK0-C input* * SSCK0-C output*2*4
1 4
Pin function PF1 input PF1 output
Notes: 1. When using as SSCK0-C input, set SSCK0S1 and SSCK0S0 in PFCR5 to B'10 before
other register setting.
2. When using as SSCK0-C output, set SSCK0S1 and SSCK0S0 in PFCR5 to B'10 before
other register setting.
3. PF1DDR = 0 when the SSU pin is used as input.
4. Do not set up for SSU unless SSCK0S1 and SSCK0S0 = B'10 in RFCR5.
Use as I/O port.
5. Not supported in the 5-V version.
SSU settings (1) (2) (1) (3) (1) (2) (1) (3)
SSUMS 0 1
MSS 0 1 0 1
SCKS 0 1 0 1 0 1 0 1
Pin state ⎯ SSCK ⎯ SSCK ⎯ SSCK ⎯ SSCK
input output input output
[Legend]
⎯: Not used as the SSU pin (can be used as an I/O port).
Note: See tables 20.4 to 20.6.
WAITE 0
WAITS ⎯
SSU settings (1) in table below (2) in table below (4) in table below (3) in table below
PF0DDR 0 1 0*5 0*5 ⎯
PF0 input PF0 output SCS0-C input* * SCS0-C I/O* * SCS0-C output*3*6
2 6 4 6
Pin function
ADTRG0-B input*1
WAITE 1
WAITS 0 1
SSU settings ⎯ (1) in table (2) in table (4) in table (3) in table ⎯
below below below below
PF0DDR ⎯ 0 0*5 0 0 1
Pin function WAIT-A input PF0 input SCS0-C Setting Setting Setting
input*2*6 prohibited prohibited prohibited
ADTRG0-B input*
1
WAITE ⎯
SSU settings (1) in table below (2) in table below (4) in table below (3) in table below
PF0DDR 0 1 0*5 0*5 ⎯
PF0 input PF0 output SCS0-C input* * SCS0-C I/O* * SCS0-C output*3*6
2 6 4 6
Pin function
ADTRG0-B input*
1
Notes: 1. ADTRG0-B input when the ADTRG0S bit in PFCR4 is 1, TRGS1 = TRGS0 = 0, and
EXTRGS = 1
2. When using as SCS0-C input, set SCS0S1 and SCS0S0 in PFCR5 to B'10 before other
register setting.
3. When using as SCS0-C output, set SCS0S1 and SCS0S0 in PFCR5 to B'10 before
other register setting.
4. When using as SCS0-C input/output, set SCS0S1 and SCS0S0 in PFCR5 to B'10
before other register setting.
5. PF0DDR = 0 when the SSU pin is used as input.
6. Do not set up for SSU unless SCS0S1 and SCS0S0 = B'10 in RFCR5.
Use as I/O port.
OEE 0
RMTS2 to ⎯
RMTS0
WAITE 0 1
WAITS ⎯ 0 1
SSU settings (1) in table below (2) in (4) in (3) in ⎯ (1) in (2) in (3) (4) in ⎯
table table table table table table
below below below below below below
Pin function PF0 input PF0 SCS0-C SCS0-C SCS0-C WAIT-A PF0 input SCS0-C Setting Setting
output input*3*7 I/O*5*7 output*4*7 input input*3*7 prohibited prohibited
ADTRG0-B input*2
OEE 1
WAITE 0 1 ⎯
WAITS ⎯ 0 1 ⎯
SSU settings (1) in table below (2) in (4) in (3) in ⎯ (1) in (2) in (3) (4) in ⎯ ⎯
table table table table table table
below below below below below below
⎯ ⎯ ⎯
6 6 6
PF0DDR 0 1 0* 0* 0 0* 0 1
Pin function PF0 input PF0 SCS0-C SCS0-C SCS0-C WAIT-A PF0 input SCS0-C Setting Setting OE-A
output input*3*7 I/O*5*7 output*4*7 input input*3*7 prohibited prohibited output*1*6
ADTRG0-B input*
2
OEE ⎯
Area 2 ⎯
WAITE ⎯
SSU settings (1) in table below (2) in table (4) in table (3) in table
below below below
PF0DDR 0 1 0*6 0*6 ⎯
Pin function PF0 input PF0 output SCS0-C SCS0-C SCS0-C
3 7
input* * I/O*5*7 output*4*7
ADTRG0-B input*
2
11.15 Port G
Port G is a 7-bit I/O port that also has other functions. Port G has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of PGDDR specify input or output for the pins of port G. PGDDR cannot be
read; if it is, an undefined value will be read.
4 PG4DR 0 R/W
3 PG3DR 0 R/W
2 PG2DR 0 R/W
1 PG1DR 0 R/W
0 PG0DR 0 R/W
5 PG5ODR 0 R/W
or CAS* output, setting a PGODR bit to 1 makes
1
Port G pins also function as the pins for bus control signal I/Os. The correspondence between the
register specification and the pin functions is shown below.
• PG6/BREQ-A
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit BRLE in BCR of the bus controller, bit BREQS in PFCR4, and bit
PG6DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
BRLE BRLE = 0 or BRLE = 1 ⎯ BRLE = 0 or BRLE = 1
BREQS BRLE = 1 and and BRLE = 1 and and
BREQS = 1 BREQS = 0 BREQS = 1 BREQS = 0
PG6DDR 0 1 ⎯ 0 1 0 1 ⎯
Pin PG6 PG6 BREQ-A PG6 PG6 PG6 PG6 BREQ-A
function input output input input output input output input
• PG5/BACK-A
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit BRLE in BCR of the bus controller, bit BACKS in PFCR4, and bit
PG5DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
BRLE BRLE = 0 or BRLE = 1 ⎯ BRLE = 0 or BRLE = 1
BACKS BRLE = 1 and and BRLE = 1 and and
BACKS = 1 BACKS = 0 BACKS = 1 BACKS = 0
PG5DDR 0 1 ⎯ 0 1 0 1 ⎯
Pin PG5 PG5 BACK-A PG5 PG5 PG5 PG5 BACK-A
function input output output input output input output output
• PG4/BREQO-A/CS4*
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit BRLE in BCR of the bus controller, bit BREQOE, bit BREQOS in
PFCR4, and bit PG4DDR.
BRLE 0 1
BREQOE ⎯ BREQOE = 0 or BREQOE = 1 and BREQOE = 1
BREQOS BREQOS = 1 and
BREQOS = 0
CS4E 0 1 0 1 ⎯
PG4DDR 0 1 0 1 0 1 0 1 ⎯
Pin function PG4 PG4 PG4 CS4 PG4 PG4 PG4 CS4 BREQO-A output
input output input output* input output input output*
BRLE ⎯
BREQOE ⎯
BREQOS
CS4E 0 1
PG4DDR 0 1 0 1
Pin function PG4 input PG4 output PG4 input CS4 output*
Note: * Not supported in the H8S/2427 Group and H8S/2427R Group.
• PG3/CS3/RAS3*2/CAS*1
The pin function is switched as shown below according to the combination of the operating
mode, bits RMTS2 to RMTS0 in DRAMCR of the bus controller, bit CS3E in PFCR0, and bit
PG3DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
CS3E 0 1 ⎯ 0 1
PG3DDR 0 1 0 1 ⎯ ⎯ 0 1 0 1 0 1 ⎯ ⎯
• PG2/CS2/RAS2*2/RAS*1
The pin function is switched as shown below according to the combination of the operating
mode, bits RMTS2 to RMTS0 in DRAMCR of the bus controller, bit CS2E in PFCR0, and bit
PG2DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
CS2E 0 1 ⎯ 0 1
PG2DDR 0 1 0 1 ⎯ ⎯ 0 1 0 1 0 1 ⎯ ⎯
• PG1/CS1, PG0/CS0
The pin function is switched as shown below according to the combination of the operating
mode, bit CSnE in PFCR0, and bit PGnDDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
CSnE 0 1 ⎯ 0 1
PGnDDR 0 1 0 1 0 1 0 1 0 1
Pin PGn PGn PGn CSn PGn PGn PGn PGn PGn CSn
function input output input output input output input output input output
[Legend]
n = 1 or 0
11.16 Port H
Note: Port H is not supported in the H8S/2425 Group.
Port H is a 4-bit I/O port that also has other functions. Port H has the following registers. For the
port function control registers, refer to section 11.18, Port Function Control Registers.
The individual bits of PHDDR specify input or output for the pins of port H. PHDDR cannot be
read; if it is, an undefined value will be read.
Port H pins also function as bus control signal I/Os and interrupt inputs. The correspondence
between the register specification and the pin functions is shown below.
• PH3/CS7/OE-A/CKE-A/IRQ7-B
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bit OEE in DRAMCR of the bus controller, bit OES in PFCR2, bit CS7E in
PFCR0, and bit PH3DDR.
OEE 0 1
OES ⎯ 0 1
RMTS2 to ⎯ ⎯ Areas 2 to Areas 2 to
RMTS0 5 are 5 are syn-
DRAM chronous
space DRAM
space
CS7E 0 1 0 1 ⎯ ⎯
PH3DDR 0 1 0 1 0 1 0 1 ⎯ ⎯
Pin PH3 PH3 PH3 CS7 PH3 PH3 PH3 CS7 OE-A*3 CKE-A
function input output input output input output input output output*2 output*2
IRQ7-B input*
1
OEE ⎯
OES ⎯
RMTS2 to RMTS0 ⎯
CS7E ⎯
PH3DDR 0 1
Pin function PH3 input PH3 output
IRQ7-B input* 1
• PH2/CS6/IRQ6-B
The pin function is switched as shown below according to the combination of the operating
mode, bit CS6E in PFCR0, and bit PH2DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
CS6E 0 1 ⎯ 0 1
PH2DDR 0 1 0 1 0 1 0 1 0 1
Pin PH2 PH2 PH2 CS6 PH2 PH2 PH2 PH2 PH2 CS6
function input output input output input output input output input output
IRQ6-B interrupt input*
Note: * IRQ6-B input when the ITS6 bit in ITSR is 1.
• PH1/CS5/RAS5*2/SDRAMφ*1
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits RMTS2 to RMTS0 in DRAMCR of the bus controller, bit SDPSTP in
SCKCR of the clock pulse generator, bit CS5E in PFCR0 and bit PH1DDR.
SDPSTP 1 0
Operating 1, 2, 4 3, 5, 7 ⎯
mode
EXPE ⎯ 0 1 ⎯
RMTS2 to Area 5 is normal space Area 5 is DRAM ⎯ Area 5 is normal space Area 5 is DRAM ⎯
RMTS0 space space
CS5E 0 1 0 1 ⎯ 0 1 0 1 ⎯
PH1DDR 0 1 0 1 0 1 ⎯ 0 1 0 1 0 1 0 1 ⎯ ⎯
Pin PH1 PH1 PH1 CS5 PH1 PH1 RAS5* PH1 PH1 PH1 PH1 PH1 CS5 PH1 PH1 RAS5* SDRAMφ
function input output input output input output output input output input output input output input output output output*
• PH0/CS4/RAS4/WE*
The pin function is switched as shown below according to the combination of the operating
mode, bit EXPE, bits RMTS2 to RMTS0 in DRAMCR of the bus controller, bit CS4E in
PFCR0, and bit PH0DDR.
Operating 1, 2, 4 3, 5, 7
mode
EXPE ⎯ 0 1
CS4E 0 1 ⎯ 0 1
PH0DDR 0 1 0 1 ⎯ ⎯ 0 1 0 1 0 1 ⎯ ⎯
Pin PH0 PH0 PH0 CS4 RAS4 WE PH0 PH0 PH0 PH0 PH0 CS4 RAS4 WE
function input output input output output output*1 input output input output input output output output*1
2 2
* *
11.17 Port J
Note: Port J is not supported in the H8S/2425 Group.
The individual bits of PJDDR specify input or output for the pins of port J. PJDDR cannot be read;
if it is, an undefined value will be read.
Port J pins function only as I/O ports. The correspondence between the register specification and
the pin functions is shown below.
• PJ2*
The PJ2 pin is an input-only pin.
• PJ1, PJ0
The pin function is switched as shown below according to bit PJnDDR.
PJnDDR 0 1
Pin function PJn input PJn output
[Legend]
n = 1 or 0
Bits 7 to 5 are valid in modes 1 and 2 and all the bits are valid in modes 3, 4, 5, and 7.
PFCR2 selects EDACK3 output polarity, switches the P85 TPU function, enables or disables AS
output, LWR output, and OE output.
0: Active low
1: Active high
5 TPUS2 0 R/W TPU Pin Selection for P85
Selects the TPU output pin function for P85 when the
TPUS bit in PFCR3 is set to 1.
0: Selects TIOCB4-B as the pin function when P85 is
designated as a TPU pin.
1: Selects TIOCA9-B as the pin function when P85 is
designated as a TPU pin.
4 ⎯ 0 ⎯ Reserved
This bit is always read as 0. Only the initial value should
be written to this bit.
3 ASOE 1 R/W AS Output Enable
Enables or disables the AS output pin.
0: PF6 is designated as I/O port
1: PF6 is designated as AS output pin
2 LWROE 1 R/W LWR Output Enable
Enables or disables the LWR output pin.
0: PF3 is designated as I/O port
1: PF3 is designated as LWR output pin
[H8S/2425 Group]
PF0 is designated as OE-A*2 output pin.
0 ⎯ 0 ⎯ Reserved
This bit is always read as 0. Only the initial value should
be written to this bit.
Notes: 1. Not supported in the H8S/2425 Group.
2. Not supported by the 5-V version.
PFCR3 switches the functions of the PPG output pin, TPU input/output pin, TMR input/output
pin, and TEND output.
PFCR4 switches the functions of the WAIT input pin, BREQ input pin, BACK output pin,
BREQO output pin, TxD4 output pin, RxD4 input pin, and SCK4 input/output pin.
12.1 Features
• Maximum 32-pulse input/output (unit 0: 16, unit 1: 16, when the EXPE bit is 0 in single-chip
mode)
• Selection of 8 counter input clocks for each channel
• The following operations can be set for each channel:
⎯ Waveform output at compare match
⎯ Input capture function
⎯ Counter clear operation
⎯ Synchronous operations:
Multiple timer counters (TCNT) can be written to simultaneously
Simultaneous clearing by compare match and input capture possible
Register simultaneous input/output possible by counter synchronous operation
⎯ Maximum of 15-phase PWM output possible by combination with synchronous operation
• Buffer operation settable for channels 0 (6) and 3 (9)
• Phase counting mode settable independently for each of channels 1 (7), 2 (8), 4 (10), and 5
(11)
• Cascaded operation
• Fast access via internal 16-bit bus
• 26 interrupt sources (per unit)
• Automatic transfer of register data
• Programmable pulse generator (PPG) output trigger can be generated (only by unit 0)
• A/D converter conversion start trigger can be generated
• Module stop state can be set
• Activation of the DMAC (only by unit 0) and DTC
TIORH TIORL
TMDR
TSR
Channel 3
TGRC
TGRD
TGRA
TGRB
TCNT
Interrupt request signals
TIER
TCR
Channel 3: TGI3A
Input/output pins TGI3B
Channel 3: TIOCA3 TGI3C
TIOCB3 TGI3D
TMDR
TSR
TIOCC3 TCI3V
Channel 4
TGRA
TGRB
TCNT
TIOCD3 Channel 4: TGI4A
Channel 4: TIOCA4 TGI4B
TIOR
TIER
TCR
TIOCB4 TCI4V
Channel 5: TIOCA5 TCI4U
TIOCB5 Channel 5: TGI5A
TGI5B
TMDR
TSR
TCI5V
Channel 5
TGRA
TGRB
TCNT
TCI5U
TIOR
TIER
TCR
Clock input
Internal clock: φ/1
φ/4
φ/16
φ/64
Module data bus
TSTR TSYR
Bus interface
Internal data bus
Control logic
φ/256
φ/1024
Common
φ/4096
A/D conversion start request signal
External clock: TCLKA
TCLKB PPG output trigger signal
TCLKC
TMDR
TCLKD
TSR
Channel 2
TGRA
TGRB
TCNT
TIOR
TIER
TCR
TIOCB0
TSR
TGI0C
Channel 1
Control logic for channels 0 to 2
TIOCC0
TGRA
TGRB
TCNT
TIOCD0 TGI0D
TCI0V
TIOR
Channel 1: TIOCA1
TIER
TCR
TCI1U
TSR
Channel 0
Channel 2: TGI2A
TGRC
TGRD
TGRA
TGRB
TCNT
TGI2B
TIER
TCR
TCI2V
TCI2U
[Legend]
TSTR: Timer start register TIER: Timer interrupt enable register
TSYR: Timer synchronous register TSR: Timer status register
TCR: Timer control register TGR (A, B, C, D): Timer general registers (A, B, C, D)
TMDR: Timer mode register TCNT: Timer counter
TIOR (H, L): Timer I/O control registers (H, L)
TIORH TIORL
TMDR
TSR
Channel 9
TGRC
TGRD
TGRA
TGRB
TCNT
Interrupt request signals
TIER
TCR
Channel 9: TGI9A
Input/output pins TGI9B
Channel 9: TIOCA9 TGI9C
TIOCB9 TGI9D
TMDR
TSR
Control logic for channels 9 to 11
TIOCC9
Channel 10
TCI9V
TGRA
TGRB
TCNT
TIOCD9 Channel 10: TGI10A
Channel 10: TIOCA10 TGI10B
TIOR
TIER
TCR
TIOCB10 TCI10V
Channel 11: TIOCA11 TCI10U
TIOCB11 Channel 11: TGI11A
TGI11B
TMDR
TSR
Channel 11
TCI11V
TGRA
TGRB
TCNT
TCI11U
TIOR
TIER
TCR
Clock input
Internal clock: φ/1
φ/4
φ/16
φ/64
Module data bus
TSTR_1 TSYR_1
Bus interface
Internal data bus
Control logic
φ/256
φ/1024
Common
φ/4096
A/D conversion start request signal
External clock: TCLKE
TCLKF
TCLKG
TMDR
TCLKH
TSR
Channel 6
TGRA
TGRB
TCNT
TIOR
TIER
TCR
TIOCB6
TSR
TGI6C
Channel 7
Control logic for channels 6 to 8
TIOCC6
TGRA
TGRB
TCNT
TIOCD6 TGI6D
TCI6V
TIOR
Channel 7: TIOCA7
TIER
TCR
TCI7U
TSR
Channel 8
Channel 8: TGI8A
TGRC
TGRD
TGRA
TGRB
TCNT
TGI8B
TIER
TCR
TCI8V
TCI8U
[Legend]
TSTR_1: Timer start register 1 TIER: Timer interrupt enable register
TSYR_1: Timer synchronous register 1 TSR: Timer status register
TCR: Timer control register TGR (A, B, C, D): Timer general registers (A, B, C, D)
TMDR: Timer mode register TCNT: Timer counter
TIOR (H, L): Timer I/O control registers (H, L)
Unit 0:
Channel 0
• Timer control register_0 (TCR_0)
• Timer mode register_0 (TMDR_0)
• Timer I/O control register H_0 (TIORH_0)
• Timer I/O control register L_0 (TIORL_0)
• Timer interrupt enable register_0 (TIER_0)
• Timer status register_0 (TSR_0)
• Timer counter_0 (TCNT_0)
• Timer general register A_0 (TGRA_0)
• Timer general register B_0 (TGRB_0)
• Timer general register C_0 (TGRC_0)
• Timer general register D_0 (TGRD_0)
Channel 1
• Timer control register_1 (TCR_1)
• Timer mode register_1 (TMDR_1)
• Timer I/O control register_1 (TIOR_1)
• Timer interrupt enable register_1 (TIER_1)
• Timer status register_1 (TSR_1)
• Timer counter_1 (TCNT_1)
• Timer general register A_1 (TGRA_1)
• Timer general register B_1 (TGRB_1)
Channel 2
• Timer control register_2 (TCR_2)
• Timer mode register_2 (TMDR_2)
• Timer I/O control register_2 (TIOR_2)
• Timer interrupt enable register_2 (TIER_2)
• Timer status register_2 (TSR_2)
• Timer counter_2 (TCNT_2)
• Timer general register A_2 (TGRA_2)
• Timer general register B_2 (TGRB_2)
Channel 3
• Timer control register_3 (TCR_3)
• Timer mode register_3 (TMDR_3)
• Timer I/O control register H_3 (TIORH_3)
• Timer I/O control register L_3 (TIORL_3)
• Timer interrupt enable register_3 (TIER_3)
• Timer status register_3 (TSR_3)
• Timer counter_3 (TCNT_3)
• Timer general register A_3 (TGRA_3)
• Timer general register B_3 (TGRB_3)
• Timer general register C_3 (TGRC_3)
• Timer general register D_3 (TGRD_3)
Channel 4
• Timer control register_4 (TCR_4)
• Timer mode register_4 (TMDR_4)
• Timer I/O control register_4 (TIOR_4)
• Timer interrupt enable register_4 (TIER_4)
• Timer status register_4 (TSR_4)
• Timer counter_4 (TCNT_4)
• Timer general register A_4 (TGRA_4)
• Timer general register B_4 (TGRB_4)
Channel 5
• Timer control register_5 (TCR_5)
• Timer mode register_5 (TMDR_5)
• Timer I/O control register_5 (TIOR_5)
• Timer interrupt enable register_5 (TIER_5)
• Timer status register_5 (TSR_5)
• Timer counter_5 (TCNT_5)
• Timer general register A_5 (TGRA_5)
• Timer general register B_5 (TGRB_5)
Unit 1:
Channel 6
• Timer control register_6 (TCR_6)
• Timer mode register_6 (TMDR_6)
• Timer I/O control register H_6 (TIORH_6)
• Timer I/O control register L_6 (TIORL_6)
• Timer interrupt enable register_6 (TIER_6)
• Timer status register_6 (TSR_6)
• Timer counter_6 (TCNT_6)
• Timer general register A_6 (TGRA_6)
• Timer general register B_6 (TGRB_6)
• Timer general register C_6 (TGRC_6)
• Timer general register D_6 (TGRD_6)
Channel 7
• Timer control register_7 (TCR_7)
• Timer mode register_7 (TMDR_7)
• Timer I/O control register_7 (TIOR_7)
• Timer interrupt enable register_7 (TIER_7)
• Timer status register_7 (TSR_7)
• Timer counter_7 (TCNT_7)
• Timer general register A_7 (TGRA_7)
• Timer general register B_7 (TGRB_7)
Channel 8
• Timer control register_8 (TCR_8)
• Timer mode register_8 (TMDR_8)
• Timer I/O control register_8 (TIOR_8)
• Timer interrupt enable register_8 (TIER_8)
• Timer status register_8 (TSR_8)
• Timer counter_8 (TCNT_8)
• Timer general register A_8 (TGRA_8)
• Timer general register B_8 (TGRB_8)
Channel 9
• Timer control register_9 (TCR_9)
• Timer mode register_9 (TMDR_9)
• Timer I/O control register H_9 (TIORH_9)
• Timer I/O control register L_9 (TIORL_9)
• Timer interrupt enable register_9 (TIER_9)
• Timer status register_9 (TSR_9)
• Timer counter_9 (TCNT_9)
• Timer general register A_9 (TGRA_9)
• Timer general register B_9 (TGRB_9)
• Timer general register C_9 (TGRC_9)
• Timer general register D_9 (TGRD_9)
Channel 10
• Timer control register_10 (TCR_10)
• Timer mode register_10 (TMDR_10)
• Timer I/O control register_10 (TIOR_10)
• Timer interrupt enable register_10 (TIER_10)
• Timer status register_10 (TSR_10)
• Timer counter_10 (TCNT_10)
• Timer general register A_10 (TGRA_10)
• Timer general register B_10 (TGRB_10)
Channel 11
• Timer control register_11 (TCR_11)
• Timer mode register_11 (TMDR_11)
• Timer I/O control register_11 (TIOR_11)
• Timer interrupt enable register_11 (TIER_11)
• Timer status register_11 (TSR_11)
• Timer counter_11 (TCNT_11)
• Timer general register A_11 (TGRA_11)
• Timer general register B_11 (TGRB_11)
The TCR registers control the TCNT operation for each channel. The TPU has a total of six TCR
registers, one for each channel. TCR register settings should be made only when TCNT operation
is stopped.
TMDR registers are used to set the operating mode for each channel. The TPU has six TMDR
registers, one for each channel. TMDR register settings should be made only when TCNT
operation is stopped.
TIOR registers control the TGR registers. The TPU has eight TIOR registers, two each for
channels 0 and 3, and one each for channels 1, 2, 4, and 5. Care is required since TIOR is affected
by the TMDR setting.
The initial output specified by TIOR is valid when the counter is stopped (the CST bit in TSTR is
cleared to 0). Note also that, in PWM mode 2, the output at the point at which the counter is
cleared to 0 is specified.
When TGRC or TGRD is designated for buffer operation, this setting is invalid and the register
operates as a buffer register.
TIORL_0, TIORL_3
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRB_0
IOB3 IOB2 IOB1 IOB0 Function TIOCB0 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCB0 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCB0 pin
Input capture at falling edge
1 x Capture input source is TIOCB0 pin
Input capture at both edges
1 x x Capture input source is channel 1/count clock
Input capture at TCNT_1 count- up/count-down*
[Legend]
x: Don't care
Note: * When bits TPSC2 to TPSC0 in TCR_1 are set to B'000 and φ/1 is used as the TCNT_1
count clock, this setting is invalid and input capture is not generated.
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRD_0
IOD3 IOD2 IOD1 IOD0 Function TIOCD0 Pin Function
0 0 0 0 Output Output disabled
compare
1 2 Initial output is 0 output
register*
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCD0 pin
capture Input capture at rising edge
register*2
1 Capture input source is TIOCD0 pin
Input capture at falling edge
1 x Capture input source is TIOCD0 pin
Input capture at both edges
1 x x Capture input source is channel 1/count clock
1
Input capture at TCNT_1 count-up/count-down*
[Legend]
x: Don't care
Notes: 1. When bits TPSC2 to TPSC0 in TCR_1 are set to B'000 and φ/1 is used as the TCNT_1
count clock, this setting is invalid and input capture is not generated.
2. When the BFB bit in TMDR_0 is set to 1 and TGRD_0 is used as a buffer register, this
setting is invalid and input capture/output compare is not generated.
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRB_1
IOB3 IOB2 IOB1 IOB0 Function TIOCB1 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCB1 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCB1 pin
Input capture at falling edge
1 x Capture input source is TIOCB1 pin
Input capture at both edges
1 x x TGRC_0 compare match/input capture
Input capture at generation of TGRC_0 compare
match/input capture
[Legend]
x: Don't care
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRB_2
IOB3 IOB2 IOB1 IOB0 Function TIOCB2 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 × 0 0 Input Capture input source is TIOCB2 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCB2 pin
Input capture at falling edge
1 x Capture input source is TIOCB2 pin
Input capture at both edges
[Legend]
x: Don't care
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRB_3
IOB3 IOB2 IOB1 IOB0 Function TIOCB3 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCB3 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCB3 pin
Input capture at falling edge
1 x Capture input source is TIOCB3 pin
Input capture at both edges
1 x x Capture input source is channel 4/count clock
Input capture at TCNT_4 count-up/count-down*
[Legend]
x: Don't care
Note: * When bits TPSC2 to TPSC0 in TCR_4 are set to B'000 and φ/1 is used as the TCNT_4
count clock, this setting is invalid and input capture is not generated.
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRD_3
IOD3 IOD2 IOD1 IOD0 Function TIOCD3 Pin Function
0 0 0 0 Output Output disabled
compare
1 2 Initial output is 0 output
register*
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCD3 pin
capture Input capture at rising edge
register*2
1 Capture input source is TIOCD3 pin
Input capture at falling edge
1 x Capture input source is TIOCD3 pin
Input capture at both edges
1 x x Capture input source is channel 4/count clock
1
Input capture at TCNT_4 count-up/count-down*
[Legend]
x: Don't care
Notes: 1. When bits TPSC2 to TPSC0 in TCR_4 are set to B'000 and φ/1 is used as the TCNT_4
count clock, this setting is invalid and input capture is not generated.
2. When the BFB bit in TMDR_3 is set to 1 and TGRD_3 is used as a buffer register, this
setting is invalid and input capture/output compare is not generated.
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRB_4
IOB3 IOB2 IOB1 IOB0 Function TIOCB4 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCB4 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCB4 pin
Input capture at falling edge
1 x Capture input source is TIOCB4 pin
Input capture at both edges
1 x x Capture input source is TGRC_3 compare
match/input capture
Input capture at generation of TGRC_3 compare
match/input capture
[Legend]
x: Don't care
Description
Bit 7 Bit 6 Bit 5 Bit 4 TGRB_5
IOB3 IOB2 IOB1 IOB0 Function TIOCB5 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 × 0 0 Input Capture input source is TIOCB5 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCB5 pin
Input capture at falling edge
1 x Capture input source is TIOCB5 pin
Input capture at both edges
[Legend]
x: Don't care
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRA_0
IOA3 IOA2 IOA1 IOA0 Function TIOCA0 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCA0 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCA0 pin
Input capture at falling edge
1 x Capture input source is TIOCA0 pin
Input capture at both edges
1 x x Capture input source is channel 1/count clock
Input capture at TCNT_1 count-up/count-down
[Legend]
x: Don't care
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRC_0
IOC3 IOC2 IOC1 IOC0 Function TIOCC0 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register*
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCC0 pin
capture Input capture at rising edge
register*
1 Capture input source is TIOCC0 pin
Input capture at falling edge
1 x Capture input source is TIOCC0 pin
Input capture at both edges
1 x x Capture input source is channel 1/count clock
Input capture at TCNT_1 count-up/count-down
[Legend]
x: Don't care
Note: * When the BFA bit in TMDR_0 is set to 1 and TGRC_0 is used as a buffer register, this
setting is invalid and input capture/output compare is not generated.
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRA_1
IOA3 IOA2 IOA1 IOA0 Function TIOCA1 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCA1 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCA1 pin
Input capture at falling edge
1 x Capture input source is TIOCA1 pin
Input capture at both edges
1 x x Capture input source is TGRA_0 compare
match/input capture
Input capture at generation of channel
0/TGRA_0 compare match/input capture
[Legend]
x: Don't care
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRA_2
IOA3 IOA2 IOA1 IOA0 Function TIOCA2 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 × 0 0 Input Capture input source is TIOCA2 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCA2 pin
Input capture at falling edge
1 x Capture input source is TIOCA2 pin
Input capture at both edges
[Legend]
x: Don't care
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRA_3
IOA3 IOA2 IOA1 IOA0 Function TIOCA3 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCA3 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCA3 pin
Input capture at falling edge
1 x Capture input source is TIOCA3 pin
Input capture at both edges
1 x x Capture input source is channel 4/count clock
Input capture at TCNT_4 count-up/count-down
[Legend]
x: Don't care
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRC_3
IOC3 IOC2 IOC1 IOC0 Function TIOCC3 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register*
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCC3 pin
capture Input capture at rising edge
register*
1 Capture input source is TIOCC3 pin
Input capture at falling edge
1 x Capture input source is TIOCC3 pin
Input capture at both edges
1 x x Capture input source is channel 4/count clock
Input capture at TCNT_4 count-up/count-down
[Legend]
x: Don't care
Note: * When the BFA bit in TMDR_3 is set to 1 and TGRC_3 is used as a buffer register, this
setting is invalid and input capture/output compare is not generated.
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRA_4
IOA3 IOA2 IOA1 IOA0 Function TIOCA4 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 0 0 0 Input Capture input source is TIOCA4 pin
capture Input capture at rising edge
register
1 Capture input source is TIOCA4 pin
Input capture at falling edge
1 x Capture input source is TIOCA4 pin
Input capture at both edges
1 x x Capture input source is TGRA_3 compare
match/input capture
Input capture at generation of TGRA_3 compare
match/input capture
[Legend]
x: Don't care
Description
Bit 3 Bit 2 Bit 1 Bit 0 TGRA_5
IOA3 IOA2 IOA1 IOA0 Function TIOCA5 Pin Function
0 0 0 0 Output Output disabled
compare
1 Initial output is 0 output
register
0 output at compare match
1 0 Initial output is 0 output
1 output at compare match
1 Initial output is 0 output
Toggle output at compare match
1 0 0 Output disabled
1 Initial output is 1 output
0 output at compare match
1 0 Initial output is 1 output
1 output at compare match
1 Initial output is 1 output
Toggle output at compare match
1 x 0 0 Input Input capture source is TIOCA5 pin
capture Input capture at rising edge
register
1 Input capture source is TIOCA5 pin
Input capture at falling edge
1 x Input capture source is TIOCA5 pin
Input capture at both edges
[Legend]
x: Don't care
TIER registers control enabling or disabling of interrupt requests for each channel. The TPU has
six TIER registers, one for each channel.
TSR registers indicate the status of each channel. The TPU has six TSR registers, one for each
channel.
The TCNT registers are 16-bit readable/writable counters. The TPU has six TCNT counters, one
for each channel.
The TCNT counters are initialized to H'0000 by a reset, or in hardware standby mode.
The TCNT counters cannot be accessed in 8-bit units; they must always be accessed as a 16-bit
unit.
The TGR registers are 16-bit readable/writable registers with a dual function as output compare
and input capture registers. The TPU has 16 TGR registers, four each for channels 0 and 3 and two
each for channels 1, 2, 4, and 5. TGRC and TGRD for channels 0 and 3 can also be designated for
operation as buffer registers. The TGR registers cannot be accessed in 8-bit units; they must
always be accessed as a 16-bit unit. TGR buffer register combinations are TGRA–TGRC and
TGRB–TGRD.
TSTR selects operation/stoppage for channels 0 to 5. When setting the operating mode in TMDR
or setting the count clock in TCR, first stop the TCNT counter.
TSYR selects independent operation or synchronous operation for the TCNT counters of channels
0 to 5. A channel performs synchronous operation when the corresponding bit in TSYR is set to 1.
TSTRB selects operation/stoppage for channels 6 to 11. When setting the operating mode in
TMDR or setting the count clock in TCR, first stop the TCNT counter.
TSYRB selects independent operation or synchronous operation for the TCNT counters of
channels 6 to 11. A channel performs synchronous operation when the corresponding bit in
TSYRB is set to 1.
12.4 Operation
Each channel has a TCNT and TGR register. TCNT performs up-counting, and is also capable of
free-running operation, periodic counting, and external event counting.
Each TGR can be used as an input capture register or output compare register.
When one of bits CST0 to CST5 is set to 1 in TSTR, the TCNT counter for the corresponding
channel starts counting. TCNT can operate as a free-running counter, periodic counter, and so on.
Immediately after a reset, the TPU’s TCNT counters are all designated as free-running counters.
When the relevant bit in TSTR is set to 1 the corresponding TCNT counter starts up-count
operation as a free-running counter. When TCNT overflows (changes from H'FFFF to H'0000),
the TCFV bit in TSR is set to 1. If the value of the corresponding TCIEV bit in TIER is 1 at this
point, the TPU requests an interrupt. After overflow, TCNT starts counting up again from H'0000.
TCNT value
H'FFFF
H'0000 Time
CST bit
TCFV
When compare match is selected as the TCNT clearing source, the TCNT counter for the relevant
channel performs periodic count operation. The TGR register for setting the period is designated
as an output compare register, and counter clearing by compare match is selected by means of bits
CCLR2 to CCLR0 in TCR. After the settings have been made, TCNT starts count-up operation as
a periodic counter when the corresponding bit in TSTR is set to 1. When the count value matches
the value in TGR, the TGF bit in TSR is set to 1 and TCNT is cleared to H'0000.
If the value of the corresponding TGIE bit in TIER is 1 at this point, the TPU requests an interrupt.
After a compare match, TCNT starts counting up again from H'0000.
H'0000 Time
CST bit
Flag cleared by software or
DTC activation
TGF
The TPU can perform 0, 1, or toggle output from the corresponding output pin using a compare
match.
Figure 12.6 shows an example of the setting procedure for waveform output by a compare match.
<Waveform output>
Figure 12.6 Example of Setting Procedure for Waveform Output by Compare Match
In this example, TCNT has been designated as a free-running counter, and settings have been
made so that 1 is output by compare match A, and 0 is output by compare match B. When the set
level and the pin level match, the pin level does not change.
TCNT value
H'FFFF
TGRA
TGRB
H'0000 Time
No change No change
1 output
TIOCA
In this example TCNT has been designated as a periodic counter (with counter clearing performed
by compare match B), and settings have been made so that output is toggled by both compare
match A and compare match B.
TCNT value
Counter cleared by TGRB compare match
H'FFFF
TGRB
TGRA
H'0000 Time
Toggle output
TIOCB
The TCNT value can be transferred to TGR on detection of the TIOC pin input edge.
Rising edge, falling edge, or both edges can be selected as the detection edge. For channels 0, 1, 3,
4, 6, 7, 9, and 10 it is also possible to specify another channel's counter input clock or compare
match signal as the input capture source.
Note: When another channel's counter input clock is used as the input capture input for channels
0, 3, 6, and 9, φ/1 should not be selected as the counter input clock used for input capture
input. Input capture will not be generated if φ/1 is selected.
Figure 12.9 shows an example of the setting procedure for input capture operation.
In this example both rising and falling edges have been selected as the TIOCA pin input capture
input edge, falling edge has been selected as the TIOCB pin input capture input edge, and counter
clearing by TGRB input capture has been designated for TCNT.
H'0160
H'0010
H'0005
H'0000 Time
TIOCA
TIOCB
TGRB H'0180
In synchronous operation, the values in multiple TCNT counters can be rewritten simultaneously
(synchronous presetting). Also, multiple of TCNT counters can be cleared simultaneously
(synchronous clearing) by making the appropriate setting in TCR.
Synchronous operation enables TGR to be incremented with respect to a single time base.
Synchronous operation
selection
Set synchronous
[1]
operation
Yes
Select counter Set synchronous
[3] [4]
clearing source counter clearing
[1] Set to 1 the SYNC bits in TSYR corresponding to the channels to be designated for synchronous operation.
[2] When the TCNT counter of any of the channels designated for synchronous operation is written to, the
same value is simultaneously written to the other TCNT counters.
[3] Use bits CCLR2 to CCLR0 in TCR to specify TCNT clearing by input capture/output compare, etc.
[4] Use bits CCLR2 to CCLR0 in TCR to designate synchronous clearing for the counter clearing source.
[5] Set to 1 the CST bits in TSTR for the relevant channels, to start the count operation.
In this example, synchronous operation and PWM mode 1 have been designated for channels 0 to
2, TGRB_0 compare match has been set as the channel 0 counter clearing source, and
synchronous clearing has been set for the channel 1 and 2 counter clearing source.
Three-phase PWM waveforms are output from pins TIOCA0, TIOCA1, and TIOCA2. At this
time, synchronous presetting, and synchronous clearing by TGRB_0 compare match, is performed
for channel 0 to 2 TCNT counters, and the data set in TGRB_0 is used as the PWM cycle.
TGRB_1
TGRA_0
TGRB_2
TGRA_1
TGRA_2
H'0000 Time
TIOCA_0
TIOCA_1
TIOCA_2
Buffer operation, provided for channels 0, 3, 6, and 9, enables TGRC and TGRD to be used as
buffer registers.
Buffer operation differs depending on whether TGR has been designated as an input capture
register or a compare match register.
Timer general
Buffer register Comparator TCNT
register
Input capture
signal
<Buffer operation>
Figure 12.16 shows an operation example in which PWM mode 1 has been designated for channel
0, and buffer operation has been designated for TGRA and TGRC. The settings used in this
example are TCNT clearing by compare match B, 1 output at compare match A, and 0 output at
compare match B.
As buffer operation has been set, when compare match A occurs the output changes and the value
in buffer register TGRC is simultaneously transferred to timer general register TGRA. This
operation is repeated each time compare match A occurs.
TCNT value
TGRB_0 H'0520
H'0450
H'0200
TGRA_0
H'0000 Time
TIOCA
Figure 12.17 shows an operation example in which TGRA has been designated as an input capture
register, and buffer operation has been designated for TGRA and TGRC.
Counter clearing by TGRA input capture has been set for TCNT, and both rising and falling edges
have been selected as the TIOCA pin input capture input edge.
As buffer operation has been set, when the TCNT value is stored in TGRA upon occurrence of
input capture A, the value previously stored in TGRA is simultaneously transferred to TGRC.
TCNT value
H'0F07
H'09FB
H'0532
H'0000 Time
TIOCA
In cascaded operation, two 16-bit counters for different channels are used together as a 32-bit
counter.
This function works by counting the channel 1 (channel 4, channel 7, or channel 10) counter clock
at overflow/underflow of TCNT_2 (TCNT_5, TCNT_8, or TCNT_11) as set in bits TPSC2 to
TPSC0 in TCR.
Underflow occurs only when the lower 16-bit TCNT is in phase-counting mode.
Note: When phase counting mode is set for channel 1, 4, 7, or 10, the counter clock setting is
invalid and the counter operates independently in phase counting mode.
Figure 12.18 shows an example of the setting procedure for cascaded operation.
<Cascaded operation>
Figure 12.19 illustrates the operation when counting upon TCNT_2 overflow/underflow has been
set for TCNT_1, TGRA_1 and TGRA_2 have been designated as input capture registers, and the
TIOC pin rising edge has been selected.
When a rising edge is input to the TIOCA1 and TIOCA2 pins simultaneously, the upper 16 bits of
the 32-bit data are transferred to TGRA_1, and the lower 16 bits to TGRA_2.
TCNT_1
clock
TCNT_2
clock
TIOCA1,
TIOCA2
TGRA_1 H'03A2
TGRA_2 H'0000
Figure 12.20 illustrates the operation when counting upon TCNT_2 overflow/underflow has been
set for TCNT_1, and phase counting mode has been designated for channel 2.
TCLKC
TCLKD
TCNT_2 FFFD FFFE FFFF 0000 0001 0002 0001 0000 FFFF
In PWM mode, PWM waveforms are output from the output pins. 0, 1, or toggle output can be
selected as the output level in response to compare match of each TGR.
Settings of TGR registers can output a PWM waveform in the range of 0–% to 100–% duty cycle.
Designating TGR compare match as the counter clearing source enables the cycle to be set in that
register. All channels can be designated for PWM mode independently. Synchronous operation is
also possible.
• PWM mode 1
PWM output is generated from the TIOCA and TIOCC pins by pairing TGRA with TGRB and
TGRC with TGRD. The outputs specified by bits IOA3 to IOA0 and IOC3 to IOC0 in TIOR
are output from the TIOCA and TIOCC pins at compare matches A and C, respectively. The
outputs specified by bits IOB3 to IOB0 and IOD3 to IOD0 in TIOR are output at compare
matches B and D, respectively. The initial output value is the value set in TGRA or TGRC. If
the set values of paired TGRs are identical, the output value does not change when a compare
match occurs.
In PWM mode 1, a maximum 8-phase PWM output is possible.
• PWM mode 2
PWM output is generated using one TGR as the cycle register and the others as duty cycle
registers. The output specified in TIOR is performed by means of compare matches. Upon
counter clearing by a synchronization register compare match, the output value of each pin is
the initial value set in TIOR. If the set values of the cycle and duty cycle registers are identical,
the output value does not change when a compare match occurs.
In PWM mode 2, a maximum 15-phase PWM output is possible by combined use with
synchronous operation.
The correspondence between PWM output pins and registers is shown in table 12.31.
Output Pins
Unit Channel Registers PWM Mode 1 PWM Mode 2
0 0 TGRA_0 TIOCA0 TIOCA0
TGRB_0 TIOCB0
TGRC_0 TIOCC0 TIOCC0
TGRD_0 TIOCD0
1 TGRA_1 TIOCA1 TIOCA1
TGRB_1 TIOCB1
2 TGRA_2 TIOCA2 TIOCA2
TGRB_2 TIOCB2
3 TGRA_3 TIOCA3 TIOCA3
TGRB_3 TIOCB3
TGRC_3 TIOCC3 TIOCC3
TGRD_3 TIOCD3
4 TGRA_4 TIOCA4 TIOCA4
TGRB_4 TIOCB4
5 TGRA_5 TIOCA5 TIOCA5
TGRB_5 TIOCB5
1 6 TGRA_6 TIOCA6 TIOCA6
TGRB_6 TIOCB6
TGRC_6 TIOCC6 TIOCC6
TGRD_6 TIOCD6
7 TGRA_7 TIOCA7 TIOCA7
TGRB_7 TIOCB7
8 TGRA_8 TIOCA8 TIOCA8
TGRB_8 TIOCB8
9 TGRA_9 TIOCA9 TIOCA9
TGRB_9 TIOCB9
TGRC_9 TIOCC9 TIOCC9
TGRD_9 TIOCD9
10 TGRA_10 TIOCA10 TIOCA10
TGRB_10 TIOCB10
11 TGRA_11 TIOCA11 TIOCA11
TGRB_11 TIOCB11
Note: In PWM mode 2, PWM output is not possible for the TGR register in which the cycle is set.
<PWM mode>
In this example, TGRA compare match is set as the TCNT clearing source, 0 is set for the TGRA
initial output value and output value, and 1 is set as the TGRB output value.
In this case, the value set in TGRA is used as the cycle, and the values set in TGRB registers as
the duty cycle.
TCNT value
Counter cleared by
TGRA compare match
TGRA
TGRB
H'0000 Time
TIOCA
In this example, synchronous operation is designated for channels 0 and 1, TGRB_1 compare
match is set as the TCNT clearing source, and 0 is set for the initial output value and 1 for the
output value of the other TGR registers (TGRA_0 to TGRD_0, TGRA_1), to output a 5-phase
PWM waveform.
In this case, the value set in TGRB_1 is used as the cycle, and the values set in the other TGRs as
the duty cycle.
Counter cleared by
TCNT value TGRB_1 compare match
TGRB_1
TGRA_1
TGRD_0
TGRC_0
TGRB_0
TGRA_0
H'0000
Time
TIOCA0
TIOCB0
TIOCC0
TIOCD0
TIOCA1
Figure 12.24 shows examples of PWM waveform output with 0% duty cycle and 100% duty cycle
in PWM mode.
TCNT value
TGRB rewritten
TGRA
TGRB
TGRB rewritten
TGRB rewritten
H'0000 Time
0% duty
TIOCA
Output does not change when cycle register and duty register
compare matches occur simultaneously
TCNT value
TGRB rewritten
TGRA
TGRB rewritten
H'0000 Time
100% duty
TIOCA
TGRB rewritten
TGRA
TGRB rewritten
TGRB
TGRB rewritten
H'0000 Time
In phase counting mode, the phase difference between two external clock inputs is detected and
TCNT is incremented/decremented accordingly. This mode can be set for channels 1, 2, 4, 5, 7, 8,
10, and 11.
When phase counting mode is set, an external clock is selected as the counter input clock and
TCNT operates as an up/down-counter regardless of the setting of bits TPSC2 to TPSC0 and bits
CKEG1 and CKEG0 in TCR. However, the functions of bits CCLR1 and CCLR0 in TCR, and of
TIOR, TIER, and TGR are valid, and input capture/compare match and interrupt functions can be
used.
When overflow occurs while TCNT is counting up, the TCFV flag in TSR is set; when underflow
occurs while TCNT is counting down, the TCFU flag is set.
The TCFD bit in TSR is the count direction flag. Reading the TCFD flag provides an indication of
whether TCNT is counting up or down.
Table 12.32 shows the correspondence between external clock pins and channels.
Figure 12.25 shows an example of the phase counting mode setting procedure.
In phase counting mode, TCNT counts up or down according to the phase difference between two
external clocks. There are four modes, according to the count conditions.
Figure 12.26 shows an example of phase counting mode 1 operation, and table 12.33 summarizes
the TCNT up/down-count conditions.
TCNT value
Up-count Down-count
Time
Figure 12.27 shows an example of phase counting mode 2 operation, and table 12.34 summarizes
the TCNT up/down-count conditions.
TCNT value
Up-count Down-count
Time
Figure 12.28 shows an example of phase counting mode 3 operation, and table 12.35 summarizes
the TCNT up/down-count conditions.
TCNT value
Down-count
Up-count
Time
Figure 12.29 shows an example of phase counting mode 4 operation, and table 12.36 summarizes
the TCNT up/down-count conditions.
TCNT value
Down-count
Up-count
Time
Figure 12.30 shows an example in which phase counting mode is designated for channel 1, and
channel 1 is coupled with channel 0 to input servo motor 2-phase encoder pulses in order to detect
the position or speed.
Channel 1 is set to phase counting mode 1, and the encoder pulse A-phase and B-phase are input
to TCLKA and TCLKB.
Channel 0 operates with TCNT counter clearing by TGRC_0 compare match; TGRA_0 and
TGRC_0 are used for the compare match function, and are set with the speed control cycle and
position control cycle. TGRB_0 is used for input capture, with TGRB_0 and TGRD_0 operating
in buffer mode. The channel 1 counter input clock is designated as the TGRB_0 input capture
source, and detection of the pulse width of 2-phase encoder 4-multiplication pulses is performed.
TGRA_1 and TGRB_1 for channel 1 are designated for input capture, channel 0 TGRA_0 and
TGRC_0 compare matches are selected as the input capture source, and the up/down-counter
values for the control cycles are stored.
Channel 1
TCLKA Edge
detection TCNT_1
TCLKB circuit
TGRA_1
(speed cycle capture)
TGRB_1
(position cycle capture)
TCNT_0
+
TGRA_0
(speed control cycle) -
+
TGRC_0
(position control cycle) -
Channel 0
When an interrupt request is generated, the corresponding status flag in TSR is set to 1. If the
corresponding enable/disable bit in TIER is set to 1 at this time, an interrupt is requested. The
interrupt request is cleared by clearing the status flag to 0.
Relative channel priorities can be changed by the interrupt controller, but the priority order within
a channel is fixed. For details, see section 6, Interrupt Controller.
An interrupt is requested if the TGIE bit in TIER is set to 1 when the TGF flag in TSR is set to 1
by the occurrence of a TGR input capture/compare match on a particular channel. The interrupt
request is cleared by clearing the TGF flag to 0. The TPU has 32 input capture/compare match
interrupts, four each for channels 0, 3, 6, and 9, and two each for channels 1, 2, 4, 5, 7, 8, 10, and
11.
An interrupt is requested if the TCIEV bit in TIER is set to 1 when the TCFV flag in TSR is set to
1 by the occurrence of TCNT overflow on a channel. The interrupt request is cleared by clearing
the TCFV flag to 0. The TPU has 12 overflow interrupts, one for each channel.
An interrupt is requested if the TCIEU bit in TIER is set to 1 when the TCFU flag in TSR is set to
1 by the occurrence of TCNT underflow on a channel. The interrupt request is cleared by clearing
the TCFU flag to 0. The TPU has eight underflow interrupts, one each for channels 1, 2, 4, 5, 7, 8,
10, and 11.
A total of 32 TPU input capture/compare match interrupts can be used as DTC activation sources,
four each for channels 0, 3, 6, and 9, and two each for channels 1, 2, 4, 5, 7, 8, 10, and 11.
In unit 0 of the TPU, a total of six TGRA input capture/compare match interrupts can be used as
DMAC activation sources, one for each channel.
If the TTGE bit in TIER is set to 1 when the TGFA flag in TSR is set to 1 by the occurrence of a
TGRA input capture/compare match on a particular channel, a request to start A/D conversion is
sent to the A/D converter. If the TPU conversion start trigger has been selected on the A/D
converter side at this time, A/D conversion is started.
In the TPU, a total of 12 TGRA input capture/compare match interrupts can be used as A/D
converter conversion start sources, one for each channel.
Figure 12.31 shows TCNT count timing in internal clock operation, and figure 12.32 shows TCNT
count timing in external clock operation.
A compare match signal is generated in the final state in which TCNT and TGR match (the point
at which the count value matched by TCNT is updated). When a compare match signal is
generated, the output value set in TIOR is output at the output compare output pin. After a match
between TCNT and TGR, the compare match signal is not generated until the (TIOC pin) TCNT
input clock is generated.
TCNT N N+1
TGR N
Compare match
signal
Compare match
output
Input capture
input
Input capture
signal
TGR N N+2
Figure 12.35 shows the timing when counter clearing by compare match occurrence is specified,
and figure 12.36 shows the timing when counter clearing by input capture occurrence is specified.
Compare match
signal
Counter clear
signal
TCNT N H'0000
TGR N
Input capture
signal
Counter clear
signal
TCNT N H'0000
TGR N
TCNT n n+1
Compare match
signal
TGRA, TGRB n N
TGRC, TGRD N
Input capture
signal
TCNT N N+1
TGRC, TGRD n N
Figure 12.39 shows the timing for setting of the TGF flag in TSR by compare match occurrence,
and the TGI interrupt request signal timing.
TCNT N N+1
TGR N
Compare match
signal
TGF flag
TGI interrupt
Figure 12.40 shows the timing for setting of the TGF flag in TSR by input capture occurrence, and
the TGI interrupt request signal timing.
Input capture
signal
TCNT N
TGR N
TGF flag
TGI interrupt
Figure 12.41 shows the timing for setting of the TCFV flag in TSR by overflow occurrence, and
the TCIV interrupt request signal timing.
Figure 12.42 shows the timing for setting of the TCFU flag in TSR by underflow occurrence, and
the TCIU interrupt request signal timing.
Overflow signal
TCFV flag
TCIV interrupt
Underflow signal
TCFU flag
TCIU interrupt
After a status flag is read as 1 by the CPU, it is cleared by writing 0 to it. When the DTC or
DMAC is activated, the flag is cleared automatically. Figure 12.43 shows the timing for status flag
clearing by the CPU, and figure 12.44 shows the timing for status flag clearing by the DTC or
DMAC.
Write signal
Status flag
Interrupt
request
signal
DTC/DMAC DTC/DMAC
read cycle write cycle
T1 T2 T1 T2
Status flag
Interrupt
request
signal
TPU operation can be disabled or enabled using the module stop control register. The initial
setting is for TPU operation to be halted. Register access is enabled by clearing the module stop
state. For details, refer to section 25, Power-Down Modes.
The input clock pulse width must be at least 1.5 states in the case of single-edge detection, and at
least 2.5 states in the case of both-edge detection. The TPU will not operate properly with a
narrower pulse width.
In phase counting mode, the phase difference and overlap between the two input clocks must be at
least 1.5 states, and the pulse width must be at least 2.5 states. Figure 12.45 shows the input clock
conditions in phase counting mode.
Phase Phase
diffe- diffe- Pulse width Pulse width
Overlap rence Overlap rence
TCLKA
(TCLKC)
TCLKB
(TCLKD)
Figure 12.45 Phase Difference, Overlap, and Pulse Width in Phase Counting Mode
When counter clearing by compare match is set, TCNT is cleared in the final state in which it
matches the TGR value (the point at which the count value matched by TCNT is updated).
Consequently, the actual counter frequency is given by the following formula:
φ
f=
(N + 1)
Where f: Counter frequency
φ: Operating frequency
N: TGR set value
If the counter clearing signal is generated in the T2 state of a TCNT write cycle, TCNT clearing
takes precedence and the TCNT write is not performed. Figure 12.46 shows the timing in this
case.
Address
TCNT N H'0000
If incrementing occurs in the T2 state of a TCNT write cycle, the TCNT write takes precedence
and TCNT is not incremented. Figure 12.47 shows the timing in this case.
Address
TCNT N M
Write data
If a compare match occurs in the T2 state of a TGR write cycle, the TGR write takes precedence
and the compare match signal is disabled. A compare match also does not occur when the same
value as before is written.
Address
TCNT N N+1
TGR N M
Disabled
If a compare match occurs in the T2 state of a TGR write cycle, the data transferred to TGR by the
buffer operation will be the data prior to the write.
Address
Compare match
signal
Write data
Buffer register N M
TGR N
Figure 12.49 Contention between Buffer Register Write and Compare Match
If the input capture signal is generated in the T1 state of a TGR read cycle, the data that is read will
be the data prior to input capture transfer.
Read signal
Input capture
signal
TGR N M
Internal
N
data bus
If the input capture signal is generated in the T2 state of a TGR write cycle, the input capture
operation takes precedence and the write to TGR is not performed.
Address
Input capture
signal
TCNT N
TGR N
If the input capture signal is generated in the T2 state of a buffer register write cycle, the buffer
operation takes precedence and the write to the buffer register is not performed.
Address
TCNT N
TGR M N
Buffer register M
Figure 12.52 Contention between Buffer Register Write and Input Capture
If overflow/underflow and counter clearing occur simultaneously, the TCFV/TCFU flag in TSR is
set and TCNT clearing is also performed.
Figure 12.53 shows the operation timing when a TGR compare match is specified as the clearing
source, and H'FFFF is set in TGR.
Counter clear
signal
TGF flag
TCFV flag
Figure 12.54 shows the operation timing when there is contention between TCNT write and
overflow.
Address
TCNT N M
Write data
TCFV flag
In this LSI, the TCLKA input pin is multiplexed with the TIOCC0 I/O pin, the TCLKB input pin
with the TIOCD0 I/O pin, the TCLKC input pin with the TIOCB1 I/O pin, and the TCLKD input
pin with the TIOCB2 I/O pin. When an external clock is input, compare match output should not
be performed from a multiplexed pin.
If a transition is made to the module stop state when an interrupt has been requested, it will not be
possible to clear the CPU interrupt source or the DMAC or DTC activation source. Interrupts
should therefore be disabled before entering the module stop state.
13.1 Features
• 16-bit output data
• Four output groups
• Selectable output trigger signals
• Non-overlap mode
• Can operate together with the data transfer controller (DTC) and the DMA controller (DMAC)
• Settable inverted output
• Module stop state can be set.
NDERH NDERL
Control logic PMR PCR
PO15
PO14 Pulse output
PO13
[Legend]
PMR : PPG output mode register
PCR : PPG output control register
NDERH : Next data enable register H
NDERL : Next data enable register L
NDRH : Next data register H
NDRL : Next data register L
PODRH : Output data register H
PODRL : Output data register L
NDERH, NDERL enable or disable pulse output on a bit-by-bit basis. For outputting pulse by the
PPG, set the corresponding DDR to 1.
• NDERH
• NDERL
PODRH and PODRL store output data for use in pulse output. A bit that has been set for pulse
output by NDER is read-only and cannot be modified.
• PODRH
• PODRL
NDRH and NDRL store the next data for pulse output. The NDR addresses differ depending on
whether pulse output groups have the same output trigger or different output triggers.
If pulse output groups 2 and 3 have different output triggers, upper 4 bits and lower 4 bits are
mapped to the different addresses as shown below.
• NDRHH*
• NDRHL*
If pulse output groups 0 and 1 have different output triggers, upper 4 bits and lower 4 bits are
mapped to the different addresses as shown below.
• NDRLH*
• NDRLL*
Note: * When pulse output groups 2 and 3 have the same output trigger by PCR settings, the
NDRH address is H'FF4C. When they have different output triggers, the NDRH
addresses corresponding to the groups 2 and 3 are NDRHL (H'FF4E) and NDRHH
(H'FF4C), respectively. Also, when pulse output groups 0 and 1 have the same output
trigger by PCR settings, the NDRL address is H'FF4D. When they have different
output triggers, the NDRL addresses corresponding to the groups 0 and 1 are NDRLL
(H'FF4F) and NDRLH (H'FF4D), respectively.
PCR selects output trigger signals on a group-by-group basis. For details on output trigger
selection, refer to section 13.3.5, PPG Output Mode Register (PMR).
PMR selects the pulse output mode of the PPG for each group. If inverted output is selected, a
low-level pulse is output when PODRH is 1 and a high-level pulse is output when PODRH is 0. If
non-overlapping operation is selected, PPG updates its output values at compare match A or B of
the TPU that becomes the output trigger. For details, refer to section 13.4.4, Non-Overlapping
Pulse Output.
13.4 Operation
Figure 13.2 shows an overview diagram of the PPG. PPG pulse output is enabled when the
corresponding bits in P1DDR, P2DDR, and NDER are set to 1. An initial output value is
determined by its corresponding PODR initial setting. When the compare match event specified
by PCR occurs, the corresponding NDR bit contents are transferred to PODR to update the output
values. Sequential output of data of up to 16 bits is possible by writing new output data to NDR
before the next compare match.
DDR NDER
Q
Output trigger signal
C
Q PODR D Q NDR D Internal data bus
Pulse output pin
If pulse output is enabled, NDR contents are transferred to PODR and output when the specified
compare match event occurs. Figure 13.3 shows the timing of these operations for the case of
normal output in groups 2 and 3, triggered by compare match A.
TCNT N N+1
TGRA N
Compare match
A signal
NDRH n
PODRH m n
PO8 to PO15 m n
Figure 13.4 shows a sample procedure for setting up normal pulse output.
Figure 13.5 shows an example in which pulse output is used for cyclic five-phase pulse output.
TGRA
H'0000 Time
NDRH 80 C0 40 60 20 30 10 18 08 88 80 C0 40
PODRH 00 80 C0 40 60 20 30 10 18 08 88 80 C0
PO15
PO14
PO13
PO12
PO11
1. Set up TGRA in TPU which is used as the output trigger to be an output compare register. Set
a cycle in TGRA so that the counter will be cleared by compare match A. Set the TGIEA bit in
TIER to 1 to enable the compare match/input capture A (TGIA) interrupt.
2. Write H'F8 in P1DDR and NDERH, and set the G3CMS1, G3CMS0, G2CMS1, and G2CMS0
bits in PCR to select compare match in the TPU channel set up in the previous step to be the
output trigger. Write output data H'80 in NDRH.
3. The timer counter in the TPU channel starts. When compare match A occurs, the NDRH
contents are transferred to PODRH and output. The TGIA interrupt handling routine writes the
next output data (H'C0) in NDRH.
4. Five-phase pulse output (one or two phases active at a time) can be obtained subsequently by
writing H'40, H'60, H'20, H'30, H'10, H'18, H'08, H'88... at successive TGIA interrupts.
If the DTC or DMAC is set for activation by the TGIA interrupt, pulse output can be obtained
without imposing a load on the CPU.
DDR NDER
Q
Compare match A
Compare match B
C
Q PODR D Q NDR D Internal data bus
Pulse
output
pin
Normal output/inverted output
Therefore, 0 data can be transferred ahead of 1 data by making compare match B occur before
compare match A.
The NDR contents should not be altered during the interval from compare match B to compare
match A (the non-overlap margin).
This can be accomplished by having the TGIA interrupt handling routine write the next data in
NDR, or by having the TGIA interrupt activate the DTC or DMAC. Note, however, that the next
data must be written before the next compare match B occurs.
Compare match A
Compare match B
Write to NDR Write to NDR
NDR
PODR
0 output 0/1 output 0 output 0/1 output
Figure 13.8 shows a sample procedure for setting up non-overlapping pulse output.
Figure 13.9 shows an example in which pulse output is used for four-phase complementary non-
overlapping pulse output.
TCNT value
TGRB
TCNT
TGRA
H'0000 Time
NDRH 95 65 59 56 95 65
PODRH 00 95 05 65 41 59 50 56 14 95 05 65
Non-overlap margin
PO15
PO14
PO13
PO12
PO11
PO10
PO9
PO8
1. Set up the TPU channel to be used as the output trigger channel so that TGRA and TGRB are
output compare registers. Set the trigger period in TGRB and the non-overlap margin in
TGRA, and set the counter to be cleared by compare match B. Set the TGIEA bit in TIER to 1
to enable the TGIA interrupt.
2. Write H'FF in P1DDR and NDERH, and set the G3CMS1, G3CMS0, G2CMS1, and G2CMS0
bits in PCR to select compare match in the TPU channel set up in the previous step to be the
output trigger. Set the G3NOV and G2NOV bits in PMR to 1 to select non-overlapping output.
Write output data H'95 in NDRH.
3. The timer counter in the TPU channel starts. When a compare match with TGRB occurs,
outputs change from 1 to 0. When a compare match with TGRA occurs, outputs change from 0
to 1 (the change from 0 to 1 is delayed by the value set in TGRA). The TGIA interrupt
handling routine writes the next output data (H'65) in NDRH.
If the G3INV, G2INV, G1INV, and G0INV bits in PMR are cleared to 0, values that are the
inverse of the PODR contents can be output.
Figure 13.10 shows the outputs when G3INV and G2INV are cleared to 0, in addition to the
settings of figure 13.9.
TCNT value
TGRB
TCNT
TGRA
H'0000 Time
NDRH 95 65 59 56 95 65
PODRL 00 95 05 65 41 59 50 56 14 95 05 65
PO15
PO14
PO13
PO12
PO11
PO10
PO9
PO8
Pulse output can be triggered by TPU input capture as well as by compare match. If TGRA
functions as an input capture register in the TPU channel selected by PCR, pulse output will be
triggered by the input capture signal.
TIOC pin
Input capture
signal
NDR N
PODR M N
PO M N
PPG operation can be disabled or enabled using the module stop control register. The initial value
is for PPG operation to be halted. Register access is enabled by clearing the module stop state. For
details, refer to section 25, Power-Down Modes.
Pins PO0 to PO15 are also used for other peripheral functions such as the TPU. When output by
another peripheral function is enabled, the corresponding pins cannot be used for pulse output.
Note, however, that data transfer from NDR bits to PODR bits takes place, regardless of the usage
of the pins.
Pin functions should be changed only under conditions in which the output trigger event will not
occur.
14.1 Features
• Selection of seven clock sources
The counters can be driven by one of six internal clock signals (φ/2, φ/8, φ/32, φ/64, φ/1024, or
φ/8192) or an external clock input
• Selection of three ways to clear the counters
The counters can be cleared on compare match A or B, or by an external reset signal (rising
edge, rising and falling edges, falling edge, low level, or high level)
• Timer output control by a combination of two compare match signals
The timer output signal in each channel is controlled by a combination of two independent
compare match signals, enabling the timer to generate output waveforms with an arbitrary duty
cycle or PWM output
• Provision for cascading of two channels (TMR_0 and TMR_1)
Operation as a 16-bit timer is possible, using TMR_0 for the upper 8 bits and TMR_1 for the
lower 8 bits (16-bit count mode)
TMR_1 can be used to count TMR_0 compare matches (compare match count mode)
• Three independent interrupts
Compare match A and B and overflow interrupts can be requested independently
• A/D converter conversion start trigger can be generated
Figure 14.1 shows a block diagram of the 8-bit timer module (TMR_0 and TMR_1).
Counter clock 1
Counter clock 0
TMCI0 Clock select
TMCI1
TCORA_0 TCORA_1
Compare match A1
Compare match A0 Comparator A_0 Comparator A_1
TMO0 Overflow 1
TMRI0 Overflow 0 TCNT_0 TCNT_1
Counter clear 0
Internal bus
Counter clear 1
Compare match B1
Control logic Compare match B0 Comparator B_0 Comparator B_1
TMO1
TMRI1
TCORB_0 TCORB_1
A/D
conversion
start request TCSR_0 TCSR_1
signal
TCR_0 TCR_1
TCCR_0 TCCR_1
Channel 0 Channel 1
(TMR_0) (TMR_1)
CMIA0
CMIB0
OVI0
CMIA1
CMIB1
OVI1
Interrupt signals
Legend:
TCORA_0 : Time constant register A_0 TCORA_1 : Time constant register A_1
TCNT_0 : Timer counter_0 TCNT_1 : Timer counter_1
TCORB_0 : Time constant register B_0 TCORB_1 : Time constant register B_1
TCSR_0 : Timer control/status register_0 TCSR_1 : Timer control/status register_1
TCR_0 : Timer control register_0 TCR_1 : Timer control register_1
TCCR_0 : Timer counter control register_0 TCCR_1 : Timer counter control register_1
Table 14.1 shows the pin configuration of the 8-bit timer module.
TCNT is 8-bit up-counter. TCNT_0 and TCNT_1 comprise a single 16-bit register so they can be
accessed together by a word transfer instruction. Bits CKS2 to CKS0 in TCR are used to select a
clock. TCNT can be cleared by an external reset input or by a compare match signal A or B.
Which signal is to be used for clearing is selected by bits CCLR1 and CCLR0 in TCR. When
TCNT overflows from H'FF to H'00, OVF in TCSR is set to 1. TCNT is initialized to H'00.
TCORA is 8-bit readable/writable register. TCORA_0 and TCORA_1 comprise a single 16-bit
register so they can be accessed together by a word transfer instruction. The value in TCORA is
continually compared with the value in TCNT. When a match is detected, the corresponding
CMFA flag in TCSR is set to 1. Note, however, that comparison is disabled during the T2 state of a
TCORA write cycle. The timer output from the TMO pin can be freely controlled by this compare
match signal (compare match A) and the settings of bits OS1 and OS0 in TCSR. TCORA is
initialized to H'FF.
TCORB is 8-bit readable/writable register. TCORB_0 and TCORB_1 comprise a single 16-bit
register so they can be accessed together by a word transfer instruction. TCORB is continually
compared with the value in TCNT. When a match is detected, the corresponding CMFB flag in
TCSR is set to 1. Note, however, that comparison is disabled during the T2 state of a TCOBR write
cycle. The timer output from the TMO pin can be freely controlled by this compare match signal
(compare match B) and the settings of bits OS3 and OS2 in TCSR. TCORB is initialized to H'FF.
TCR selects the clock source and the time at which TCNT is cleared, and controls interrupts.
TCCR selects the TCNT internal clock source and controls the external reset input.
TCR TCCR
Bit 1 Bit 0 Bit 3
CCLR1 CCLR0 TMRIS Description
0 0 0 Clearing is disabled
0 1 0 Clear by compare match A
1 0 0 Clear by compare match B
1 1 0 Clear by rising edge of external reset input
0 0 1 Clear by both rising and falling edges of external reset input
0 1 1 Clear by falling edge of external reset input
1 0 1 Clear by low level of external reset input
1 1 1 Clear by high level of external reset input
TCR TCCR
TCR TCCR
• TCSR_0
• TCSR_1
14.3 Operation
Figure 14.2 shows an example in which the 8-bit timer is used to generate a pulse output with a
selected duty cycle. The control bits are set as follows:
[1] In TCR, the CCLR1 bit is cleared to 0 and the CCLR0 bit is set to 1 so that TCNT is cleared at
a TCORA compare match.
[2] In TCSR, the OS3 to OS0 bits are set to B'0110, causing the output to change to 1 at a TCORA
compare match and to 0 at a TCORB compare match.
With these settings, the 8-bit timer provides output of pulses at a rate determined by TCORA with
a pulse width determined by TCORB. No software intervention is required.
TCNT
H'FF
Counter clear
TCORA
TCORB
H'00
TMO
Figure 14.3 shows an example in which the 8-bit timer is used to generate a pulse output with a
selected delay in response to the TMRI input. The control bits are set as follows:
[1] The CCLR0 bit in TCR is set to 1 and the TMRIS bit in TCCR is set to 1 so that TCNT is
cleared at the high level of the TMRI input.
[2] In TCSR, bits OS3 to OS0 are set to B'0110, causing the output to change to 1 at a TCORA
compare match and to 0 at a TCORB compare match.
With these settings, the 8-bit timer provides output of pulses whose delay from the TMRI input is
determined by TCORA and the pulse width determined by (TCORB − TCORA).
TCORB
TCORA
TCNT
H'00
TMRI
TMO
Figure 14.4 shows the count timing for internal clock input. Figure 14.5 shows the count timing
for external clock signal. Note that the external clock pulse width must be at least 1.5 states for
incrementation at a single edge, and at least 2.5 states for incrementation at both edges. The
counter will not increment correctly if the pulse width is less than these values.
Internal clock
Clock input
to TCNT
External clock
input pin
Clock input
to TCNT
The CMFA and CMFB flags in TCSR are set to 1 by a compare match signal generated when the
TCOR and TCNT values match. The compare match signal is generated at the last state in which
the match is true, just before the timer counter is updated. Therefore, when TCOR and TCNT
match, the compare match signal is not generated until the next incrementation clock input. Figure
14.6 shows this timing.
TCNT N N+1
TCOR N
Compare match
signal
CMF
When compare match A or B occurs, the timer output changes as specified by bits OS3 to OS0 in
TCSR. Figure 14.7 shows the timing when the output is set to toggle at compare match A.
Compare match A
signal
TCNT is cleared when compare match A or B occurs, depending on the settings of the CCLR1
and CCLR0 bits in TCR and the TMRIS bit in TCCR. Figure 14.8 shows the timing of this
operation.
Compare match
signal
TCNT N H'00
TCNT is cleared at the rising edge, falling edge, low level, or high level of an external reset input,
depending on the settings of the CCLR1 and CCLR0 bits in TCR and the TMRIS bit in TCCR.
The clear pulse width must be at least 1.5 states for a single edge and at least 2.5 states for both
edges. Figure 14.9 shows the timing of this operation.
External reset
input pin
Clear signal
The OVF in TCSR is set to 1 when TCNT overflows (changes from H'FF to H'00). Figure 14.10
shows the timing of this operation.
Overflow signal
OVF
When bits CKS2 to CKS0 in TCR_0 are set to B'100, the timer functions as a single 16-bit timer
with channel 0 occupying the upper 8 bits and channel 1 occupying the lower 8 bits.
When bits CKS2 to CKS0 in TCR_1 are B'100, TCNT_1 counts compare match A's for channel 0.
Channels 0 and 1 are controlled independently. Conditions such as setting of the CMF flag,
generation of interrupts, output from the TMO pin, and counter clear are in accordance with the
settings for each channel.
There are three 8-bit timer interrupt sources: CMIA, CMIB, and OVI. Their relative priorities are
shown in table 14.4. Each interrupt source is set as enabled or disabled by the corresponding
interrupt enable bit in TCR or TCSR, and independent interrupt requests are sent for each to the
interrupt controller. It is also possible to activate the DTC by means of CMIA and CMIB
interrupts.
The A/D converter can be activated only by TMR_0 compare match A. If the ADTE bit in TCSR0
is set to 1 when the CMFA flag is set to 1 by the occurrence of TMR_0 compare match A, a
request to start A/D conversion is sent to the A/D converter. If the 8-bit timer conversion start
trigger has been selected on the A/D converter side at this time, A/D conversion is started.
If a timer counter clock pulse is generated during the T2 state of a TCNT write cycle, the clear
takes priority, so that the counter is cleared and the write is not performed. Figure 14.11 shows
this operation.
TCNT N H'00
If a timer counter clock pulse is generated during the T2 state of a TCNT write cycle, the write
takes priority and the counter is not incremented. Figure 14.12 shows this operation.
TCNT N M
During the T2 state of a TCOR write cycle, the TCOR write has priority and the compare match
signal is inhibited even if a compare match event occurs as shown in figure 14.13.
TCNT N N+1
TCOR N M
Inhibited
If compare match events A and B occur at the same time, the 8-bit timer operates in accordance
with the priorities for the output statuses set for compare match A and compare match B, as shown
in table 14.5.
TCNT may increment erroneously when the internal clock is switched over. Table 14.6 shows the
relationship between the timing at which the internal clock is switched (by writing to the CKS1,
CKS0, ICKS1, and ICKS0 bits) and the TCNT operation.
When the TCNT clock is generated from an internal clock, the rising edge or falling edge of the
internal clock pulse is detected. Therefore, when the falling edge is selected, if clock switching
causes a change from high to low level, as shown in case 3 in table 14.6, a TCNT clock pulse is
generated and the TCNT incremented on the assumption that the switchover is a falling edge. This
is the same as when the rising edge is selected.
The erroneous incrementation can also happen when switching between the rising edge and falling
edge of an internal clock or switching between internal and external clocks.
Timing of Switchover
by Means of Modifying
CKS1, CKS0, ICKS1,
No. and ICKS0 Bits TCNT Clock Operation
1 Switching from Clock before
low to low*1 switchover
Clock after
switchover
TCNT clock
TCNT N N+1
2 Switching from
Clock before
low to high*2
switchover
Clock after
switchover
TCNT clock
Clock after
swichover
*4
TCNT clock
Timing of Switchover
by Means of Modifying
CKS1, CKS0, ICKS1,
No. and ICKS0 Bits TCNT Clock Operation
4 Switching from high
Clock before
to high
switchover
Clock after
switchover
TCNT clock
Notes: 1. Includes switching from low to stop, and from stop to low.
2. Includes switching from stop to high.
3. Includes switching from high to stop.
4. Generated on the assumption that the switchover is a falling edge; TCNT is
incremented.
If 16-bit counter mode and compare match count mode are specified at the same time, input clocks
for TCNT_0 and TCNT_1 are not generated, and the counter stops. Do not specify 16-bit counter
and compare match count modes simultaneously.
TMR Operation can be disabled or enabled using the module stop control register. The initial
setting is for operation of the TMR to be halted. Register access is enabled by clearing the module
stop state. For details, refer to section 25, Power-Down Modes.
If a transition is made to the module stop state when an interrupt has been requested, it will not be
possible to clear the CPU interrupt source or the DTC and DMAC activation source. Interrupts
should therefore be disabled before entering the module stop state.
When this watchdog function is not needed, the WDT can be used as an interval timer. In interval
timer operation, an interval timer interrupt is generated each time the counter overflows. A block
diagram of the WDT is shown in figure 15.1.
15.1 Features
• Selectable from eight counter input clocks
• Switchable between watchdog timer mode and interval timer mode
• If the counter overflows, the WDT outputs WDTOVF. It is possible to select whether or not
the entire chip is reset at the same time.
• If the counter overflows, the WDT generates an interval timer interrupt (WOVI).
Overflow φ/2
WOVI Interrupt φ/64
(interrupt request control φ/128
signal)
Clock φ/512
Clock φ/2048
select
φ/8192
WDTOVF φ/32768
Reset φ/131072
Internal reset signal* control
Internal clock
sources
Internal bus
RSTCSR TCNT TCSR
Bus
Module bus interface
WDT
[Legend]
TCSR: Timer control/status register
TCNT: Timer counter
RSTCSR: Reset control/status register
TCNT is an 8-bit readable/writable up-counter. TCNT is initialized to H'00 when the TME bit in
the timer control/status register (TCSR) is cleared to 0.
TCSR selects the clock source to be input to TCNT, and the timer mode.
RSTCSR controls the generation of the internal reset signal when TCNT overflows, and selects
the type of internal reset signal. RSTCSR is initialized to H'1F by a reset signal from the RES pin,
but not by the WDT internal reset signal caused by overflows.
15.4 Operation
To use the WDT as a watchdog timer mode, set the WT/IT and TME bits in TCSR to 1.
If TCNT overflows without being rewritten because of a system crash or other error, the
WDTOVF signal is output.
This ensures that TCNT does not overflow while the system is operating normally. Software must
prevent TCNT overflows by rewriting the TCNT value (normally be writing H'00) before
overflow occurs. This WDTOVF signal can be used to reset the chip internally in watchdog timer
mode.
If TCNT overflows when 1 is set in the RSTE bit in RSTCSR, a signal that resets this LSI
internally is generated at the same time as the WDTOVF signal. If a reset caused by a signal input
to the RES pin occurs at the same time as a reset caused by a WDT overflow, the RES pin reset
has priority and the WOVF bit in RSTCSR is cleared to 0.
The WDTOVF signal is output for 132 states when RSTE = 1, and for 130 states when RSTE = 0.
The internal reset signal is output for 518 states.
When TCNT overflows in watchdog timer mode, the WOVF bit in RSTCSR is set to 1. If TCNT
overflows when 1 is set in the RSTE bit in RSTCSR, an internal reset signal is generated to the
entire chip.
TCNT count
Overflow
H'FF
H'00 Time
WDTOVF signal
132 states*2
Internal reset signal*1
518 states
Notes: 1. If TCNT overflows when the RSTE bit is set to 1, an internal reset signal is generated.
2. 130 states when the RSTE bit is cleared to 0.
To use the WDT as an interval timer, set the WT/IT bit to 0 and TME bit in TCSR to 1.
When the WDT is used as an interval timer, an interval timer interrupt (WOVI) is generated each
time the TCNT overflows. Therefore, an interrupt can be generated at intervals.
When the TCNT overflows in interval timer mode, an interval timer interrupt (WOVI) is requested
at the same time the OVF bit in the TCSR is set to 1.
TCNT count
H'00 Time
[Legend]
WOVI: Interval timer interrupt request generation
The watchdog timer’s TCNT, TCSR, and RSTCSR registers differ from other registers in being
more difficult to write to. The procedures for writing to and reading these registers are given
below.
TCNT and TCSR must be written to by a word transfer instruction. They cannot be written to by a
byte transfer instruction.
TCNT and TCSR both have the same write address. Therefore, satisfy the relative condition
shown in figure 15.4 to write to TCNT or TCSR. The transfer instruction writes the lower byte
data to TCNT or TCSR according to the satisfied condition.
To write to RSTCSR, execute a word transfer instruction for address H'FFBE. A byte transfer
instruction cannot perform writing to RSTCSR.
The method of writing 0 to the WOVF bit differs from that of writing to the RSTE bit. To write 0
to the WOVF bit, satisfy the lower condition shown in figure 15.4.
If satisfied, the transfer instruction clears the WOVF bit to 0, but has no effect on the RSTE bit.
To write to the RSTE bit, satisfy the above condition shown in figure 15.4. If satisfied, the transfer
instruction writes the value in bit 6 of the lower byte into the RSTE bit, but has no effect on the
WOVF bit.
TCNT write or
Writing to RSTE bit in RSTCSR
TCSR write
15 8 7 0
Address: H'FFBC (TCSR)
H'A5 Write data
15 8 7 0
Address: H'FFBE (RSTCSR)
H'A5 H'00
15 8 7 0
Address: H'FFBE (RSTCSR)
H'5A Write data
These registers are read in the same way as other registers. The read addresses are H'FFBC for
TCSR, H'FFBD for TCNT, and H'FFBF for RSTCSR.
If a timer counter clock pulse is generated during the T2 state of a TCNT write cycle, the write
takes priority and the timer counter is not incremented. Figure 15.5 shows this operation.
T1 T2
Address
TCNT N M
If bits CKS2 to CKS0 in TCSR are written to while the WDT is operating, errors could occur in
the incrementation. Software must stop the watchdog timer (by clearing the TME bit to 0) before
changing the value of bits CKS2 to CKS0.
15.6.4 Switching between Watchdog Timer Mode and Interval Timer Mode
If the mode is switched from watchdog timer to interval timer, while the WDT is operating, errors
could occur in the incrementation. Software must stop the watchdog timer (by clearing the TME
bit to 0) before switching the mode.
This LSI is not reset internally if TCNT overflows while the RSTE bit is cleared to 0 during
watchdog timer mode operation, but TCNT and TCSR of the WDT are reset.
TCNT, TCSR, and RSTCR cannot be written to while the WDTOVF signal is low. Also note that
a read of the WOVF flag is not recognized during this period. To clear the WOVF flag, therefore,
read TCSR after the WDTOVF signal goes high, then write 0 to the WOVF flag.
If the WDTOVF output signal is input to the RES pin, the chip will not be initialized correctly.
Make sure that the WDTOVF signal is not input logically to the RES pin. To reset the entire
system by means of the WDTOVF signal, use the circuit shown in figure 15.6.
This LSI
16.1 Features
• Choice of asynchronous or clocked synchronous serial communication mode
• Full-duplex communication capability
The transmitter and receiver are mutually independent, enabling transmission and reception to
be executed simultaneously. Double-buffering is used in both the transmitter and the receiver,
enabling continuous transmission and continuous reception of serial data.
• On-chip baud rate generator allows any bit rate to be selected
External clock can be selected as a transfer clock source (except for in Smart Card interface
mode).
• Choice of LSB-first or MSB-first transfer (except in the case of asynchronous mode 7-bit data)
• Four interrupt sources
Four interrupt sources ⎯ transmit-end, transmit-data-empty, receive-data-full, and receive
error ⎯ that can issue requests. The transmit-data-empty interrupt and receive data full
interrupts can activate the data transfer controller (DTC) or DMA controller (DMAC).
• Module stop state can be set.
Asynchronous Mode
Bus interface
Module data bus Internal
data bus
RSR is a shift register used to receive serial data that is input to the RxD pin and convert it into
parallel data. When one byte of data has been received, it is transferred to RDR automatically.
RSR cannot be directly accessed by the CPU.
RDR is an 8-bit register that stores receive data. When the SCI has received one byte of serial
data, it transfers the received serial data from RSR to RDR where it is stored. After this, RSR is
receive-enabled. Since RSR and RDR function as a double buffer in this way, enables continuous
receive operations to be performed. After confirming that the RDRF bit in SSR is set to 1, read
RDR. RDR cannot be written to by the CPU.
TDR is an 8-bit register that stores transmit data. When the SCI detects that TSR is empty, it
transfers the transmit data written in TDR to TSR and starts transmission. The double-buffered
structures of TDR and TSR enable continuous serial transmission. If the next transmit data has
already been written to TDR during serial transmission, the SCI transfers the written data to TSR
to continue transmission. Although TDR can be read or written to by the CPU at all times, write
transmit data to TDR after confirming that the TDRE bit in SSR is set to 1.
TSR is a shift register that transmits serial data. To perform serial data transmission, the SCI first
transfers transmit data from TDR to TSR, then sends the data to the TxD pin starting. TSR cannot
be directly accessed by the CPU.
SMR is used to set the SCI's serial transfer format and select the on-chip baud rate generator clock
source. Some bit functions of SMR differ in normal serial communication interface mode and
Smart Card interface mode.
SCR performs enabling or disabling of SCI transfer operations and interrupt requests, and
selection of the transfer/receive clock source. For details on interrupt requests, refer to section
16.9, Interrupt Sources. Some bit functions of SCR differ in normal serial communication
interface mode and Smart Card interface mode.
SSR is a register containing status flags of the SCI and multiprocessor bits for transfer. 1 cannot
be written to flags TDRE, RDRF, ORER, PER, and FER; they can only be cleared. Some bit
functions of SSR differ in normal serial communication interface mode and Smart Card interface
mode.
BRR is an 8-bit register that adjusts the bit rate. As the SCI performs baud rate generator control
independently for each channel, different bit rates can be set for each channel. Table 16.2 shows
the relationships between the N setting in BRR and bit rate B for normal asynchronous mode,
clocked synchronous mode, and Smart Card interface mode. The initial value of BRR is H'FF, and
it can be read or written to by the CPU at all times.
1 φ × 106 φ × 106
N= −1 Error (%) = { − 1 } × 100
32 × 2 2n−1 × B B × 32 × 2 2n−1 × (N + 1)
1 0 0 32
1 0 1 64
1 1 0 372
1 1 1 256
Table 16.3 shows sample N settings in BRR in normal asynchronous mode. Table 16.4 shows the
maximum bit rate for each frequency in normal asynchronous mode. Table 16.6 shows sample N
settings in BRR in clocked synchronous mode. Table 16.8 shows sample N settings in BRR in
Smart Card interface mode. In Smart Card interface mode, S (the number of basic clock cycles in
a 1-bit transfer interval) can be selected. For details, refer to section 16.7.4, Receive Data
Sampling Timing and Reception Margin. Tables 16.5 and 16.7 show the maximum bit rates with
external clock input.
When the ABCS bit in the serial extension mode register (SEMR) of the SCI is set to 1 in
asynchronous mode, the bit rates in table 16.3 are doubled.
Table 16.3 BRR Settings for Various Bit Rates (Asynchronous Mode)
Table 16.4 Maximum Bit Rate for Each Frequency (Asynchronous Mode)
Table 16.5 Maximum Bit Rate with External Clock Input (Asynchronous Mode)
Table 16.6 BRR Settings for Various Bit Rates (Clocked Synchronous Mode)
110
250 3 124 ⎯ ⎯ 3 249
500 2 249 ⎯ ⎯ 3 124 ⎯ ⎯ 3 233
1k 2 124 ⎯ ⎯ 2 249 ⎯ ⎯ 3 97 3 116 3 128
2.5 k 1 199 1 249 2 99 2 124 2 155 2 187 2 205
5k 1 99 1 124 1 199 1 249 2 77 2 93 2 102
10 k 0 199 0 249 1 99 1 124 1 155 1 187 1 205
25 k 0 79 0 99 0 159 0 199 0 249 1 74 1 82
50 k 0 39 0 49 0 79 0 99 0 124 0 149 0 164
100 k 0 19 0 24 0 39 0 49 0 62 0 74 0 82
250 k 0 7 0 9 0 15 0 19 0 24 0 29 0 32
500 k 0 3 0 4 0 7 0 9 ⎯ ⎯ 0 14 ⎯ ⎯
1M 0 1 0 3 0 4 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
2.5 M 0 0* 0 1 ⎯ ⎯ 0 2 ⎯ ⎯
5M 0 0* ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
[Legend]
Blank: Cannot be set.
⎯: Can be set, but there will be a degree of error.
*: Continuous transfer is not possible.
Table 16.7 Maximum Bit Rate with External Clock Input (Clocked Synchronous Mode)
Table 16.8 Examples of Bit Rate for Various BRR Settings (Smart Card Interface Mode)
(when n = 0 and S = 372)
Table 16.9 Maximum Bit Rate at Various Frequencies (Smart Card Interface Mode)
(when S = 372)
SEMR selects the clock source in asynchronous mode. The basic clock can be automatically set by
selecting the average transfer rate.
0 ACS0 0 R/W* Selects the clock source for the average transfer
rate.
The basic clock can be automatically set by
selecting the average transfer rate in spite of the
value of ABCS.
000: External clock input
001: Selects 115.152 kbps which is the average
transfer rate dedicated for φ= 10.667 MHz.
(Operates on a basic clock with a frequency
of 16 times the transfer rate.)
010: Selects 460.606 kbps which is the average
transfer rate dedicated for φ= 10.667 MHz.
(Operates on a basic clock with a frequency
of 8 times the transfer rate.)
011: Selects 720 kbps which is the average
transfer rate dedicated for φ = 32 MHz.
(Operates on a basic clock with a frequency
of 16 times the transfer rate.)
100: Reserved
101: Selects 115.196 kbps which is the average
transfer rate dedicated for φ = 16 MHz
(Operates on a basic clock with a frequency
of 16 times the transfer rate.)
110: Selects 460.784 kbps which is the average
transfer rate dedicated for φ = 16 MHz
(Operates on a basic clock with a frequency
of 16 times the transfer rate.)
111: Selects 720 kbps which is the average
transfer rate dedicated for φ = 16 MHz
(Operates on a basic clock with a frequency
of 8 times the transfer rate.)
Note that the average transfer rate does not
correspond to the frequency other than 10.667,
16, or 32 MHz.
Note: * Can be written to only when TE = RE = 0.
Idle state
(mark state)
1 LSB MSB 1
Serial 0 D0 D1 D2 D3 D4 D5 D6 D7 0/1 1 1
data
Start Parity Stop bit(s)
bit Transmit/receive data bit
Table 16.10 shows the data transfer formats that can be used in asynchronous mode. Any of 12
transfer formats can be selected according to the SMR setting. For details on the multiprocessor
bit, refer to section 16.5, Multiprocessor Communication Function.
CHR PE MP STOP 1 2 3 4 5 6 7 8 9 10 11 12
[Legend]
S: Start bit
STOP: Stop bit
P: Parity bit
MPB: Multiprocessor bit
16.4.2 Receive Data Sampling Timing and Reception Margin in Asynchronous Mode
In asynchronous mode, the SCI operates on a basic clock with a frequency of 16 times the bit rate.
In reception, the SCI samples the falling edge of the start bit using the basic clock, and performs
internal synchronization. Receive data is latched at the middle of each bit by sampling the data at
the rising edge of the 8th pulse of the basic clock as shown in figure 16.3. Thus the reception
margin in asynchronous mode is given by formula (1) below.
1 ⏐D – 0.5⏐
M = { (0.5 – ) – (L – 0.5) F – (1 + F) } × 100 [%]
2N N ... Formula (1)
Where M: Reception Margin
N: Ratio of bit rate to clock (N = 16)
D: Clock duty cycle (D = 0.5 to 1.0)
L: Frame length (L = 9 to 12)
F: Absolute value of clock rate deviation
Assuming values of F = 0 and D = 0.5 in formula (1), a reception margin is given by formula
below.
However, this is only the computed value, and a margin of 20% to 30% should be allowed in
system design.
16 clocks
8 clocks
0 7 15 0 7 15 0
Internal base
clock
Synchronization
sampling timing
Data sampling
timing
16.4.3 Clock
Either an internal clock generated by the on-chip baud rate generator or an external clock input at
the SCK pin can be selected as the SCI’s serial clock, according to the setting of the C/A bit in
SMR and the CKE1 and CKE0 bits in SCR. When an external clock is input at the SCK pin, the
clock frequency should be 16 times the bit rate used.
When the SCI is operated on an internal clock, the clock can be output from the SCK pin. The
frequency of the clock output in this case is equal to the bit rate, and the phase is such that the
rising edge of the clock is in the middle of the transmit data, as shown in figure 16.4.
SCK
TxD 0 D0 D1 D2 D3 D4 D5 D6 D7 0/1 1 1
1 frame
Figure 16.4 Relation between Output Clock and Transfer Data Phase
(Asynchronous Mode)
Before transmitting and receiving data, you should first clear the TE and RE bits in SCR to 0, then
initialize the SCI as shown in figure 16.5. When the operating mode, transfer format, etc., is
changed, the TE and RE bits must be cleared to 0 before making the change. When the TE bit is
cleared to 0, the TDRE flag is set to 1. Note that clearing the RE bit to 0 does not initialize the
contents of the RDRF, PER, FER, and ORER flags, or the contents of RDR. When the external
clock is used in asynchronous mode, the clock must be supplied even during initialization.
<Initialization completed>
Figure 16.6 shows an example of the operation for transmission in asynchronous mode. In
transmission, the SCI operates as described below.
1. The SCI monitors the TDRE flag in SSR, and if is cleared to 0, recognizes that data has been
written to TDR, and transfers the data from TDR to TSR.
2. After transferring data from TDR to TSR, the SCI sets the TDRE flag to 1 and starts
transmission. If the TIE bit is set to 1 at this time, a transmit data empty interrupt request (TXI)
is generated. Because the TXI interrupt routine writes the next transmit data to TDR before
transmission of the current transmit data has finished, continuous transmission can be enabled.
3. Data is sent from the TxD pin in the following order: start bit, transmit data, parity bit or
multiprocessor bit (may be omitted depending on the format), and stop bit.
4. The SCI checks the TDRE flag at the timing for sending the stop bit.
5. If the TDRE flag is 0, the data is transferred from TDR to TSR, the stop bit is sent, and then
serial transmission of the next frame is started.
6. If the TDRE flag is 1, the TEND flag in SSR is set to 1, the stop bit is sent, and then the “mark
state” is entered in which 1 is output. If the TEIE bit in SCR is set to 1 at this time, a TEI
interrupt request is generated.
TDRE
TEND
1 frame
<End>
Figure 16.8 shows an example of the operation for reception in asynchronous mode. In serial
reception, the SCI operates as described below.
1. The SCI monitors the communication line, and if a start bit is detected, performs internal
synchronization, receives receive data in RSR, and checks the parity bit and stop bit.
2. If an overrun error (when reception of the next data is completed while the RDRF flag is still
set to 1) occurs, the ORER bit in SSR is set to 1. If the RIE bit in SCR is set to 1 at this time,
an ERI interrupt request is generated. Receive data is not transferred to RDR. The RDRF flag
remains to be set to 1.
3. If a parity error is detected, the PER bit in SSR is set to 1 and receive data is transferred to
RDR. If the RIE bit in SCR is set to 1 at this time, an ERI interrupt request is generated.
4. If a framing error (when the stop bit is 0) is detected, the FER bit in SSR is set to 1 and receive
data is transferred to RDR. If the RIE bit in SCR is set to 1 at this time, an ERI interrupt
request is generated.
5. If reception finishes successfully, the RDRF bit in SSR is set to 1, and receive data is
transferred to RDR. If the RIE bit in SCR is set to 1 at this time, an RXI interrupt request is
generated. Because the RXI interrupt routine reads the receive data transferred to RDR before
reception of the next receive data has finished, continuous reception can be enabled.
RDRF
FER
1 frame
Table 16.11 shows the states of the SSR status flags and receive data handling when a receive
error is detected. If a receive error is detected, the RDRF flag retains its state before receiving
data. Reception cannot be resumed while a receive error flag is set to 1. Accordingly, clear the
ORER, FER, PER, and RDRF flags to 0 before resuming reception. Figure 16.9 shows a sample
flowchart for serial data reception.
[3]
Error handling
No
ORER = 1?
Yes
No
FER = 1?
Yes
Yes
Break?
No
No
PER = 1?
Yes
<End>
The SCI uses the MPIE bit in SCR to implement this function. When the MPIE bit is set to 1,
transfer of receive data from RSR to RDR, error flag detection, and setting the SSR flags, RDRF,
FER, and ORER to 1 are inhibited until data with a 1 multiprocessor bit is received. On reception
of receive character with a 1 multiprocessor bit, the MPBR bit in SSR is set to 1 and the MPIE bit
is automatically cleared, thus normal reception is resumed. If the RIE bit in SCR is set to 1 at this
time, an RXI interrupt is generated. When the MPIE bit is cleared to 0, the receive operation is
performed regardless of the value of the multiprocessor bit. The multiprocessor bit is stored in the
MPB bit in SSR.
When the multiprocessor format is selected, the parity bit setting is invalid. All other bit settings
are the same as those in normal asynchronous mode. The clock used for multiprocessor
communication is the same as that in normal asynchronous mode.
Transmitting
station
Serial communication line
Serial
data H'01 H'AA
(MPB= 1) (MPB= 0)
Legend:
MPB: Multiprocessor bit
Figure 16.11 shows a sample flowchart for multiprocessor serial data transmission. For an ID
transmission cycle, set the MPBT bit in SSR to 1 before transmission. For a data transmission
cycle, clear the MPBT bit in SSR to 0 before transmission. All other SCI operations are the same
as those in asynchronous mode.
<End>
Figure 16.13 shows a sample flowchart for multiprocessor serial data reception. If the MPIE bit in
SCR is set to 1, data is skipped until data with a 1 multiprocessor bit is received. On receiving data
with a 1 multiprocessor bit, the receive data is transferred to RDR. An RXI interrupt request is
generated at this time. All other SCI operations are the same as in asynchronous mode. Figure
16.12 shows an example of SCI operation for multiprocessor format reception.
0 D0 D1 D7 1 1 0 D0 D1 D7 0 1 Idle state
(mark state)
MPIE
RDRF
RDR
ID1
value
MPIE = 0 RXI interrupt RDR data read If not this station’s ID, RXI interrupt request is
request and RDRF flag MPIE bit is set to 1 not generated, and RDR
(multiprocessor cleared to 0 in again retains its state
interrupt) RXI interrupt
generated handling routine
0 D0 D1 D7 1 1 0 D0 D1 D7 0 1 Idle state
(mark state)
MPIE
RDRF
RDR
ID1 ID2 Data2
value
MPIE = 0 RXI interrupt RDR data read and Matches this station’s ID, MPIE bit set to 1
request RDRF flag cleared so reception continues, and again
(multiprocessor to 0 in RXI interrupt data is received in RXI
interrupt) handling routine interrupt handling routine
generated
No
All data received? [5]
Error handling
Yes
(Continued on
Clear RE bit in SCR to 0 next page)
<End>
No
ORER = 1?
Yes
No
FER = 1?
Yes
Yes
Break?
No
<End>
LSB MSB
Serial
Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7
data
16.6.1 Clock
Either an internal clock generated by the on-chip baud rate generator or an external
synchronization clock input at the SCK pin can be selected, according to the setting of CKE1 and
CKE0 bits in SCR. When the SCI is operated on an internal clock, the serial clock is output from
the SCK pin. Eight serial clock pulses are output in the transfer of one character, and when no
transfer is performed the clock is fixed high.
Before transmitting and receiving data, you should first clear the TE and RE bits in SCR to 0, then
initialize the SCI as described in a sample flowchart in figure 16.15. When the operating mode,
transfer format, etc., is changed, the TE and RE bits must be cleared to 0 before making the
change. When the TE bit is cleared to 0, the TDRE flag is set to 1. Note that clearing the RE bit to
0 does not change the contents of the RDRF, PER, FER, and ORER flags, or the contents of RDR.
Yes
<Transfer start>
Note: In simultaneous transmit and receive operations, the TE and RE bits should
both be cleared to 0 or set to 1 simultaneously.
Figure 16.16 shows an example of SCI operation for transmission in clocked synchronous mode.
In serial transmission, the SCI operates as described below.
1. The SCI monitors the TDRE flag in SSR, and if is 0, recognizes that data has been written to
TDR, and transfers the data from TDR to TSR.
2. After transferring data from TDR to TSR, the SCI sets the TDRE flag to 1 and starts
transmission. If the TIE bit in SCR is set to 1 at this time, a TXI interrupt request is generated.
Because the TXI interrupt routine writes the next transmit data to TDR before transmission of
the current transmit data has finished, continuous transmission can be enabled.
3. 8-bit data is sent from the TxD pin synchronized with the output clock when output clock
mode has been specified and synchronized with the input clock when use of an external clock
has been specified.
4. The SCI checks the TDRE flag at the timing for sending the MSB.
5. If the TDRE flag is cleared to 0, data is transferred from TDR to TSR, and serial transmission
of the next frame is started.
6. If the TDRE flag is set to 1, the TEND flag in SSR is set to 1, and the TxD pin maintains the
output state of the last bit. If the TEIE bit in SCR is set to 1 at this time, a TEI interrupt request
is generated. The SCK pin is fixed high.
Figure 16.17 shows a sample flowchart for serial data transmission. Even if the TDRE flag is
cleared to 0, transmission will not start while a receive error flag (ORER, FER, or PER) is set to 1.
Make sure to clear the receive error flags to 0 before starting transmission. Note that clearing the
RE bit to 0 does not clear the receive error flags.
Transfer direction
Serial clock
TDRE
TEND
1 frame
Read TDRE flag in SSR [2] [2] SCI status check and transmit data
write:
Read SSR and check that the TDRE
No
TDRE = 1? flag is set to 1, then write transmit data
to TDR and clear the TDRE flag to 0.
Yes
[3] Serial transmission continuation
procedure:
Write transmit data to TDR and
clear TDRE flag in SSR to 0
To continue serial transmission, be
sure to read 1 from the TDRE flag to
confirm that writing is possible, then
No write data to TDR, and then clear the
All data transmitted? [3]
TDRE flag to 0.
Checking and clearing of the TDRE
Yes
flag is automatic when the DMAC or
DTC is activated by a transmit-data-
Read TEND flag in SSR empty interrupt (TXI) request and data
is written to TDR.
No
TEND = 1?
Yes
<End>
Figure 16.18 shows an example of SCI operation for reception in clocked synchronous mode. In
serial reception, the SCI operates as described below.
1. The SCI performs internal initialization in synchronization with a synchronization clock input
or output, starts receiving data, and stores the received data in RSR.
2. If an overrun error (when reception of the next data is completed while the RDRF flag is still
set to 1) occurs, the ORER bit in SSR is set to 1. If the RIE bit in SCR is set to 1 at this time,
an ERI interrupt request is generated. Receive data is not transferred to RDR. The RDRF flag
remains to be set to 1.
3. If reception finishes successfully, the RDRF bit in SSR is set to 1, and receive data is
transferred to RDR. If the RIE bit in SCR is set to 1 at this time, an RXI interrupt request is
generated. Because the RXI interrupt routine reads the receive data transferred to RDR before
reception of the next receive data has finished, continuous reception can be enabled.
Serial
clock
RDRF
ORER
RXI interrupt request RDR data read and RXI interrupt request ERI interrupt request
generated RDRF flag cleared to 0 generated generated by overrun
in RXI interrupt handling error
routine
1 frame
Transfer cannot be resumed while a receive error flag is set to 1. Accordingly, clear the ORER,
FER, PER, and RDRF flags to 0 before resuming reception. Figure 16.19 shows a sample
flowchart for serial data reception.
<End>
Figure 16.20 shows a sample flowchart for simultaneous serial transmit and receive operations.
The following procedure should be used for simultaneous serial data transmit and receive
operations after the SCI is initialized. To switch from transmit mode to simultaneous transmit and
receive mode, after checking that the SCI has finished transmission and the TDRE and TEND
flags are set to 1, clear TE to 0. Then simultaneously set TE and RE to 1 with a single instruction.
To switch from receive mode to simultaneous transmit and receive mode, after checking that the
SCI has finished reception, clear RE to 0. Then after checking that the RDRF and receive error
flags (ORER, FER, and PER) are cleared to 0, simultaneously set TE and RE to 1 with a single
instruction.
Figure 16.20 Sample Flowchart of Simultaneous Serial Transmit and Receive Operations
Figure 16.21 shows an example of connection with the Smart Card. In communication with an IC
card, since both transmission and reception are carried out on a single data transmission line, the
TxD pin and RxD pin should be connected with the LSI pin. The data transmission line should be
pulled up to the VCC power supply with a resistor. If an IC card is not connected, and the TE and
RE bits are both set to 1, closed transmission/reception is possible, enabling self-diagnosis to be
carried out. When the clock generated on the SCI is used by an IC card, the SCK pin output is
input to the CLK pin of the IC card. This LSI port output is used as the reset signal.
VCC
TxD
I/O
RxD Data line
SCK CLK
Clock line
Rx (port) RST
Reset line IC card
This LSI
Connected equipment
Figure 16.22 shows the transfer data format in Smart Card interface mode.
• One frame consists of 8-bit data plus a parity bit in asynchronous mode.
• In transmission, a guard time of at least 2 etu (Elementary Time Unit: time for transfer of 1 bit)
is left between the end of the parity bit and the start of the next frame.
• If a parity error is detected during reception, a low error signal level is output for one etu
period, 10.5 etu after the start bit.
• If an error signal is sampled during transmission, the same data is retransmitted automatically
after the elapse of 2 etu or longer.
Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp
Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp DE
Receiving station
Legend: output
Ds : Start bit
D0 to D7 : Data bits
Dp : Parity bit
DE : Error signal
Data transfer with the types of IC cards (direct convention and inverse convention) are performed
as described in the following.
Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp
As in the above sample start character, with the direct convention type, the logic 1 level
corresponds to state Z and the logic 0 level to state A, and transfer is performed in LSB-first order.
The start character data above is H'3B. For the direct convention type, clear the SDIR and SINV
bits in SCMR to 0. According to the Smart Card regulations, clear the O/E bit in SMR to 0 to
select even parity mode.
Ds D7 D6 D5 D4 D3 D2 D1 D0 Dp
With the inverse convention type, the logic 1 level corresponds to state A and the logic 0 level to
state Z, and transfer is performed in MSB-first order. The start character data above is H'3F. For
the inverse convention type, set the SDIR and SINV bits in SCMR to 1. According to the Smart
Card regulations, even parity mode is the logic 0 level of the parity bit, and corresponds to state Z.
In this LSI, the SINV bit inverts only data bits D7 to D0. Therefore, set the O/E bit in SMR to 1 to
invert the parity bit for both transmission and reception.
Operation in block transfer mode is the same as that in normal Smart Card interface, except for the
following points.
• In reception, though the parity check is performed, no error signal is output even if an error is
detected. However, the PER bit in SSR is set to 1 and must be cleared before receiving the
parity bit of the next frame.
• In transmission, a guard time of at least 1 etu is left between the end of the parity bit and the
start of the next frame.
• In transmission, because retransmission is not performed, the TEND flag is set to 1, 11.5 etu
after transmission start.
• As with the normal Smart Card interface, the ERS flag indicates the error signal status, but
since error signal transfer is not performed, this flag is always cleared to 0.
Only the internal clock generated by the on-chip baud rate generator is used as transmit/receive
clock in Smart Card interface. In Smart Card interface mode, the SCI operates on a basic clock
with a frequency of 32, 64, 372, 256, 93, 128, 186, or 512 times the bit rate (fixed at 16 times in
normal asynchronous mode) as determined by bits BCP2 to BCP0. In reception, the SCI samples
the falling edge of the start bit using the basic clock, and performs internal synchronization. As
shown in figure 16.25, by sampling receive data at the rising-edge of the 16th, 32nd, 186th, 128th,
46th, 64th, 93rd, or 256th pulse of the basic clock, data can be latched at the middle of the bit. The
reception margin is given by the following formula.
1 ⏐D – 0.5⏐
M = ⏐ (0.5 – ) – (L – 0.5) F – (1 + F) ⏐ × 100 [%]
2N N
Where M: Reception margin (%)
N: Ratio of bit rate to clock (N = 32, 64, 372, 256, 93, 128, 186, or 512)
D: Clock duty cycle (D = 0 to 1.0)
L: Frame length (L = 10)
F: Absolute value of clock frequency deviation
Assuming values of F = 0, D = 0.5 and N = 372 in the above formula, the reception margin
formula is as follows.
372 clocks
186 clocks
0 185 371 0 185 371 0
Internal
basic clock
Synchronization
sampling timing
Data sampling
timing
16.7.5 Initialization
Before transmitting and receiving data, initialize the SCI as described below. Initialization is also
necessary when switching from transmit mode to receive mode, or vice versa.
To switch from receive mode to transmit mode, after checking that the SCI has finished reception,
initialize the SCI, and clear RE to 0 and set TE to 1. Whether SCI has finished reception can be
checked with the RDRF, PER, or ORER flag. To switch from transmit mode to receive mode,
after checking that the SCI has finished transmission, initialize the SCI, and clear TE to 0 and set
RE to 1. Whether SCI has finished transmission can be checked with the TEND flag.
As data transmission in Smart Card interface mode involves error signal sampling and
retransmission processing, the operations are different from those in normal serial communication
interface mode (except for block transfer mode). Figure 16.26 illustrates the retransfer operation
when the SCI is in transmit mode.
1. If an error signal is sampled from the receiving end after transmission of one frame is
completed, the ERS bit in SSR is set to 1. If the RIE bit in SCR is set at this time, an ERI
interrupt request is generated. The ERS bit in SSR should be cleared to 0 before the next parity
bit is sampled.
2. The TEND bit in SSR is not set for a frame for which an error signal is received. The contents
of TSR are retransmitted automatically.
3. If an error signal is not sent back from the receiving end, the ERS bit in SSR is not set.
4. Transmission of one frame, including a retransfer, is judged to have been completed, and the
TEND bit in SSR is set to 1. If the TIE bit in SCR is set at this time, a TXI interrupt request is
generated. Writing transmit data to TDR transfers the next transmit data.
Figure 16.28 shows a flowchart for transmission. The sequence of transmit operations can be
performed automatically by specifying the DTC or DMAC to be activated with a TXI interrupt
source. In a transmit operation, a TXI interrupt request will be generated if the TIE bit in SCR is 1
when the TEND flag in SSR is set to 1. If the TXI interrupt request is designated beforehand as a
DTC or DMAC activation source, the DTC or DMAC will be activated by the TXI interrupt
request, and transfer of the transmit data will be carried out. The TDRE and TEND flags are
automatically cleared to 0 when data transfer is performed by the DTC or DMAC. In the event of
an error, the SCI retransmits the same data automatically. During this period, the TEND flag
remains cleared to 0 and the DTC or DMAC is not activated. Therefore, the SCI and DTC or
DMAC will automatically transmit the specified number of bytes in the event of an error,
including retransmission. However, the ERS flag is not cleared automatically when an error
occurs, and so the RIE bit should be set to 1 beforehand so that an ERI interrupt request will be
generated in the event of an error, and the ERS flag will be cleared.
When performing transfer using the DTC or DMAC, it is essential to set and enable the DTC or
DMAC before carrying out SCI setting. For details on the DTC or DMAC setting procedures,
refer to section 10, Data Transfer Controller (DTC), or section 8, DMA Controller (DMAC).
Transfer
nth transfer frame Retransferred frame frame n+1
(DE)
Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp DE Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp Ds D0 D1 D2 D3 D4
TDRE
Transfer to TSR
Transfer to TSR from TDR Transfer to TSR from TDR
from TDR
TEND
[2] [4]
FER/ERS
[1] [3]
Figure 16.26 Retransfer Operation in SCI Transmit Mode (Transfer from TDR to TSR is
Not Performed at Retransfer)
The timing for setting the TEND flag depends on the value of the GM bit in SMR. The TEND flag
generation timing is shown in figure 16.27.
I/O data Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp DE
Guard
TXI
time
(TEND interrupt)
12.5 etu
When GM = 0
11.0 etu
When GM = 1
Legend:
Ds : Start bit
D0 to D7 : Data bits
Dp : Parity bit
DE : Error signal
Note: etu (Elementary Time Unit): Time for transfer of 1 bit
Start
Initialization
Start transmission
No
ERS = 0?
Yes
Error processing
No
TEND = 1?
Yes
No
All data transmitted ?
Yes
No
ERS = 0?
Yes
Error processing
No
TEND = 1?
Yes
Clear TE bit to 0
End
Data reception in Smart Card interface mode uses the same operation procedure as for normal
serial communication interface mode. Figure 16.29 illustrates the retransfer operation when the
SCI is in receive mode.
1. If an error is found when the received parity bit is checked, the PER bit in SSR is
automatically set to 1. If the RIE bit in SCR is set at this time, an ERI interrupt request is
generated. The PER bit in SSR should be cleared to 0 before the next parity bit is sampled.
2. The RDRF bit in SSR is not set for a frame in which an error has occurred.
3. If no error is found when the received parity bit is checked, the PER bit in SSR is not set to 1.
4. The receive operation is judged to have been completed normally, and the RDRF flag in SSR
is automatically set to 1. If the RIE bit in SCR is set at this time, an RXI interrupt request is
generated.
Figure 16.30 shows a flowchart for reception. The sequence of receive operations can be
performed automatically by specifying the DTC or DMAC to be activated with an RXI interrupt
source. In a receive operation, an RXI interrupt request will be generated if the RIE bit is 1 when
the RDRF flag in SSR is set to 1. If the RXI interrupt request is designated beforehand as a DTC
or DMAC activation source, the DTC or DMAC will be activated by the RXI interrupt request,
and transfer of the receive data will be carried out. The RDRF flag is cleared to 0 automatically
when data transfer is performed by the DTC or DMAC. If an error occurs in receive mode and the
ORER or PER flag is set to 1, a transfer error interrupt (ERI) request will be generated, and so the
error flag must be cleared to 0. In the event of an error, the DTC or DMAC is not activated and
receive data is skipped. Therefore, receive data is transferred for only the specified number of
bytes in the event of an error. Even when a parity error occurs in receive mode and the PER flag is
set to 1, the data that has been received is transferred to RDR and can be read from there.
Note: For details on receive operations in block transfer mode, refer to section 16.4, Operation in
Asynchronous Mode.
Transfer
nth transfer frame Retransferred frame frame n+1
(DE)
Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp DE Ds D0 D1 D2 D3 D4 D5 D6 D7 Dp Ds D0 D1 D2 D3 D4
RDRF
[2] [4]
PER
[1] [3]
Start
Initialization
Start reception
ORER = 0 and No
PER = 0
Yes
Error processing
No
RDRF = 1?
Yes
No
All data received?
Yes
Clear RE bit to 0
When the GM bit in SMR is set to 1, the clock output level can be fixed with bits CKE1 and
CKE0 in SCR. At this time, the minimum clock pulse width can be made the specified width.
Figure 16.31 shows the timing for fixing the clock output level. In this example, GM is set to 1,
CKE1 is cleared to 0, and the CKE0 bit is controlled.
CKE0
SCK
When turning on the power or switching between Smart Card interface mode and software
standby mode, the following procedures should be followed in order to maintain the clock duty
cycle.
Powering On: To secure the clock duty cycle from power-on, the following switching procedure
should be followed.
1. The initial state is port input and high impedance. Use a pull-up resistor or pull-down resistor
to fix the potential.
2. Fix the SCK pin to the specified output level with the CKE1 bit in SCR.
3. Set SMR and SCMR, and switch to Smart Card mode operation.
4. Set the CKE0 bit in SCR to 1 to start clock output.
When Changing from Smart Card Interface Mode to Software Standby Mode:
1. Set the data register (DR) and data direction register (DDR) corresponding to the SCK pin to
the value for the fixed output state in software standby mode.
2. Write 0 to the TE bit and RE bit in the serial control register (SCR) to halt transmit/receive
operation. At the same time, set the CKE1 bit to the value for the fixed output state in software
standby mode.
3. Write 0 to the CKE0 bit in SCR to halt the clock.
4. Wait for one serial clock cycle.
During this interval, clock output is fixed at the specified level, with the duty cycle preserved.
5. Make the transition to the software standby state.
When Returning to Smart Card Interface Mode from Software Standby Mode:
Software
Normal operation standby Normal operation
In the IrDA specification version 1.0 system, communication is started at a transfer rate of 9600
bps, and subsequently the transfer rate can be varied as necessary. As the IrDA interface in this
LSI does not include a function for varying the transfer rate automatically, the transfer rate setting
must be changed by software.
IrDA SCI0
TxD
TxD0/IrTxD Pulse encoder
RxD
RxD0/IrRxD Pulse decoder
IrCR
(1) Transmission
In transmission, the output signal (UART frame) from the SCI is converted to an IR frame by the
IrDA interface (see figure 16.34).
When the serial data is 0, a high pulse of 3/16 the bit rate (interval equivalent to the width of one
bit) is output (initial value). The high-level pulse can be varied according to the setting of bits
IrCKS2 to IrCKS0 in IrCR.
In the specification, the high pulse width is fixed at a minimum of 1.41 µs, and a maximum of
(3/16 + 2.5%) × bit rate or (3/16 × bit rate) + 1.08 µs. When system clock φ is 20 MHz, 1.6 µs can
be set for a high pulse width with a minimum value of 1.41 µs.
UART frame
Start Data Stop
bit bit
0 1 0 1 0 0 1 1 0 1
Transmit Receive
IR frame
Data Stop
Start
bit bit
0 1 0 1 0 0 1 1 0 1
(2) Reception
In reception, IR frame data is converted to a UART frame by the IrDA interface, and input to the
SCI.
When a high pulse is detected, 0 data is output, and if there is no pulse during a one-bit interval, 1
data is output. Note that a pulse shorter than the minimum pulse width of 1.41 µs will be identified
as a 0 signal.
Table 16.12 shows possible settings for bits IrCKS2 to IrCKS0 (minimum pulse width), and
operating frequencies of this LSI and bit rates, for making the pulse width shorter than 3/16 times
the bit rate in transmission.
Table 16.13 shows the interrupt sources in serial communication interface mode. A different
interrupt vector is assigned to each interrupt source, and individual interrupt sources can be
enabled or disabled using the enable bits in SCR.
When the TDRE flag in SSR is set to 1, a TXI interrupt request is generated. When the TEND flag
in SSR is set to 1, a TEI interrupt request is generated. A TXI interrupt can activate the DTC or
DMAC to perform data transfer. The TDRE flag is cleared to 0 automatically when data transfer is
performed by the DTC or DMAC. When the RDRF flag in SSR is set to 1, an RXI interrupt
request is generated. When the ORER, PER, or FER flag in SSR is set to 1, an ERI interrupt
request is generated. An RXI interrupt request can activate the DTC or DMAC to perform data
transfer. The RDRF flag is cleared to 0 automatically when data transfer is performed by the DTC
or DMAC. A TEI interrupt is generated when the TEND flag is set to 1 while the TEIE bit is set to
1. If a TEI interrupt and a TXI interrupt are generated simultaneously, the TXI interrupt has
priority for acceptance. However, note that if the TDRE and TEND flags are cleared
simultaneously by the TXI interrupt routine, the SCI cannot branch to the TEI interrupt routine
later.
DTC DMAC
Channel Name Interrupt Source Interrupt Flag Activation Activation Priority
0 ERI0 Receive error ORER, FER, PER Not possible Not possible High
RXI0 Receive data full RDRF Possible Possible
TXI0 Transmit data empty TDRE Possible Possible
TEI0 Transmission end TEND Not possible Not possible
1 ERI1 Receive error ORER, FER, PER Not possible Not possible
RXI1 Receive data full RDRF Possible Possible
TXI1 Transmit data empty TDRE Possible Possible
TEI1 Transmission end TEND Not possible Not possible
2 ERI2 Receive error ORER, FER, PER Not possible Not possible
RXI2 Receive data full RDRF Possible Not possible
TXI2 Transmit data empty TDRE Possible Not possible
TEI2 Transmission end TEND Not possible Not possible
3 ERI3 Receive error ORER, FER, PER Not possible Not possible
RXI3 Receive data full RDRF Possible Not possible
TXI3 Transmit data empty TDRE Possible Not possible
TEI3 Transmission end TEND Not possible Not possible
4 ERI4 Receive error ORER, FER, PER Not possible Not possible
RXI4 Receive data full RDRF Possible Not possible
TXI4 Transmit data empty TDRE Possible Not possible
TEI4 Transmission end TEND Not possible Not possible Low
Table 16.14 shows the interrupt sources in Smart Card interface mode. The transmit end interrupt
(TEI) cannot be used in this mode.
DTC DMAC
Channel Name Interrupt Source Interrupt Flag Activation Activation Priority
0 ERI0 Receive error, error signal ORER, PER, ERS Not possible Not possible High
detection
RXI0 Receive data full RDRF Possible Possible
TXI0 Transmit data empty TEND Possible Possible
1 ERI1 Receive error, error signal ORER, PER, ERS Not possible Not possible
detection
RXI1 Receive data full RDRF Possible Possible
TXI1 Transmit data empty TEND Possible Possible
2 ERI2 Receive error, error signal ORER, PER, ERS Not possible Not possible
detection
RXI2 Receive data full RDRF Possible Not possible
TXI2 Transmit data empty TEND Possible Not possible
3 ERI3 Receive error, error signal ORER, PER, ERS Not possible Not possible
detection
RXI3 Receive data full RDRF Possible Not possible
TXI3 Transmit data empty TEND Possible Not possible
4 ERI4 Receive error, error signal ORER, PER, ERS Not possible Not possible
detection
RXI4 Receive data full RDRF Possible Not possible
TXI4 Transmit data empty TEND Possible Not possible Low
In Smart Card interface mode, as in normal serial communication interface mode, transfer can be
carried out using the DTC or DMAC. In a transmit operation, a TXI interrupt request is generated
when the TEND flag in SSR is set to 1. If the TXI interrupt request is designated beforehand as a
DTC or DMAC activation source, the DTC or DMAC will be activated by the TXI interrupt
request, and transfer of the transmit data will be carried out. The TDRE and TEND flags are
automatically cleared to 0 when data transfer is performed by the DTC or DMAC. In the event of
an error, the SCI retransmits the same data automatically. During this period, the TEND flag
remains cleared to 0 and the DTC or DMAC is not activated. Therefore, the SCI and DTC or
DMAC will automatically transmit the specified number of bytes in the event of an error,
including retransmission. However, the ERS flag is not cleared automatically when an error
occurs, and so the RIE bit should be set to 1 beforehand so that an ERI interrupt request will be
generated in the event of an error, and the ERS flag will be cleared.
In a receive operation, an RXI interrupt request is generated when the RDRF flag in SSR is set to
1. If the RXI interrupt request is designated beforehand as a DTC or DMAC activation source, the
DTC or DMAC will be activated by the RXI interrupt request, and transfer of the receive data will
be carried out. The RDRF flag is cleared to 0 automatically when data transfer is performed by the
DTC or DMAC. If an error occurs, an error flag is set but the RDRF flag is not. Consequently, the
DTC or DMAC is not activated, but instead, an ERI interrupt request is sent to the CPU.
Therefore, the error flag should be cleared.
When using the DTC or DMAC for transmission or reception, it is essential to set and enable the
DTC or DMAC before carrying out SCI setting. For details on the DTC or DMAC setting
procedures, refer to section 10, Data Transfer Controller (DTC), or section 8, DMA Controller
(DMAC).
SCI operation can be disabled or enabled using the module stop control register. The initial setting
is for SCI operation to be halted. Register access is enabled by clearing the module stop state. For
details, refer to section 25, Power-Down Modes.
When framing error detection is performed, a break can be detected by reading the RxD pin value
directly. In a break, the input from the RxD pin becomes all 0s, and so the FER flag is set, and the
PER flag may also be set. Note that, since the SCI continues the receive operation after receiving a
break, even if the FER flag is cleared to 0, it will be set to 1 again.
When the TE bit is 0, the TxD pin is used as an I/O port whose direction (input or output) and
level are determined by DR and DDR. This can be used to set the TxD pin to mark state or send a
break during serial data transmission. To maintain the communication line at mark state until the
TE bit is set to 1, set both DDR and DR to 1. Since the TE bit is cleared to 0 at this point, the TxD
pin becomes an I/O port, and 1 is output from the TxD pin. To send a break during serial
transmission, first set DDR to 1 and clear DR to 0, and then clear the TE bit to 0. When the TE bit
is cleared to 0, the transmitter is initialized regardless of the current transmission state, the TxD
pin becomes an I/O port, and 0 is output from the TxD pin.
16.10.4 Receive Error Flags and Transmit Operations (Clocked Synchronous Mode Only)
Transmission cannot be started when a receive error flag (ORER) is set to 1, even if the TDRE
flag is cleared to 0. Be sure to clear the receive error flags to 0 before starting transmission. Note
also that receive error flags cannot be cleared to 0 even if the RE bit is cleared to 0.
The TDRE flag in SSR is a status flag that indicates that transmit data has been transferred from
TDR to TSR. When the SCI transfers data from TDR to TSR, the TDRE flag is set to 1.
Data can be written to TDR regardless of the state of the TDRE flag. However, if new data is
written to TDR when the TDRE flag is cleared to 0, the data stored in TDR will be lost since it has
not yet been transferred to TSR. It is therefore essential to check that the TDRE flag is set to 1
before writing transmit data to TDR.
1. When an external clock source is used as the serial clock, the transmit clock should not be
input until at least 5 φ clock cycles after TDR is updated by the DMAC or DTC. Incorrect
operation may occur if the transmit clock is input within 4 φ clock cycles after TDR is updated.
(Figure 16.35)
2. When RDR is read by the DMAC or DTC, be sure to set the activation source to the relevant
SCI receive-data-full interrupt (RXI).
SCK
TDRE
LSB
Serial data D0 D1 D2 D3 D4 D5 D6 D7
(1) Transmission
Operation should be stopped (by clearing TE, TIE, and TEIE to 0) before setting the module
stop state or making a transition to software standby mode. TSR, TDR, and SSR are reset. The
output pin states in the module stop state or software standby mode depend on the port
settings, and become high-level output after the relevant mode is cleared. If a transition is
made during transmission, the data being transmitted will be undefined.
When transmitting without changing the transmit mode after the relevant mode is cleared,
transmission can be started by setting TE to 1 again, and performing the following sequence:
SSR read → TDR write → TDRE clearance. To transmit with a different transmit mode after
clearing the relevant mode, the procedure must be started again from initialization.
Figure 16.36 shows a sample flowchart for mode transition during transmission. Port pin states
during mode transition are shown in figures 16.37 and 16.38.
Operation should also be stopped (by clearing TE, TIE, and TEIE to 0) before making a
transition from transmission by DTC transfer to module stop state setting or software standby
mode transition. To perform transmission with the DTC after the relevant mode is cleared,
setting TE and TIE to 1 will set the TXI flag and start DTC transmission.
(2) Reception
Receive operation should be stopped (by clearing RE to 0) before setting the module stop state or
making a transition to software standby mode. RSR, RDR, and SSR are reset. If a transition is
made during reception, the data being received will be invalid.
To continue receiving without changing the receive mode after the relevant mode is cleared, set
the RE bit to 1 before starting reception. To receive in a different receive mode after clearing the
relevant mode, the procedure must be started again from initialization.
Figure 16.39 shows a sample flowchart for mode transition during reception.
<Transmission>
Change No
operating mode?
Yes
Initialization TE = 1
<Start of transmission>
TE bit
TxD output pin Port input/output High output Start Stop Port input/output High output
TE bit
TxD output pin Port input/output Marking output Last TxD bit held Port input/output High output*
SCI TxD
Port SCI TxD output Port
output
<Reception>
Yes
RE = 0
Transition to software
standby mode [2] [2] Includes setting of module
stop state.
Change No
operating mode?
Yes
Initialization RE = 1
<Start of reception>
For the input of the external clock SCK in clocked synchronous mode, the high pulse period and
low pulse period must each be at least two clock cycles and the cycle must be at least six clock
cycles.
16.11.1 Features
• CRC code generated for any desired data length in an 8-bit unit
• CRC operation executed on eight bits in parallel
• One of three generating polynomials selectable
• CRC code generation for LSB-first or MSB-first Communication selectable
Control
signal
CRCCR
Internal bus
CRC code
CRCDIR generation
circuit
CRCDOR
[Legend]
CRCCR: CRC control register
CRCDIR: CRC data input register
CRCDOR: CRC data output register
CRCCR initializes the CRC operation circuit, switches the operation mode, and selects the
generating polynomial.
Initial
Bit Bit Name Value R/W Description
7 DORCLR 0 W CRCDOR Clear
Setting this bit to 1 clears CRCDOR to H'0000.
6 to 3 ⎯ All 0 R Reserved
The initial value should not be changed.
2 LMS 0 R/W CRC Operation Switch
Selects CRC code generation for LSB-first or MSB-first
Communication.
0: Performs CRC operation for LSB-first
Communication. The lower byte (bits 7 to 0) is first
transmitted when CRCDOR contents (CRC code)
are divided into two bytes to be transmitted in two
parts.
1: Performs CRC operation for MSB-first
Communication. The upper byte (bits 15 to 8) is first
transmitted when CRCDOR contents (CRC code)
are divided into two bytes to be transmitted in two
parts.
1 G1 0 R/W CRC Generating Polynomial Select:
0 G0 0 R/W Selects the polynomial.
00: Reserved
8 2
01: X + X + X + 1
16 15 2
10: X + X + X + 1
16 12 5
11: X + X + X + 1
CRCDIR is an 8-bit readable/writable register, to which the bytes to be CRC-operated are written.
The result is obtained in CRCDOR.
CRCDOR is a 16-bit readable/writable register that contains the result of CRC operation when the
bytes to be CRC-operated are written to CRCDIR after CRCDOR is cleared. When the CRC
operation result is additionally written to the bytes to which CRC operation is to be performed, the
CRC operation result will be H'0000 if the data contains no CRC error. When bits 1 and 0 in
CRCCR (G1 and G0 bits) are set to 0 and 1, respectively, the lower byte of this register contains
the result.
The CRC operation circuit generates a CRC code for LSB-first/MSB-first Communication. An
example in which a CRC code for hexadecimal data H'F0 is generated using the X16 + X12 + X5 + 1
polynomial with the G1 and G0 bits in CRCCR set to B'11 is shown below.
Note that the sequence to transmit the CRC code differs between LSB-first transmission and
MSB-first transmission.
2. Transmission data
The I2C bus interface conforms to and provides a subset of the NXP I2C bus (inter-IC bus)
interface functions (Rev. 0.3) for standard-mode and fast-mode. The register configuration that
controls the I2C bus differs partly from the NXP configuration, however.
Figure 17.1 shows a block diagram of the I2C bus interface 2. Figure 17.2 shows an example of
I/O pin connections to external circuits.
17.1 Features
• Continuous transmission/reception
Since the shift register, transmit data register, and receive data register are independent from
each other, the continuous transmission/reception can be performed.
• Start and stop conditions generated automatically in master mode
• Selection of acknowledge output levels when receiving
• Automatic loading of acknowledge bit when transmitting
• Bit synchronization/wait function
In master mode, the state of SCL is monitored per bit, and the timing is synchronized
automatically. If transmission/reception is not yet possible, set the SCL to low until
preparations are completed.
• Six interrupt sources
Transmit-data-empty (including slave-address match), transmit-end, receive-data-full
(including slave-address match), arbitration lost, NACK detection, and stop condition
detection
• Direct bus drive
Two pins, SCL and SDA pins function as NMOS open-drain outputs.
Transfer clock
generation
circuit
Transmission/ ICCRA
reception
Output control circuit
SCL ICCRB
control
ICMR
Noise canceler
ICDRT
ICDRR
Bus state
decision circuit
Arbitration
decision circuit ICSR
ICIER
Interrupt
generator Interrupt request
[Legend]
ICCRA : 2
I C bus control register A
ICCRB : I2C bus control register B
ICMR : I2C mode register
ICSR : I2C status register
ICIER : I2C interrupt enable register
ICDRT : I2C transmit data register
ICDRR : I2C receive data register
ICDRS : I2C bus shift register
SAR : Slave address register
Vcc Vcc
SCL SCL
SCL in
SCL out
SDA SDA
SDA in
SDA out
SCL
SCL
SDA
SDA
(Master)
SCL in SCL in
SCL out SCL out
SDA in SDA in
SDA out SDA out
(Slave 1) (Slave 2)
Channel 0
Channel 1
Channel 2
Channel 3
ICCRA is an 8-bit readable/writable register that enables or disables the I2C bus interface, controls
transmission or reception, and selects master or slave mode, transmission or reception, and
transfer clock frequency in master mode.
CKS3 CKS2 CKS1 CKS0 Clock φ = 8 MHz φ = 10 MHz φ = 20 MHz φ = 25 MHz φ = 33 MHz
0 0 0 0 φ/28 286 kHz 357 kHz 714 kHz* 893 kHz* 1179 kHz*
1 φ/40 200 kHz 250 kHz 500 kHz* 625 kHz* 825 kHz*
1 0 φ/48 167 kHz 208 kHz 417 kHz* 521 kHz* 688 kHz*
1 φ/64 125 kHz 156 kHz 313 kHz 391 kHz 516 kHz*
1 0 0 φ/168 47.6 kHz 59.5 kHz 119 kHz 149 kHz 196 kHz
1 φ/100 80.0 kHz 100 kHz 200 kHz 250 kHz 330 kHz
1 0 φ/112 71.4 kHz 89.3 kHz 179 kHz 223 kHz 295 kHz
1 φ/128 62.5 kHz 78.1 kHz 156 kHz 195 kHz 258 kHz
1 0 0 0 φ/56 143 kHz 179 kHz 357 kHz 446 kHz* 589 kHz*
1 φ/80 100 kHz 125 kHz 250 kHz 313 kHz 413 kHz*
1 0 φ/96 83.3 kHz 104 kHz 208 kHz 260 kHz 344 kHz
1 φ/128 62.5 kHz 78.1 kHz 156 kHz 195 kHz 258 kHz
1 0 0 φ/336 23.8 kHz 29.8 kHz 59.5 kHz 74.4 kHz 98.2 kHz
1 φ/200 40.0 kHz 50.0 kHz 100 kHz 125 kHz 165 kHz
1 0 φ/224 35.7 kHz 44.6 kHz 89.3 kHz 112 kHz 147 kHz
1 φ/256 31.3 kHz 39.1 kHz 78.1 kHz 97.7 kHz 129 kHz
Note: * Correct operation cannot be guaranteed since the transfer rate is beyond the I2C bus
interface specification (normal mode: maximum 100 kHz, high-speed mode: maximum
400 kHz).
ICCRB is an 8-bit readable/writable register that issues start/stop conditions, manipulates the SDA
pin, monitors the SCL pin, and controls reset in I2C control.
ICMR controls the master mode wait and selects the number of transfer bits.
ICIER is an 8-bit readable/writable register that enables or disables interrupt sources and
acknowledge bits, sets acknowledge bits to be transferred, and confirms acknowledge bits to be
received.
ICSR is an 8-bit readable/writable register that performs confirmation of interrupt request flags
and status.
SAR is an 8-bit readable/writable register that sets slave address. When the chip is in slave mode,
if the upper 7 bits of SAR match the upper 7 bits of the first frame received after a start condition,
the chip operates as the slave device.
ICDRT is an 8-bit readable/writable register that stores the transmit data. When ICDRT detects the
space in the I2C bus shift register (ICDRS), it transfers the transmit data which is written in
ICDRT to ICDRS and starts transferring data. If the next transfer data is written to ICDRT during
transferring data of ICDRS, continuous transfer is possible. The initial value of ICDRT is H'FF.
ICDRR is an 8-bit register that stores the receive data. When data of one byte is received, ICDRR
transfers the received data from ICDRS to ICDRR and the next data can be received. ICDRR is a
receive-only register, therefore the CPU cannot be written to this register. The initial value of
ICDRR is H'FF.
ICDRS is a register that is used to transfer/receive data. In transmission, data is transferred from
ICDRT to ICDRS and the data is sent from the SDA pin. In reception, data is transferred from
ICDRS to ICDRR after data of one byte is received. This register cannot be read from the CPU.
17.4 Operation
Figure 17.3 shows the I2C bus formats. Figure 17.4 shows the I2C bus timing. The first frame
following a start condition always consists of 8 bits.
1 m1 1 m2
SDA
SCL
1-7 8 9 1-7 8 9 1-7 8 9
Legend:
S: Start condition. The master device drives SDA from high to low while SCL is high.
SLA: Slave address
R/W: Indicates the direction of data transfer: from the slave device to the master device when
R/W is 1, or from the master device to the slave device when R/W is 0.
A: Acknowledge. The receiving device drives SDA to low.
DATA: Transferred data
P: Stop condition. The master device drives SDA from low to high while SCL is high.
In I2C bus format master transmit mode, the master device outputs the transmit clock and transmit
data, and the slave device returns an acknowledge signal. The transmission procedure and
operations in master transmit mode are described below.
1. Set the ICE bit in ICCRA to 1. Set the WAIT bit in ICMR and the CKS3 to CKS0 bits in
ICCR1 to 1. (Initial setting)
2. Read the BBSY flag in ICCRB to confirm that the bus is free. Set the MST and TRS bits in
ICCRA to select master transmit mode. Then, write 1 to BBSY and 0 to SCP using MOV
instruction. (Start condition issued) This generates the start condition.
3. After confirming that TDRE in ICSR has been set, write the transmit data (the first byte data
show the slave address and R/W) to ICDRT. After this, when TDRE is cleared to 0, data is
transferred from ICDRT to ICDRS. TDRE is set again.
4. When transmission of one byte data is completed while TDRE is 1, TEND in ICSR is set to 1
at the rise of the 9th transmit clock pulse. Read the ACKBR bit in ICIER, and confirm that the
slave device has been selected. Then, write second byte data to ICDRT, and clear TDRE and
TEND. When ACKBR is 1, the slave device has not been acknowledged, so issue the stop
condition. To issue the stop condition, write 0 to BBSY and SCP using MOV instruction. SCL
is fixed low until the transmit data is prepared or the stop condition is issued.
5. The transmit data after the second byte is written to ICDRT every time TDRE is set, thus
clearing TDRE.
6. Write the number of bytes to be transmitted to ICDRT. Wait until TEND is set (the end of last
byte data transmission) while TDRE is 1, or wait for NACK (NACKF in ICSR = 1) from the
receive device while ACKE in ICIER is 1. Then, issue the stop condition to clear TEND or
NACKF.
7. When the STOP bit in ICSR is set to 1, the operation returns to the slave receive mode.
SCL
(master output) 1 2 3 4 5 6 7 8 9 1 2
SDA Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit 7 Bit 6
(master output)
Slave address R/W
SDA
A
(slave output)
TDRE
TEND
User [2] Instruction of start [4] Write data to ICDRT (second byte).
processing condition issuance
[3] Write data to ICDRT (first byte).
[5] Write data to ICDRT (third byte).
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
(master output) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
SDA
(slave output) A A/A
TDRE
TEND
ICDRT Data n
ICDRS Data n
User [5] Write data to ICDRT. [6] Issue stop condition. Clear TEND.
processing
[7] Set slave receive mode
In master receive mode, the master device outputs the receive clock, receives data from the slave
device, and returns an acknowledge signal. The reception procedure and operations in master
receive mode are shown below.
1. Clear the TEND bit in ICSR to 0, then clear the TRS bit in ICCRA to 0 to switch from master
transmit mode to master receive mode. Then, clear the TDRE bit to 0.
2. When ICDRR is read (dummy data read), reception is started, and the receive clock is output,
and data received, in synchronization with the internal clock. The master device outputs the
level specified by ACKBT in ICIER to SDA, at the 9th receive clock pulse.
3. After the reception of first frame data is completed, the RDRF bit in ICST is set to 1 at the rise
of 9th receive clock pulse. At this time, the received data is read by reading ICDRR.
4. The continuous reception is performed by reading ICDRR and clearing RDRF to 0 every time
RDRF is set. If 8th receive clock pulse falls after reading ICDRR by the other processing while
RDRF is 1, SCL is fixed low until ICDRR is read.
5. If next frame is the last receive data, set the RCVD bit in ICCR1 to 1 before reading ICDRR.
This enables the issuance of the stop condition after the next reception.
6. When the RDRF bit is set to 1 at rise of the 9th receive clock pulse, read ICDRR. Then, clear
RCVD.
7. When the STOP bit in ICSR is set to 1, read ICDRR and clear RDRF to 0. Then clear the
RCVD bit to 0.
8. The operation returns to the slave receive mode.
SDA
(master output) A
SDA
A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit 7
(slave output)
TDRE
TEND
TRS
RDRF
ICDRS Data 1
ICDRR Data 1
SCL
9 1 2 3 4 5 6 7 8 9
(master output)
SDA
A A/A
(master output)
SDA
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
(slave output)
RDRF
RCVD
User [5] Read ICDRR [6] Issue stop [7] Read ICDRR
processing after setting RCVD. condition and clear RCVD
[8] Set slave
receive mode
In slave transmit mode, the slave device outputs the transmit data, while the master device outputs
the receive clock and returns an acknowledge signal.
The transmission procedure and operations in slave transmit mode are described below.
1. Set the ICE bit in ICCRA to 1. Set the MLS and WAIT bits in ICMR and the CKS3 to CKS0
bits in ICCRA to 1. (Initial setting) Set the MST and TRS bits in ICCRA to select slave receive
mode, and wait until the slave address matches.
2. When the slave address matches in the first frame following detection of the start condition,
the slave device outputs the level specified by ACKBT in ICIER to SDA, at the rise of the 9th
clock pulse. At this time, if the 8th bit data (R/W) is 1, the TRS in ICCRA and TDRE in ICSR
are set to 1, and the mode changes to slave transmit mode automatically. The continuous
transmission is performed by clearing TDRE after writing transmit data to ICDRT every time
TDRE is set.
3. If TDRE is set after writing last transmit data to ICDRT, wait until TEND in ICSR is set to 1,
with TDRE = 1. When TEND is set, clear TEND.
4. Clear TRS for the end processing, and read ICDRR (dummy read). SCL is free.
5. Clear TDRE.
SCL
(master output) 9 1 2 3 4 5 6 7 8 9 1
SDA A
(master output)
SCL
(slave output)
SDA
A Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit 7
(slave output)
TDRE
TEND
TRS
ICDRR
User
processing [2] Write data to ICDRT (data 1). [2] Write data to ICDRT (data 2). [2] Write data to ICDRT (data 3).
Slave receive
mode
Slave transmit mode
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
(master output) A A/A
SCL
(slave output)
SDA
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
(slave output)
TDRE
TEND
TRS
ICDRT
ICDRS Data n
ICDRR
User
processing [3] Clear TEND [4] Read ICDRR (dummy read) [5] Clear TDRE
after clearing TRS
In slave receive mode, the master device outputs the transmit clock and transmit data, and the
slave device returns an acknowledge signal. The reception procedure and operations in slave
receive mode are described below.
1. Set the ICE bit in ICCRA to 1. Set the MLS and WAIT bits in ICMR and the CKS3 to CKS0
bits in ICCRA to 1. (Initial setting) Set the MST and TRS bits in ICCRA to select slave receive
mode, and wait until the slave address matches.
2. When the slave address matches in the first frame following detection of the start condition,
the slave device outputs the level specified by ACKBT in ICIER to SDA, at the rise of the 9th
clock pulse. At the same time, RDRF in ICSR is set to read ICDRR (dummy read) and RDRF
is cleared. (Since the read data show the slave address and R/W, it is not used.)
3. Clear RDRF after reading ICDRR every time RDRF is set. If 8th receive clock pulse falls
while RDRF is 1, SCL is fixed low until ICDRR is read. The change of the acknowledge
before reading ICDRR, to be returned to the master device, is reflected to the next transmit
frame.
4. The last byte data is read by reading ICDRR.
SCL
(master output) 9 1 2 3 4 5 6 7 8 9 1
SDA
(master output) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit 7
SCL
(slave output)
SDA
A A
(slave output)
RDRF
ICDRR Data 1
User
processing
[2] Read ICDRR (dummy read). [2] Read ICDRR.
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
(master output) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
SCL
(slave output)
SDA
A A
(slave output)
RDRF
ICDRR Data 1
User
processing [8] Set ACKBT [9] Read ICDRR. [11] Read ICDRR.
The logic levels at the SCL and SDA pins are routed through noise cancelers before being latched
internally. Figure 17.13 shows a block diagram of the noise canceler circuit.
The noise canceler consists of two cascaded latches and a match detector. The SCL (or SDA)
input signal is sampled on the system clock, but is not passed forward to the next circuit unless the
outputs of both latches agree. If they do not agree, the previous value is held.
Sampling clock
C C
SCL or SDA Internal
D Q D Q
input signal Match detector SCL or SDA
Latch Latch signal
System clock
period
Sampling
clock
Flowcharts in respective modes that use the I2C bus interface are shown in figures 17.14 to 17.17.
Start
Initialize
No [10]
TEND=1 ?
Yes
Write BBSY = 0
[13]
and SCP = 0
[14]
No
STOP=1 ?
Yes
Set MST = 0 and TRS
= 0 in ICCRA
[15]
End
Last receive Yes [9] Wait for the final byte to be received.
[5]
- 1?
No [10] Clear STOP flag.
Read ICDRR [6]
[11] Stop condition issuance.
No [9]
RDRF=1 ?
Yes
Clear STOP in ICSR [10]
Write BBSY = 0
[11]
and SCP = 0
No [12]
STOP=1 ?
Yes
Read ICDRR [13]
End
Note: * Ensure that no interrupts are received while steps [1] through [3] are being processed.
Additional information: If only one byte is received, steps [2] through [6] are omitted following step [1],
and processing jumps to step [7]. Step [8] is ICDDR dummy read.
Clear AAS in ICSR [1] [2] Set transmit data for ICDRT (except for the last byte).
Read TDRE in ICSR [5] Wait the transmission end of the last byte.
[3]
No [6] Clear the TEND flag.
TDRE=1 ?
Yes [4]
[9] Clear the TDRE flag.
Write transmit data
in ICDRT
Yes
Clear TEND in ICSR [6]
End
Clear RDRF in ICSR Read RDRF in ICSR [9] Read the received data of the (last byte - 1).
[14] [5] [10] Wait the reception end of the last byte.
Clear STOP in ICSR No
RDRF=1 ?
[11] Read the received data of the last byte.
[15] Yes
Set RIE = 1 in ICIER
[12] Receive-data-full interrupt requests
Yes are disabled.
Last receive
- 1? [6]
[13] Determined by the stop condition
No detection flag.
Read ICDRR [7]
[14] Clear the RDRF and STOP flags.
Yes
End
Additional information: If only one byte is received, steps [2] through [6] are omitted following step [1],
and processing jumps to step [7]. Step [8] is ICDRR dummy read.
Note: * In slave receive mode, even if the actual and received slave addresses did not match,
received data are stored in ICDRR, after which the RDRF bit in ICSR is set.
Checking whether or not the addresses matched is thus required.
Interrupt exception handling is performed when the interrupt conditions listed in table 17.3 are set
to 1 and the CPU is ready to accept interrupts. During exception handling, the interrupt sources
should be cleared. Note, however, that TDRE and TEND are automatically cleared by writing
transmit data to ICDRT, and RDRF is automatically cleared by reading data from ICDRR. In
particular, if TDRE is set at the same time transmit data is written to ICDRT, and then TDRE is
cleared again, an extra byte of data may be transmitted.
This module has a possibility that high level period may be short in the two states described
above. Therefore it monitors SCL and communicates by bit with synchronization. Figure 17.18
shows the timing of the bit synchronous circuit and table 17.4 shows the time when SCL output
changes from low to Hi-Z then SCL is monitored.
SCL monitor
timing reference
clock
SCL VIH
Internal SCL
⎯ Write 0 to BBSY and SCP in ICCRB to issue the stop condition when SDA = low in
master transmission or master reception mode and this module is the only module which
pulls SCL low. BBSY is cleared to 0 when the stop condition (SCL = high and SDA rising)
is output.
5. Restriction on Setting Transfer Rate in Use of Multi-Master
In multi-master usage when I2C transfer rate setting of this LSI is lower than those of the other
masters, unexpected length of SCL may occasionally be output. To avoid this, the specified
value must be greater than or equal to the value produced by multiplying the fastest transfer
rate among the other masters by 1/1.8. For example, when the transfer rate of the fastest bus
master among the other bus masters is 400 kbps, the transfer rate of the I2C of this LSI must
be set to at least 223 kbps (= 400/1.8).
6. Restriction on Use of Bit Manipulation Instructions to Set MST and TRS in Use of Multi-
Master
When master transmission is selected by consecutively manipulating the MST and TRS bits in
multi-master usage, an arbitration loss during execution of the bit-manipulation instruction for
TRS leads to the contradictory situation where AL in ICSR is 1 in master transmit mode (MST
= 1, TRS = 1).
Ways to avoid this effect are listed below.
⎯ Use the MOV instruction to set MST and TRS in multi-master usage.
⎯ When arbitration is lost, confirm that MST = 0 and TRS = 0. If the setting of MST = 0 and
TRS = 0 is not confirmed, set MST = 0 and TRS = 0 again.
7. Note on Master Receive Mode
In master receive mode, when SCL is fixed low on the falling edge of the 8th clock while the
RDRF bit is set to 1 and ICDRR is read around the falling edge of the 8th clock, the clock is
only fixed low in the 8th clock of the next round of data reception. The SCL is then released
from its fixed state without reading ICDRR and the 9th clock is output. As a result, some
receive data is lost.
Ways to avoid this phenomenon are listed below.
⎯ Read ICDRR in master receive mode before the rising edge of the 8th clock.
⎯ Set RCVD to 1 in master receive mode and perform communication in units of one byte.
Figures 18.1 and 18.2 show block diagrams of the A/D converter units 0 and 1, respectively.
18.1 Features
• 10-bit resolution
• Input channels:
H8S/2427 Group and H8S/2427R Group: Eight channels (total of 16 channels for the two
units)
H8S/2425 Group: Eight channels for unit 0 and two channels for unit 1 (total of 10 channels
for the two units)
• Conversion cycle: 64 cycles or 40 cycles (A/D conversion clock)
• Two kinds of operating modes
⎯ Single mode: Single-channel A/D conversion
⎯ Scan mode: Continuous A/D conversion on 1 to 4 channels, or 1 to 8 channels*1
• Separate A/D conversion clock specifiable for each unit (φ, φ/2, or φ/4)
• Eight data registers for A/D converter unit 0 and eight data registers for unit 1*2 (total of 16
data registers for the two units)
Results of A/D conversion are held in a 16-bit data register for each channel.
• Sample and hold functionality
• Three types of conversion start
Conversion can be started by software, a conversion start trigger by the 16-bit timer pulse unit
(TPU) or 8-bit timer (TMR), or an external trigger signal.
• Interrupt source
A/D conversion end interrupt (ADI) request can be generated.
• Module stop state specifiable
Internal
Module data bus data bus
Bus interface
Successive approximation
AVCC
ADDRG_0
ADDRC_0
ADDRD_0
ADDRH_0
ADDRA_0
ADDRB_0
ADDRE_0
ADCSR_0
ADDRF_0
ADCR_0
register
Vref 10-bit A/D
AVSS
AN0
AN1 +
AN2 –
Multiplexer
AN3 Comparator
Control circuit
AN4
AN5 Sample-and-
hold circuit
AN6
AN7
ADI0 interrupt
signal
ADTRG0-A
ADTRG0-B Conversion start
trigger from
TPU (units 0, 1) or TMR
[Legend]
ADCR_0: A/D control register_0 ADDRD_0: A/D data register D_0
ADCSR_0: A/D control/status register_0 ADDRE_0: A/D data register E_0
ADDRA_0: A/D data register A_0 ADDRF_0: A/D data register F_0
ADDRB_0: A/D data register B_0 ADDRG_0: A/D data register G_0
ADDRC_0: A/D data register C_0 ADDRH_0: A/D data register H_0
Internal
Module data bus data bus
Bus interface
Successive approximation
AVCC
ADDRG_1
ADDRC_1
ADDRD_1
ADDRH_1
ADDRA_1
ADDRB_1
ADDRE_1
ADCSR_1
ADDRF_1
ADCR_1
register
Vref 10-bit A/D
AVSS
AN8*
+
AN9*
–
AN10*
Multiplexer
Comparator
AN11* Control circuit
AN12 Sample-and-
AN13 hold circuit
AN14*
AN15*
ADI1 interrupt
signal
ADTRG1-A
Conversion start
trigger from
TPU (units 0, 1)
[Legend]
ADCR_1: A/D control register_1 ADDRD_0: A/D data register D_1
ADCSR_1: A/D control/status register_1 ADDRE_0: A/D data register E_1
ADDRA_1: A/D data register A_1 ADDRF_0: A/D data register F_1
ADDRB_1: A/D data register B_1 ADDRG_0: A/D data register G_1
ADDRC_1: A/D data register C_1 ADDRH_0: A/D data register H_1
There are eight 16-bit read-only ADDR registers, ADDRA to ADDRH, used to store the results of
A/D conversion. The ADDR registers, which store a conversion result for each channel, are shown
in tables 18.3 and 18.4.
The converted 10-bit data is stored in bits 15 to 6. The lower 6-bit data is always read as 0.
The data bus between the CPU and the A/D converter has a 16-bit width. The data can be read
directly from the CPU. ADDR must not be accessed in 8-bit units and must be accessed in 16-bit
units.
Table 18.3 Analog Input Channels and Corresponding ADDR Registers (H8S/2427 Group
and H8S/2427R Group)
Table 18.4 Analog Input Channels and Corresponding ADDR Registers (H8S/2425 Group)
Initial
Bit Bit Name Value R/W Description
7 ADF 0 R/(W)* A/D End Flag
A status flag that indicates the end of A/D conversion.
[Setting conditions]
• Completion of A/D conversion in single mode
• Completion of A/D conversion on all specified
channels in scan mode
[Clearing conditions]
• Writing of 0 after reading ADF = 1
• Reading from ADDR after activation of the DMAC or
DTC by an ADI interrupt
6 ADIE 0 R/W A/D Interrupt Enable
Setting this bit to 1 enables ADI interrupts by ADF.
5 ADST 0 R/W A/D Start
Clearing this bit to 0 stops A/D conversion, and the A/D
converter enters wait state.
Setting this bit to 1 starts A/D conversion. In single mode,
this bit is cleared to 0 automatically when A/D conversion
on the specified channel ends. In scan mode, A/D
conversion continues sequentially on the specified
channels until this bit is cleared to 0 by software, a reset,
or hardware standby mode. While the ADSTCLR bit in
ADCR is set to 1, the ADST bit is cleared to 0
automatically when A/D conversion on all selected
channels ends, and then A/D conversion stops.
The timing to clear the ADST bit automatically differs
from that of ADF setting; the ADST bit is cleared before
the ADF bit is set.
4 EXCKS 0 R/W Clock Extension Select
Specifies the A/D conversion time in combination with the
CKS1 and CKS0 bits in ADCR. Be sure to set these three
bits at one time. For details, see the description of the
ADCR resisters.
Initial
Bit Bit Name Value R/W Description
3 CH3 0 R/W Channel Select 3 to 0
2 CH2 0 R/W Selects analog input together with bits SCANE and
1 CH1 0 R/W SCANS in ADCR.
0 CH0 0 R/W • When SCANE = 0 and SCANS = x
0000: AN0
0001: AN1
0010: AN2
0011: AN3
0100: AN4
0101: AN5
0110: AN6
0111: AN7
1xxx: Setting prohibited
• When SCANE = 1 and SCANS = 0
0000: AN0
0001: AN0 and AN1
0010: AN0 to AN2
0011: AN0 to AN3
0100: AN4
0101: AN4 and AN5
0110: AN4 to AN6
0111: AN4 to AN7
1xxx: Setting prohibited
• When SCANE = 1 and SCANS = 1
0000: AN0
0001: AN0 and AN1
0010: AN0 to AN2
0011: AN0 to AN3
0100: AN0 to AN4
0101: AN0 to AN5
0110: AN0 to AN6
0111: AN0 to AN7
1xxx: Setting prohibited
[Legend]
x: Don't care
Note: * Only 0 can be written to this bit, to clear the flag.
Initial
Bit Bit Name Value R/W Description
7 ADF 0 R/(W)* A/D End Flag
A status flag that indicates the end of A/D conversion.
[Setting conditions]
• Completion of A/D conversion in single mode
• Completion of A/D conversion on all specified
channels in scan mode
[Clearing conditions]
• Writing of 0 after reading ADF = 1
• Reading from ADDR after activation of the DTC by an
ADI interrupt
6 ADIE 0 R/W A/D Interrupt Enable
Setting this bit to 1 enables ADI interrupts by ADF.
5 ADST 0 R/W A/D Start
Clearing this bit to 0 stops A/D conversion, and the A/D
converter enters wait state.
Setting this bit to 1 starts A/D conversion. In single mode,
this bit is cleared to 0 automatically when A/D conversion
on the specified channel ends. In scan mode, A/D
conversion continues sequentially on the specified
channels until this bit is cleared to 0 by software, a reset,
or hardware standby mode. While the ADSTCLR bit in
ADCR is set to 1, the ADST bit is cleared to 0
automatically when A/D conversion on all selected
channels ends, and then A/D conversion stops.
The timing to clear the ADST bit automatically differs
from that of ADF setting; the ADST bit is cleared before
the ADF bit is set.
4 EXCKS 0 R/W Clock Extension Select
Specifies the A/D conversion time in combination with the
CKS1 and CKS0 bits in ADCR. Be sure to set these
three bits at one time. For details, see the description of
the ADCR resisters.
• H8S/2425 Group
Initial
Bit Bit Name Value R/W Description
3 CH3 0 R/W Channel Select 3 to 0
2 CH2 0 R/W Selects analog input together with bits SCANE and
1 CH1 0 R/W SCANS in ADCR.
0 CH0 0 R/W • When SCANE = 0 and SCANS = x
0xxx: Setting prohibited
10xx: Setting prohibited
1100: AN12
1101: AN13
111x: Setting prohibited
• When SCANE = 1 and SCANS = 0
0xxx: Setting prohibited
10xx: Setting prohibited
1100: AN12
1101: AN12 and AN13
111x: Setting prohibited
• Setting SCANE = 1 and SCANS = 1 are prohibited.
[Legend]
x: Don't care
Note: * Only 0 can be written to this bit, to clear the flag.
Initial
Bit Bit Name Value R/W Description
7 TRGS1 0 R/W Timer Trigger Select 1 and 0 and Extended Trigger Select
6 TRGS0 0 R/W These bits enable or disable the start of A/D conversion by a
0 EXTRGS 0 R/W trigger signal.
000: Disables A/D conversion start by external trigger
010: Enables A/D conversion start by external trigger from
TPU (units 0 and 1)*
100: Enables A/D conversion start by external trigger from
TMR
110: Enables A/D conversion start by the ADTRG0-A pin
001: Enables A/D conversion start by the ADTRG0-B pin
011: Enables simultaneous A/D conversion start in multiple
units by external trigger from TPU (units 0 and 1)
101: Enables simultaneous A/D conversion start in multiple
units by external trigger from TMR
111: Enables simultaneous A/D conversion start in multiple
units by the ADTRG0-B pin
5 SCANE 0 R/W Scan Mode
4 SCANS 0 R/W These bits select the A/D conversion operating mode.
0x: Single mode
10: Scan mode. A/D conversion is performed continuously for
channels 1 to 4.
11: Scan mode. A/D conversion is performed continuously for
channels 1 to 8.
Initial
Bit Bit Name Value R/W Description
3 CKS1 0 R/W Clock Select 1 and 0
2 CKS0 0 R/W These bits select the A/D conversion clock (ADCLK) and
specify the A/D conversion time in combination with the
EXCKS bit.
First select the A/D conversion time while ADST = 0 in
ADCSR and then set the mode of A/D conversion. Before
entering software standby mode or module stop state, set
these bits to B'11.
Set CKS1 and CKS0 bits appropriately so that the ADCLK
satisfies the conversion time.
EXCKS, CKS1, and CKS0
000: Setting prohibited
001: A/D conversion time = 268 states (max.) at ADCLK = φ/4
010: A/D conversion time = 138 states (max.) at ADCLK = φ/2
011: A/D conversion time = 73 states (max.) at ADCLK = φ
100: Setting prohibited
101: A/D conversion time = 172 states (max.) at ADCLK = φ/4
110: A/D conversion time = 90 states (max.) at ADCLK = φ/2
111: A/D conversion time = 49 states (max.) at ADCLK = φ
1 ADSTCLR 0 R/W A/D Start Clear
This bit enables or disables automatic clearing of the ADST
bit in scan mode.
0: The ADST bit is not automatically cleared to 0 in scan
mode.
1: The ADST bit is cleared to 0 upon completion of the A/D
conversion for all of the selected channels in scan mode.
[Legend]
x: Don't care
Note: * If this bit is set the same as the TRGS_1, TRGS0, and EXTRGS bits in ADCR_1, the
A/D converter units 0 and 1 start A/D conversion by conversion start trigger from TPU
(units 0 and 1).
Initial
Bit Bit Name Value R/W Description
7 TRGS1 0 R/W Timer Trigger Select 1 and 0 and Extended Trigger Select
6 TRGS0 0 R/W These bits enable or disable the start of A/D conversion by a
0 EXTRGS 0 R/W trigger signal.
000: Disables A/D conversion start by external trigger
010: Enables A/D conversion start by external trigger from
1
TPU (units 0 and 1)*
100: Enables A/D conversion start by external trigger from
TMR
110: Enables A/D conversion start by the ADTRG1 pin
001: Setting prohibited
011: Enables simultaneous A/D conversion start in multiple
units by external trigger from TPU (units 0 and 1)
101: Enables simultaneous A/D conversion start in multiple
units by external trigger from TMR
111: Enables simultaneous A/D conversion start in multiple
units by the ADTRG0-B pin
5 SCANE 0 R/W Scan Mode
4 SCANS 0 R/W These bits select the A/D conversion operating mode.
0x: Single mode
10: Scan mode. A/D conversion is performed continuously for
channels 1 to 4.
11: Scan mode. A/D conversion is performed continuously for
2
channels 1 to 8.*
Initial
Bit Bit Name Value R/W Description
3 CKS1 0 R/W Clock Select 1 and 0
2 CKS0 0 R/W These bits select the A/D conversion clock (ADCLK) and
specify the A/D conversion time in combination with the
EXCKS bit.
First select the A/D conversion time while ADST = 0 in
ADCSR and then set the mode of A/D conversion. Before
entering software standby mode or module stop state, set
these bits to B'11.
Set CKS1 and CKS0 bits appropriately so that the ADCLK
satisfies the conversion time.
EXCKS, CKS1, and CKS0
000: Setting prohibited
001: A/D conversion time = 268 states (max.) at ADCLK = φ/4
010: A/D conversion time = 138 states (max.) at ADCLK = φ/2
011: A/D conversion time = 73 states (max.) at ADCLK = φ
100: Setting prohibited
101: A/D conversion time = 172 states (max.) at ADCLK = φ/4
110: A/D conversion time = 90 states (max.) at ADCLK = φ/2
111: A/D conversion time = 49 states (max.) at ADCLK = φ
1 ADSTCLR 0 R/W A/D Start Clear
This bit enables or disables automatic clearing of the ADST
bit in scan mode.
0: The ADST bit is not automatically cleared to 0 in scan
mode.
1: The ADST bit is cleared to 0 upon completion of the A/D
conversion for all of the selected channels in scan mode.
[Legend]
x: Don't care
Notes: 1. If this bit is set the same as the TRGS_1, TRGS0, and EXTRGS bits in ADCR_0, the
A/D converter units 0 and 1 start A/D conversion by conversion start trigger from TPU
(units 0 and 1).
2. Setting prohibited in the H8S/2425 Group.
18.4 Operation
The A/D converter has two operating modes: single mode and scan mode. First select the clock for
A/D conversion (ADCLK). When changing the operating mode or analog input channel, to
prevent incorrect operation, first clear the ADST bit in ADCSR to 0. The ADST bit can be set to 1
at the same time as the operating mode or analog input channel is changed.
In single mode, A/D conversion is to be performed only once on the analog input of the specified
single channel.
1. A/D conversion for the selected channel is started when the ADST bit in ADCSR is set to 1 by
software, TPU, TMR, or an external trigger input.
2. When A/D conversion is completed, the A/D conversion result is transferred to the
corresponding A/D data register of the channel.
3. When A/D conversion is completed, the ADF bit in ADCSR is set to 1. If the ADIE bit is set
to 1 at this time, an ADI interrupt request is generated.
4. The ADST bit remains at 1 during A/D conversion, and is automatically cleared to 0 when
A/D conversion ends. The A/D converter enters wait state. If the ADST bit is cleared to 0
during A/D conversion, A/D conversion stops and the A/D converter enters a wait state.
Set*
ADIE
Set* Set*
A/D conversion start
ADST
Clear* Clear*
ADF
ADDRA
Reading A/D conversion result Reading A/D conversion result
ADDRC
ADDRD
Figure 18.3 Example of A/D Converter Operation (Single Mode, Channel 1 Selected)
In scan mode, A/D conversion is to be performed sequentially on the analog inputs of the specified
channels up to four or eight* channels. Two types of scan mode are provided, that is, continuous
scan mode where A/D conversion is repeatedly performed and one-cycle scan mode where A/D
conversion is performed for the specified channels for one cycle.
1. When the ADST bit in ADCSR is set to 1 by software, TPU, TMR, or an external trigger
input, A/D conversion starts on the first channel in the specified channel group. Consecutive
A/D conversion on a maximum of four channels (SCANE and SCANS = B'10) or on a
maximum of eight channels (SCANE and SCANS = B'11) can be selected. When consecutive
A/D conversion is performed on four channels, A/D conversion starts on AN0 when CH3 and
CH2 of unit 0 = B'00, on AN4 when CH3 and CH2 of unit 1 = B'01, on AN8* when CH3 and
CH2 of unit 1 = B'10, or on AN12 when CH3 and CH2 of unit 1= B'11. When consecutive
A/D conversion is performed on eight channels, A/D conversion starts on AN0 when CH3 =
B'0 or on AN8* when CH3 = B'1.
2. When A/D conversion for each channel is completed, the A/D conversion result is sequentially
transferred to the corresponding ADDR of each channel.
3. When A/D conversion of all selected channels is completed, the ADF bit in ADCSR is set to 1.
If the ADIE bit is set to 1 at this time, an ADI interrupt request is generated. A/D conversion of
the first channel in the group starts again.
4. The ADST bit is not cleared automatically, and steps 2 to 3 are repeated as long as the ADST
bit remains set to 1. When the ADST bit is cleared to 0, A/D conversion stops and the A/D
converter enters wait state. If the ADST bit is later set to 1, A/D conversion starts again from
the first channel in the group.
ADST
Clear*1
ADF
A/D conversion time
A/D
Channel 0 (AN0) Waiting for conver-
operation state conversion Waiting for conversion A/D Waiting for conversion
sion 1 conver-
sion 4
A/D A/D Waiting for
Channel 1 (AN1)
Waiting for conversion conver- Waiting for conversion conver- *2 conversion
operation state sion 2 sion 5
A/D
Channel 2 (AN2) Waiting for conversion conver- Waiting for conversion
operation state sion 3
ADDRD
Set *
ADST
Clear*
ADF
A/D conversion time
Channel 4 (AN4) Waiting for conversion A/D conversion 1 Waiting for conversion
operation state
Channel5 (AN5) Waiting for conversion A/D conversion 2 Waiting for conversion
operation state
Channel 6 (AN6)
Waiting for conversion A/D conversion 3 Waiting for conversion
operation state
Channel 7 (AN7)
Waiting for conversion
operation state
Transfer
ADDRE A/D conversion result 1
ADDRH
The A/D converter has a built-in sample-and-hold circuit. The A/D converter samples the analog
input when the A/D conversion start delay time (tD) passes after the ADST bit in ADCSR is set to
1, then starts A/D conversion. Figure 18.6 shows the A/D conversion timing. Tables 18.5 and 18.6
show the A/D conversion time.
As shown in figure 18.6, the A/D conversion time (tCONV) includes the A/D conversion start delay
time (tD) and the input sampling time (tSPL). The length of tD varies depending on the timing of the
write access to ADCSR. The total conversion time therefore varies within the ranges indicated in
tables 18.5 and 18.6.
In scan mode, the values given in tables 18.5 and 18.6 apply to the first conversion time. The
values given in table 18.7 apply to the second and subsequent conversions. In either case, bit
EKCKS in ADCSR, and bits CKS1 and CKS0 in ADCR should be set so that the conversion time
is within the ranges indicated by the A/D conversion characteristics.
(1)
Address (2)
Write signal
Input sampling
timing
ADF
tD tSPL
tCONV
[Legend]
(1): ADCSR write cycle
(2): ADCSR address
tD: A/D conversion start delay time
tSPL: Input sampling time
tCONV: A/D conversion time
CKS1 = 0 CKS1 = 1
Item Symbol Min. Typ. Max. Min. Typ. Max. Min. Typ. Max. Min. Typ. Max.
A/D conversion time tCONV 515 ⎯ 530 259 ⎯ 266 131 ⎯ 134 67 ⎯ 68
CKS1 = 0 CKS1 = 1
Item Symbol Min. Typ. Max. Min. Typ. Max. Min. Typ. Max. Min. Typ. Max.
A/D conversion can be externally triggered. For unit 0, an external trigger is input from the
ADTRG0 pin when the TRGS1, TRGS0, and EXTRGS bits are set to B'110 or B'001 in ADCR_0.
For unit 1, an external trigger is input from the ADTRG1 pin when the TRGS1, TRGS0, and
EXTRGS bits are set to B'110 in ADCR_1. For multiple-unit simultaneous start, an external
trigger is input from the ADTRG0 pin when the TRGS1, TRGS0, and EXTRGS bits are set to
B'111 in ADCR. A/D conversion starts when the ADST bit in ADCSR is set to 1 on the falling
edge of the ADTRG0 pin. Other operations, in both single and scan modes, are the same as when
the ADST bit has been set to 1 by software. Figure 18.7 shows the timing. Figure 18.8 shows the
timing of multiple-unit simultaneous start.
ADTRG0
Internal trigger
signal
ADST
A/D conversion
Figure 18.7 External Trigger Input Timing (TRGS1, TRGS0, and EXTRGS ≠ B'111)
ADTRG0
Internal trigger
signal
ADST
A/D conversion
Figure 18.8 External Trigger Input Timing when Multiple Units Start Simultaneously
(TRSG1, TRGS0, and EXTRGS = B'111)
• Resolution
The number of A/D converter digital output codes.
• Quantization error
The deviation inherent in the A/D converter, given by 1/2 LSB (see figure 18.9).
• Offset error
The deviation of the analog input voltage value from the ideal A/D conversion characteristic
when the digital output changes from the minimum voltage value B'0000000000 (H'000) to
B'0000000001 (H'001) (see figure 18.10).
• Full-scale error
The deviation of the analog input voltage value from the ideal A/D conversion characteristic
when the digital output changes from B'1111111110 (H'3FE) to B'1111111111 (H'3FF) (see
figure 18.10).
• Nonlinearity error
The error with respect to the ideal A/D conversion characteristic between the zero voltage and
the full-scale voltage. Does not include the offset error, full-scale error, or quantization error
(see figure 18.10).
• Absolute accuracy
The deviation between the digital value and the analog input value. Includes the offset error,
full-scale error, quantization error, and nonlinearity error.
Digital output
110
101
100
011
001
000
1 2 1022 1023 FS
1024 1024 1024 1024
Analog
input voltage
Nonlinearity
error
Operation of the A/D converter can be disabled or enabled using the module stop control register.
The initial setting is for operation of the A/D converter to be halted. Register access is enabled by
clearing the module stop state. Set the CKS1 and CKS2 bits to 1 to set ADCLK to φ, and clear the
ADST, TRGS1, TRGS0, and EXTRGS bits all to 0 to disable A/D conversion when entering
module stop state after operation of the A/D converter. After that, set the module stop control
register after executing a dummy read by one word. For details, see section 25, Power-Down
Modes.
When this LSI enters software standby mode with A/D conversion enabled, the analog inputs are
retained, and the analog power supply current is equal to as during A/D conversion. If the analog
power supply current needs to be reduced in software standby mode, set the CKS1 and CKS2 bits
to 1 to set ADCLK to φ, and clear the ADST, TRGS1, TRGS0, and EXTRGS bits all to 0 to
disable A/D conversion. After that, enter software standby mode after executing a dummy read by
one word.
When the ADST bit has been cleared to 0, A/D converter stops in synchronization with the
ADCLK and then enters the standby sate. After the ADST bit has been cleared, the converter may
not actually make the transition to the standby state for up to 10 cycles (φ), so do not change the
channels of the ADCLK, motion mode, or analog input at this time.
When restarting the A/D converter right after the ADST bit has been cleared to 0, read the 16
bytes from ADDRA to ADDRH and then start the A/D converter by setting the ADST bit to 1. If
the converter is in single mode or one-cycle scan mode, however, the ADST bit can be set to 1 by
clearing the ADF bit to 0 after confirming that the ADF bit had been set to 1 on completion of the
previous round of conversion.
This LSI's analog input is designed so that the conversion accuracy is guaranteed for an input
signal for which the signal source impedance is 5 kΩ or less. This specification is provided to
enable the A/D converter's sample-and-hold circuit input capacitance to be charged within the
sampling time; if the sensor output impedance exceeds 5 kΩ, charging may be insufficient and it
may not be possible to guarantee the A/D conversion accuracy. However, if a large capacitance is
provided externally for conversion in single mode, the input load will essentially comprise only
the internal input resistance of 5 kΩ, and the signal source impedance is ignored. However, since a
low-pass filter effect is obtained in this case, it may not be possible to follow an analog signal with
a large differential coefficient (e.g., 5 mV/μs or greater) (see figure 18.11). When converting a
high-speed analog signal or conversion in scan mode, a low-impedance buffer should be inserted.
This LSI
Equivalent circuit of the A/D converter
Sensor output
impedance
R to 5 kΩ 10 kΩ
Sensor input
Cin = 7 pF
Low-pass
15 pF
filter
C to 0.1 μF
Adding capacitance results in coupling with GND, and therefore noise in GND may adversely
affect absolute accuracy. Be sure to make the connection to an electrically stable GND such as
AVss.
Care is also required to insure that filter circuits do not communicate with digital signals on the
mounting board, acting as antennas.
If the conditions shown below are not met, the reliability of the LSI may be adversely affected.
In board design, digital circuitry and analog circuitry should be as mutually isolated as possible,
and layout in which digital circuit signal lines and analog circuit signal lines cross or are in close
proximity should be avoided as far as possible. Failure to do so may result in incorrect operation
of the analog circuitry due to inductance, adversely affecting A/D conversion values.
Digital circuitry must be isolated from the analog input pins (AN0 to AN15*), analog reference
power supply (Vref), and analog power supply (AVcc) by the analog ground (AVss). Also, the
analog ground (AVss) should be connected at one point to a stable ground (Vss) on the board.
Note: * In the H8S/2425 Group, only AN0 to AN7, AN11, and AN12 are available as analog
input pins.
A protection circuit connected to prevent damage due to an abnormal voltage such as an excessive
surge at the analog input pins (AN0 to AN15*) should be connected between AVcc and AVss as
shown in figure 18.12. Also, the bypass capacitors connected to AVcc and the filter capacitor
connected to the AN0 to AN11 pins must be connected to AVss.
If a filter capacitor is connected, the input currents at the AN0 to AN15* pins are averaged, and so
an error may arise. Also, when A/D conversion is performed frequently, as in scan mode, if the
current charged and discharged by the capacitance of the sample-and-hold circuit in the A/D
converter exceeds the current input via the input impedance (Rin), an error will arise in the analog
input pin voltage. Careful consideration is therefore required when deciding the circuit constants.
Note: * In the H8S/2425 Group, only AN0 to AN7, AN11, and AN12 are available as analog
input pins.
AVCC
Vref
Rin* 2 100 Ω
*1 *1 AN0 to AN15* 3
0.1 µF
AVSS
10 µF 0.01 µF
When operating two A/D converters concurrently, if conversion by the two converters starts at
different times, the accuracy of conversion may be affected by crosstalk between the two
converters.
When converter Y starts A/D conversion during the period indicated by TX-Y in figure 18.13 below
after the start of A/D conversion by converter X, and conversion by converter X is completed
while conversion by converter Y is still in progress, the accuracy of A/D conversion may not be
guaranteed.
When operating two A/D converters concurrently, be sure to conduct adequate evaluation in
advance.
Note: X and Y in "converter X" and "converter Y" indicate either pair of 0 and 1.
Converter X
ADST
Converter Y
ADST
ANn
Wait for conversion tSPL A/D conversion Wait for conversion
in operation
TX-Y
[Legend]
ANn: Operating channel of converter Y
TX-Y: Difference in time when A/D conversion starts
tSPL: Input sampling time
Figure 18.13 Example of Timing Where Accuracy of A/D Conversion is not Guaranteed
Table 18.10 Difference in Time When A/D Conversion Starts (TX-Y) in Figure 18.13
TX-Y Unit
0 to 10 ADCLK cycles
18.7.10 Notes on Start of A/D Conversion by Conversion Start Trigger from TPU (Units 0
and 1)
When A/D conversion starts by a conversion start trigger from the TPU, the register settings of the
TPU and A/D converters must be checked so that A/D conversion does not start at unintended
timing.
When the TTGE bit in multiple channels of the TPU (units 0 and 1) is set to 1 and the TRGS1,
TRGS0, and EXTRGS bits in ADCR_0 and ADCR_1 are set to b’010 at the start of A/D
conversion by a conversion start trigger from the TPU, the A/D converter units 0 and 1 start A/D
conversion by the trigger accepted first regardless of the number of the TPU unit which has issued
the trigger. The trigger requested during A/D conversion is ignored. Figure 18.14 shows an
example of the operation timing when A/D conversion starts by the trigger from the TPU (units 0
and 1).
Figure 18.14 Example of Operation Timing when A/D Conversion Starts by Conversion
Start Trigger from TPU (Units 0 and 1)
19.1 Features
• 8-bit resolution
• Output channels: Two channels
• Maximum conversion time of 10 µs (with 20 pF load)
• Output voltage of 0 V to Vref
• D/A output hold function in software standby mode
• Module stop state can be set.
Bus interface
Vref
AVcc
DACR23
8-bit
DADR2
DADR3
DA3
D/A
DA2
AVss
Control circuit
[Legend]
DADR2: D/A data register 2
DADR3: D/A data register 3
DACR23: D/A control register 23
DADR are 8-bit readable/writable registers that store data for D/A conversion.
Whenever analog output is enabled, the values in DADR are converted and output to the analog
output pins.
Initial
Bit Bit Name Value R/W Description
7 DAOE3 0 R/W D/A Output Enable 3
Controls D/A conversion and analog output.
0: Channel 3 analog output (DA3) is disabled.
1: Channel 3 D/A conversion is enabled; channel 3
analog output (DA3) is enabled.
6 DAOE2 0 R/W D/A Output Enable 2
Controls D/A conversion and analog output.
0: Channel 2 analog output (DA2) is disabled.
1: Channel 2 D/A conversion is enabled; channel 2
analog output (DA2) is enabled.
5 DAE 0 R/W D/A Enable
This bit is used together with the DAOE2 and DAOE3
bits to control D/A conversion. When the DAE bit is
cleared to 0, channel 2 and 3 D/A conversions are
controlled independently. When the DAE bit is set to 1,
channel 2 and 3 D/A conversions are controlled
together.
Output of conversion results is always controlled
independently by the DAOE2 and DAOE3 bits. For
details, see table 19.2.
4 to 0 ⎯ All 1 ⎯ Reserved
These bits are always read as 1 and cannot be
modified.
19.4 Operation
The D/A converter includes D/A conversion circuits for two channels, each of which can operate
independently. When DAOE bit in DACR23 is set to 1, D/A conversion is enabled and the
conversion result is output. The following shows an example of D/A conversion on channel 2.
Figure 19.2 shows the timing of this operation.
3. If DADR2 is written to again, the conversion is immediately started. The conversion result is
output after the conversion time tDCONV has elapsed.
4. If the DAOE2 bit is cleared to 0, analog output is disabled.
Address
DAOE2
Conversion
DA2 Conversion result (2)
result (1)
High-impedance state
tDCONV tDCONV
[Legend]
tDCONV: D/A conversion time
D/A converter operation can be disabled or enabled using the module stop control register. The
initial setting is for the D/A converter to be halted. Register access is enabled by clearing the
module stop state. For details, see section 25, Power-Down Modes.
If D/A conversion is enabled and this LSI enters software standby mode, D/A output is held and
analog power supply current remains at the same level during D/A conversion. When the analog
power supply current is required to go low in software standby mode, the DAOE3, DAOE2, and
DAE bits should be cleared to 0 to disable D/A output.
20.1 Features
• Choice of SSU mode and clock synchronous mode
• Choice of master mode and slave mode
• Choice of standard mode and bidirectional mode
• Synchronous serial communication with devices with different clock polarity and clock phase
• Choice of 8/16/24/32-bit width of transmit/receive data
• Full-duplex communication capability
The shift register is incorporated, enabling transmission and reception to be executed
simultaneously.
• Consecutive serial communication
• Choice of LSB-first or MSB-first transfer
• Choice of a clock source
Seven internal clocks (φ/4, φ/8, φ/16, φ/32, φ/64, φ/128, φ/256) or an external clock
• Five interrupt sources
Transmit-end, transmit-data-register-empty, receive-data-full, overrun-error, and conflict error
• Module stop state can be set
Bus interface
Module data bus Internal data bus
SSCRH
SSCRL
Control circuit
Shift-in
selector φ/64
φ/128
φ/256
Selector
[Legend]
SSCRH: SS control register H
SSCRL: SS control register L
SSCR2: SS control register 2
SSMR: SS mode register
SSER: SS enable register
SSSR: SS status register
SSTDR0 to SSTDR3: SS transmit data registers 0 to 3
SSRDR0 to SSRDR3: SS receive data registers 0 to 3
SSTRSR: SS shift register
SSCRH specifies master/slave device selection, bidirectional mode enable, SSO pin output value
selection, SSCK pin selection, and SCS pin selection.
Initial
Bit Bit Name Value R/W Description
7 MSS 0 R/W Master/Slave Device Select
Selects that this module is used in master mode or
slave mode. When master mode is selected, transfer
clocks are output from the SSCK pin. When the CE bit
in SSSR is set, this bit is automatically cleared.
0: Slave mode is selected.
1: Master mode is selected.
6 BIDE 0 R/W Bidirectional Mode Enable
Selects that both serial data input pin and output pin
are used or one of them is used. However,
transmission and reception are not performed
simultaneously when bidirectional mode is selected.
For details, refer to section 20.4.3, Relationship
between Data Input/Output Pins and Shift Register.
0: Standard mode (two pins are used for data input and
output)
1: Bidirectional mode (one pin is used for data input
and output)
5 ⎯ 0 R/W Reserved
This bit is always read as 0. The write value should
always be 0.
Initial
Bit Bit Name Value R/W Description
4 SOL 0 R/W Serial Data Output Value Select
The serial data output retains its level of the last bit
after completion of transmission. The output level
before or after transmission can be specified by setting
this bit. When specifying the output level, use the MOV
instruction after clearing the SOLP bit to 0. Since
writing to this bit during data transmission causes
malfunctions, this bit should not be changed.
0: Serial data output is changed to low.
1: Serial data output is changed to high.
3 SOLP 1 R/W SOL Bit Write Protect
When changing the output level of serial data, set the
SOL bit to 1 or clear the SOL bit to 0 after clearing the
SOLP bit to 0 using the MOV instruction.
0: Output level can be changed by the SOL bit
1: Output level cannot be changed by the SOL bit. This
bit is always read as 1.
2 SCKS 0 R/W SSCK Pin Select
Selects that the SSCK pin functions as a port or a serial
clock pin. When the SSCK pin is used as a serial clock
pin, this bit must be set to 1.
0: Functions as an I/O port.
1: Functions as a serial clock.
1 CSS1 0 R/W SCS Pin Select
0 CSS0 0 R/W Select that the SCS pin functions as a port or SCS
input or output. However, when MSS = 0, the SCS pin
functions as an input pin regardless of the CSS1 and
CSS0 settings.
00: I/O port
01: Functions as SCS input
10: Functions as SCS automatic input/output (function
as SCS input before and after transfer and output a
low level during transfer)
11: Functions as SCS automatic output (outputs a high
level before and after transfer and outputs a low
level during transfer)
SSCRL selects operating mode, software reset, and transmit/receive data length.
Initial
Bit Bit Name Value R/W Description
7 ⎯ 0 R/W Reserved
This bit is always read as 0. The write value should
always be 0.
6 SSUMS 0 R/W Selects transfer mode from SSU mode and clock
synchronous mode.
0: SSU mode
1: Clock synchronous mode
5 SRES 0 R/W Software Reset
Setting this bit to 1 forcibly resets the SSU internal
sequencer. After that, this bit is automatically cleared.
The ORER, TEND, TDRE, RDRF, and CE bits in SSSR
and the TE and RE bits in SSER are also initialized.
Values of other bits for SSU registers are held.
To stop transfer, set this bit to 1 to reset the SSU
internal sequencer.
4 to 2 ⎯ All 0 R/W Reserved
These bits are always read as 0. The write value should
always be 0.
1 DATS1 0 R/W Transmit/Receive Data Length Select
0 DATS0 0 R/W Select serial data length.
00: 8 bits
01: 16 bits
10: 32 bits
11: 24 bits
SSMR selects the MSB first/LSB first, clock polarity, clock phase, and clock rate of synchronous
serial communication.
Initial
Bit Bit Name Value R/W Description
7 MLS 0 R/W MSB First/LSB First Select
Selects that the serial data is transmitted in MSB first or
LSB first.
0: LSB first
1: MSB first
6 CPOS 0 R/W Clock Polarity Select
Selects the SSCK clock polarity.
0: High output in idle mode, and low output in active
mode
1: Low output in idle mode, and high output in active
mode
5 CPHS 0 R/W Clock Phase Select (Only for SSU Mode)
Selects the SSCK clock phase.
0: Data changes at the first edge.
1: Data is latched at the first edge.
4, 3 ⎯ All 0 R/W Reserved
These bits are always read as 0. The write value should
always be 0.
2 CKS2 0 R/W Transfer Clock Rate Select
1 CKS1 0 R/W Select the transfer clock rate when an internal clock is
0 CKS0 0 R/W selected.
000: Reserved 100: φ/32
001: φ/4 101: φ/64
010: φ/8 110: φ/128
011: φ/16 111: φ/256
Initial
Bit Bit Name Value R/W Description
7 TE 0 R/W Transmit Enable
When this bit is set to 1, transmission is enabled.
6 RE 0 R/W Receive Enable
When this bit is set to 1, reception is enabled.
5, 4 ⎯ All 0 R/W Reserved
These bits are always read as 0. The write value should
always be 0.
3 TEIE 0 R/W Transmit End Interrupt Enable
When this bit is set to 1, a TEI interrupt request is
enabled.
2 TIE 0 R/W Transmit Interrupt Enable
When this bit is set to 1, a TXI interrupt request is
enabled.
1 RIE 0 R/W Receive Interrupt Enable
When this bit is set to 1, an RXI interrupt request and
an OEI interrupt request are enabled.
0 CEIE 0 R/W Conflict Error Interrupt Enable
When this bit is set to 1, a CEI interrupt request is
enabled.
Initial
Bit Bit Name Value R/W Description
7 ⎯ 0 ⎯ Reserved
This bit is always read as 0. The write value should
always be 0.
6 ORER 0 R/W Overrun Error
If the next data is received while RDRF = 1, an overrun
error occurs, indicating abnormal termination. SSRDR
stores 1-frame receive data before an overrun error
occurs and loses data to be received later. While ORER
= 1, consecutive serial reception cannot be continued.
Serial transmission cannot be continued, either.
[Setting condition]
When one byte of the next reception is completed with
RDRF = 1
[Clearing condition]
When writing 0 after reading ORER = 1
5, 4 ⎯ All 0 R/W Reserved
These bits are always read as 0. The write value should
always be 0.
3 TEND 1 R Transmit End
[Setting condition]
• When the last bit of transmit data is transmitted
while the TENDSTS bit in SSCR2 is cleared to 0
and the TDRE bit is set to 1
• After the last bit of transmit data is transmitted while
the TENDSTS bit in SSCR2 is set to 1 and the
TDRE bit is set to 1
[Clearing conditions]
• When writing 0 after reading TEND = 1
• When writing data to SSTDR
Initial
Bit Bit Name Value R/W Description
2 TDRE 1 R/W Transmit Data Empty
Indicates whether or not SSTDR contains transmit data.
[Setting conditions]
• When the TE bit in SSER is 0
• When data is transferred from SSTDR to SSTRSR
and SSTDR is ready to be written to.
[Clearing conditions]
• When writing 0 after reading TDRE = 1
• When writing data to SSTDR with TE = 1
1 RDRF 0 R/W Receive Data Full
Indicates whether or not SSRDR contains receive data.
[Setting condition]
• When receive data is transferred from SSTRSR to
SSRDR after successful serial data reception
[Clearing conditions]
• When writing 0 after reading RDRF = 1
• When reading receive data from SSRDR
0 CE 0 R/W Conflict/Incomplete Error
Indicates that a conflict error has occurred
when 0 is externally input to the SCS pin with SSUMS
= 0 (SSU mode) and MSS = 1 (master device).
If the SCS pin level changes to 1 with SSUMS = 0 (SSU
mode) and MSS = 0 (slave device), an incomplete error
occurs because it is determined that a master device
has terminated the transfer. Data reception does not
continue while the CE bit is set to 1. Serial transmission
also does not continue. Reset the SSU internal
sequencer by setting the SRES bit in SSCRL to 1
before resuming transfer after incomplete error.
[Setting condition]
• When a low level is input to the SCS pin in master
device (the MSS bit in SSCRH is set to 1)
• When the SCS pin is changed to 1 during transfer in
slave device (the MSS bit in SSCRH is cleared to 0)
[Clearing condition]
• When writing 0 after reading CE = 1
SSCR2 is a register that enables/disables the open-drain outputs of the SSO, SSI, SSCK, and SCS
pins, selects the assert timing of the SCS pin, data output timing of the SSO pin, and set timing of
the TEND bit.
Initial
Bit Bit Name Value R/W Description
7 SDOS 0 R/W Serial Data Pin Open Drain Select
Selects whether the serial data output pin is used as a
CMOS or an NMOS open drain output. Pins to output
serial data differ according to the register setting. For
details, refer to section 20.4.3, Relationship between
Data Input/Output Pins and Shift Register.
0: CMOS output
1: NMOS open drain output
6 SSCKOS 0 R/W SSCK Pin Open Drain Select
Selects whether the SSCK pin is used as a CMOS or
an NMOS open drain output.
0: CMOS output
1: NMOS open drain output
5 SCSOS 0 R/W SCS Pin Open Drain Select
Selects whether the SCS pin is used as a CMOS or an
NMOS open drain output.
0: CMOS output
1: NMOS open drain output
4 TENDSTS 0 R/W Selects the timing of setting the TEND bit (valid in SSU
and master mode).
0: Sets the TEND bit when the last bit is being
transmitted
1: Sets the TEND bit after the last bit is transmitted
Initial
Bit Bit Name Value R/W Description
3 SCSATS 0 R/W Selects the assertion timing of the SCS pin (valid in
SSU and master mode).
0: Min. values of tLEAD and tLAG are 1/2 × tSUcyc
1: Min. values of tLEAD and tLAG are 3/2 × tSUcyc
2 SSODTS 0 R/W Selects the data output timing of the SSO pin (valid in
SSU and master mode)
0: While BIDE = 0, MSS = 1, and TE = 1 or while BIDE
= 1, TE = 1, and RE = 0, the SSO pin outputs data
1: While BIDE = 0, MSS = 1, and TE = 1 or while BIDE
= 1, TE = 1, and RE = 0, the SSO pin outputs data
while the SCS pin is driven low
1, 0 ⎯ All 0 R/W Reserved
These bits are always read as 0. The write value should
always be 0.
SSTDR is an 8-bit register that stores transmit data. When 8-bit data length is selected by bits
DATS1 and DATS0 in SSCRL, SSTDR0 is valid. When 16-bit data length is selected, SSTDR0
and SSTDR1 are valid. When 24-bit data length is selected, SSTDR0, SSTDR1, and SSTDR2 are
valid. When 32-bit data length is selected, SSTDR0 to SSTDR3 are valid. Be sure not to access to
invalid SSTDRs.
When the SSU detects that SSTRSR is empty, it transfers the transmit data written in SSTDR to
SSTRSR and starts serial transmission. If the next transmit data has already been written to
SSTDR during serial transmission, the SSU performs consecutive serial transmission.
Although SSTDR can always be read from or written to, to achieve reliable serial transmission,
write transmit data to SSTDR after confirming that the TDRE bit in SSSR is set to 1.
DATS[1:0] (SSCRL[1:0])
SSTDR 00 01 10 11 (Setting Invalid)
0 Valid Valid Valid Valid
1 Invalid Valid Valid Valid
2 Invalid Invalid Valid Valid
3 Invalid Invalid Valid Invalid
SSRDR is an 8-bit register that stores receive data. When 8-bit data length is selected by bits
DATS1 and DATS0 in SSCRL, SSRDR0 is valid. When 16-bit data length is selected, SSRDR0
and SSRDR1 are valid. When 24-bit data length is selected, SSRDR0, SSRDR1, and SSRDR2 are
valid. When 32-bit data length is selected, SSRDR0 to SSRDR3 are valid. Be sure not to access to
invalid SSRDR.
When the SSU has received 1-byte data, it transfers the received serial data from SSTRSR to
SSRDR where it is stored. After this, SSTRSR is ready for reception. Since SSTRSR and SSRDR
function as a double buffer in this way, consecutive receive operations can be performed.
Read SSRDR after confirming that the RDRF bit in SSSR is set to 1.
DATS[1:0] (SSCRL[1:0])
SSRDR 00 01 10 11 (Setting Invalid)
0 Valid Valid Valid Valid
1 Invalid Valid Valid Valid
2 Invalid Invalid Valid Valid
3 Invalid Invalid Valid Invalid
When data is transferred from SSTDR to SSTRSR, bit 0 of transmit data is bit 0 in the SSTDR
contents (MLS = 0: LSB first communication) and is bit 7 in the SSTDR contents (MLS = 1: MSB
first communication). The SSU transfers data from the LSB (bit 0) in SSTRSR to the SSO pin to
perform serial data transmission.
In reception, the SSU sets serial data that has been input via the SSI pin in SSTRSR from the LSB
(bit 0). When 1-byte data has been received, the SSTRSR contents are automatically transferred to
SSRDR. SSTRSR cannot be directly accessed by the CPU.
20.4 Operation
A transfer clock can be selected from eight internal clocks and an external clock. When using this
module, set the SCKS bit in SSCRH to 1 to select the SSCK pin as a serial clock. When the MSS
bit in SSCRH is 1, an internal clock is selected and the SSCK pin is used as an output pin. When
transfer is started, the clock with the transfer rate set by bits CKS2 to CKS0 in SSMR is output
from the SSCK pin. When MSS = 0, an external clock is selected and the SSCK pin is used as an
input pin.
The relationship of clock phase, polarity, and transfer data depends on the combination of the
CPOS and CPHS bits in SSMR. Figure 20.2 shows the relationship. When SSUMS = 1, the CPHS
setting is invalid although the CPOS setting is valid.
Setting the MLS bit in SSMR selects that MSB or LSB first communication. When MLS = 0, data
is transferred from the LSB to the MSB. When MLS = 1, data is transferred from the MSB to the
LSB.
SSCK
(CPOS = 0)
SSCK
(CPOS = 1)
SSI, SSO Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7
SSCK
(CPOS = 0)
SSCK
(CPOS = 1)
SSI, SSO Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7
The connection between data input/output pins and the SS shift register (SSTRSR) depends on the
combination of the MSS and BIDE bits in SSCRH and the SSUMS bit in SSCRL. Figure 20.3
shows the relationship.
The SSU transmits serial data from the SSO pin and receives serial data from the SSI pin when
operating with BIDE = 0 and MSS = 1 (standard, master mode) (see figure 20.3 (1)). The SSU
transmits serial data from the SSI pin and receives serial data from the SSO pin when operating
with BIDE = 0 and MSS = 0 (standard, slave mode) (see figure 20.3 (2)).
The SSU transmits and receives serial data from the SSO pin regardless of master or slave mode
when operating with BIDE = 1 (bidirectional mode) (see figures 20.3 (3) and (4)).
However, even if both the TE and RE bits are set to 1, transmission and reception are not
performed simultaneously. Either the TE or RE bit must be selected.
The SSU transmits serial data from the SSO pin and receives serial data from the SSI pin when
operating with SSUMS = 1. The SSCK pin outputs the internal clock when MSS = 1 and function
as an input pin when MSS = 0 (see figures 20.3 (5) and (6)).
(1) When SSUMS = 0, BIDE = 0 (standard mode), (2) When SSUMS = 0, BIDE = 0 (standard mode),
MSS = 1, TE = 1, and RE = 1 MSS = 0, TE = 1, and RE = 1
SSCK SSCK
(4) When SSUMS = 0, BIDE = 1 (bidirectional mode), (3) When SSUMS = 0, BIDE = 1 (bidirectional mode),
MSS = 1, and either TE or RE = 1 MSS = 0, and either TE or RE = 1
SSCK SSCK
(5) When SSUMS = 1 and MSS = 1 (6) When SSUMS = 1 and MSS = 0
SSCK SSCK
Figure 20.3 Relationship between Data Input/Output Pins and Shift Register
The SSU switches the input/output pin (SSI, SSO, SSCK, and SCS) functions according to the
communication modes and register settings. When a pin is used as an input pin, clear the
corresponding bit in each data direction register (DDR) to 0. The relationship of communication
modes and input/output pin functions are shown in tables 20.4 to 20.6.
Table 20.4 Communication Modes and Pin States of SSI and SSO Pins
In SSU mode, data communications are performed via four lines: clock line (SSCK), data input
line (SSI or SSO), data output line (SSI or SSO), and chip select line (SCS).
In addition, the SSU supports bidirectional mode in which a single pin functions as data input and
data output lines.
Figure 20.4 shows an example of the initial settings in SSU mode. Before data transfer, clear both
the TE and RE bits in SSER to 0 to set the initial values.
Note: Before changing operating modes and communications formats, clear both the TE and RE
bits to 0. Although clearing the TE bit to 0 sets the TDRE bit to 1, clearing the RE bit to 0
does not change the values of the RDRF and ORER bits and SSRDR. Those bits retain the
previous values.
[1] Clear a bit in DDR to 0 [2] Specify master/slave mode selection, bidirectional mode enable,
SSO pin output value selection, SSCK pin selection, and SCS pin
selection.
[2] Specify MSS, BIDE, SOL, SCKS, CSS1,
and CSS0 bits in SSCRH [3] Selects SSU mode and specify transmit/receive data length.
Clear SSUMS in SSCRL to 0 and [4] Specify MSB first/LSB first selection, clock polarity selection,
[3]
specify bits DATS1 and DATS0 clock phase selection, and transfer clock rate selection.
End
Figure 20.5 shows an example of transmission operation, and figure 20.6 shows a flowchart
example of data transmission.
In master mode, the SSU outputs a transfer clock and data. In slave mode, when a low level signal
is input to the SCS pin and a transfer clock is input to the SSCK pin, the SSU outputs data in
synchronization with the transfer clock.
Writing transmit data to SSTDR after the TE bit is set to 1 clears the TDRE bit in SSSR to 0, and
the SSTDR contents are transferred to SSTRSR. After that, the SSU sets the TDRE bit to 1 and
starts transmission. At this time, if the TIE bit in SSER is set to 1, a TXI interrupt is generated.
When 1-frame data has been transferred with TDRE = 0, the SSTDR contents are transferred to
SSTRSR to start the next frame transmission. When the 8th bit of transmit data has been
transferred with TDRE = 1, the TEND bit in SSSR is set to 1 and the state is retained. At this time,
if the TEIE bit is set to 1, a TEI interrupt is generated. After transmission, the output level of the
SSCK pin is fixed high when CPOS = 0 and low when CPOS = 1.
While the ORER bit in SSSR is set to 1, transmission is not performed. Check that the ORER bit
is cleared to 0.
1 frame 1 frame
SCS
SSCK
SSO Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
0 1 2 3 4 5 6 7 7 6 5 4 3 2 1 0
SSTDR0 SSTDR0
(LSB first transmission) (MSB first transmission)
TDRE
TEND
1 frame
SCS
SSCK
SSO Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
(LSB first) 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
SSTDR1 SSTDR0
SSO Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
(MSB first) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
SSTDR0 SSTDR1
TDRE
TEND
Figure 20.5 (2) Example of Transmission Operation (SSU Mode) When 16-Bit Data Length
is Selected (SSTDR0 and SSTDR1 are Valid) with CPOS = 0 and CPHS = 0
1 frame
SCS
SSCK
SSO Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
0 1 to 6 7 0 1 to 6 7 0 1 to 6 7
(LSB first)
SSTDR2 SSTDR1 SSTDR0
TDRE
TEND
Figure 20.5 (3) Example of Transmission Operation (SSU Mode) When 24-Bit Data Length
is Selected (SSTDR0, SSTDR1, and SSTDR2 are Valid) with CPOS = 0 and CPHS = 0
1 frame
SCS
SSCK
TDRE
TEND
Data transferred from SSTDR to SSTRSR [4] Procedure for data transmission end:
To end data transmission, confirm that the TEND bit is cleared
to 0. After completion of transmitting the last bit, clear the TE
Set TDRE to 1 to start transmission
bit to 0.
Yes
[3] Consecutive data transmission?
No
Read TEND in SSSR
No
TEND = 1?
Yes
Clear TEND to 0
End transmission
Figure 20.7 shows an example of reception operation, and figure 20.8 shows a flowchart example
of data reception. When receiving data, the SSU operates as shown below.
After setting the RE bit to 1 and dummy-reading SSRDR, the SSU starts data reception.
In master mode, the SSU outputs a transfer clock and receives data. In slave mode, when a low
level signal is input to the SCS pin and a transfer clock is input to the SSCK pin, the SSU receives
data in synchronization with the transfer clock.
When 1-frame data has been received, the RDRF bit in SSSR is set to 1 and the receive data is
stored in SSRDR. At this time, if the RIE bit in SSER is set to 1, an RXI interrupt is generated.
The RDRF bit is automatically cleared to 0 by reading SSRDR.
When the RDRF bit has been set to 1 at the 8th rising edge of the transfer clock, the ORER bit in
SSSR is set to 1. This indicates that an overrun error (OEI) has occurred. At this time, data
reception is stopped. While the ORER bit in SSSR is set to 1, reception is not performed. To
resume the reception, clear the ORER bit to 0.
1 frame 1 frame
SCS
SSCK
SSI Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
0 1 2 3 4 5 6 7 7 6 5 4 3 2 1 0
SSRDR0 SSRDR0
(LSB first transmission) (MSB first transmission)
RDRF
1 frame
SCS
SSCK
SSI Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
(LSB first) 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
SSRDR1 SSRDR0
SSI Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
(MSB first) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
SSRDR0 SSRDR1
RDRF
RXI interrupt
LSI operation generated
Figure 20.7 (2) Example of Reception Operation (SSU Mode) When 16-Bit Data Length is
Selected (SSRDR0 and SSRDR1 are Valid) with CPOS = 0 and CPHS = 0
1 frame
SCS
SSCK
SSI Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
to to to
(LSB first) 0 1 6 7 0 1 6 7 0 1 6 7
SSI Bit Bit to Bit Bit Bit Bit to Bit Bit Bit Bit to Bit Bit
7 6 1 0 7 6 1 0 7 6 1 0
(MSB first)
SSRDR0 SSRDR1 SSRDR2
RDRF
Figure 20.7 (3) Example of Reception Operation (SSU Mode) When 24-Bit Data Length is
Selected (SSRDR0, SSRDR1, and SSRDR2 are Valid) with CPOS = 0 and CPHS = 0
1 frame
SCS
SSCK
RDRF
Start
[1] Initial setting:
[1] Initial setting Specify the receive data format.
End reception
End reception
Start
No
TEND = 1?
Yes
Clear TEND in SSSR to 0 Error processing
No
Has the 1 bit transfer
period elapsed?
Yes
Clear TE and RE in SSER to 0
End transmission/reception
When bits CSS1 and CSS0 in SSCRH are specified to B'10 and the SSUMS bit in SSCRL is
cleared to 0, the SCS pin functions as an input (Hi-Z) to detect conflict error. The conflict
detection period is from setting the MSS bit in SSCRH to 1 to starting serial transfer and after
transfer ends. When a low level signal is input to the SCS pin within the period, a conflict error
occurs. At this time, the CE bit in SSSR is set to 1 and the MSS bit is cleared to 0.
Note: While the CE bit is set to 1, transmission or reception is not resumed. Clear the CE bit to 0
before resuming the transmission or reception.
Internal-clocked SCS
MSS
Pφ
SCS (Hi-Z)
MSS
In clock synchronous communication mode, data communications are performed via three lines:
clock line (SSCK), data input line (SSI), and data output line (SSO).
Figure 20.12 shows an example of the initial settings in clock synchronous communication mode.
Before data transfer, clear both the TE and RE bits in SSER to 0 to set the initial values.
Note: Before changing operating modes and communications formats, clear both the TE and RE
bits to 0. Although clearing the TE bit to 0 sets the TDRE bit to 1, clearing the RE bit to 0
does not change the values of the RDRF and ORER bits and SSRDR. Those bits retain the
previous values.
Clear TE and RE bits in SSER to 0 [1] When the pin is used as an input.
End
Figure 20.13 shows an example of transmission operation, and figure 20.14 shows a flowchart
example of data transmission. When transmitting data in clock synchronous communication mode,
the SSU operates as shown below.
In master mode, the SSU outputs a transfer clock and data. In slave mode, when a transfer clock is
input to the SSCK pin, the SSU outputs data in synchronization with the transfer clock.
Writing transmit data to SSTDR after the TE bit is set to 1 clears the TDRE bit in SSSR to 0, and
the SSTDR contents are transferred to SSTRSR. After that, the SSU sets the TDRE bit to 1 and
starts transmission. At this time, if the TIE bit in SSER is set to 1, a TXI interrupt is generated.
When 1-frame data has been transferred with TDRE = 0, the SSTDR contents are transferred to
SSTRSR to start the next frame transmission. When the 8th bit of transmit data has been
transferred with TDRE = 1, the TEND bit in SSSR is set to 1 and the state is retained. At this time,
if the TEIE bit is set to 1, a TEI interrupt is generated.
While the ORER bit in SSSR is set to 1, transmission is not performed. Check that the ORER bit
is cleared to 0.
SSCK
1 frame 1 frame
TDRE
TEND
Data transferred from SSTDR to SSTRSR [4] Procedure for data transmission end:
To end data transmission, confirm that the TEND bit is cleared
to 0. After completion of transmitting the last bit, clear the TE
Set TDRE to 1 to start transmission
bit to 0.
Yes
[3] Consecutive data transmission?
No
Read TEND in SSSR
No
TEND = 1?
Yes
Clear TEND to 0
End transmission
Figure 20.15 shows an example of reception operation, and figure 20.16 shows a flowchart
example of data reception. When receiving data, the SSU operates as shown below.
After setting the RE bit in SSER to 1, the SSU starts data reception.
In master mode, the SSU outputs a transfer clock and receives data. In slave mode, when a transfer
clock is input to the SSCK pin, the SSU receives data in synchronization with the transfer clock.
When 1-frame data has been received, the RDRF bit in SSSR is set to 1 and the receive data is
stored in SSRDR. At this time, if the RIE bit is set to 1, an RXI interrupt is generated. The RDRF
bit is automatically cleared to 0 by reading SSRDR.
When the RDRF bit has been set to 1 at the 8th rising edge of the transfer clock, the ORER bit in
SSSR is set to 1. This indicates that an overrun error (OEI) has occurred. At this time, data
reception is stopped. While the ORER bit in SSSR is set to 1, reception is not performed. To
resume the reception, clear the ORER bit to 0.
SSCK
1 frame 1 frame
RDRF
No
No
Consecutive data reception?
Yes
Read received data in SSRDR
[3] RE = 0
End reception
End reception
Start
[1] Initial setting:
Specify the transmit/receive data format.
[1] Initial setting
[2] Check the SSU state and write transmit data:
[2] Read TDRE in SSSR Write transmit data to SSTDR after reading and
confirming that the TDRE bit in SSSR is 1. The TDRE bit
No is automatically cleared to 0 and transmission is started
TDRE = 1? by writing data to SSTDR.
Yes
[3] Check the SSU state:
Write transmit data to SSTDR
Read SSSR confirming that the RDRF bit is 1.
A change of the RDRF bit (from 0 to 1) can be notified
TDRE automatically cleared by RXI interrupt.
No
TEND = 1?
Yes
Clear TEND in SSSR to 0 Error processing
No
Has the 1 bit transfer
period elapsed?
Yes
Clear TE and RE in SSER to 0
End transmission/reception
Since both an overrun error and a conflict error interrupts are allocated to the SSERI vector
address, and both a transmit data register empty and a transmit end interrupts are allocated to the
SSTXI vector address, the interrupt source should be decided by their flags. Table 20.7 lists the
interrupt sources.
When an interrupt condition shown in table 20.7 is satisfied, an interrupt is requested. Clear the
interrupt source by the CPU.
SSU operation can be disabled or enabled using the module stop control register. The initial
setting is for the SSU to be halted. Register access is enabled by clearing the module stop state.
For details, see section 25, Power-Down Modes.
21.1 Features
• Supports communications between this LSI and SPI flash memory
• Can operate as a master
• Transfer clock selectable from system clock φ, φ/2, φ/4, φ/8, φ/16, φ/32, φ/64, and φ/128
• Two interrupt sources: Transmit end and receive end interrupts
Table 21.2 shows the initial state of the FSI pins when the FSIE bit in FSICR1 is set to 1.
FSICR1 has control bits that are classified into three functionalities: resetting the FSI internal
signals, enabling/disabling FSI functions, and selecting FSI functions.
Initial
Bit Bit Name Value R/W Description
7 SRES 0 R/W Software Reset
Controls initialization of the FSI internal sequencer.
0: Normal state
1: Clears the internal sequencer.
Writing 1 to this bit generates a clear signal for the
sequencer in the corresponding module, resulting in the
initialization of the FSI's internal state.
6 FSIE 0 R/W FSI Enable
0: Disables FSI operation.
1: Enables FSI operation.
The following shows the initial state of the FSI pins when
the FSIE bit is set to 1:
FSISS: Outputs high level.
FSICK: Outputs high level or low level depending on the
CPHS and CPOS bits.
FSIDO: Outputs high level.
FSIDI: Inputs data.
5, 4 ⎯ All 0 R/W Reserved
The initial value should not be modified.
Initial
Bit Bit Name Value R/W Description
3 CPHS 0 R/W CPHS: FSICK Clock Polarity Select
2 CPOS 0 R/W CPOS: FSICK Clock Phase Select
CPHS CPOS
00: Initial value of FSICK: Low level
Data changes at the FSICK falling edge.
11: Initial value of FSICK: High level
Data changes at the FSICK falling edge.
01: Setting prohibited
10: Setting prohibited
1, 0 ⎯ All 0 R/W Reserved
The initial value should not be modified.
FSICR2 has control bits that are classified into two functionalities: enabling/disabling the FSI
communications and enabling/disabling the FSI internal interrupts.
Initial
Bit Bit Name Value R/W Description
7 TE 0 R/(W)* FSI Transmit Enable
0: FSI transmission disabled state (transmission end)
[Clearing condition]
• When FSI data transmission is completed
1: FSI transmission is possible
6 RE 0 R/(W)* FSI Receive Enable
0: FSI reception disabled state (reception end)
[Clearing condition]
• When FSI data reception is completed
1: FSI reception is possible
5 FSITEIE 0 R/W FSI Transmit End Interrupt Enable
0: Disables the FSITEI interrupt request.
1: Enables the FSITEI interrupt request.
4 FSIRXIE 0 R/W FSI Receive End Interrupt Enable
0: Disables the FSIRXI interrupt request.
1: Enables the FSIRXI interrupt request.
3 ⎯ 0 R/W Reserved
The initial value should not be modified.
2 to 0 PS_SEL2 to All 0 R/W FSI Communications Clock Select
PS_SEL0 000: φ
001: φ/2
010: φ/4
011: φ/8
100: φ/16
101: φ/32
110: φ/64
111: φ/128
Note: * Only 1 can be written to bits 7 and 6 as transmit/receive enable bits.
FSIBNR sets the number of bytes to be transmitted or received. The settings of this register should
not be modified while the FSI is performing communications.
Initial
Bit Bit Name Value R/W Description
7 to 4 TBN3 0 R/W Transmit Byte Count 3 to 0
TBN2 0 R/W These bits specify the number of data bytes to be
TBN1 0 R/W transmitted. The TBN value is decremented (−1) each
time one byte of FSI data transmission is completed.
TBN0 0 R/W
When the FSI transmission ends, the TBN bits are
cleared to B'0000.
0000: Transmits no data
0001: Transmits one byte of data
0010: Transmits two bytes of data
0011: Transmits three bytes of data
0100: Transmits four bytes of data
0101: Transmits five bytes of data
0110: Transmits six bytes of data
0111: Transmits seven bytes of data
1000: Transmits eight bytes of data
1001 to 1111: Setting prohibited
If transmission of nine bytes or more is specified, data in
FSITDR7 is transmitted.
3 ⎯ 0 R/W Reserved
The initial value should not be modified.
Initial
Bit Bit Name Value R/W Description
2 to 0 RBN2 0 R/W Receive Byte Count 2 to 0
RBN1 0 R/W These bits specify the number of data bytes to be
RBN0 0 R/W received. After the FSI reception operation ends (when
the FSIRXI bit in FSISTR is 1), the RBN value is
decremented (−1) each time FSIRDR is read.
When all the data bytes have been read, the RBN bits
are cleared to B'000.
000: Receives no data
001: Receives one byte of data
010: Receives two bytes of data
011: Receives three bytes of data
100: Receives four bytes of data
101 to 111: Setting prohibited
If reception of five bytes or more is specified, FSIRDR is
overwritten.
FSIINS sets an instruction to be sent to the SPI flash memory. When this register has been
modified after the completion of communications setting, the FSI communications operation is
started. The settings of this register should not be modified while the FSI is performing
communications.
Initial
Bit Bit Name Value R/W Description
7 to 0 Bit 7 to Bit 0 All 0 R/W These bits store an instruction to be transmitted to the
SPI flash memory.
FSISTR indicates the processing status of the transfer between the FSI and SPI flash memory.
Initial
Bit Bit Name Value R/W Description
7 FSITEI 0 R/(W)* FSI Transmit End Interrupt Flag
[Setting condition]
• When write data has been transmitted to the SPI
flash memory
[Clearing condition]
• When 0 is written to FSITEI after reading FSITEI
=1
6 ⎯ 0 R Reserved
The read value is undefined, and this bit cannot be
modified.
5 FSIRXI 0 R FSI Receive End Interrupt Flag
Indicates whether or not there is data to be read by
the FSI.
0: There is no read data.
[Clearing condition]
• When all receive data has been read
(when RBN is cleared to 0)
(automatically cleared)
1: There is read data.
[Setting condition]
• When receive data has been transferred to
FSIRDR
4 to 0 ⎯ All 0 R/W Reserved
The initial value should not be modified.
Note: * Only 0 can be written to bit 7 to clear the flag.
FSITDR stores a total of eight bytes of transmit data. A total of 8 bytes of addresses, instructions,
and data items can be transferred continuously from FSITDR0 to FSITDR7 in this order to the SPI
flash memory, according to the setting of the TBN bits in FSIBNR. No data should be set to
FSITDR0 because the value of FSIINS is automatically stored in FSITDR0 when the
communications operation is started. The settings of this register should not be modified while the
FSI is performing communications.
Initial
Bit Bit Name Value R/W Description
7 to 0 Bit 7 to Bit 0 All 0 R/W These bits store transmit data.
FSIRDR stores a total of four bytes of receive data items continuously sent from the SPI flash
memory. This register should not be read unless the FSI has finished receiving data. Note that four
bytes of the receive register share a single register address. Which receive register is to be read
will be determined by the value of the RBN bits in FSIBNR. When RBN = B'000, H'00 is read
out.
Initial
Bit Bit Name Value R/W Description
7 to 0 Bit 7 to Bit 0 All 0 R These bits store receive data.
21.4 Operation
The SPI flash memory transfer is performed using FSIDO and FSIDI synchronously with FSICK.
The initial value of FSICK can be either fixed to high or low through programming.
FSISS
FSICK
The FSI has two communications functions to perform data transfer with the flash memory:
transmit and receive operations. Up to seven bytes of addresses or data items are transmitted in
each transmit operation. Up to four bytes of data items are received in each receive operation, and
the received data is stored in on-chip FIFOs. Issue FSI transmit and receive operations following
the setting procedures shown in figure 21.3.
Initial setting:
Set FSIE bit and select
Initial setting:
communications mode (FSICR1)
Set FSIE bit and select
communications mode (FSICR1)
Set FSI receive enable bit RE
and select communications clock
(FSICR2)
Set FSI transmit enable bit TE
and select communications clock
(FSICR2)
Set transmit byte count and receive
byte count (FSIBNR) and write transmit
address to FSITDR1 to FSITDR7
Yes
Yes
Yes
FSIRXI = 1?
End of transmission
No
End of reception
1. Set the FSI enable bit FSIE (in FSICR1) to 1 and set the communications mode bits CPHS and
CPOS (in FSICR1) (CPHS = CPOS = 0: Mode 0; CPHS = CPHS = 1: Mode 3).
2. Set the FSI transmit enable bit TE (in FSICR2) to 1 and select the communications clock.
3. Set the number of bytes to be transmitted (FSIBNR) and write the transmit data to FSITDR1 to
FSITDR7.
4. Set the FSI instruction register (FSIINS).
FSISS
Mode 3
FSICK Mode 0
TE
FSITEI
FSIDO
1. Set the FSI enable bit FSIE (in FSICR1) to 1 and set the communications mode bits CPHS and
CPOS (in FSICR1) (CPHS = CPOS = 0: Mode 0; CPHS = CPHS = 1: Mode 3).
2. Set the FSI receive enable bit RE (in FSICR2) to 1 and select the communications clock.
3. Set the number of bytes to be transmitted and received (FSIBNR) and write the transmit data
to FSITDR1 to FSITDR7.
4. Set the FSI instruction register (FSIINS).
FSISS
Mode 3
FSICK Mode 0
RE
FSIRXI
FSIDO
FSIDI
After the FSI communications operation has started, the FSI issues a communications operation
according to the communications settings. The communications settings must not be changed until
the communications operation has completed. To change communications settings, such as
communications mode, communications clock, and number of bytes to be transmitted or received,
wait until completion of the communications operation and then change the communications
settings.
FSI operation can be disabled or enabled using the module stop control register. The initial setting
is for the FSI to be halted. Register access is enabled by clearing the module stop state. For details,
see section 25, Power-Down Modes.
Section 22 RAM
This LSI has an on-chip high-speed static RAM. The RAM is connected to the CPU by a 16-bit
data bus, enabling one-state access by the CPU to both byte data and word data.
The on-chip RAM can be enabled or disabled by means of the RAME bit in the system control
register (SYSCR). For details on the system control register (SYSCR), see section 3.2.2, System
Control Register (SYSCR).
RAM
Product Type ROM Type Capacity RAM Address
H8S/24279 R4F24279 Flash memory version 64 Kbytes H'FEC000 to H'FFBFFF
H8S/24279R R4F24279R
H8S/24276 R4F24276
H8S/24276R R4F24276R
H8S/24259 R4F24259
H8S/24256 R4F24256
H8S/24278 R4F24278 48 Kbytes H'FF0000 to H'FFBFFF
H8S/24278R R4F24278R
H8S/24275 R4F24275
H8S/24275R R4F24275R
H8S/24258 R4F24258
H8S/24255 R4F24255
Table 23.1 gives an overview of the flash memory specifications (refer to section 1, Overview, for
items that are not shown in table 23.1).
Item Description
Flash memory programming modes Four modes (user program mode, boot mode, user
boot mode, and programmer mode)
Erase block division User ROM See figure 23.2.
Data flash
User boot ROM
Programming method Word units
Erase method Block units
Programming and erase control method Programming and erasure are controlled by
software commands
Number of commands Eight commands
Programming and erase count 1,000 times/10,000 times*1*2
Data retention Ten years
Notes: 1. The programming and erase count determine the number of times the erase operation
can be performed in each block.
For example, if 1-word programming is done 2,048 times, each at a different address in
a 4-Kbyte block and then the block is erased, this is counted as one programming and
erase count. If the allowed programming and erase count is 1,000 times, each block
can be erased 1,000 times.
2. 10,000 times for the data flash and 1,000 times for other blocks.
• When on-chip ROM is disabled, flash memory cannot be read, programmed, or erased.
• In user mode, flash memory can be read but cannot be programmed or erased.
• The on-board modes in which flash memory can be read, programmed, and erased are user
program mode, boot mode, and user boot mode.
• In programmer mode, flash memory can be read, programmed, and erased using a PROM
programmer.
RES = 0 RES = 0
ROM disabled
ROM disabled Reset state Programmer Programmer
mode
mode setting mode setting mode
Use
R
ES
r bo
0
RE
=
= ng Bo
tti
0
ES
ot m
ot
S=
R se
e m
od
ode
od
0
m e
r se
set
e
Us tti
ng
ting
FLSHE = 0
Table 23.3 Differences between User Program Mode, Boot Mode, User Boot Mode, and
Programmer Mode
User
Program Programmer
Item Mode Boot Mode User Boot Mode Mode
Programming/ On-board On-board On-board PROM
erasing environment programming programming programming programmer
Programming/ User ROM User ROM User ROM User ROM
erasing enable MAT Data flash Data flash Data flash Data flash
User boot ROM User boot ROM
1
All erasure O O (Automatic)* O O
1
Block division erasure O O* O O
Program data transfer From desired From host via From desired Via programmer
device SCI device
Reset initiation MAT User ROM Embedded User boot ROM*2 ⎯
program storage
MAT
Transition to user Changing Changing mode Changing mode ⎯
mode the FLSHE and performing and performing
bit setting reset reset
Notes: 1. All-erasure is performed. After that, the specified block can be erased.
2. In this LSI, user program mode is defined as the period from the timing when a program
concerning programming and erasure is started to the timing when the program is
completed. For details on a program concerning programming and erasure, refer to
section 23.5.1, User Program Mode.
The user ROM and data flash are divided into multiple blocks.
The start addresses of the user ROM and user boot ROM are allocated to the same address.
Therefore, when program execution or data access is performed between the two memory MATs,
the memory MATs must be switched by the FMMS bit in FLMMATS.
The user ROM and data flash can be programmed in any mode as long as on-chip ROM is
enabled, but the user boot ROM can be programmed only in boot mode and programmer mode.
H'000000 H'000000
16 Kbytes User boot ROM
Block 0: 64 Kbytes H'003FFF
H'00FFFF
H'010000
Block 1: 64 Kbytes
H'01FFFF
H'020000
Block 2: 64 Kbytes
384 Kbytes
H'02FFFF
H'030000
Block 3: 64 Kbytes
512 Kbytes
H'03FFFF
User ROM
H'040000
Block 4: 64 Kbytes
H'04FFFF
H'050000
Block 5: 64 Kbytes
H'05FFFF
H'060000
Block 6: 64 Kbytes
H'06FFFF
H'070000
Block 7: 64 Kbytes
H'07FFFF
H'F00000
Block A: 4 Kbytes
H'F00FFF Data flash
H'F01000
Block B: 4 Kbytes
H'F01FFF
The size of the user ROM is different from that of the user boot ROM. Addresses which exceed
the size of the 16-Kbyte user boot ROM area should not be accessed. If data is read from a user
boot ROM area of a size greater than 16 Kbytes, data is read as an undefined value.
Note: When the FLSHE bit in SYSCR is 0, the read values are undefined and registers cannot be
modified.
Initial
Bit Bit Name Value R/W Description
7 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
6 CBIDB 1 R/W CPU Programming Mode Select
Setting this bit to 0 (CPU programming mode) enables
command acceptance.
0: CPU programming mode enabled
1: CPU programming mode disabled
5 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
4 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
3 FMLBE 0 R/W Lock Bit Disable Select
Setting this bit to 1 disables the lock bit (see section 23.7,
Data Protection Function). This bit only disables the lock
bit function, and the lock bit data will not be changed.
0: Lock bit enabled
1: Lock bit disabled
2 ⎯ 1 ⎯ Reserved
The initial value should not be changed.
1 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
0 FMCMDEN 0 R/W Flash Memory Software Command Enable
Setting this bit to 1 (CPU programming mode) enables
command acceptance.
0: Flash memory software commands disabled
1: Flash memory software commands enabled
To set this bit to 1, be sure to write 0 and then write 1 in a
row.
Initial
Bit Bit Name Value R/W Description
7 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
6 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
5 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
4 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
3 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
2 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
1 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
0 FMDBPT0 0 R/W Data Flash E/W Protect*
0: Data flash E/W disabled
1: Data flash E/W enabled
To set this bit to 0, be sure to write 1 and then write 0 in a
row.
Note: * This bit is set to 1 simultaneously when the FMCMDEN bit in FLMCR1 is set to 1. To
set this bit to 1, be sure to write 0 and then write 1 in a row.
Initial
Bit Bit Name Value R/W Description
7 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
6 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
5 FMERSF* 0 R Erase or Blank Check Status Flag
0: Successfully completed
1: Ended with an error
4 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
3 FMPRSF* 0 R Program Status Flag
0: Successfully completed
1: Ended with an error
2 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
1 ⎯ 1 ⎯ Reserved
The initial value should not be set.
0 FMRDY 1 R Flash Memory Ready/Busy Status
0: Busy (Interrupt processing or erasure is in progress)
1: Ready
Note: * The FMERSF and FMPRSF bits are cleared to 0 by a clear status command.
Initial
Bit Bit Name Value R/W Description
7 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
6 ⎯ 1 ⎯ Reserved
The initial value should not be changed.
5 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
4 FMMS 0 R MAT Select
Switch the MATs always following the memory MAT
switching procedure in section 23.13, Switching between
User ROM and User Boot ROM. (The user boot ROM
cannot be programmed in user program mode. The user
boot ROM should be programmed in boot mode or
programmer mode.)
0: User ROM is selected
1: User boot ROM is selected
[Programming condition]
When the program is being executed in on-chip RAM
3 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
2 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
1 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
0 ⎯ 0 ⎯ Reserved
The initial value should not be changed.
Table 23.4 shows the pin setting for each operating mode.
In user program mode, the flash memory can be programmed by the CPU through execution of
software commands. In this mode, the user ROM and data flash can be programmed without using
a ROM programmer with the microcomputer mounted on a system board.
The programming and block erase commands should be executed only in each block area of the
user ROM and data flash.
User program mode provides the erase/write 0 mode (EW0 mode). Table 23.5 gives an overview
of the EW0 mode specifications.
Item Description
Operating mode • Single-chip mode
• Expanded mode with on-chip ROM enabled
Area for storing the programming User ROM
control program
Area for executing the The programming control program should be transferred to an
programming control program area outside the flash memory (such as RAM) before
2
execution*
Programmable area User ROM, data flash
Limitations on software None
commands
Mode after programming or Read status register mode
erasure
CPU state during automatic Operating*1
programming or erasure
Flash memory status detection • Reading the FMPRSF and FMERSF bits in FLMSTR by a
program.
• Executing a read status register command to read the
SR7, SR5, and SR4 bits in the status register.
Notes: 1. Make sure that no interrupt (except NMI) or DMA transfer is generated.
2. In user program mode, the programming control program should be executed in the on-
chip RAM or an external area.
Setting the FMCMDEN bit in FLMCR1 to 1 shifts the flash memory into user program mode, in
which commands can be accepted. Figure 23.3 shows how to set and clear the EW0 mode.
Programming and erasure are controlled through software commands. The flash memory state
after programming or erasure can be checked through FLMSTR or the status register.
Single-chip mode or
expanded mode with on-chip ROM enabled Write 0 to the FMCMDEN bit and then write 1
to it (user program mode enabled).*1
Clear CBIDB to 0.
Notes: 1. To set the FMR01 bit to 1, write 0 to the bit and then write 1 to it
in a row.
Write to the FMR01 bit from an area outside the on-chip flash memory.
2. After a read array command, disable the CPU programming mode.
3. In user program mode, the programming control program should be executed
in the on-chip RAM or an external area.
Write H'FFxx in the first bus cycle to shift the flash memory into the read array mode. Specify the
target read address in the next bus cycle after setting the CBIDB bit in FLMCR1 to 1, and data is
read from the address in 16-bit units.
As the flash memory stays in the read array mode until another command is issued, multiple
addresses can be read in sequence.
Write H'70xx in the first bus cycle, and the status register can be read in the second bus cycle
(refer to section 23.8, Status Register). Specify an even address in the user ROM, data flash, or
user boot ROM to read the status register.
Write H'50xx in the first bus cycle, and the FMERSF and FMPRSF bits in FLMSTR are cleared to
0.
23.6.4 Program
Write H'41xx in the first bus cycle and write data to the target address in the second and third bus
cycles; the flash memory starts automatic writing (programming and verifying data). The address
value specified in the first bus cycle should be the same even address as that specified in the
second bus cycle.
Completion of automatic writing can be checked through the FMRDY bit in FLMSTR. The
FMRDY bit is 0 (busy) during automatic writing and becomes 1 (ready) when writing is
completed.
After automatic writing is completed, the result can be checked through the FMPRSF bit in
FMRSTR (refer to section 23.9, Full Status Check).
Once an address is programmed, additional data should not be written to the address. Figure 23.4
shows a flowchart of the program command processing.
In the EW0 mode, the read status register mode is entered as soon as automatic writing starts, and
the status register can be read. The SR7 bit in the status register becomes 0 when automatic
writing starts and returns to 1 when writing is completed. In this case, the flash memory stays in
the read status register mode until a read array command is issued. After automatic writing is
completed, the result of writing can be checked by reading the status register.
Start
Write data to
the target write address.
NO
FMRDY = 1?
YES
End of programming
Write H'20xx in the first bus cycle and H' D0xx to the lowest address (an even address) of the
target block in the second bus cycle; automatic erasure (erasing data and verifying the erased
status) starts in the specified block.
Completion of automatic erasure can be checked through the FMRDY bit in FLMSTR.
The FMRDY bit is 0 (busy) during automatic erasure and becomes 1 (ready) when erasure is
completed.
After automatic erasure is completed, the result can be checked through the FMERSF bit in
FLMSTR (refer to section 23.9, Full Status Check).
In the EW0 mode, the read status register mode is entered as soon as automatic erasure starts, and
the status register can be read. The SR7 bit in the status register becomes 0 when automatic
erasure starts and returns to 1 when erasure is completed. In this case, the flash memory stays in
the read status register mode until a read array command is issued. If an erase error occurs, repeat
a sequence of the clear status register command -> block erase command at least three times until
no erase error occurs.
Start
NO
FMRDY = 1?
YES
Write H'25xx in the first bus cycle and H'D0xx to the lowest address (an even address) of the
target block in the second bus cycle; the check result will be stored in the FMERSF bit in
FLMSTR. After the FMRDY bit in FLMSTR has become 1 (ready), read the FMERSF bit.
Figure 23.6 shows a flowchart of the block blank check command processing.
Start
NO
FMRDY = 1?
YES
NO
FMERSF = 0?
YES
Write H'77xx in the first bus cycle and H'D0xx to the lowest address (an even address) of the
target block in the second bus cycle; 0 is written to the lock bit of the specified block. The address
value in the first bus cycle should be set to match the lowest address of the block that is specified
in the second bus cycle.
Figure 23.7 shows a flowchart of the lock bit program command processing. The lock bit status
(lock bit data) can be read using the read lock bit data command.
The end of writing can be confirmed using the FMRDY bit in FLMSTR. The FMRDY bit is 0
(busy) during writing and becomes 1 (ready) after writing has finished.
For the lock bit function and the method for setting the lock bit to 1 (unlocked state), refer to
section 23.7, Data Protection Function.
Figure 23.7 shows a flowchart of the lock bit program command processing.
Start
No
FMRDY = 1?
Yes
End of program
H'71xx is read in the first bus cycle, and the lock bit data (D6) is read in the second bus cycle.
Note that data must be read from an even address in the user ROM, data flash, or user boot ROM.
The lock bit data becomes 0 (locked state) when the lock bit program command is executed, and
changes to 1 (unlocked state) when the block is erased. The lock bit data cannot be changed to 1
by a command.
The lock bit data can be read out by the read lock bit data command.
When the FMLBE bit is set to 1, the lock bit function is disabled and all blocks enter the unlocked
state (each lock bit data does not change). When the FMLBE bit is cleared to 0, the lock bit
function is enabled (lock bit data is held).
If the block erase command is executed when the FMLBE bit is 1, the specified blocks are erased
regardless of the lock bit data. After erasure has finished, the lock bit of each block is set to 1.
In the EW0 mode, the status register can be read with the following timing.
• When a read status register command is issued and then an even address in the user ROM or
data flash is read
• When a program command, a block erase command, or a block blank check command is
issued and then an even address in the user ROM or data flash is read before a read array
command is issued
Status
Bits in Status Bits in Value after
Register FMLSTR Status Name 0 1 Reset
SR0 (D0) ⎯ Reserved ⎯ ⎯ ⎯
SR1 (D1) ⎯ Reserved ⎯ ⎯ ⎯
SR2 (D2) ⎯ Reserved ⎯ ⎯ ⎯
SR3 (D3) ⎯ Reserved ⎯ ⎯ ⎯
SR4 (D4) FMPRSF Programming Completed Ended with 0
status successfully error
SR5 (D5) FMERSF Erase status Completed Ended with 0
successfully error
SR6 (D6) ⎯ Reserved ⎯ ⎯
SR7 (D7) FMRDY Sequencer status Busy Ready 1
[Legend]
SR0 to SR7: Status register data
D0 to D7: Data bus from which the bit is read when a read status register command is issued.
Note: The FMERSF (SR5) and FMPRSF (SR4) bits are cleared to 0 by a clear status register
command.
When the FMERSF (SR5) or FMPRSF (SR4) bit is 1, the program, block erase, and block
blank check commands are not accepted.
The sequencer status bit indicates the state of flash memory operation. Its value is 0 during
execution of a program, block erase, or block blank check and 1 in other cases.
Table 23.8 shows the errors and FLMSTR status and figure 23.8 shows a flowchart of full status
check processing and corrective actions for each error.
State of FLMSTR
(Status Register)
FMERSF Bit FMPRSF Bit
(SR5) (SR4) Error Error Conditions
1 1 Command • When a command is not issued correctly
sequence error
• When an invalid value (a value other than
H'D0xx or H'FFxx) is written in the second
bus cycle of a block erase command*
1 0 Erase error • When a block erase command is issued but
the block is not erased correctly
• When a block blank check command is
issued and the checked block is not blank
0 1 Programming • When a program command is issued but
error automatic writing is not done correctly
Note: * When H'FFxx is written in the second bus cycle of this command, the flash memory
enters the read array mode and the command code written in the first bus cycle is
ignored.
FMPRSF = 1 YES
and Command sequence
. . . (1) Execute a clear status register command to clear the FMPRSF and
FMERSF =1 ? error FMERSF bits to 0 (successfully completed state).
(2) Check if the command was input correctly, and execute it again.
NO
NO
FMERSF = 0? Erase error . . . (1) Execute a clear stats register command to clear the FMERSF bit
to 0 (successfully completed state).
(2) Execute a block erase command.
Repeat steps (1), (2), and (3) at least three times until no block erase
error occurs.
Note: If an error still occurs, the block cannot be used.
YES
NO
FMPRSF = 0? Programming error . . . [During program execution]
(1) Execute a clear stats register command to clear the FMPRSF bit
to 0 (successfully completed state).
(2) Execute a block erase command again.
Note: If an error still occurs, the block cannot be used.
YES
End of
full status check
Note: When either the FMPRSF or FMERSF bit is 1 (ended with error), the program, block erase, and block blank check
commands are not accepted. Execute a clear status register command and then execute a desired command again.
• The NMI and watchdog timer interrupts can be used because FLMCR1 is forcibly initialized
when an interrupt is generated; specify the destination address of each interrupt routine in the
fixed vector table. Flash memory programming is terminated when an NMI interrupt or a
watchdog timer interrupt occurs. In this case, execute the programming program again after the
interrupt routine is completed.
To set the FMCMDEN bit to 1, be sure to write 0 to the bit and then write 1 in a row. Make sure
that no interrupt, EXDMAC transfer, DTC transfer, or DMA transfer is generated between writing
0 and 1.
If the power-supply voltage falls during programming of the block that stores the programming
control program, the programming control program cannot be correctly modified and the flash
memory may not be programmed after that. In this case, use the on-board programming mode or
programmer mode instead.
The address to write a command code should be a multiple of four (H'0, H'4, H'8, H'C, ...).
Before entering the stop mode, set the FMCMDEN bit to 0 (CPU programming mode disabled),
disable the DMA transfer, and then make a transition to the software standby mode.
Boot mode executes programming/erasing of the user ROM, data flash, or user boot ROM by
means of the control command and program data transmitted from the externally connected host
via the on-chip SCI_1.
In boot mode, the tool for transmitting the control command and program data, and the program
data must be prepared in the host. The serial communication mode is set to asynchronous mode.
The system configuration in boot mode is shown in figure 23.9. Interrupts are ignored in boot
mode. Configure the user system so that interrupts do not occur.
This LSI
MD2 to MD0 011
Software for
analyzing Flash
control memory
Host commands
(on-chip)
Control command,
Programming program data
tool and program RxD1
On-chip
data SCI_1
RAM
TxD1
Response
Only the user ROM and data flash can be programmed/erased in user boot mode.
Programming/erasing of user boot ROM is enabled only in boot mode or programmer mode.
When a hardware reset is issued with the mode pins set to mode 5, this LSI enters user boot mode
and the built-in check routine runs. The user ROM, data flash, and user boot ROM states will be
checked.
While the check routine is running, NMI and all other interrupts cannot be accepted.
Next, processing starts from the execution start address of the reset vector in user boot ROM. At
this point, the FMMS bit in FLMMATS is set to 1 because user boot ROM has been selected as
the execution memory MAT.
For programming the user ROM in user boot mode, additional processing made by setting the
FMMS bit in FLMMATS is required: switching from the user boot ROM to the user ROM, and
switching back to the user boot ROM after programming completes.
Figure 23.10 shows the procedure for programming the user ROM in user boot mode.
Programming control
program
Start of programming
procedure program Write 0 to FLMCMDEN bit and then write 1
Clear CBIDB bit to 0 (user program
mode is enabled)
End of programming
procedure program
Figure 23.10 Procedure for Programming User ROM in User Boot Mode
The difference between the programming procedures in user program mode and user boot mode is
the memory MAT switching, as shown in figure 23.10.
In user boot mode, though the user boot ROM can be seen in the flash memory space, the user
ROM is hidden in the background. Therefore, the user ROM and user boot ROM are switched
only while the user ROM is being programmed. Because the user boot ROM is hidden while the
user ROM is being programmed, the procedure program must be executed in the on-chip RAM
area. After programming completes, switch the memory MATs again to return to the first state.
Memory MAT switching is enabled by writing the defined value to the FMMS bit in FLMMATS.
However note that access to a memory MAT is not allowed until memory MAT switching is
completed. During memory MAT switching, the LSI is in an unstable state, e.g. if an interrupt
occurs, from which memory MAT the interrupt vector is read is undetermined. Perform memory
MAT switching in accordance with the description in section 23.13, Switching between User
ROM and User Boot ROM.
Except for memory MAT switching, the programming procedure is the same as that in user
program mode.
For erasing the user ROM in user boot mode, additional processing made by setting the FMMS bit
in FLMMATS is required: switching from the user boot ROM to the user ROM, and switching
back to the user boot ROM after erasing completes.
Figure 23.11 shows the procedure for erasing the user ROM in user boot mode.
Programming control
program
Start of programming
procedure program Write 0 to FLMCMDEN bit and then write 1
Clear CBIDB bit to 0 (user program
mode is enabled)
End of programming
procedure program
Figure 23.11 Procedure for Erasing User ROM in User Boot Mode
The difference between the erasing procedures in user program mode and user boot mode is the
memory MAT switching, as shown in figure 23.11.
The user ROM and user boot ROM are switched only while the user ROM is being erased.
Because the user boot ROM is hidden while the user ROM is being erased, the procedure program
must be executed in an area other than flash memory. After erasure completes, switch the memory
MATs again to return to the first state.
Memory MAT switching is enabled by writing the defined value to the FMMS bit in FLMMATS.
However note that access to a memory MAT is not allowed until memory MAT switching is
completed. During memory MAT switching, the LSI is in an unstable state, e.g. if an interrupt
occurs, from which memory MAT the interrupt vector is read is undetermined. Perform memory
MAT switching in accordance with the description in section 23.13, Switching between User
ROM and User Boot ROM.
Except for memory MAT switching, the erasing procedure is the same as that in user program
mode.
1. Memory MAT switching by the FMMS bit in FLMMATS should always be executed from the
on-chip RAM.
2. When accessing the memory MAT immediately after switching the memory MATs by
modifying the FMMS bit in FLMMATS from the on-chip RAM, similarly execute four NOP
instructions in the on-chip RAM (this prevents access to the flash memory during memory
MAT switching).
3. If an interrupt request has occurred during memory MAT switching, there is no guarantee of
which memory MAT is accessed. Always mask the maskable interrupts before switching
memory MATs. In addition, configure the system so that NMI interrupts do not occur during
memory MAT switching.
4. After the memory MATs have been switched, take care because the interrupt vector tables will
also have been switched.
5. The size of the user ROM is different from that of the user boot ROM. Addresses which
exceed the size of the 16-Kbyte user boot ROM area should not be accessed. If a user boot
ROM area of a size greater than 16 Kbytes is accessed, data is read as an undefined value.
Procedure for
switching to
user boot ROM
Procedure for
switching to
user ROM
Figure 23.12 Switching between User ROM and User Boot ROM
(1) Status
1. Bit-Rate-Adjustment State
In this state, the boot program adjusts the bit rate to communicate with the host. Initiating boot
mode enables starting of the boot program and entry to the bit-rate-adjustment state. The
program receives the command from the host to adjust the bit rate. After adjusting the bit rate,
the program enters the inquiry/selection state.
2. Inquiry/Selection State
In this state, the boot program responds to inquiry commands from the host. The device name,
clock mode, and bit rate are selected. After selection of these settings, the program is made to
enter the programming/erasing state by the command for a transition to the
programming/erasing state. The boot program transfers the libraries required for erasure to the
RAM and erases the user ROM, data flash, and user boot ROM before the transition to the
programming/erasing state.
3. Programming/erasing state
Programming and erasure by the boot program take place in this state. The boot program is
made to transfer the programming/erasing programs to the RAM by commands from the host.
Sum checks and blank checks are executed by sending these commands from the host.
Reset
Bit-rate-adjustment
state
Response
Inquiry/response
wait Inquiry
Operations for Operations for
Transition to inquiry and selection response
programming/erasing
Programming/erasing
wait
Programming Erasing Checking
The bit rate is calculated by measuring the period of transfer of a low-level byte (H'00) from the
host. The bit rate can be changed by the command for a new bit rate selection. After the bit rate
has been adjusted, the boot program enters the inquiry and selection state. The bit-rate-adjustment
sequence is shown in figure 23.14.
H'55
H'FF (error)
After adjustment of the bit rate, the protocol for communications between the host and the boot
program is as shown below.
Error response
Error code
Error response
The boot program returns information from the flash memory in response to the host's inquiry
commands and sets the device code, clock mode, and bit rate in response to the host's selection
command.
The selection commands, which are device selection (H'10), clock mode selection (H'11), and new
bit rate selection (H'3F), should be sent from the host in that order. These commands will certainly
be needed. When two or more selection commands are sent at once, the last command will be
valid.
All of these commands, except for the boot program status inquiry command (H'4F), will be valid
until the boot program receives the programming/erasing transition command (H'40). The host can
choose the needed commands out of the commands and inquiries listed above. The boot program
status inquiry command (H'4F) is valid even after the boot program has received the
programming/erasing transition command (H'40).
The boot program will return the device codes of supported devices and the product name in
response to the supported device inquiry.
Command H'20
• Command, H'20, (1 byte): Inquiry regarding supported devices
···
SUM
• Response, H'30, (1 byte): Response to the supported device inquiry
• Size (1 byte): Number of bytes to be transmitted, excluding the command, size, and checksum,
that is, the amount of data contributes by the number of devices, characters, device codes and
product names
• Number of devices (1 byte): The number of device types supported by the boot program
• Number of characters (1 byte): The number of characters in the device codes and boot
program’s name
• Device code (4 bytes): ASCII code of the supporting product
• Product name (n bytes): Type name of the boot program in ASCII-coded characters
• SUM (1 byte): Checksum
The checksum is calculated so that the total of all values from the command byte to the SUM
byte becomes H'00.
The boot program will set the supported device to the specified device code in response to the
device selection. The program will return the selected device code in response to the inquiry after
this setting has been made.
Response H'06
• Response, H'06, (1 byte): Response to the device selection command
ACK will be returned when the device code matches.
The boot program will return the supported clock modes in response to the clock mode inquiry.
Command H'21
• Command, H'21, (1 byte): Inquiry regarding clock mode
The boot program will set the specified clock mode in response to the clock mode selection. The
program will return the selected clock-mode information after this setting has been made.
The clock-mode selection command should be sent after the device-selection commands.
Response H'06
• Response, H'06, (1 byte): Response to the clock mode selection command
ACK will be returned when the clock mode matches.
Even if the clock mode numbers are H'00 and H'01 by a clock mode inquiry, the clock mode must
be selected using these respective values.
The boot program will return the supported multiplication and division ratios in response to the
multiplication ratio inquiry.
Command H'22
• Command, H'22, (1 byte): Inquiry regarding multiplication ratio
The boot program will return the number of operating clock frequencies, and the maximum and
minimum values in response to the operating clock frequency inquiry.
Command H'23
• Command, H'23, (1 byte): Inquiry regarding operating clock frequencies
The boot program will return the number of user boot ROM areas and their addresses in response
to the user boot ROM information inquiry.
Command H'24
• Command, H'24, (1 byte): Inquiry regarding user boot ROM information
Response H'34 Size Number of areas
Area-start address Area-last address
···
SUM
• Response, H'34, (1 byte): Response to the user boot ROM information inquiry
• Size (1 byte): The number of bytes that represents the number of areas, area-start address, and
area-last address
• Number of areas (1 byte): The number of consecutive user boot ROM areas
When the user boot ROM areas are consecutive, the number of areas returned is H'01.
• Area-start address (4 bytes): Start address of the area
• Area-last address (4 bytes): Last address of the area
There are as many groups of data representing the start and last addresses as there are areas.
• SUM (1 byte): Checksum
The boot program will return the number of user ROM areas and their addresses in response to the
user ROM information inquiry.
Command H'25
• Command, H'25, (1 byte): Inquiry regarding user ROM information
The boot program will return the number of data flash areas and their addresses in response to the
data flash information inquiry.
Command H'2B
• Command, H'2B, (1 byte): Inquiry regarding data flash information
The boot program will return the number of erased blocks and their addresses in response to the
erased block information inquiry.
Command H'26
• Command, H'26, (1 byte): Inquiry regarding erased block information
• Size (2 bytes): The number of bytes that represents the number of blocks, block-start
addresses, and block-last addresses.
• Number of blocks (1 byte): The number of erased blocks
• Block-start address (4 bytes): Start address of a block
• Block-last Address (4 bytes): Last address of a block
There are as many groups of data representing the start and last addresses as there are blocks.
• SUM (1 byte): Checksum
The boot program will return the programming unit used to program data in response to the
programming unit inquiry.
Command H'27
• Command, H'27, (1 byte): Inquiry regarding programming unit
The boot program will set a new bit rate and return the new bit rate in response to the new bit-rate
selection.
This selection should be sent after sending the clock mode selection command.
Response H'06
• Response, H'06, (1 byte): Response to selection of a new bit rate
When it is possible to set the bit rate, the response will be ACK.
1. Input frequency
The received value of the input frequency is checked to ensure that it is within the range of
minimum to maximum frequencies which matches the clock modes of the specified device. When
the value is out of this range, an input-frequency error is generated.
2. Multiplication ratio
The received value of the multiplication ratio or division ratio is checked to ensure that it matches
a multiplication or division ratio for the clock modes of the specified device. When the value is
out of this range, an input-frequency error is generated.
The calculated operating frequency should be checked to ensure that it is within the range of
minimum to maximum frequencies which are available with the clock modes of the specified
device. When it is out of this range, an operating frequency error is generated.
4. Bit rate
To facilitate error checking, the value (n) of clock select (CKS) in the serial mode register (SMR),
and the value (N) in the bit rate register (BRR), which are found from the peripheral operating
clock frequency (φ) and bit rate (B), are used to calculate the error rate to ensure that it is less than
4%. If the error is 4% or more, a bit rate error is generated. The error is calculated using the
following expression:
φ × 106
Error (%) = {[ ] − 1} × 100
(N + 1) × B × 64 × 2(2×n − 1)
When the new bit rate is selectable, the rate will be set in the register after sending ACK in
response. The host will send an ACK with the new bit rate for confirmation and the boot program
will response with that rate.
Confirmation H'06
• Confirmation, H'06, (1 byte): Confirmation of a new bit rate
Response H'06
• Response, H'06, (1 byte): Response to confirmation of a new bit rate
H'06 (ACK)
Waiting for one-bit period
at the specified bit rate
The boot program will transfer the erasing program, and erase the user ROM areas in response to
the transition to programming/erasing state. On completion of this erasure, ACK will be returned
and the programming/erasing state will be entered.
The host should select the device code, clock mode, and new bit rate with device selection, clock-
mode selection, and new bit-rate selection commands, and then send the command for the
transition to programming/erasing state. These procedures should be carried out before sending of
the programming selection command or program data.
Command H'40
• Command, H'40, (1 byte): Transition to programming/erasing state
Response H'06
• Response, H'06, (1 byte): Response to transition to programming/erasing state
The boot program will send ACK when the user ROM has been erased by the transferred
erasing program.
A command error will occur when a command is undefined, the order of commands is incorrect,
or a command is unacceptable. Issuing a clock-mode selection command before a device selection
or an inquiry command after the transition to programming/erasing state command, are examples.
1. A supported device inquiry (H'20) should be made to inquire about the supported devices.
2. The device should be selected from among those described by the returned information and set
with a device-selection (H'10) command.
3. A clock-mode inquiry (H'21) should be made to inquire about the supported clock modes.
4. The clock mode should be selected from among those described by the returned information
and set.
5. After selection of the device and clock mode, inquiries for other required information should
be made, such as the multiplication-ratio inquiry (H'22) or operating frequency inquiry (H'23),
which are needed for a new bit-rate selection.
6. A new bit rate should be selected with the new bit-rate selection (H'3F) command, according
to the returned information on multiplication ratios and operating frequencies.
7. After selection of the device and clock mode, a user ROM information inquiry (H'25), erased
block information inquiry (H'26), and programming unit inquiry (H'27) should be made to
inquire about the programming/erasing information of the user ROM.
8. After making inquiries and selecting a new bit rate, issue the transition to
programming/erasing state command (H'40). The boot program will then enter the
programming/erasing state.
A programming selection command makes the boot program select the programming method, an
128-byte programming command makes it program the memory with data, and an erasing
selection command and block erasing command make it erase the block. The
programming/erasing commands are listed in table 23.10.
• Programming
Programming is executed by a programming-selection command and a 128-byte programming
command.
Firstly, the host should send the programming-selection command and select the programming
method and programming MATs. There are two programming selection commands according
to the area and method for programming.
(1) User boot ROM programming selection
(2) User ROM programming selection (including the data flash)
After issuing the programming selection command, the host should send the 128-byte
programming command. The 128-byte programming command that follows the selection
command represents the data programmed according to the method specified by the selection
command. When more than 128-byte data is programmed, 128-byte commands should
repeatedly be executed. Sending a 128-byte programming command with H'FFFFFFFF as the
address will stop the programming. On completion of programming, the boot program will
wait for selection of programming or erasing.
Where the sequence of programming operations that is executed includes programming with
another method or of another MAT, the procedure must be repeated from the programming
selection command.
The sequence for programming-selection and 128-byte programming commands is shown in
figure 23.17.
ACK
ACK
The boot program will transfer a program for programming in response to the user boot ROM
programming selection. The data is programmed to the user boot ROM areas by the transferred
program for programming.
Command H'42
• Command, H'42, (1 byte): User boot ROM programming selection
Response H'06
• Response, H'06, (1 byte): Response to user boot ROM programming selection
When the programming program has been transferred, the boot program will return ACK.
The boot program will transfer a program for programming in response to the user ROM
programming selection. The data is programmed to the user ROM areas by the transferred
program for programming.
Command H'43
• Command, H'43, (1 byte): User ROM programming selection
Response H'06
• Response, H'06, (1 byte): Response to user ROM programming selection
When the programming program has been transferred, the boot program will return ACK.
The boot program will use the programming program transferred by the programming selection to
program the user boot ROM and user ROM areas in response to the n-byte programming.
Response H'06
• Response, H'06, (1 byte): Response to 128-byte programming
On completion of programming, the boot program will return ACK.
The specified address should match the unit for programming of data. For example, when the
programming is in 128-byte units, the lower byte of the address should be H'00 or H'80.
When there are less than 128 bytes of data to be programmed, the host should fill the rest with
H'FF.
Sending the 128-byte programming command with the address of H'FFFFFFFF will stop the
programming operation. The boot program will interpret this as the end of the programming and
wait for selection of programming or erasing.
Response H'06
• Response, H'06, (1 byte): Response to 128-byte programming
On completion of programming, the boot program will return ACK.
(10) Erasure
Erasure is performed with the erasure selection and block erasure command.
Firstly, erasure is selected by the erasure selection command and the boot program then erases the
specified block. The command should be repeatedly executed if two or more blocks are to be
erased. Sending a block-erasure command from the host with the block number H'FF will stop the
erasure operating. On completion of erasing, the boot program will wait for selection of
programming or erasing.
The sequences of the issuing of erasure selection commands and the erasure of data are shown in
figure 23.18.
ACK
ACK
Erasure (H'FF)
ACK
The boot program will transfer the erasure program in response to the erasure selection. User
ROM data is erased by the transferred erasure program.
Command H'48
• Command, H'48, (1 byte): Erasure selection
Response H'06
• Response, H'06, (1 byte): Response for erasure selection
After the erasure program has been transferred, the boot program will return ACK.
The boot program will erase the contents of the specified block in response to the block erasure.
Response H'06
• Response, H'06, (1 byte): Response to Erasure
After erasure has been completed, the boot program will return ACK.
The boot program will return the data stored in the specified address in response to the memory
read.
The boot program will add all the data bytes in the user boot ROM area and return the result in
response to the user boot ROM sum check.
Command H'4A
• Command, H'4A, (1 byte): Sum check for user boot ROM
Response H'5A Size Checksum of user boot ROM SUM
• Response, H'5A, (1 byte): Response to the user boot ROM sum check
• Size (1 byte): The number of bytes that represents the checksum
This is fixed to 4.
• Checksum of user boot ROM (4 bytes): Result of checksum calculation for the user boot ROM
area; the total of all the data in the area, in byte units.
• SUM (1 byte): Sum check for data being transmitted
The boot program will add all the data bytes in the user ROM area and return the result in
response to the user ROM sum check.
Command H'4B
• Command, H'4B, (1 byte): Sum check for user ROM
Response H'5B Size Checksum of user ROM SUM
• Response, H'5B, (1 byte): Response to the user ROM sum check
• Size (1 byte): The number of bytes that represents the checksum
This is fixed to 4.
• Checksum of user ROM (4 bytes): Result of checksum calculation for the user ROM area; the
total of all the data in the area, in byte units.
• SUM (1 byte): Sum check for data being transmitted
The boot program will add all the data bytes in the data flash area and return the result in response
to the data flash sum check.
Command H'61
• Command, H'61, (1 byte): Sum check for data flash
Response H'71 Size Checksum of data flash SUM
• Response, H'71, (1 byte): Response to the data flash sum check
• Size (1 byte): The number of bytes that represents the checksum
This is fixed to 4.
• Checksum of data flash (4 bytes): Result of checksum calculation for the data flash area; the
total of all the data in the area, in byte units.
• SUM (1 byte): Sum check for data being transmitted
The boot program will check to see if the whole user boot ROM area is blank and return the result
in response to the user boot ROM blank check.
Command H'4C
• Command, H'4C, (1 byte): Blank check for user boot ROM
Response H'06
• Response, H'06, (1 byte): Response to the user boot ROM blank check
If all user boot ROM areas are blank (H'FF), the boot program will return ACK.
Error response H'CC H'52
• Error response, H'CC, (1 byte): Error response to blank check for user boot ROM
• Error code, H'52, (1 byte): Erasure incomplete error
The boot program will check to see if the whole user ROM area is blank and return the result in
response to the user ROM blank check.
Command H'4D
• Command, H'4D, (1 byte): Blank check for user ROM
Response H'06
• Response, H'06, (1 byte): Response to the user ROM blank check
If all user ROM areas are blank (H'FF), the boot program will return ACK.
Error response H'CD H'52
• Error response, H'CD, (1 byte): Error response to blank check for user ROM
• Error code, H'52, (1 byte): Erasure incomplete error
The boot program will check to see if the whole data flash area is blank and return the result in
response to the data flash blank check.
Command H'62
• Command, H'62, (1 byte): Blank check for data flash
Response H'06
• Response, H'06, (1 byte): Response to the data flash blank check
If all data flash areas are blank (H'FF), the boot program will return ACK.
Error response H'E2 H'52
• Error response, H'E2, (1 byte): Error response to blank check for data flash
• Error code, H'52, (1 byte): Erasure incomplete error
The lock bit for an area of user ROM is read, and the result is returned.
• Upper address (1 byte): Higher-order bits (bits 16 to 23) of the address where the block ends
• SUM (1 byte): Sum check
Response STATUS
• STATUS (1 byte): The value 0 for bit 6 indicates the locked state.
• STATUS (1 byte): The value 1 for bit 6 indicates the unlocked state.
Error Response H'F1 ERROR
• Error response H'F1 (1 byte): Error response to a lock-bit state read command
• ERROR (1 byte): Error code
H'11: Sum check error
H'2A: Address error. This error indicates that the specified block address is incorrect.
Command H'7A
• Command H'7A (1 byte): Enabling lock bit
Response H'06
• Response H'06 (1 byte): Response to an enabling-lock-bit command (ACK code)
Command H'75
• Command H'75 (1 byte): Disabling lock bit
Response H'06
• Response H'06 (1 byte): Response to a disabling-lock-bit command (ACK code)
The boot program will return indications of its present state and error condition in response to a
boot program status inquiry command. This inquiry can be made in the inquiry/selection state or
the programming/erasing state.
Command H'4F
• Command, H'4F, (1 byte): Inquiry regarding boot program states
Response H'5F Size STATUS ERROR SUM
• Response, H'5F, (1 byte): Response to the boot program state inquiry
• Size (1 byte): The number of bytes. This is fixed to 2.
• STATUS (1 byte): State of the boot program
Code Description
H'11 Device selection wait
H'12 Clock mode selection wait
H'13 Bit rate selection wait
H'1F Programming/erasing state transition wait (Bit rate selection is completed)
H'31 Programming state for erasure
H'3F Programming/erasing selection wait (erasure completed)
H'4F Programming data transmit wait (programming completed)
H'5F Erasure block specification wait (erasure completed)
Code Description
H'00 No error
H'11 Sum check error
H'12 Program size error
H'21 Device code mismatch error
H'22 Clock mode mismatch error
H'24 Bit-rate selection disable error
H'25 Input frequency error
H'26 Multiplication ratio error
H'27 Operating frequency error
H'29 Block number error
H'2A Address error
H'2B Data size error
H'51 Erasure error
H'52 Erasure incomplete error
H'53 Programming error
H'54 Selection processing error
H'80 Command error
H'FF Bit-rate-adjustment confirmation error
A status-polling system is adopted for operation in automatic program, automatic erase, and
status-read modes. In the status-read mode, details of the system’s internal signals are output after
execution of automatic programming or automatic erasure. In programmer mode, a 12-MHz input-
clock signal should be provided.
PLLCR
STC0, STC1
EXTAL
System-clock
Oscillator PLL circuit Divider
(×1, 2)
XTAL
The frequency of the system clock from the oscillator can be changed by means of the system-
clock PLL circuit and divider. Frequency changes are made by software by means of settings in
the PLL control register (PLLCR).
SCKCR controls φ clock output and selects operation when the PLLCR register setting is changed.
Note: * The H8S/2427 group and H8S/2424 group do not have this bit. The pin always
functions as an I/O port regardless of this bit setting.
PLLCR sets the frequency multiplication factor used by the system-clock PLL circuit.
Care must be taken when writing to this register. For details, see section 24.3, System-Clock PLL
Circuit and Divider.
24.2 Oscillator
Clock pulses can be supplied by connecting a crystal resonator, or by input of an external clock.
A crystal resonator can be connected as shown in the example in figure 24.2. Select the damping
resistance Rd according to table 24.1. When a crystal resonator is used, the range of its frequencies
is from 8 to 20 MHz.
Figure 24.3 shows the equivalent circuit of the crystal resonator. Use a crystal resonator that has
the characteristics shown in table 24.2.
CL1
EXTAL
XTAL
Rd CL2 CL1 = CL2 = 10 to 22 pF
Frequency (MHz) 8 12 16 20
Rd (Ω) 200 0 0 0
CL
L Rs
XTAL EXTAL
C0
Frequency (MHz) 8 12 16 20
RS max (Ω) 80 60 50 40
C0 max (pF) 7 7 7 7
An external clock signal can be input as shown in the examples in figure 24.4. If the XTAL pin is
left open, make sure that parasitic capacitance is no more than 10 pF. When the counter clock is
input to the XTAL pin, make sure that the external clock is held high in standby mode.
Table 24.3 shows the input conditions for the external clock. When an external clock is used, the
range of its frequencies is from 8 to 20 MHz.
XTAL
tEXH tEXL
tEXr tEXf
When the frequency is changed with the system-clock PLL circuit and divider, operation varies
according to the setting of the STCS bit in SCKCR.
When STCS = 0, the setting of the changed frequency becomes valid after a transition to software
standby mode. The transition time count is performed in accordance with the setting of bits STS3
to STS0 in SBYCR. For details on SBYCR, see section 25.1.1, Standby Control Register
(SBYCR).
When STCS = 1, a change to the frequency setting becomes effective a maximum of four cycles
after the setting is changed. If the clock frequency is changed during access to an external address
space, correct operation cannot be guaranteed. Therefore, be sure to store instructions that change
the STC1 and STC0 bits and other instructions to be executed within a maximum of four cycles
after the change to the frequency setting in on-chip ROM or on-chip RAM, so that instructions do
not access an external address space before the frequency clock is switched over.
1. The following points should be noted since the frequency of φ changes according to the
settings of PLLCR.
Select a clock division ratio that is within the operation guaranteed range of clock cycle time
tcyc shown in the AC timing of the Electrical Characteristics. In other words, φ must be set to
a value between 8 MHz (minimum) and 33 MHz (maximum). The setting of φ must not be less
than 8 MHz or greater than 33 MHz.
2. All the on-chip peripheral modules operate on the φ. Therefore, note that the time processing
of modules such as a timer and SCI differ before and after changing the clock division ratio. In
addition, wait time for clearing software standby mode differs by changing the clock division
ratio. See the description, Setting Oscillation Stabilization Time after Clearing Software
Standby Mode in section 25.2.3, Software Standby Mode, for details.
3. Note that the frequency of φ will be changed when setting PLLCR while executing the external
bus cycle with the write-data-buffer function.
Since various characteristics related to the resonator are closely linked to the user’s board design,
thorough evaluation is necessary on the user’s part, using the resonator connection examples
shown in this section as a guide. As the parameters for the oscillation circuit will depend on the
floating capacitance of the resonator and the user board, the parameters should be determined in
consultation with the resonator manufacturer. The design must ensure that a voltage exceeding the
maximum rating is not applied to the resonator pin.
When using the crystal resonator, place the crystal resonator and its load capacitors as close as
possible to the XTAL and EXTAL pins. Other signal lines should be routed away from the
oscillation circuit to prevent induction from interfering with correct oscillation. See figure 24.6.
CL2
XTAL
EXTAL
CL1
Figure 24.7 shows the external circuitry recommended for the PLL circuit. Separate PLLVcc and
PLLVss from the other Vcc and Vss lines at the board power supply source, and be sure to insert
bypass capacitors CPB and CB close to the pins.
PLLVCC
CPB: 0.1 µF*
PLLVSS
VCC
CB: 0.1 µF*
VSS
This LSI’s operating modes are high-speed mode and six power down modes:
Sleep mode is a CPU state, clock division mode is an on-chip peripheral function (including bus
masters and the CPU) state, and module stop function is an on-chip peripheral function (including
bus masters other than the CPU) state. A combination of these modes can be set.
Table 25.1 shows the internal states of this LSI in each mode. Figure 25.1 shows the mode
transition diagram.
Notes: • From any state, a transition to hardware standby mode occurs when STBY is driven low.
• From any state except hardware standby mode, a transition to the reset state occurs
when RES is driven low.
1. NMI, IRQ0 to IRQ15*3, 8-bit timer interrupts, watchdog timer interrupts.
(8-bit timer interrupts are valid when MSTP0 = 0.)
2. NMI, IRQ0 to IRQ15*3
(IRQ0 to IRQ15*3 are valid when the corresponding bit in SSIER is 1.)
3. IRQ8 to IRQ15 are not supported by the H8S/2425 Group.
MSTPCR performs module stop state control. Setting a bit to 1, the corresponding module enters
the module stop state, while clearing the bit to 0 clears the module stop state.
• MSTPCRH
• MSTPCRL
EXMSTPCR performs module stop state control. Setting a bit to 1, the corresponding module
enters the module stop state, while clearing the bit to 0 clears the module stop state. When entering
all module clocks stop mode, set EXMSTPCR to H'FFFF.
• EXMSTPCRH
• EXMSTPCRL
RMMSTPCR performs module stop state control of the RAM area. Setting bits MSTP32 to
MSTP39 to 1 stops the corresponding on-chip RAM area. During access to an on-chip RAM area,
do not set bits MSTP32 to MSTP39 corresponding to the area to 1. While bit RAME in SYSCR is
1, and bits MSTP32 to MSTP39 are 1, do not access the corresponding RAM area.
• RMMSTPCRH
• RMMSTPCRL
25.2 Operation
When bits STC1 and STC0 in PLLCR are set to 11, a transition is made to clock division mode,
and the system clock frequency is divided with respect to the oscillator frequency. Clock division
mode is cancelled by clearing bits STC1 and STC0 to a value other than 11. The timings of
transition and clearing depend on the STCS bit setting in SCKCR. For the operation at transition
and clearing, see section 24.3, System-Clock PLL Circuit and Divider.
If a SLEEP instruction is executed while the SSBY bit in SBYCR is cleared to 0, the chip enters
sleep mode. When sleep mode is cleared by an interrupt, clock division mode is restored.
If a SLEEP instruction is executed while the SSBY bit in SBYCR is set to 1, the chip enters
software standby mode. When software standby mode is cleared by an external or internal
interrupt, clock division mode is restored.
When the RES pin is driven low, the reset state is entered and clock division mode is cleared. The
same applies to a reset caused by watchdog timer overflow.
When the STBY pin is driven low, a transition is made to hardware standby mode.
When the SLEEP instruction is executed while the SSBY bit is 0 in SBYCR, the CPU enters the
sleep mode. In sleep mode, CPU operation stops but the contents of the CPU’s internal registers
are retained. Other peripheral functions do not stop.
Sleep mode is exited by any interrupt, or signals at the RES, or STBY pins.
If a SLEEP instruction is executed when the SSBY bit in SBYCR is set to 1, software standby
mode is entered. In this mode, the CPU, on-chip peripheral functions, and oscillator all stop.
However, the contents of the CPU's internal registers, RAM data, and the states of on-chip
peripheral functions other than the IIC2 and SSU, and the states of I/O ports, are retained. Whether
the address bus and bus control signals are placed in the high-impedance state or retain the output
state can be specified by the OPE bit in SBYCR.
In this mode the oscillator stops, and therefore power dissipation is significantly reduced.
Software standby mode is cleared by an external interrupt (NMI pin, or pins IRQ0 to IRQ15*), or
by means of the RES pin or STBY pin. Setting the SSI bit in SSIER to 1 enables IRQ0 to IRQ15*
to be used as software standby mode clearing sources.
(3) Setting Oscillation Stabilization Time after Clearing Software Standby Mode
φ* [MHz]
Standby
STS3 STS2 STS1 STS0 Time 33 25 20 13 10 8 Unit
0 0 0 0 Reserved ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ µs
1 Reserved ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
1 0 Reserved ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
1 Reserved ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
1 0 0 Reserved ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
1 64 1.9 2.6 3.2 4.9 6.4 8.0
1 0 512 15.5 20.5 25.6 39.4 51.2 64.0
1 1024 31.0 41.0 51.2 78.8 102.4 128.0
1 0 0 0 2048 62.1 81.9 102.4 157.5 204.8 256.0
1 4096 0.12 0.16 0.20 0.32 0.41 0.51 ms
1 0 16384 0.50 0.66 0.82 1.26 1.64 2.05
1 32765 0.99 1.31 1.64 2.52 3.28 4.10
1 0 0 65536 1.99 2.62 3.28 5.04 6.55 8.19
1 131072 3.97 5.24 6.55 10.08 13.11 16.38
1 0 262144 7.94 10.49 13.11 20.16 26.21 32.77
1 524288 15.89 20.97 26.21 40.33 52.43 65.54
Note: * φ is the frequency divider output.
Figure 25.2 shows an example in which a transition is made to software standby mode at the
falling edge on the NMI pin, and software standby mode is cleared at the rising edge on the NMI
pin.
In this example, after an NMI interrupt is accepted with the NMIEG bit in INTCR cleared to 0
(falling edge specification), the NMIEG bit is set to 1 (rising edge specification). And after the
SSBY bit is set to 1, a SLEEP instruction is executed, causing a transition to software standby
mode.
Software standby mode is then cleared at the rising edge on the NMI pin.
Oscillator
NMI
NMIEG
SSBY
SLEEP instruction
When the STBY pin is driven low, a transition is made to hardware standby mode from any mode.
In hardware standby mode, all functions enter the reset state and stop operation, resulting in a
significant reduction in power dissipation. As long as the prescribed voltage is supplied, on-chip
RAM data is retained. I/O ports are set to the high-impedance state.
In order to retain on-chip RAM data, the RAME bit in SYSCR should be cleared to 0 before
driving the STBY pin low. Do not change the state of the mode pins (MD2 to MD0) while this
LSI is in hardware standby mode.
Hardware standby mode is cleared by means of the STBY pin and the RES pin. When the STBY
pin is driven high while the RES pin is low, the reset state is set and clock oscillation is started.
Ensure that the RES pin is held low until the clock oscillator stabilizes (for details on the
oscillation stabilization time, see table 25.2). When the RES pin is subsequently driven high, a
transition is made to the program execution state via the reset exception handling state.
When the STBY pin is driven low after the RES pin has been driven low, a transition is made to
hardware standby mode. Hardware standby mode is cleared by driving the STBY pin high,
waiting for the oscillation stabilization time, then changing the RES pin from low to high.
Oscillator
RES
STBY
Oscillation Reset
stabilization exception
time handling
When entering hardware standby mode immediately after the power is supplied, the RES signal
must be driven low for a given period with retaining the STBY signal high. After the RES signal is
canceled, drive the STBY signal low.
RES
(2) Reset period
STBY
Module stop function can be set for individual on-chip peripheral modules.
When an MSTP bit is cleared to 0, the corresponding module stop state is cleared and the module
starts operating at the end of the bus cycle. In the module stop state, the internal state of the SSU is
reset but the internal states of the other peripheral modules are retained.
After reset clearance, all modules other than the EXDMAC*, DMAC, DTC, and on-chip RAM are
in the module stop state.
The module registers that are set in the module stop state cannot be read or written to.
The module stop function for RAM is only effective for on-chip RAM. When an area of on-chip
RAM is set up as an external address space by bits RAME and EXPE in SYSCR, the resulting
external space is accessible regardless of the module stop setting. Table 25.3 lists the kinds of
operation in case of access to the on-chip RAM area.
Table 25.3 Combinations of SYSCR Settings and Operation in Access to On-Chip RAM
Register Settings
RAME EXPE mstp Target for Access Description
1 X 1 ⎯ This area is not readable/writable and access is
prohibited.
0 On-chip RAM
0 1 X External address
space
0 X ⎯ This area is not readable/writable and access is
prohibited.
When the ACSE bit in MSTPCRH is set to 1 and module stop state is set for all the on-chip
peripheral functions controlled by MSTPCR or EXMSTPCR (MSTPCR = H'FFFF, EXMSTPCR
= H'FFFF), or for all the on-chip peripheral functions except the 8-bit timer (MSTPCR = H'FFFE,
EXMSTPCR = H'FFFF), executing a SLEEP instruction while the SSBY bit in SBYCR is cleared
to 0 will cause all the on-chip peripheral functions (except the 8-bit timer and watchdog timer), the
bus controller, and the I/O ports to stop operating, and a transition to be made to all module clocks
stop mode at the end of the bus cycle.
Operation or stopping of the 8-bit timer can be selected by means of the MSTP0 bit.
To further reduce the current consumption in all module clocks stop mode, stop the modules
controlled by RMMSTPCR (RMMSTPCR = H'FFFF).
All module clocks stop mode is cleared by an external interrupt (NMI, IRQ0 to IRQ15* pins),
RES pin input, or an internal interrupt (8-bit timer, watchdog timer), and the CPU returns to the
normal program execution state via the exception handling state. All module clocks stop mode is
not cleared if interrupts are disabled, if interrupts other than NMI are masked by the CPU, or if the
relevant interrupt is designated as a DTC activation source.
When the STBY pin is driven low, a transition is made to hardware standby mode.
In software standby mode, I/O port states are retained. Therefore, there is no reduction in current
dissipation for the output current when a high-level signal is output.
Depending on the operating status of the EXDMAC, DMAC, or DTC, the MSTP12 to MSTP14
may not be set to 1. Setting of the EXDMAC, DMAC, or DTC module stop state should be carried
out only when the respective module is not activated.
For details, see section 9, EXDMA Controller (EXDMAC), section 8, DMA Controller (DMAC),
and section 10, Data Transfer Controller (DTC).
Relevant interrupt operations cannot be performed in the module stop state. Consequently, if the
module stop state is entered when an interrupt has been requested, it will not be possible to clear
the CPU interrupt source or the DMAC or DTC activation source.
Interrupts should therefore be disabled before entering the module stop state.
• Select the clock division ratio by the STC1 and STC0 bits so that the frequency of φ is within
the operation guaranteed range of clock cycle time tcyc shown in the Electrical Characteristics.
In other words, the frequency of φ must be 8 MHz or higher; be careful not so specify φ < 8
MHz.
• All the on-chip peripheral modules operate on the φ. Therefore, note that the time processing
of modules such as a timer and SCI differ before and after changing the clock division ratio. In
addition, the wait time for clearing software standby mode differs by changing the clock
division ratio.
• Note that the frequency of φ will be changed by changing the clock division ratio.
2. Register bits
• Bit configurations of the registers are described in the same order as the register addresses.
• Reserved bits are indicated by ⎯ in the bit name column.
• For the registers of 16 or 32 bits, the MSB is described first.
The number of access states indicates the number of states based on the specified reference clock.
Notes: 1. If the pulse output group 2 and pulse output group 3 output triggers are the same
according to the PCR setting, the NDRH address will be H'FF4C, and if different, the
address of NDRH for group 2 will be H'FF4E, and that for group 3 will be H'FF4C.
Similarly, if the pulse output group 0 and pulse output group 1 output triggers are the
same according to the PCR setting, the NDRL address will be H'FF4D, and if different,
the address of NDRL for group 0 will be H'FF4F, and that for group 1 will be H'FF4D.
2. For writing, see section 15.6.1, Notes on Register Access.
3. Not supported by the H8S/2425 Group.
Each line covers eight bits, and 16-bit and 32-bit registers are shown as 2 or 4 lines, respectively.
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
MAR0 bit31 bit30 bit29 bit28 bit27 bit26 bit25 bit24 DMAC
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
MAR3 bit31 bit30 bit29 bit28 bit27 bit26 bit25 bit24 DMAC
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
ETCRB4 bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 DMAC
FSICR1 SRES SPIE FRDE AAIE CPHS CPOS SSSEL FASTSEL FSI
SAR ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
DAR ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
CRA ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
CRB ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
RMMSTPCRH MSTP47 MSTP46 MSTP45 MSTP44 MSTP43 MSTP42 MSTP41 MSTP40 SYSTEM
MDLCFGR ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ DMCOMMD
DTCERI DTCEI7 DTCEI6 DTCEI5 DTCEI4 DTCEI3 DTCEI2 DTCEI1 DTCEI0 DTC*1
ADDRA_1 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 A/D_1
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
ADDRD_1 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 A/D_1
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
TCR_6 CCLR2 CCLR1 CCLR0 CKEG1 CKEG0 TPSC2 TPSC1 TPSC0 TPU_6
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
TIOR_7 IOB3 IOB2 IOB1 IOB0 IOA3 IOA2 IOA1 IOA0 TPU_7
TCR_9 CCLR2 CCLR1 CCLR0 CKEG1 CKEG0 TPSC2 TPSC1 TPSC0 TPU_9
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
TGRC_9 Bit15 Bit14 Bit13 Bit12 Bit11 Bit10 Bit9 Bit8 TPU_9
P1ODR P17ODR P16ODR P15ODR P14ODR P13ODR P12ODR P11ODR P10ODR PORT
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
PCODR PC7ODR PC6ODR PC5ODR PC4ODR PC3ODR PC2ODR PC1ODR PC0ODR PORT
ICCRA_0 ICE RCVD MST TRS CKS3 CKS2 CKS1 CKS0 IIC2_0
ICCRA_1 ICE RCVD MST TRS CKS3 CKS2 CKS1 CKS0 IIC2_1
ICCRA_2 ICE RCVD MST TRS CKS3 CKS2 CKS1 CKS0 IIC2_2
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
ICCRA_3 ICE RCVD MST TRS CKS3 CKS2 CKS1 CKS0 IIC2_3
EDMDR0 EDA BEF EDRAKE ETENDE EDREQS AMS MDS1 MDS0 EXDMAC
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
EDSAR0 bit31 bit30 bit29 bit28 bit27 bit26 bit25 bit24 EXDMAC*5
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
EDTCR2 bit31 bit30 bit29 bit28 bit27 bit26 bit25 bit24 EXDMAC*5
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
P1DDR P17DDR P16DDR P15DDR P14DDR P13DDR P12DDR P11DDR P10DDR PORT
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
PDDDR PD7DDR PD6DDR PD5DDR PD4DDR PD3DDR PD2DDR PD1DDR PD0DDR PORT
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
RDR_4 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 SCI_4,
Smart card
SCMR_4 BCP2 ⎯ ⎯ ⎯ SDIR SINV ⎯ SMIF
interface_4
SEMR_4 ⎯ ⎯ ⎯ ⎯ ABCS ACS2 ACS1 ACS0
TCR_3 CCLR2 CCLR1 CCLR0 CKEG1 CKEG0 TPSC2 TPSC1 TPSC0 TPU_3
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
TIOR_5 IOB3 IOB2 IOB1 IOB0 IOA3 IOA2 IOA1 IOA0 TPU_5
FLMDBPR ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ FMDBPT0
FLMMATS ⎯ ⎯ FMMS ⎯ ⎯ ⎯ ⎯ ⎯
ABWCR ABW7 ABW6 ABW5 ABW4 ABW3 ABW2 ABW1 ABW0 BSC
⎯ ⎯ ⎯ ⎯ ⎯ ICIS2 ⎯ ⎯
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
DTCVBR bit31 bit30 bit29 bit28 bit27 bit26 bit25 bit24 DTC
DMACRS0 DTSZ DTID MDS DTDIR DTF3 DTF2 DTF1 DTF0 DMAC
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
DMABCR FAE1 FAE0 SAE1 SAE0 DTA3 DTA2 DTA1 DTA0 DMAC
DTCERA DTCEA7 DTCEA6 DTCEA5 DTCEA4 DTCEA3 DTCEA2 DTCEA1 DTCEA0 DTC
PCR G3CMS1 G3CMS0 G2CMS1 G2CMS0 G1CMS1 G1CMS0 G0CMS1 G0CMS0 PPG
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
PODRL POD7 POD6 POD5 POD4 POD3 POD2 POD1 POD0 PPG
4
NDRHH* NDR15 NDR14 NDR13 NDR12 NDR11 NDR10 NDR9 NDR8
4
NDRLH* NDR7 NDR6 NDR5 NDR4 NDR3 NDR2 NDR1 NDR0
NDRHL* 4
⎯ ⎯ ⎯ ⎯ NDR11 NDR10 NDR9 NDR8
NDRLL* 4
⎯ ⎯ ⎯ ⎯ NDR3 NDR2 NDR1 NDR1
PORT1 P17 P16 P15 P14 P13 P12 P11 P10 PORT
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
RDR_2 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 SCI_2,
Smart card
SCMR_2 BCP2 ⎯ ⎯ ⎯ SDIR SINV ⎯ SMIF
interface _2
SEMR_2 ⎯ ⎯ ⎯ ⎯ ABCS ACS2 ACS1 ACS0
ADDRA_0 AD9 AD8 AD7 AD6 AD5 AD4 AD3 AD2 A/D_0
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
AD1 AD0 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
DADR2 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 D/A
TCR_0 CMIEB CMIEA OVIE CCLR1 CCLR0 CKS2 CKS1 CKS0 TMR_0
TCR_1 CMIEB CMIEA OVIE CCLR1 CCLR0 CKS2 CKS1 CKS0 TMR_1
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
TCNT_0 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 TMR_1
TCR_0 CCLR2 CCLR1 CCLR0 CKEG1 CKEG0 TPSC2 TPSC1 TPSC0 TPU_0
Register
Abbreviation Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Module
Notes: 1. Loaded in on-chip RAM. The bus width is 32 bits when the DTC accesses this area as
register information, and 16 bits otherwise.
2. For normal mode
3. For smart card interface mode
4. If the pulse output group 2 and pulse output group 3 output triggers are the same
according to the PCR setting, the NDRH address will be H'FF4C, and if different, the
address of NDRH for group 2 will be H'FF4E, and that for group 3 will be H'FF4C.
Similarly, if the pulse output group 0 and pulse output group 1 output triggers are the
same according to the PCR setting, the NDRL address will be H'FF4D, and if different,
the address of NDRL for group 0 will be H'FF4F, and that for group 1 will be H'FF4D.
5. Not supported by the H8S/2425 Group.
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
PORT1 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ PORT
PORT2 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORT3 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORT4 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORT5 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORT6 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORT8 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORT9 ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTA ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTB ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTC ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTD ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTE ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTF ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTG ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
PORTH ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
PORTJ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯ ⎯
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
All
Module
Register High- Clock Module Clock Software Hardware
Abbreviation Reset Speed Division Sleep Stop Stop Standby Standby Module
27.1.2 DC Characteristics
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Test
Item Symbol Min. Typ. Max. Unit Conditions
Output high All output pins VOH VCC − 0.3 ⎯ ⎯ V IOH = −200 μA
voltage
VCC − 0.5 ⎯ ⎯ V IOH = −1 mA
VCC − 0.8 ⎯ ⎯ V IOH = −2 mA
Output low All output pins VOL ⎯ ⎯ 0.4 V IOL = 4.0 mA
voltage
⎯ ⎯ IOL = 8.0 mA
4
P26 and P27* , 0.4 V
4
P32 to P35* ,
4
P50 and P51*
Input leakage RES |Iin| ⎯ ⎯ 10.0 μA Vin = 0.5 to
current VCC −0.5 V
STBY, NMI, ⎯ ⎯ 1.0 μA
MD2 to MD0
Ports 4 and 9 ⎯ ⎯ 1.0 μA Vin = 0.5 to
AVCC −0.5 V
Notes: Pins of port 2, P32 to P35, P50 and P51, and PJ0 to PJ2 are 5-V tolerant.
1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. When used as IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
3. When used as other than IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
4. When used as SCL or SDA.
5. When used as SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V*
Test
Item Symbol Min. Typ. Max. Unit Conditions
Three-state Ports 1 to 3, | ITSI | ⎯ ⎯ 1.0 μA Vin = 0.5 to
leakage current P50 to P53, VCC −0.5 V
(off state) ports 6 and 8,
ports A to I
Input pull-up Ports A to E −Ip 10 ⎯ 300 μA VCC = 2.7 to
MOS current 3.6 V
Vin = 0 V
Input RES Cin ⎯ ⎯ 30 pF Vin = 0 V
capacitance NMI ⎯ ⎯ 30 pF f = 1 MHz
All input pins ⎯ ⎯ 18 pF Ta = 25°C
except RES
and NMI
Supply current*2 Normal operation ⎯ f = 25 MHz
4
ICC* 35 45 mA
(3.3 V)
Sleep mode ⎯ 25 35 mA f = 25 MHz
(3.3 V)
Standby mode*3 ⎯ 20 80 μA Ta ≤ 50°C
⎯ 80 500 μA 50°C < Ta
Analog power During A/D and AICC ⎯ 0.5 2.0 mA When channel
supply current D/A conversion (3.3 V) 1 is in use
Idle ⎯ 0.01 5.0 μA When channel
1 is in use
Reference During A/D and AICC ⎯ 0.5 1.0 mA
power supply D/A conversion (3.3 V)
current
Idle ⎯ 0.01 5.0 μA
RAM standby voltage VRAM 2.5 ⎯ ⎯ V
⎯ ⎯
5
VCC start voltage* VCC start 0.8 V
VCC rising slope *5 SVCC 0.02 ⎯ 20 ms/V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. Supply current values are for VIHmin = VCC −0.2 V and VILmax = 0.2 V with all output pins
unloaded and all input pull-up MOSs in the off state.
3. The values are for VRAM ≤ VCC < 2.7 V, VIHmin = VCC × 0.9, and VILmax = 0.3 V.
4. ICC depends on VCC and f as follows:
ICCmax = 5.2 (mA) + 1.66 (mA/(MHz)) × f (normal operation)
ICCmax = 2.6 (mA) + 1.28 (mA/(MHz)) × f (sleep mode)
5. Applied when RES is low at power-on.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V*
27.1.3 AC Characteristics
The following shows the timings of the clock, control signals, bus, DMAC, EXDMAC, and on-
chip peripheral functions.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
3V
RL
C RH
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Test
Item Symbol Min. Max. Unit Conditions
Address delay time tAD ⎯ 20 ns Figures 27.10
to 27.25, 27.31
Address setup time 1 tAS1 0.5 × tcyc −13 ⎯ ns
and 27.32
Address setup time 2 tAS2 1.0 × tcyc −13 ⎯ ns
Address setup time 3 tAS3 1.5 × tcyc −13 ⎯ ns
Address setup time 4 tAS4 2.0 × tcyc −13 ⎯ ns
Address hold time 1 tAH1 0.5 × tcyc −8 ⎯ ns
Address hold time 2 tAH2 1.0 × tcyc −8 ⎯ ns
Address hold time 3 tAH3 1.5 × tcyc −8 ⎯ ns
CS delay time 1 tCSD1 ⎯ 15 ns
CS delay time 2 tCSD2 ⎯ 15 ns
CS delay time 3 tCSD3 ⎯ 20 ns
AS delay time tASD ⎯ 15 ns
RD delay time 1 tRSD1 ⎯ 15 ns
RD delay time 2 tRSD2 ⎯ 15 ns
Read data setup time 1 tRDS1 15 ⎯ ns
Read data setup time 2 tRDS2 15 ⎯ ns
Read data hold time 1 tRDH1 0 ⎯ ns
Read data hold time 2 tRDH2 0 ⎯ ns
Read data access time 1 tAC1 ⎯ 1.0 × tcyc − 25 ns
Read data access time 2 tAC2 ⎯ 1.5 × tcyc − 25 ns
Read data access time 3 tAC3 ⎯ 2.0 × tcyc − 25 ns
Read data access time 4 tAC4 ⎯ 2.5 × tcyc − 25 ns
Read data access time 5 tAC5 ⎯ 1.0 × tcyc − 25 ns
Read data access time 6 tAC6 ⎯ 2.0 × tcyc − 25 ns
Read data access time 7 tAC7 ⎯ 4.0 × tcyc − 25 ns
Test
Item Symbol Min. Max. Unit Conditions
Read data access time 8 tAC8 ⎯ 3.0 × tcyc − 25 ns Figures 27.10
to 27.25, 27.31
Counter address read data access tAA1 ⎯ 1.0 × tcyc − 25 ns
and 27.32
time 1
Counter address read data access tAA2 ⎯ 1.5 × tcyc − 25 ns
time 2
Counter address read data access tAA3 ⎯ 2.0 × tcyc − 25 ns
time 3
Counter address read data access tAA4 ⎯ 2.5 × tcyc − 25 ns
time 4
Counter address read data access tAA5 ⎯ 3.0 × tcyc − 25 ns
time 5
Counter address read data access tAA6 ⎯ 4.0 × tcyc − 25 ns
time 6
Multiplexed address delay time tMAD ⎯ 20 ns
Multiplexed address setup time 1 tMAS1 0.5 × tcyc − 15 ⎯ ns
Multiplexed address setup time 2 tMAS2 1.5 × tcyc − 15 ⎯ ns
Multiplexed address hold time tMAH 1.0 × tcyc − 15 ⎯ ns
AH delay time tAHD ⎯ 15 ns
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Test
Item Symbol Min. Max. Unit Conditions
WR delay time 1 tWRD1 ⎯ 15 ns Figures 27.10
to 27.25, 27.31
WR delay time 2 tWRD2 ⎯ 15 ns
and 27.32
WR pulse width 1 tWSW1 1.0 × tcyc −13 ⎯ ns
WR pulse width 2 tWSW2 1.5 × tcyc −13 ⎯ ns
Write data delay time tWDD ⎯ 23 ns
Write data setup time 1 tWDS1 0.5 × tcyc −15 ⎯ ns
Write data setup time 2 tWDS2 1.0 × tcyc −15 ⎯ ns
Write data setup time 3 tWDS3 1.5 × tcyc −15 ⎯ ns
Write data hold time 1 tWDH1 0.5 × tcyc −13 ⎯ ns
Write data hold time 2 tWDH2 1.0 × tcyc −13 ⎯ ns
Write data hold time 3 tWDH3 1.5 × tcyc −13 ⎯ ns
Write command setup time 1 tWCS1 0.5 × tcyc −10 ⎯ ns
Write command setup time 2 tWCS2 1.0 × tcyc −10 ⎯ ns
Write command hold time 1 tWCH1 0.5 × tcyc −10 ⎯ ns
Write command hold time 2 tWCH2 1.0 × tcyc −10 ⎯ ns
Read command setup time 1 tRCS1 1.5 × tcyc −10 ⎯ ns
Read command setup time 2 tRCS2 2.0 × tcyc −10 ⎯ ns
Read command hold time tRCH 0.5 × tcyc −10 ⎯ ns
CAS delay time 1 tCASD1 ⎯ 15 ns
CAS delay time 2 tCASD2 ⎯ 15 ns
CAS setup time 1 tCSR1 0.5 × tcyc −10 ⎯ ns
CAS setup time 2 tCSR2 1.5 × tcyc −10 ⎯ ns
CAS pulse width 1 tCASW1 1.0 × tcyc −20 ⎯ ns
CAS pulse width 2 tCASW2 1.5 × tcyc −20 ⎯ ns
CAS precharge time 1 tCPW1 1.0 × tcyc −20 ⎯ ns
CAS precharge time 2 tCPW2 1.5 × tcyc −20 ⎯ ns
Test
Item Symbol Min. Max. Unit Conditions
OE delay time 1*1 tOED1 ⎯ 15 ns Figures 27.10
to 27.25, 27.31
tOED1B ⎯ 19 ns
and 27.32
OE delay time 2* ⎯
1
tOED2 15 ns
tOED2B ⎯ 19 ns
Precharge time 1 tPCH1 1.0 × tcyc −20 ⎯ ns
Precharge time 2 tPCH2 1.5 × tcyc −20 ⎯ ns
Self-refresh precharge time 1 tRPS1 2.5 × tcyc −20 ⎯ ns Figures 27.24
and 27.25
Self-refresh precharge time 2 tRPS2 3.0 × tcyc −20 ⎯ ns
WAIT setup time tWTS 25 ⎯ ns Figures 27.12,
27.18, and
WAIT hold time tWTH 1 ⎯ ns
27.32
BREQ setup time tBREQS 30 ⎯ ns Figure 27.26
BACK delay time tBACD ⎯ 15 ns
Bus floating time tBZD ⎯ 40 ns
BREQO delay time tBRQOD ⎯ 25 ns Figure 27.27
Address delay time 2*2 tAD2 1 16.5 ns Figure 27.28
CS delay time 4*2 tCSD4 1 16.5 ns Figure 27.28
2
DQM delay time* tDQMD 1 16.5 ns Figure 27.28
2 3
CKE delay time* * tCKED 1 16.5 ns Figures 27.29
and 27.30
tCKEDB 1 19 ns
⎯
2
Read data setup time 3* tRDS3 15 ns Figure 27.28
⎯
2
Read data hold time 3* tRDH3 0 ns Figure 27.28
⎯
2
Write data delay time 2* tWDD 31.5 ns Figure 27.28
Write data hold time 4*2 tWDH4 2 ⎯ ns Figure 27.28
Notes: 1. tOED1 and tOED2 correspond to the OE-A and RD, tOED1B and tOED2B correspond to the OE-B.
2. Supported only by the H8S/2427R Group.
3. tCKED corresponds to the CKE-A, tCKEDB corresponds to the CKE-B.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Standard Value
27.2.2 DC Characteristics
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Test
Item Symbol Min. Typ. Max. Unit Conditions
Output high All output pins VOH VCC − 0.3 ⎯ ⎯ V IOH = −200 μA
voltage
VCC − 0.5 ⎯ ⎯ V IOH = −1 mA
VCC − 0.8 ⎯ ⎯ V IOH = −2 mA
Output low All output pins VOL ⎯ ⎯ 0.4 V IOL = 4.0 mA
voltage
⎯ ⎯ IOL = 8.0 mA
4
P26 and P27* 0.4 V
4
P32 to P35* ,
4
P50 and P51*
Input leakage RES |Iin| ⎯ ⎯ 10.0 μA Vin = 0.5 to
current VCC −0.5 V
STBY, NMI, ⎯ ⎯ 1.0 μA
MD2 to MD0
Port 4, Port 9 ⎯ ⎯ 1.0 μA Vin = 0.5 to AVCC
−0.5 V
Notes: Pins of port 2, P32 to P35, P50 and P51, and P81 and P83 are 5-V tolerant.
1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. When used as IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
3. When used as other than IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
4. When used as SCL or SDA.
5. When used as SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Three-state Ports 1 to 3, | ITSI | ⎯ ⎯ 1.0 μA Vin = 0.5 to
leakage current P50 to P53, VCC −0.5 V
(off state) port 8,
ports A to G
Input pull-up Ports A to E −Ip 10 ⎯ 300 μA VCC = 2.7 to
MOS current 3.6 V
Vin = 0 V
Input RES Cin ⎯ ⎯ 30 pF Vin = 0 V
capacitance NMI ⎯ ⎯ 30 pF f = 1 MHz
All input pins ⎯ ⎯ 18 pF Ta = 25°C
except RES and
NMI
Supply current*2 Normal operation ICC*4 ⎯ 35 45 mA f = 25 MHz
(3.3 V)
Sleep mode ⎯ 25 35 mA f = 25 MHz
(3.3 V)
Standby mode*3 ⎯ 20 80 μA Ta ≤ 50°C
⎯ 80 500 μA 50°C < Ta
Analog power During A/D and AICC ⎯ 0.5 2.0 mA When channel
supply current D/A conversion (3.3 V) 1 is in use
Idle ⎯ 0.01 5.0 μA When channel
1 is in use
Reference power During A/D and AICC ⎯ 0.5 1.0 mA
supply current D/A conversion (3.3 V)
Idle ⎯ 0.01 5.0 μA
RAM standby voltage VRAM 2.5 ⎯ ⎯ V
⎯ ⎯
5
VCC start voltage* VCC start 0.8 V
VCC rising slope*5 SVCC 0.02 ⎯ 20 ms/V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. Supply current values are for VIHmin = VCC −0.2 V and VILmax = 0.2 V with all output pins
unloaded and all input pull-up MOSs in the off state.
3. The values are for VRAM ≤ VCC < 2.7 V, VIHmin = VCC × 0.9, and VILmax = 0.3 V.
4. ICC depends on VCC and f as follows:
ICCmax = 5.2 (mA) + 1.66 (mA/(MHz)) × f (normal operation)
ICCmax = 2.6 (mA) + 1.28 (mA/(MHz)) × f (sleep mode)
5. Applied when RES is low at power-on.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V*
27.2.3 AC Characteristics
The following shows the timings of the clock, control signals, bus, DMAC, and on-chip peripheral
functions.
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
3V
RL
C RH
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Slave 2.5 ⎯
SSU* SCS hold time Master tLAG 2.5 ⎯ tcyc Figures 27.50 to
27.53
Slave 2.5 ⎯
Data output delay Master tOD ⎯ 40 ns
time
Slave ⎯ 40
Data output hold time Master tOH -5 ⎯ ns
Slave 0 ⎯
Continuous transmit Master tTD 2.5 ⎯ tcyc
delay time
Slave 2.5 ⎯
Slave access time tSA ⎯ 1 tcyc Figures 27.52 and
27.53
Slave out release time tREL ⎯ 1 tcyc
FSI Clock cycle tCYC 40 ⎯ ns Figure 27.54
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Conditions: VCC = 2.7 V to 3.6 V, AVCC = 2.7 V to 3.6 V, Vref = 2.7 V to AVCC,
VSS = AVSS = 0 V, φ = 8 MHz to 25 MHz
Standard Value
27.3.2 DC Characteristics
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Test
Item Symbol Min. Typ. Max. Unit Conditions
Output high All output pins VOH VCC − 0.3 ⎯ ⎯ V IOH = −200 μA
voltage
VCC − 0.5 ⎯ ⎯ V IOH = −1 mA
VCC − 0.8 ⎯ ⎯ V IOH = −2 mA
Output low All output pins VOL ⎯ ⎯ 0.4 V IOL = 4.0 mA
voltage
⎯ ⎯ IOL = 8.0 mA
4
P26 and P27* , 0.4 V
4
P32 to P35* ,
4
P50 and P51*
Input leakage RES |Iin| ⎯ ⎯ 10.0 μA Vin = 0.5 to
current VCC −0.5 V
STBY, NMI, ⎯ ⎯ 1.0 μA
MD2 to MD0
Ports 4 and 9 ⎯ ⎯ 1.0 μA Vin = 0.5 to
AVCC −0.5 V
Notes: Pins of port 2, P32 to P35, P50 and P51, and PJ0 to PJ2 are 5-V tolerant.
1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. When used as IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
3. When used as other than IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
4. When used as SCL or SDA.
5. When used as SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Three-state Ports 1 to 3, | ITSI | ⎯ ⎯ 1.0 μA Vin = 0.5 to
leakage current P50 to P53, VCC −0.5 V
(off state) ports 6 and 8,
ports A to I
Input pull-up Ports A to E −Ip 10 ⎯ 300 μA VCC = 3.0 to
MOS current 3.6 V
Vin = 0 V
Input RES Cin ⎯ ⎯ 30 pF Vin = 0 V
capacitance NMI ⎯ ⎯ 30 pF f = 1 MHz
All input pins ⎯ ⎯ 18 pF Ta = 25°C
except RES
and NMI
Supply current*2 Normal operation ICC*4 ⎯ 45 60 mA f = 33 MHz
(3.3 V)
Sleep mode ⎯ 35 45 mA f = 33 MHz
(3.3 V)
Standby mode*3 ⎯ 20 80 μA Ta ≤ 50°C
⎯ 80 500 μA 50°C < Ta
Analog power During A/D and AICC ⎯ 0.5 2.0 mA When channel
supply current D/A conversion (3.3 V) 1 is in use
Idle ⎯ 0.01 5.0 μA When channel
1 is in use
Reference During A/D and AICC ⎯ 0.5 1.0 mA
power supply D/A conversion (3.3 V)
current
Idle ⎯ 0.01 5.0 μA
RAM standby voltage VRAM 2.5 ⎯ ⎯ V
⎯ ⎯
5
VCC start voltage* VCC start 0.8 V
VCC rising slope *5 SVCC 0.02 ⎯ 20 ms/V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. Supply current values are for VIHmin = VCC −0.2 V and VILmax = 0.2 V with all output pins
unloaded and all input pull-up MOSs in the off state.
3. The values are for VRAM ≤ VCC < 3.0 V, VIHmin = VCC × 0.9, and VILmax = 0.3 V.
4. ICC depends on VCC and f as follows:
ICCmax = 5.2 (mA) + 1.66 (mA/(MHz)) × f (normal operation)
ICCmax = 2.6 (mA) + 1.28 (mA/(MHz)) × f (sleep mode)
5. Applied when RES is low at power-on.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC,
VSS = AVSS = 0 V*
27.3.3 AC Characteristics
The following shows the timings of the clock, control signals, bus, DMAC, EXDMAC, and on-
chip peripheral functions.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
3V
RL
C=50pF: Ports A to J (except for PH1 when SDRAMφ is in use.)
C=30pF: Ports 1 to 3, P50 to P53, ports 6 and 8, and PH1 when SDRAMφ∗ is in use.
C RH
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Test
Item Symbol Min. Max. Unit Conditions
Address delay time tAD ⎯ 20 ns Figures 27.10
to 27.25, 27.31
Address setup time 1 tAS1 0.5 × tcyc −13 ⎯ ns
and 27.32
Address setup time 2 tAS2 1.0 × tcyc −13 ⎯ ns
Address setup time 3 tAS3 1.5 × tcyc −13 ⎯ ns
Address setup time 4 tAS4 2.0 × tcyc −13 ⎯ ns
Address hold time 1 tAH1 0.5 × tcyc −8 ⎯ ns
Address hold time 2 tAH2 1.0 × tcyc −8 ⎯ ns
Address hold time 3 tAH3 1.5 × tcyc −8 ⎯ ns
CS delay time 1 tCSD1 ⎯ 15 ns
CS delay time 2 tCSD2 ⎯ 15 ns
CS delay time 3 tCSD3 ⎯ 20 ns
AS delay time tASD ⎯ 15 ns
RD delay time 1 tRSD1 ⎯ 15 ns
RD delay time 2 tRSD2 ⎯ 15 ns
Read data setup time 1 tRDS1 15 ⎯ ns
Read data setup time 2 tRDS2 15 ⎯ ns
Read data hold time 1 tRDH1 0 ⎯ ns
Read data hold time 2 tRDH2 0 ⎯ ns
Read data access time 1 tAC1 ⎯ 1.0 × tcyc − 25 ns
Read data access time 2 tAC2 ⎯ 1.5 × tcyc − 25 ns
Read data access time 3 tAC3 ⎯ 2.0 × tcyc − 25 ns
Read data access time 4 tAC4 ⎯ 2.5 × tcyc − 25 ns
Read data access time 5 tAC5 ⎯ 1.0 × tcyc − 25 ns
Read data access time 6 tAC6 ⎯ 2.0 × tcyc − 25 ns
Read data access time 7 tAC7 ⎯ 4.0 × tcyc − 25 ns
Test
Item Symbol Min. Max. Unit Conditions
Read data access time 8 tAC8 ⎯ 3.0 × tcyc − 25 ns Figures 27.10
to 27.25, 27.31
Counter address read data access tAA1 ⎯ 1.0 × tcyc − 25 ns
and 27.32
time 1
Counter address read data access tAA2 ⎯ 1.5 × tcyc − 25 ns
time 2
Counter address read data access tAA3 ⎯ 2.0 × tcyc − 25 ns
time 3
Counter address read data access tAA4 ⎯ 2.5 × tcyc − 25 ns
time 4
Counter address read data access tAA5 ⎯ 3.0 × tcyc − 25 ns
time 5
Counter address read data access tAA6 ⎯ 4.0 × tcyc − 25 ns
time 6
Multiplexed address delay time tMAD ⎯ 20 ns
Multiplexed address setup time 1 tMAS1 0.5 × tcyc − 15 ⎯ ns
Multiplexed address setup time 2 tMAS2 1.5 × tcyc − 15 ⎯ ns
Multiplexed address hold time tMAH 1.0 × tcyc − 15 ⎯ ns
AH delay time tAHD ⎯ 15 ns
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Test
Item Symbol Min. Max. Unit Conditions
WR delay time 1 tWRD1 ⎯ 15 ns Figures 27.10
to 27.25, 27.31
WR delay time 2 tWRD2 ⎯ 15 ns
and 27.32
WR pulse width 1 tWSW1 1.0 × tcyc −13 ⎯ ns
WR pulse width 2 tWSW2 1.5 × tcyc −13 ⎯ ns
Write data delay time tWDD ⎯ 23 ns
Write data setup time 1 tWDS1 0.5 × tcyc −15 ⎯ ns
Write data setup time 2 tWDS2 1.0 × tcyc −15 ⎯ ns
Write data setup time 3 tWDS3 1.5 × tcyc −15 ⎯ ns
Write data hold time 1 tWDH1 0.5 × tcyc −13 ⎯ ns
Write data hold time 2 tWDH2 1.0 × tcyc −13 ⎯ ns
Write data hold time 3 tWDH3 1.5 × tcyc −13 ⎯ ns
Write command setup time 1 tWCS1 0.5 × tcyc −10 ⎯ ns
Write command setup time 2 tWCS2 1.0 × tcyc −10 ⎯ ns
Write command hold time 1 tWCH1 0.5 × tcyc −10 ⎯ ns
Write command hold time 2 tWCH2 1.0 × tcyc −10 ⎯ ns
Read command setup time 1 tRCS1 1.5 × tcyc −10 ⎯ ns
Read command setup time 2 tRCS2 2.0 × tcyc −10 ⎯ ns
Read command hold time tRCH 0.5 × tcyc −10 ⎯ ns
CAS delay time 1 tCASD1 ⎯ 15 ns
CAS delay time 2 tCASD2 ⎯ 15 ns
CAS setup time 1 tCSR1 0.5 × tcyc −10 ⎯ ns
CAS setup time 2 tCSR2 1.5 × tcyc −10 ⎯ ns
CAS pulse width 1 tCASW1 1.0 × tcyc −20 ⎯ ns
CAS pulse width 2 tCASW2 1.5 × tcyc −20 ⎯ ns
CAS precharge time 1 tCPW1 1.0 × tcyc −20 ⎯ ns
CAS precharge time 2 tCPW2 1.5 × tcyc −20 ⎯ ns
Test
Item Symbol Min. Max. Unit Conditions
OE delay time 1*1 tOED1 ⎯ 15 ns Figures 27.10
to 27.25, 27.31
tOED1B ⎯ 19 ns
and 27.32
OE delay time 2* ⎯
1
tOED2 15 ns
tOED2B ⎯ 19 ns
Precharge time 1 tPCH1 1.0 × tcyc −20 ⎯ ns
Precharge time 2 tPCH2 1.5 × tcyc −20 ⎯ ns
Self-refresh precharge time 1 tRPS1 2.5 × tcyc −20 ⎯ ns Figures 27.24
and 27.25
Self-refresh precharge time 2 tRPS2 3.0 × tcyc −20 ⎯ ns
WAIT setup time tWTS 25 ⎯ ns Figures 27.12,
27.18, and
WAIT hold time tWTH 1 ⎯ ns
27.32
BREQ setup time tBREQS 30 ⎯ ns Figure 27.26
BACK delay time tBACD ⎯ 15 ns
Bus floating time tBZD ⎯ 40 ns
BREQO delay time tBRQOD ⎯ 25 ns Figure 27.27
Address delay time 2*2 tAD2 1 16.5 ns Figure 27.28
CS delay time 4*2 tCSD4 1 16.5 ns Figure 27.28
2
DQM delay time* tDQMD 1 16.5 ns Figure 27.28
2 3
CKE delay time* * tCKED 1 16.5 ns Figures 27.29
and 27.30
tCKEDB 1 19 ns
⎯
2
Read data setup time 3* tRDS3 15 ns Figure 27.28
⎯
2
Read data hold time 3* tRDH3 0 ns Figure 27.28
⎯
2
Write data delay time 2* tWDD 31.5 ns Figure 27.28
Write data hold time 4*2 tWDH4 2 ⎯ ns Figure 27.28
Notes: 1. tOED1 and tOED2 correspond to the OE-A and RD, tOED1B and tOED2B correspond to the OE-B.
2. Supported only by the H8S/2427R Group.
3. tCKED corresponds to the CKE-A, tCKEDB corresponds to the CKE-B.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Standard Value
Item Applicable Area Min. Typ. Max. Unit
⎯ ⎯
1 2
Programming and erase count* User ROM 1000* Times
⎯ ⎯
2
Data flash area 10000*
Programming time User ROM ⎯ 150 4000 μs
(per 4 bytes)
Data flash area ⎯ 300 4000
Erase time (per 1 block) User ROM ⎯ 300 3000 ms
Data flash area ⎯ 300 3000
Programming and erase voltage User ROM 3.0 ⎯ 3.6 V
Data flash area
Read voltage User ROM 3.0 ⎯ 3.6 V
Data flash area
Access state User ROM 1 ⎯ ⎯ State
Data flash area 2 ⎯ ⎯
Notes: 1. When programming is to be performed multiple times on a system, reduce the effective number of
programming operations by shifting the writing addresses in sequence and so on until the
remaining blank area is as small as possible and only then erasing the entire block once. For
example, if sets of 16 bytes are being programmed, erasing the block once after programming the
maximum number of sets (256) minimizes the effective number of programming operations.
We recommend keeping information on the number of times erasure is performed for each block,
and setting up the limit on the number of times.
2. If an erase error occurs during erasure, execute the clear status command and then the erase
command at least 3 times until the erase error does not occur.
*1. Determination of the number of times for programming/erasure operations.
Number of times programming/erasure is performed in each block.
When the number of times for programming/erasure operations is n (n = 100), data can be erased
n times in each block.
For example, if programming of 4 bytes is done 1024 times, each at a different address in a 4-
kbyte per block, and the block is then erased, this counts as programming/erasure one time.
However, programming of any location in a block multiple times is not possible (overwriting is
prohibited).
*2. This is the number of times for which all electrical characteristics are guaranteed.
27.4.2 DC Characteristics
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Test
Item Symbol Min. Typ. Max. Unit Conditions
Output high All output pins VOH VCC − 0.3 ⎯ ⎯ V IOH = −200 μA
voltage
VCC − 0.5 ⎯ ⎯ V IOH = −1 mA
VCC − 0.8 ⎯ ⎯ V IOH = −2 mA
Output low All output pins VOL ⎯ ⎯ 0.4 V IOL = 4.0 mA
voltage
⎯ ⎯ IOL = 8.0 mA
4
P26 and P27* 0.4 V
4
P32 to P35* ,
4
P50 and P51*
Input leakage RES |Iin| ⎯ ⎯ 10.0 μA Vin = 0.5 to
current VCC −0.5 V
STBY, NMI, ⎯ ⎯ 1.0 μA
MD2 to MD0
Port 4, Port 9 ⎯ ⎯ 1.0 μA Vin = 0.5 to AVCC
−0.5 V
Notes: Pins of port 2, P32 to P35, P50 and P51, and P81 and P83 are 5-V tolerant.
1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. When used as IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
3. When used as other than IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
4. When used as SCL or SDA.
5. When used as SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Three-state Ports 1 to 3, | ITSI | ⎯ ⎯ 1.0 μA Vin = 0.5 to
leakage current P50 to P53, VCC −0.5 V
(off state) port 8,
ports A to G
Input pull-up Ports A to E −Ip 10 ⎯ 300 μA VCC = 3.0 to
MOS current 3.6 V
Vin = 0 V
Input RES Cin ⎯ ⎯ 30 pF Vin = 0 V
capacitance NMI ⎯ ⎯ 30 pF f = 1 MHz
All input pins ⎯ ⎯ 18 pF Ta = 25°C
except RES and
NMI
Supply current*2 Normal operation ICC*4 ⎯ 45 60 mA f = 33 MHz
(3.3 V)
Sleep mode ⎯ 35 45 mA f = 33 MHz
(3.3 V)
Standby mode*3 ⎯ 20 80 μA Ta ≤ 50°C
⎯ 80 500 μA 50°C < Ta
Analog power During A/D and AICC ⎯ 0.5 2.0 mA When channel
supply current D/A conversion (3.3 V) 1 is in use
Idle ⎯ 0.01 5.0 μA When channel
1 is in use
Reference During A/D and AICC ⎯ 0.5 1.0 mA
power supply D/A conversion (3.3 V)
current
Idle ⎯ 0.01 5.0 μA
RAM standby voltage VRAM 2.5 ⎯ ⎯ V
⎯ ⎯
5
VCC start voltage* VCC start 0.8 V
VCC rising slope *5 SVCC 0.02 ⎯ 20 ms/V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. Supply current values are for VIHmin = VCC −0.2 V and VILmax = 0.2 V with all output pins
unloaded and all input pull-up MOSs in the off state.
3. The values are for VRAM ≤ VCC < 3.0 V, VIHmin = VCC × 0.9, and VILmax = 0.3 V.
4. ICC depends on VCC and f as follows:
ICCmax = 5.2 (mA) + 1.66 (mA/(MHz)) × f (normal operation)
ICCmax = 2.6 (mA) + 1.28 (mA/(MHz)) × f (sleep mode)
5. Applied when RES is low at power-on.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC,
VSS = AVSS = 0 V*
27.4.3 AC Characteristics
The following shows the timings of the clock, control signals, bus, DMAC, and on-chip peripheral
functions.
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
3V
RL
C=50pF: Ports A to G
C=30pF: Ports 1 to 3, P50 to P53, and port 8
C RH
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS =
0 V, φ = 8 MHz to 33 MHz
Conditions: VCC = 3.0 V to 3.6 V, AVCC = 3.0 V to 3.6 V, Vref = 3.0 V to AVCC, VSS = AVSS = 0
V, φ = 8 MHz to 33 MHz
Standard Value
Item Applicable Area Min. Typ. Max. Unit
⎯ ⎯
1 2
Programming and erase count* User ROM 1000* Times
⎯ ⎯
2
Data flash area 10000*
Programming time User ROM ⎯ 150 4000 μs
(per 4 bytes)
Data flash area ⎯ 300 4000
Erase time (per 1 block) User ROM ⎯ 300 3000 ms
Data flash area ⎯ 300 3000
Programming and erase voltage User ROM 3.0 ⎯ 3.6 V
Data flash area
Read voltage User ROM 3.0 ⎯ 3.6 V
Data flash area
Access state User ROM 1 ⎯ ⎯ State
Data flash area 2 ⎯ ⎯
Notes: 1. When programming is to be performed multiple times on a system, reduce the effective number of
programming operations by shifting the writing addresses in sequence and so on until the
remaining blank area is as small as possible and only then erasing the entire block once. For
example, if sets of 16 bytes are being programmed, erasing the block once after programming the
maximum number of sets (256) minimizes the effective number of programming operations.
We recommend keeping information on the number of times erasure is performed for each block,
and setting up the limit on the number of times.
2. If an erase error occurs during erasure, execute the clear status command and then the erase
command at least 3 times until the erase error does not occur.
*1. Determination of the number of times for programming/erasure operations.
Number of times programming/erasure is performed in each block.
When the number of times for programming/erasure operations is n (n = 100), data can be erased
n times in each block.
For example, if programming of 4 bytes is done 1024 times, each at a different address in a 4-
kbyte per block, and the block is then erased, this counts as programming/erasure one time.
However, programming of any location in a block multiple times is not possible (overwriting is
prohibited).
*2. This is the number of times for which all electrical characteristics are guaranteed.
tcyc
tCH tCf
tCL tCr
tcyc
tSDCH tsdcf
SDRAMφ
tsdcr
tSDCL
EXTAL
tDEXT tDEXT
Vcc
STBY
tOSC1
tOSC1
RES
Oscillator
NMI
NMIEG
SSBY
φ
tRESS tRESS
RES
tRESW
tNMIS tNMIH
NMI
tNMIW
tIRQW
IRQi
(i = 0 to 15)*
tIRQS tIRQH
IRQ
(edge input)
tIRQS
IRQ
(level input)
T1 T2
φ
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tAH1
tASD tASD
AS
tAS1
tRSD1 tRSD1
RD
Read
(RDNn = 1) tAC5 tRDS1 tRDH1
tAA2
D15 to D0
tAS1
tRSD1 tRSD2
RD
Read
tAC2 tRDS2 tRDH2
(RDNn = 0)
tAA3
D15 to D0
tAS1 tAH1
tWRD2 tWRD2
HWR, LWR
D15 to D0
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
T1 T2 T3
φ
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tAH1
tASD tASD
AS
tAS1
tRSD1 tRSD1
Read RD
(RDNn = 1)
tAC6 tRDS1 tRDH1
tAA4
D15 to D0
tAS1
tRSD1 tRSD2
RD
Read
(RDNn = 0) tAC4 tRDS2 tRDH2
tAA5
D15 to D0
tAS2 tAH1
tWRD2
tWRD1
HWR, LWR
tWDS1
tWDD tWSW2 tWDH1
Write
D15 to D0
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
T1 T2 Tw T3
A23 to A0
CS7 to CS0
AS
Read RD
(RDNn = 1)
D15 to D0
RD
Read
(RDNn = 0)
D15 to D0
HWR, LWR
Write
D15 to D0
tWTS tWTH tWTS tWTH
WAIT
Th T1 T2 Tt
φ
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tAH1
tASD
tASD
AS
tAS3 tAH3
tRSD1 tRSD1
RD
Read
(RDNn = 1) tAC5 tRDS1 tRDH1
D15 to D0
tAS3 tAH2
tRSD1 tRSD2
RD
Read tAC2 tRDS2 tRDH2
(RDNn = 0)
D15 to D0
tAS3 tAH3
tWRD2 tWRD2
HWR, LWR
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.13 Basic Bus Timing: Two-State Access (CS Assertion Period Extended)
Th T1 T2 T3 Tt
φ
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tASD tAH1
tASD
AS
tAS3 tRSD1 tRSD1 tAH3
RD
Read tAC6 tRDS1 tRDH1
(RDNn = 1)
D15 to D0
tAS3 tAH2
tRSD1 tRSD2
RD
Read
tAC4 tRDS2 tRDH2
(RDNn = 0)
D15 to D0
tAS4 tWRD2 tAH3
tWRD1
HWR, LWR
tWDS3
Write tWDD tWSW2 tWDH3
D15 to D0
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.14 Basic Bus Timing: Three-State Access (CS Assertion Period Extended)
T1 T2 T1 T1
A23 to A6, A0
tAD
A5 to A1
CS1, CS0
AS
tRSD2
RD
D15 to D0
HWR, LWR
T1 T2 T3 T1 T2
A23 to A6, A0
tAD
A5 to A1
CS1, CS0
tAS1 tAH1
tASD tASD
AS
tRSD2
RD
tRDS2 tRDH2
Read tAA3
D15 to D0
HWR, LWR
Tp Tr Tc1 Tc2
φ
tAD tAD
A23 to A0
tCASW1
LCAS
tOED1/tOED1B t tOED1/tOED1B
AC1
OE, RD
HWR
Read tAA3
tRDS2 tRDH2
tAC4
D15 to D0
Write HWR
D15 to D0
AS
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
A23 to A0
RAS5 to RAS2
UCAS, LCAS
OE, RD
Read
HWR
D15 to D0
UCAS, LCAS
OE, RD
Write
HWR
D15 to D0
AS
tWTS tWTH tWTS tWTH
WAIT
EDACK2, EDACK3
A23 to A0
RAS5 to RAS2
tCPW1
UCAS
LCAS
OE, RD
Read HWR
tAC3
D15 to D0
OE, RD
tRCH
Write HWR
tRCS1
D15 to D0
AS
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
φ
tAD tAD
A23 to A0
tCSD3
tAS2 tAH2
tCSD1
RAS5 to RAS2
tPCH1
tAS3 tAH3
tCASD1
tCASD2
UCAS
tCASW2
OE, RD
Read HWR
tAA5
tRDS2 tRDH2
tAC7
D15 to D0
OE, RD
tWRD2 tWCS2 tWCH2
tWRD2
Write HWR
tWDD
tWDS2 tWDH3
D15 to D0
AS
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
A23 to A0
RAS5 to RAS0
tCPW2
UCAS
LCAS
OE, RD
Read HWR
tAC8
D15 to D0
OE, RD
tRCH
Write HWR
tRCS2
D15 to D0
AS
EDACK2, EDACK3
tCSD1
tCSD2
RAS5 to RAS2
tCSR1
tCASD1
tCASD1
UCAS, LCAS
OE
tCSD1
tCSD2
RAS5 to RAS2
tCSR2
tCASD1
tCASD1
UCAS, LCAS
OE
tCSD2 tCSD2
UCAS, LCAS
OE
Figure 27.24 Self-Refresh Timing (Return from Software Standby Mode: RAST = 0)
φ
tCSD2 tCSD2
UCAS, LCAS
OE
Figure 27.25 Self-Refresh Timing (Return from Software Standby Mode: RAST = 1)
φ
tBREQS tBREQS
BREQ
tBACD tBACD
BACK
tBZD tBZD
A23 to A0
CS7 to CS0
(RAS5 to RAS2)
D15 to D0
AS, RD
HWR, LWR
UCAS, LCAS, OE
BACK
tBRQOD tBRQOD
BREQO
Tp Tr Tc1 Tw Tc2
SDRAMφ
tAD2
Address bus
Precharge-sel
tCSD4 tCSD4
RAS
tCSD4 tCSD4
CAS
tCSD4 tCSD4
Read WE
DQMU,
DQML tRDS3 tRDH3
Data bus
tCSD4 tCSD4
RAS
tCSD4 tCSD4
CAS
WE
Write
DQMU,
DQML
tWDD2 tWDH4
Data bus
SDRAMφ
Address bus
Precharge-sel
RAS
CAS
WE
tCKED/tCKEDB tCKED/tCKEDB
CKE
SDRAMφ
Address bus
Precharge-sel
RAS
CAS
WE
tCKED/tCKEDB tCKED/tCKEDB
CKE
DQMU,
DQML
Data bus
DACK or
EDACK
Tma1 Tma2 T1 T2
φ
tAD
A23 to A0
tCSD1
CS7, CS6
tAHD
AH
tRSD1 tRSD2
RD
tAC2
tAA6
Read
(RDNn = 0) tMAD tMAS1 tMAH tRDS2 tRDH2
tWRD2 tWRD2
HWR, LWR
Write tWSW
tMAD tWDD tWDH1
tDACD1 tDACD2
DACK0,
DACK1,
DACK3
tEDACD1 tEDACD2
EDACK2,
EDACK3
φ
tAD
A23 to A0
tCSD1
CS7, CS6
tAHD
AH
tRSD1 tRSD2
RD
Read
(RDNn = 0) tMAD tMAS2 tMAH tRDS2 tRDH2
tWRD1 tWRD2
HWR, LWR
tMAD tWDD tWDS1 tWDH1
Write
WAIT
Figure 27.32 Multiplexed Bus Timing: Data Three-State Access, One Wait
(With address wait: when ADDEX = 1)
T1 T2
A23 to A0
CS7 to CS0
AS
RD
(read)
D15 to D0
(read)
HWR, LWR
(write)
D15 to D0
(write)
tDACD1 tDACD2
DACK0, DACK1,
DACK3
tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.33 DMAC and EXDMAC Single Address Transfer Timing: Two-State Access
T1 T2 T3
A23 to A0
CS7 to CS0
AS
RD
(read)
D15 to D0
(read)
HWR, LWR
(write)
D15 to D0
(write)
tDACD1 tDACD2
DACK0, DACK1,
DACK3 tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.34 DMAC and EXDMAC Single Address Transfer Timing: Three-State Access
T1 T2 or T3
tTED tTED
TEND0, TEND1,
TEND3, TEND4,
TEND5 tETED tETED
ETEND2, ETEND3
tDRQS tDRQH
DREQ0, DREQ1,
DREQ3, DREQ4,
DREQ5 tEDRQS tEDRQH
EDREQ2, EDREQ3
tEDRKD tEDRKD
EDRAK2, EDRAK3
T1 T2
tPRS tPRH
Ports 1 to 6, 8, 9,
A to J (read)
tPWD
Ports 1 to 3, 6, 8,
P53 to P50,
ports A to J
(write)
tPOD
PO15 to PO0
φ
tTOCD
Output compare
output*
tTICS
Input capture
input*
tTCKS tTCKS
TCLKA to TCLKH
tTCKWL tTCKWH
tTMOD
TMO0, TMO1
φ
tTMCS tTMCS
TMCI0, TMCI1
tTMCWL tTMCWH
tTMRS
TMRI0, TMRI1
tWOVD tWOVD
WDTOVF
SCK0 to SCK4
tScyc
SCK0 to SCK4
tTXD
TxD0 to TxD4
(transmit data)
tRXS tRXH
RxD0 to RxD4
(receive data)
tTRGS
ADTRG0,
ADTRG1
VIH
SDA0
to VIL
SDA1
tBUF
tSCLH tSP tSTOS
tSTAH tSTAS
SCL0
to
SCL1 P* S* Sr* P*
tSCLL
tSf tSr tSDAS
tSCL
tSDAH
SCS (output)
tTD
tLEAD tHI tFALL tRISE tLAG
SSCK (output)
CPOS = 1
tLO
tHI
SSCK (output)
CPOS = 0
tLO tSUcyc
SSO (output)
tOH tOD
SSI (input)
tSU tH
SCS (output)
tTD
tLEAD tHI tFALL tRISE tLAG
SSCK (output)
CPOS = 1
tLO
tHI
SSCK (output)
CPOS = 0
tLO tSUcyc
SSO (output)
tOH tOD
SSI (input)
tSU tH
SCS (input)
SSCK (input)
CPOS = 1
tLO
tHI
SSCK (input)
CPOS = 0
tLO tSUcyc
SSO (input)
tSU tH tREL
SSI (output)
tOH tOD
tSA
SCS (input)
SSCK (input)
CPOS = 1
tLO
tHI
SSCK (input)
CPOS = 0
tLO tSUcyc
SSO (input)
tSU tH tREL
SSI (output)
tCKH tCYC
FSICK
tCKL
FSICK
tSSL tSSH
FSISS
tTXD
FSIDO
tRXS tRXH
FSIDI
27.6.2 DC Characteristics
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Test
Item Symbol Min. Typ. Max. Unit Conditions
Output high All output pins VOH VCC − 0.3 ⎯ ⎯ V IOH = −200 μA
voltage
VCC − 0.5 ⎯ ⎯ V IOH = −1 mA
VCC − 0.8 ⎯ ⎯ V IOH = −2 mA
Output low All output pins VOL ⎯ ⎯ 0.4 V IOL = 4.0 mA
voltage
⎯ ⎯ IOL = 8.0 mA
4
P26 and P27* , 0.4 V
4
P32 to P35* ,
4
P50 and P51*
Input leakage RES |Iin| ⎯ ⎯ 10.0 μA Vin = 0.5 to
current VCC −0.5 V
STBY, NMI, ⎯ ⎯ 1.0 μA
MD2 to MD0
Ports 4 and 9 ⎯ ⎯ 1.0 μA Vin = 0.5 to AVCC
−0.5 V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. When used as IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
3. When used as other than IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
4. When used as SCL or SDA.
5. When used as SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC,
VSS = AVSS = 0 V*1
Test
Item Symbol Min. Typ. Max. Unit Conditions
Three-state Ports 1 to 3, | ITSI | ⎯ ⎯ 1.0 μA Vin = 0.5 to
leakage current P50 to P53, VCC −0.5 V
(off state) ports 6 and 8,
ports A to I
Input pull-up Ports A to E −Ip 10 ⎯ 300 μA VCC = 4.5 to
MOS current 5.5 V
Vin = 0 V
Input RES Cin ⎯ ⎯ 30 pF Vin = 0 V
capacitance NMI ⎯ ⎯ 30 pF f = 1 MHz
All input pins ⎯ ⎯ 18 pF Ta = 25°C
except RES
and NMI
Supply current*2 Normal operation ICC*4 ⎯ 45 70 mA f = 33 MHz
(5.0 V)
Sleep mode ⎯ 35 45 mA f = 33 MHz
(5.0 V)
Standby mode*3 ⎯ 20 80 μA Ta ≤ 50°C
⎯ 80 500 μA 50°C < Ta
Analog power During A/D and AICC ⎯ 0.5 2.0 mA When channel
supply current D/A conversion (5.0 V) 1 is in use
Idle ⎯ 0.01 5.0 μA When channel
1 is in use
Reference During A/D and AICC ⎯ 0.5 1.0 mA
power supply D/A conversion (5.0 V)
current
Idle ⎯ 0.01 5.0 μA
RAM standby voltage VRAM 2.5 ⎯ ⎯ V
⎯ ⎯
5
VCC start voltage* VCC start 0.8 V
VCC rising slope *5 SVCC 0.02 ⎯ 20 ms/V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. Supply current values are for VIHmin = VCC −0.2 V and VILmax = 0.2 V with all output pins
unloaded and all input pull-up MOSs in the off state.
3. The values are for VRAM ≤ VCC < 4.5 V, VIHmin = VCC × 0.9, and VILmax = 0.3 V.
4. ICC depends on VCC and f as follows:
ICCmax = 5.2 (mA) + 1.96 (mA/(MHz)) × f (normal operation)
ICCmax = 2.6 (mA) + 1.26 (mA/(MHz)) × f (sleep mode)
5. Applied when RES is low at power-on.
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC,
VSS = AVSS = 0 V*
27.6.3 AC Characteristics
The following shows the timings of the clock, control signals, bus, DMAC, EXDMAC, and on-
chip peripheral functions.
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V
φ = 8 MHz to 33 MHz
3V
RL
C=50pF: Ports A to J
C=30pF: Ports 1 to 3, P50 to P53, and ports 6 and 8
C RH
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Test
Item Symbol Min. Max. Unit Conditions
Address delay time tAD ⎯ 20 ns Figures 27.61
to 27.71
Address setup time 1 tAS1 0.5 × tcyc −13 ⎯ ns
Address setup time 2 tAS2 1.0 × tcyc −13 ⎯ ns
Address setup time 3 tAS3 1.5 × tcyc −13 ⎯ ns
Address setup time 4 tAS4 2.0 × tcyc −13 ⎯ ns
Address hold time 1 tAH1 0.5 × tcyc −8 ⎯ ns
Address hold time 2 tAH2 1.0 × tcyc −8 ⎯ ns
Address hold time 3 tAH3 1.5 × tcyc −8 ⎯ ns
CS delay time 1 tCSD1 ⎯ 15 ns
AS delay time tASD ⎯ 15 ns
RD delay time 1 tRSD1 ⎯ 15 ns
RD delay time 2 tRSD2 ⎯ 15 ns
Read data setup time 1 tRDS1 15 ⎯ ns
Read data setup time 2 tRDS2 15 ⎯ ns
Read data hold time 1 tRDH1 1 ⎯ ns
Read data hold time 2 tRDH2 1 ⎯ ns
Read data access time 2 tAC2 ⎯ 1.5 × tcyc − 25 ns
Read data access time 4 tAC4 ⎯ 2.5 × tcyc − 25 ns
Read data access time 5 tAC5 ⎯ 1.0 × tcyc − 25 ns
Read data access time 6 tAC6 ⎯ 2.0 × tcyc − 25 ns
Test
Item Symbol Min. Max. Unit Conditions
Counter address read data access tAA1 ⎯ 1.0 × tcyc − 25 ns Figures 27.61
time 1 to 27.71
Counter address read data access tAA2 ⎯ 1.5 × tcyc − 25 ns
time 2
Counter address read data access tAA3 ⎯ 2.0 × tcyc − 25 ns
time 3
Counter address read data access tAA4 ⎯ 2.5 × tcyc − 25 ns
time 4
Counter address read data access tAA5 ⎯ 3.0 × tcyc − 25 ns
time 5
Counter address read data access tAA6 ⎯ 4.0 × tcyc − 25 ns
time 6
Multiplexed address delay time tMAD ⎯ 20 ns
Multiplexed address setup time 1 tMAS1 0.5 × tcyc − 15 ⎯ ns
Multiplexed address setup time 2 tMAS2 1.5 × tcyc − 15 ⎯ ns
Multiplexed address hold time tMAH 1.0 × tcyc − 15 ⎯ ns
AH delay time tAHD ⎯ 15 ns
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Test
Item Symbol Min. Max. Unit Conditions
WR delay time 1 tWRD1 ⎯ 15 ns Figures 27.61
to 27.71
WR delay time 2 tWRD2 ⎯ 15 ns
WR pulse width 1 tWSW1 1.0 × tcyc −13 ⎯ ns
WR pulse width 2 tWSW2 1.5 × tcyc −13 ⎯ ns
Write data delay time tWDD ⎯ 23 ns
Write data setup time 1 tWDS1 0.5 × tcyc −15 ⎯ ns
Write data setup time 2 tWDS2 1.0 × tcyc −15 ⎯ ns
Write data setup time 3 tWDS3 1.5 × tcyc −15 ⎯ ns
Write data hold time 1 tWDH1 0.5 × tcyc −13 ⎯ ns
Write data hold time 3 tWDH3 1.5 × tcyc −13 ⎯ ns
WAIT setup time tWTS 25 ⎯ ns Figures 27.63
and 27.72
WAIT hold time tWTH 1 ⎯ ns
BREQ setup time tBREQS 30 ⎯ ns Figure 27.68
BACK delay time tBACD ⎯ 15 ns
Bus floating time tBZD ⎯ 40 ns
BREQO delay time tBRQOD ⎯ 25 ns Figure 27.69
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Standard Value
Item Applicable Area Min. Typ. Max. Unit
⎯ ⎯
2
Programming and erase User ROM 1,000* Times
1
count*
⎯ ⎯
2
Data flash area 10,000*
Programming time User ROM ⎯ 150 4000 μs
(per 4 bytes)
Data flash area ⎯ 300 4000
Erase time (per 1 block) User ROM ⎯ 300 3000 ms
Data flash area ⎯ 300 3000
Programming and erase User ROM 4.5 ⎯ 5.5 V
voltage
Data flash area
Read voltage User ROM 4.5 ⎯ 5.5 V
Data flash area
Access state User ROM 1 ⎯ ⎯ State
Data flash area 2 ⎯ ⎯
Notes: 1. When programming is to be performed multiple times on a system, reduce the effective number of
programming operations by shifting the writing addresses in sequence and so on until the
remaining blank area is as small as possible and only then erasing the entire block once. For
example, if sets of 16 bytes are being programmed, erasing the block once after programming the
maximum number of sets (256) minimizes the effective number of programming operations.
We recommend keeping information on the number of times erasure is performed for each block,
and setting up the limit on the number of times.
2. If an erase error occurs during erasure, execute the clear status command and then the erase
command at least 3 times until the erase error does not occur.
*1. Determination of the number of times for programming/erasure operations.
Number of times programming/erasure is performed in each block.
When the number of times for programming/erasure operations is n (n = 100), data can be erased
n times in each block.
For example, if programming of 4 bytes is done 1024 times, each at a different address in a 4-
kbyte per block, and the block is then erased, this counts as programming/erasure one time.
However, programming of any location in a block multiple times is not possible (overwriting is
prohibited).
*2. This is the number of times for which all electrical characteristics are guaranteed.
27.7.2 DC Characteristics
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V
Test
Item Symbol Min. Typ. Max. Unit Conditions
Test
Item Symbol Min. Typ. Max. Unit Conditions
Output high All output pins VOH VCC − 0.3 ⎯ ⎯ V IOH = −200 μA
voltage
VCC − 0.5 ⎯ ⎯ V IOH = −1 mA
VCC − 0.8 ⎯ ⎯ V IOH = −2 mA
Output low All output pins VOL ⎯ ⎯ 0.4 V IOL = 4.0 mA
voltage
⎯ ⎯ IOL = 8.0 mA
4
P26 and P27* 0.4 V
4
P32 to P35* ,
4
P50 and P51*
Input leakage RES |Iin| ⎯ ⎯ 10.0 μA Vin = 0.5 to
current VCC −0.5 V
STBY, NMI, ⎯ ⎯ 1.0 μA
MD2 to MD0
Port 4, port 9 ⎯ ⎯ 1.0 μA Vin = 0.5 to AVCC
−0.5 V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. When used as IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
3. When used as other than IRQ, TIOC, TCLK, TMRI, SCL, or SDA.
4. When used as SCL or SDA.
5. When used as SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V
Test
Item Symbol Min. Typ. Max. Unit Conditions
Three-state Ports 1 to 3, | ITSI | ⎯ ⎯ 1.0 μA Vin = 0.5 to
leakage current P50 to P53, VCC −0.5 V
(off state) port 8,
ports A to G
Input pull-up Ports A to E −Ip 10 ⎯ 300 μA VCC = 4.5 to
MOS current 5.5 V
Vin = 0 V
Input RES Cin ⎯ ⎯ 30 pF Vin = 0 V
capacitance f = 1 MHz
NMI ⎯ ⎯ 30 pF
All input pins ⎯ ⎯ 18 pF Ta = 25°C
except RES and
NMI
Supply current*2 Normal operation ICC*4 ⎯ 45 70 mA f = 33 MHz
(5.0 V)
Sleep mode ⎯ 35 45 mA f = 33 MHz
(5.0 V)
⎯ μA Ta ≤ 50°C
3
Standby mode* 20 80
⎯ 80 500 μA 50°C < Ta
Analog power During A/D and AICC ⎯ 0.5 2.0 mA When channel
supply current D/A conversion (5.0 V) 1 is in use
Idle ⎯ 0.01 5.0 μA When channel
1 is in use
Reference During A/D and AICC ⎯ 0.5 1.0 mA
power supply D/A conversion (5.0 V)
current
Idle ⎯ 0.01 5.0 μA
RAM standby voltage VRAM 2.5 ⎯ ⎯ V
VCC start voltage*5 VCC start ⎯ ⎯ 0.8 V
⎯
5
VCC rising slope * SVCC 0.02 20 ms/V
Notes: 1. When the A/D and D/A converters are not used, the AVCC, Vref, and AVSS pins should not
be open. Connect the AVCC and Vref pins to VCC, and the AVSS pin to VSS.
2. Supply current values are for VIHmin = VCC −0.2 V and VILmax = 0.2 V with all output pins
unloaded and all input pull-up MOSs in the off state.
3. The values are for VRAM ≤ VCC < 4.5 V, VIHmin = VCC × 0.9, and VILmax = 0.3 V.
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V
27.7.3 AC Characteristics
The following shows the timings of the clock, control signals, bus, DMAC, and on-chip peripheral
functions.
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
3V
RL
C=50pF: Ports A to G
C=30pF: Ports 1 to 3, P50 to P53, port 8
C RH
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Conditions: VCC = 4.5 V to 5.5 V, AVCC = 4.5 V to 5.5 V, Vref = 4.5 V to AVCC, VSS = AVSS = 0 V,
φ = 8 MHz to 33 MHz
Standard Value
Item Applicable Area Min. Typ. Max. Unit
⎯ ⎯
1 2
Programming and erase count* Programming ROM 1,000* Times
⎯ ⎯
2
Data flash area 10,000*
Programming time Programming ROM ⎯ 150 4000 μs
(per 4 bytes) Data flash area ⎯ 300 4000
Erase time (per 1 block) Programming ROM ⎯ 300 3000 ms
Data flash area ⎯ 300 3000
Programming and erase voltage Programming ROM 4.5 ⎯ 5.5 V
Data flash area
Read voltage Programming ROM 4.5 ⎯ 5.5 V
Data flash area
Access state Programming ROM 1 ⎯ ⎯ State
Data flash area 2 ⎯ ⎯
Notes: 1. When programming is to be performed multiple times on a system, reduce the effective number of
programming operations by shifting the writing addresses in sequence and so on until the
remaining blank area is as small as possible and only then erasing the entire block once. For
example, if sets of 16 bytes are being programmed, erasing the block once after programming the
maximum number of sets (256) minimizes the effective number of programming operations.
We recommend keeping information on the number of times erasure is performed for each block,
and setting up the limit on the number of times.
2. If an erase error occurs during erasure, execute the clear status command and then the erase
command at least 3 times until the erase error does not occur.
*1. Determination of the number of times for programming/erasure operations.
Number of times programming/erasure is performed in each block.
When the number of times for programming/erasure operations is n (n = 100), data can be erased
n times in each block.
For example, if programming of 4 bytes is done 1024 times, each at a different address in a 4-
kbyte per block, and the block is then erased, this counts as programming/erasure one time.
However, programming of any location in a block multiple times is not possible (overwriting is
prohibited).
*2. This is the number of times for which all electrical characteristics are guaranteed.
tcyc
tCH tCf
tCL tCr
EXTAL
tDEXT tDEXT
Vcc
STBY
tOSC1
tOSC1
RES
Oscillator
NMI
NMIEG
SSBY
tRESS tRESS
RES
tRESW
tNMIS tNMIH
NMI
tNMIW
tIRQW
IRQi
(i = 0 to 15)*
tIRQS tIRQH
IRQ
(edge input)
tIRQS
IRQ
(level input)
T1 T2
φ
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tAH1
tASD tASD
AS
tAS1
tRSD1 tRSD1
RD
Read
(RDNn = 1) tAC5 tRDS1 tRDH1
tAA2
D15 to D0
tAS1
tRSD1 tRSD2
RD
Read tAC2 tRDS2 tRDH2
(RDNn = 0)
tAA3
D15 to D0
tAS1 tAH1
tWRD2 tWRD2
HWR, LWR
D15 to D0
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
T1 T2 T3
φ
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tAH1
tASD tASD
AS
tAS1
tRSD1 tRSD1
RD
Read
(RDNn = 1) tAC6 tRDS1 tRDH1
tAA4
D15 to D0
tAS1
tRSD1 tRSD2
RD
Read tRDS2 tRDH2
tAC4
(RDNn = 0)
tAA5
D15 to D0
tAS2 tAH1
tWRD2
tWRD1
HWR, LWR
tWDS1
tWDD tWSW2 tWDH1
Write
D15 to D0
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
T1 T2 Tw T3
A23 to A0
CS7 to CS0
AS
Read RD
(RDNn = 1)
D15 to D0
RD
Read
(RDNn = 0)
D15 to D0
HWR, LWR
Write
D15 to D0
tWTS tWTH tWTS tWTH
WAIT
Th T1 T2 Tt
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tAH1
tASD
tASD
AS
tAS3 tAH3
tRSD1 tRSD1
RD
Read
(RDNn = 1) tAC5 tRDS1 tRDH1
D15 to D0
tAS3 tAH2
tRSD1 tRSD2
RD
Read tAC2 tRDS2 tRDH2
(RDNn = 0)
D15 to D0
tAS3 tAH3
tWRD2 tWRD2
HWR, LWR
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.64 Basic Bus Timing: Two-State Access (CS Assertion Period Extended)
Th T1 T2 T3 Tt
tAD
A23 to A0
tCSD1
CS7 to CS0
tAS1 tASD tAH1
tASD
AS
tAS3 tRSD1 tRSD1 tAH3
RD
Read tRDS1 tRDH1
tAC6
(RDNn = 1)
D15 to D0
tAS3 tAH2
tRSD1 tRSD2
RD
Read
tAC4 tRDS2 tRDH2
(RDNn = 0)
D15 to D0
tAS4 tWRD2 tAH3
tWRD1
HWR, LWR
tWDS3
Write tWDD tWSW2 tWDH3
D15 to D0
tDACD1 tDACD2
tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.65 Basic Bus Timing: Three-State Access (CS Assertion Period Extended)
T1 T2 T1 T1
A23 to A6, A0
tAD
A5 to A1
CS1, CS0
AS
tRSD2
RD
D15 to D0
HWR, LWR
T1 T2 T3 T1 T2
A23 to A6, A0
tAD
A5 to A1
CS1, CS0
tAS1 tAH1
tASD tASD
AS
tRSD2
RD
tRDS2 tRDH2
Read tAA3
D15 to D0
HWR, LWR
tBREQS tBREQS
BREQ
tBACD tBACD
BACK
tBZD tBZD
A23 to A0
CS7 to CS0
(RAS5 to RAS2)
D15 to D0
AS, RD
HWR, LWR
UCAS, LCAS, OE
BACK
tBRQOD tBRQOD
BREQO
Tma1 Tma2 T1 T2
tAD
A23 to A0
tCSD1
CS7, CS6
tAHD
AH
tRSD1 tRSD2
RD
tAC2
Read tAA6
(RDNn=0) tMAD tMAS1 tMAH tRDS2 tRDH2
tWRD2 tWRD2
HWR, LWR
tWSW
Write
tMAD tWDD tWDH1
tDACD1 tDACD2
DACK0,
DACK1,
DACK3
tEDACD1 tEDACD2
EDACK2,
EDACK3
tAD
A23 to A0
tCSD1
CS7, CS6
tAHD
AH
tRSD1 tRSD2
RD
Read
(RDNn=0) tMAD tMAS2 tMAH tRDS2 tRDH2
tWRD1 tWRD2
WAIT
Figure 27.71 Multiplexed Bus Timing: Data Three-State Access, One Wait
(With address wait: when ADDEX = 1)
T1 T2
A23 to A0
CS7 to CS0
AS
RD
(read)
D15 to D0
(read)
HWR, LWR
(write)
D15 to D0
(write)
tDACD1 tDACD2
DACK0, DACK1,
DACK3
tEDACD1 tEDACD2
EDACK0, EDACK3
Figure 27.72 DMAC and EXDMAC Single Address Transfer Timing: Two-State Access
T1 T2 T3
A23 to A0
CS7 to CS0
AS
RD
(read)
D15 to D0
(read)
HWR, LWR
(write)
D15 to D0
(write)
tDACD1 tDACD2
DACK0, DACK1,
DACK3 tEDACD1 tEDACD2
EDACK2, EDACK3
Figure 27.73 DMAC and EXDMAC Single Address Transfer Timing: Three-State Access
T1 T2 or T3
tTED tTED
TEND0, TEND1,
TEND3, TEND4,
TEND5 tETED tETED
ETEND2, ETEND3
tDRQS tDRQH
DREQ0, DREQ1,
DREQ3, DREQ4,
DREQ5 tEDRQS tEDRQH
EDREQ2, EDREQ3
tEDRKD tEDRKD
EDRAK2, EDRAK3
T1 T2
tPRS tPRH
Ports 1 to 6, 8, 9,
A to J (read)
tPWD
Ports 1 to 3, 6, 8,
P53 to P50,
ports A to J
(write)
φ
tPOD
PO15 to PO0
φ
tTOCD
Output compare
output*
tTICS
Input capture
input*
φ
tTCKS tTCKS
TCLKA to TCLKH
tTCKWL tTCKWH
φ
tTMOD
TMO0, TMO1
φ
tTMCS tTMCS
TMCI0, TMCI1
tTMCWL tTMCWH
tTMRS
TMRI0, TMRI1
tWOVD tWOVD
WDTOVF
SCK0 to SCK4
tScyc
SCK0 to SCK4
tTXD
TxD0 to TxD4
(transmit data)
tRXS tRXH
RxD0 to RxD4
(receive data)
tTRGS
ADTRG0,
ADTRG1
VIH
SDA0
to VIL
SDA1
tBUF
tSCLH tSP tSTOS
tSTAH tSTAS
SCL0
to
SCL1
P* S* Sr* P*
tSCLL
tSf tSr tSDAS
tSCL
tSDAH
SCS (output)
tTD
tLEAD tHI tFALL tRISE tLAG
SSCK (output)
CPOS = 1
tLO
tHI
SSCK (output)
CPOS = 0
tLO tSUcyc
SSO (output)
tOH tOD
SSI (input)
tSU tH
SCS (output)
tTD
tLEAD tHI tFALL tRISE tLAG
SSCK (output)
CPOS = 1
tLO
tHI
SSCK (output)
CPOS = 0
tLO tSUcyc
SSO (output)
tOH tOD
SSI (input)
tSU tH
SCS (input)
SSCK (input)
CPOS = 1
tLO
tHI
SSCK (input)
CPOS = 0
tLO tSUcyc
SSO (input)
tSU tH tREL
SSI (output)
tOH tOD
tSA
SCS (input)
SSCK (input)
CPOS = 1
tLO
tHI
SSCK (input)
CPOS = 0
tLO tSUcyc
SSO (input)
tSU tH tREL
SSI (output)
tCKH tCYC
FSICK
tCKL
FSICK
tSSL tSSH
FSISS
tTXD
FSIDO
tRXS tRXH
FSIDI
Appendix
[CKE-B output,
OPE = 1]
keep
[DAOE3 = 0]
[DAOE2 = 0]
keep
PA2/A18 [OPE = 1]
PA1/A17 keep
keep
T A15 to A8
[OPE = 1]
keep
keep
T A7 to A0
[OPE = 1]
keep
keep
T T D15 to D8,
AD15 to AD8
[Other than the [Other than the
above] above] [Other than the
above]
keep keep
I/O port
T T D7 to D0,
AD7 to AD0
[Other than the [Other than the
above] above] [Other than the
above]
keep keep
I/O port
keep
PF4/HWR T
[OPE = 1]
keep
keep
T T LCAS, DQML
keep
2
PF1/UCAS* / 1, 2, 3, 4, 5, T T [UCAS, DQMU [UCAS, DQMU [UCAS, DQMU
DQMU*1 7 output, output] output]
OPE = 0]
T UCAS
T
[Other than the [Other than the
[UCAS, DQMU above] above]
output,
keep I/O port
OPE = 1]
keep
keep
keep
PH3/OE-A* / 2
1, 2, 3, 4, 5, T T [OE-A, CS, [OE-A, CS, [OE-A, CKE-A
CKE-A*1/CS7 7 CKE-A output, CKE-A output] output]
OPE = 0]
T OE-A, CKE-A
T
[Other than the [CS output]
[OE-A output, above]
CS
OPE = 1]
keep
[Other than the
H
above]
[CS output,
I/O port
OPE = 1]
[CKE-A output,
OPE = 1]
keep
keep
keep
keep
WDTOVF 1, 2, 3, 4, 5, H H H H H*4
7
[Legend]
H: High-level
L: Low-level
Keep: Input ports become high-impedance, and output ports retain their state.
T: High-impedance
DDR: Data direction register
OPE: Output port enable
Notes: 1. Not supported by the H8S/2427 Group.
2. Not supported in the 5-V version.
3. Not incorporated in the PTLG0145JB-A package.
4. Low output if a watchdog timer overflow occurs when WT/IT is set to 1.
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
T T WAIT-B
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
keep
[DAOE3 = 0]T
keep
[DAOE2 = 0]T
[Address output,
OPE = 1]
keep
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
keep
PA2/A18 [OPE = 1]
PA1/A17 keep
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
T A15 to A8
[OPE = 1]
keep
keep
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
T A7 to A0
[OPE = 1]
keep
keep
keep
T T D15 to D8,
AD15 to AD8
[Other than the [Other than the
above] above] [Other than the
above]
keep keep
I/O port
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
T T D7 to D0,
AD7 to AD0
[Other than the [Other than the
above] above] [Other than the
above]
keep keep
I/O port
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
1
PF2/LCAS* / 1, 2, 3, 4, 5, 7 T T [LCAS output, [LCAS output] [LCAS output]
CS6 OPE = 0]
T LCAS
T
[CS output] [CS output]
[LCAS output,
T CS
OPE = 1]
[Other than the [Other than the
H
above] above]
[CS output,
keep I/O port
OPE = 1]
[CS output,
OPE = 1]
keep
1
PF1/UCAS* / 1, 2, 3, 4, 5, 7 T T [UCAS output, [UCAS output] [UCAS output]
CS5 OPE = 0]
T UCAS
T
[CS output] [CS output]
[UCAS output,
T CS
OPE = 1]
[Other than the [Other than the
H
above] above]
[CS output,
keep I/O port
OPE = 1]
[CS output,
OPE = 1]
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
keep
T BREQ-A BREQ-A
keep
MCU Program
Port Name Operating Hardware Software Bus Release Execution State
Pin Name Mode Reset Standby Mode Standby Mode State Sleep Mode
keep
keep
WDTOVP 1, 2, 3, 4, 5, 7 H H H H H*2
[Legend]
H: High-level
L: Low-level
Keep: Input ports become high-impedance, and output ports retain their state.
T: High-impedance
DDR: Data direction register
OPE: Output port enable
B. Package Dimensions
JEITA Package Code RENESAS Code Previous Code MASS[Typ.]
P-LQFP144-20x20-0.50 PLQP0144KA-A 144P6Q-A / FP-144L / FP-144LV 1.2g
HD
*1
D
108 73
NOTE)
109 72 1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
2. DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
bp
b1
c1
c
HE
E
Reference Dimension in Millimeters
*2
Symbol
Min Nom Max
Terminal cross section
D 19.9 20.0 20.1
E 19.9 20.0 20.1
A2 1.4
HD 21.8 22.0 22.2
HE 21.8 22.0 22.2
144 A
37 1.7
ZE
c
ZD Index mark b1 0.20
F
c 0.09 0.145 0.20
A1
L c1 0.125
L1 0° 8°
*3 e 0.5
e bp
y x Detail F x 0.08
y 0.10
ZD 1.25
ZE 1.25
L 0.35 0.5 0.65
L1 1.0
HD
*1
D
90 61
91 60 NOTE)
1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
2. DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
bp
b1
HE
E
c1
c
*2
Reference Dimension in Millimeters
Symbol
Min Nom Max
D 13.9 14.0 14.1
Terminal cross section
E 13.9 14.0 14.1
A2 1.4
120
31
HD 15.8 16.0 16.2
ZE
A2
A
c
c 0.09 0.145 0.20
c1 0.125
L 0° 8°
A1
L1
e 0.4
y
e *3
bp x 0.07
x y
Detail F
0.08
ZD 1.2
ZE 1.2
L 0.35 0.5 0.65
L1 1.0
HD
*1
D
90 61
91 60 NOTE)
1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
2. DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
bp
b1
HE
E
c1
c
Reference Dimension in Millimeters
*2
Symbol
Min Nom Max
D 15.9 16.0 16.1
Terminal cross section
E 15.9 16.0 16.1
A2 1.4
120
31
HD 17.8 18.0 18.2
ZE
A2
A
c 0.09 0.145 0.20
c
c1 0.125
L 0° 8°
A1
L1
e 0.5
y
e *3
bp x 0.08
x
Detail F
y 0.08
ZD 0.75
ZE 0.75
L 0.35 0.5 0.65
L1 1.0
D
w S A w S B
E
x4
v
y1 S
S
A
y S
e ZD
A
N
e
M
L
K Dimension in Millimeters
Reference
J B Symbol
Min Nom Max
H
D 9.0
G
E 9.0
F
v 0.15
E
w 0.20
D
C A 1.2
ZE
B A1
A e 0.65
b 0.30 0.35 0.40
1 2 3 4 5 6 7 8 9 10 11 12 13
x 0.08
φb
φxn S A B y 0.1
y1 0.20
SD
SE
ZD 0.6
ZE 0.6
H8S/2427R R4F24279NVRFQU 512 Kbytes 64 Kbytes 3.0 to 3.6 V -20 to 75°C PLQP0144KA-A
Group R4F24278NVRFQU 512 Kbytes 48 Kbytes 3.0 to 3.6 V
H8S/2427 R4F24279NVFQU 512 Kbytes 64 Kbytes 3.0 to 3.6 V -20 to 75°C PLQP0144KA-A
Group R4F24278NVFQU 512 Kbytes 48 Kbytes 3.0 to 3.6 V
R4F24276NVFQU 384 Kbytes 64 Kbytes 3.0 to 3.6 V
R4F24275NVFQU 384 Kbytes 48 Kbytes 3.0 to 3.6 V
R4F24279NFQU 512 Kbytes 64 Kbytes 4.5 to 5.5 V
R4F24278NFQU 512 Kbytes 48 Kbytes 4.5 to 5.5 V
R4F24276NFQU 384 Kbytes 64 Kbytes 4.5 to 5.5 V
R4F24275NFQU 384 Kbytes 48 Kbytes 4.5 to 5.5 V
R4F24279DWFQU 512 Kbytes 64 Kbytes 2.7 to 3.6 V -40 to 85°C
H8S/2425 R4F24259NVFPU 512 Kbytes 64 Kbytes 3.0 to 3.6 V -20 to 75°C PLQP0120LA-A
Group R4F24258NVFPU 512 Kbytes 48 Kbytes 3.0 to 3.6 V
R4F24256NVFPU 384 Kbytes 64 Kbytes 3.0 to 3.6 V
R4F24255NVFPU 384 Kbytes 48 Kbytes 3.0 to 3.6 V
R4F24259NFPU 512 Kbytes 64 Kbytes 4.5 to 5.5 V
R4F24258NFPU 512 Kbytes 48 Kbytes 4.5 to 5.5 V
R4F24256NFPU 384 Kbytes 64 Kbytes 4.5 to 5.5 V
R4F24255NFPU 384 Kbytes 48 Kbytes 4.5 to 5.5 V
R4F24259DWFPU 512 Kbytes 64 Kbytes 2.7 to 3.6 V -40 to 85°C
φ × 106
N= −1
32 × 2 2n−1 × B
φ × 106
N= −1
8 × 2 2n−1 × B
φ × 106
N= −1
S × 2 2n+1 × B
Note: * If this bit is set the same as the TRGS_1, TRGS0, and EXTRGS bits
in ADCR_1, the A/D converter units 0 and 1 start A/D conversion by
conversion start trigger from TPU (units 0 and 1).
Notes: 1. If this bit is set the same as the TRGS_1, TRGS0, and EXTRGS
bits in ADCR_0, the A/D converter units 0 and 1 start A/D
conversion by conversion start trigger from TPU (units 0 and 1).
2. Setting prohibited in the H8S/2425 Group.
18.7.10 Notes on 18-28 Added
Start of A/D
Conversion by
Conversion Start
Trigger from TPU
(Units 0 and 1)
2 2
ports 6* and 8* ,
2
Table 27.53 DC 1396, PA4 to PA7* ,
2 2
Characteristics (1) 1397 ports B* and C* ,
2 2
PF1* , PF2* ,
2 2
PH2* , PH3*
5
Input high voltage P14 to P17* ,
5
P24 to P26* ,
3
port 3* ,
3
P50 to P53* ,
3 3 3
ports 6* and 8* , ports A to J*
5
Input low voltage P14 to P17* ,
5
P24 to P26* ,
3 3 3
ports 3* , 5* , and 6* ,
3
port 8* ,
3
ports A to J*
Notes: 5. When used as SSO, SSI, SSCK, SCS, WAIT, or ADTRG1.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, or
ADTRG1.
2
port 8* , PA4 to
2 2
Table 27.66 DC 1412, PA7* , ports B*
2 2
Characteristics (1) 1413 and C* , PF1* ,
2 2
PF2* , P81*
2
and P83*
5
Input high voltage P10 to P11* ,
5
P14 to P17* ,
5
P24 to P26* ,
3
port 3* ,
3
P50 to P53* ,
3
port 8* , ports A
3
to G*
5
Input low voltage P10 to P11* ,
5
P14 to P17* ,
5
P24 to P26*
3 3
ports 3* and 5* ,
3
port 8* ,
3
ports A to G*
Notes: 5. When used as SSO, SSI, SSCK, SCS, WAIT, ADTRG1 or DREQ.
6. When used as other than SSO, SSI, SSCK, SCS, WAIT, ADTRG1
or DREQ.
L
F List of registers ..................................... 1241
Flash memory ....................................... 1137 Logic operations instructions.................... 70
Framing error.......................................... 944
Full-scale error...................................... 1062
M
Mark state ............................................... 984
G MCU operating modes.............................. 87
General call address.............................. 1011 Memory indirect ....................................... 79
General registers ....................................... 58 Multi-channel operation.......................... 418
Multiply-accumulate register (MAC) ....... 61
I
I/O port states in each processing N
state....................................................... 1447 NMI ........................................................ 155
I/O ports.................................................. 537 NMI interrupt.......................................... 137
Nonlinearity error ................................. 1062
R01UH0311EJ0300
(REJ09B0565-0100)