User's Manual
The revision list summarizes the locations of
revisions and additions. Details should always
be checked by referring to the relevant text.
SH7670
Group
32
User’s Manual: Hardware
Renesas 32-Bit RISC Microcomputer
SuperHTM RISC engine Family / SH7670 Series
SH7670
SH7671
SH7672
SH7673
R5S76700
R5S76710
R5S76720
R5S76730
All information contained in these materials, including products and product specifications,
represents information on the product at the time of publication and is subject to change by
Renesas Electronics Corp. without notice. Please review the latest information published
by Renesas Electronics Corp. through various means, including the Renesas Electronics
Corp. website (http://www.renesas.com).
www.renesas.com
Rev.3.00 Jun 2011
Page ii of xxvi
Notice
1.
All information included in this document is current as of the date this document is issued. Such information, however, is
subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please
confirm the latest product information with a Renesas Electronics sales office. Also, please pay regular and careful attention to
additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website.
2. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights
of third parties by or arising from the use of Renesas Electronics products or technical information described in this document.
No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights
of Renesas Electronics or others.
3. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part.
4. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of
semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software,
and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by
you or third parties arising from the use of these circuits, software, or information.
5. When exporting the products or technology described in this document, you should comply with the applicable export control
laws and regulations and follow the procedures required by such laws and regulations. You should not use Renesas
Electronics products or the technology described in this document for any purpose relating to military applications or use by
the military, including but not limited to the development of weapons of mass destruction. Renesas Electronics products and
technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited
under any applicable domestic or foreign laws or regulations.
6. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics
does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages
incurred by you resulting from errors in or omissions from the information included herein.
7. Renesas Electronics products are classified according to the following three quality grades: "Standard", "High Quality", and
"Specific". The recommended applications for each Renesas Electronics product depends on the product's quality grade, as
indicated below. You must check the quality grade of each Renesas Electronics product before using it in a particular
application. You may not use any Renesas Electronics product for any application categorized as "Specific" without the prior
written consent of Renesas Electronics. Further, you may not use any Renesas Electronics product for any application for
which it is not intended without the prior written consent of Renesas Electronics. Renesas Electronics shall not be in any way
liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an
application categorized as "Specific" or for which the product is not intended where you have failed to obtain the prior written
consent of Renesas Electronics. The quality grade of each Renesas Electronics product is "Standard" unless otherwise
expressly specified in a Renesas Electronics data sheets or data books, etc.
"Standard":
Computers; office equipment; communications equipment; test and measurement equipment; audio and visual
equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots.
"High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anticrime systems; safety equipment; and medical equipment not specifically designed for life support.
"Specific":
Aircraft; aerospace equipment; submersible repeaters; nuclear reactor control systems; medical equipment or
systems for life support (e.g. artificial life support devices or systems), surgical implantations, or healthcare
intervention (e.g. excision, etc.), and any other applications or purposes that pose a direct threat to human life.
8. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics,
especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation
characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or
damages arising out of the use of Renesas Electronics products beyond such specified ranges.
9. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have
specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further,
Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to
guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a
Renesas Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire
control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because
the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system
manufactured by you.
10. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental
compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable
laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS
Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with
applicable laws and regulations.
11. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written consent of Renesas
Electronics.
12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this
document or Renesas Electronics products, or if you have any other inquiries.
(Note 1) "Renesas Electronics" as used in this document means Renesas Electronics Corporation and also includes its majorityowned subsidiaries.
(Note 2) "Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics.
Page iii of xxvi
General Precautions in the Handling of MPU/MCU Products
The following usage notes are applicable to all MPU/MCU products from Renesas. For detailed usage notes
on the products covered by this manual, refer to the relevant sections of the manual. If the descriptions under
General Precautions in the Handling of MPU/MCU Products and in the body of the manual differ from each
other, the description in the body of the manual takes precedence.
1. Handling of Unused Pins
Handle unused pins in accord with the directions given under Handling of Unused Pins in the
manual.
⎯ The input pins of CMOS products are generally in the high-impedance state. In operation
with an unused pin in the open-circuit state, extra electromagnetic noise is induced in the
vicinity of LSI, an associated shoot-through current flows internally, and malfunctions occur
due to the false recognition of the pin state as an input signal become possible. Unused
pins should be handled as described under Handling of Unused Pins in the manual.
2. Processing at Power-on
The state of the product is undefined at the moment when power is supplied.
⎯ The states of internal circuits in the LSI are indeterminate and the states of register
settings and pins are undefined at the moment when power is supplied.
In a finished product where the reset signal is applied to the external reset pin, the states
of pins are not guaranteed from the moment when power is supplied until the reset
process is completed.
In a similar way, the states of pins in a product that is reset by an on-chip power-on reset
function are not guaranteed from the moment when power is supplied until the power
reaches the level at which resetting has been specified.
3. Prohibition of Access to Reserved Addresses
Access to reserved addresses is prohibited.
⎯ The reserved addresses are provided for the possible future expansion of functions. Do
not access these addresses; the correct operation of LSI is not guaranteed if they are
accessed.
4. Clock Signals
After applying a reset, only release the reset line after the operating clock signal has become
stable. When switching the clock signal during program execution, wait until the target clock
signal has stabilized.
⎯ When the clock signal is generated with an external resonator (or from an external
oscillator) during a reset, ensure that the reset line is only released after full stabilization of
the clock signal. Moreover, when switching to a clock signal produced with an external
resonator (or by an external oscillator) while program execution is in progress, wait until
the target clock signal is stable.
5. Differences between Products
Before changing from one product to another, i.e. to one with a different type number, confirm
that the change will not lead to problems.
⎯ The characteristics of MPU/MCU in the same group but having different type numbers may
differ because of the differences in internal memory capacity and layout pattern. When
changing to products of different type numbers, implement a system-evaluation test for
each of the products.
Page iv of xxvi
How to Use This Manual
1. Objective and Target Users
This manual was written to explain the hardware functions and electrical characteristics of this
LSI to the target users, i.e. those who will be using this LSI in the design of application
systems. Target users are expected to understand the fundamentals of electrical circuits, logic
circuits, and microcomputers.
This manual is organized in the following items: an overview of the product, descriptions of
the CPU, system control functions, and peripheral functions, electrical characteristics of the
device, and usage notes.
When designing an application system that includes this LSI, take all points to note into
account. Points to note are given in their contexts and at the final part of each section, and
in the section giving usage notes.
The list of revisions is a summary of major points of revision or addition for earlier versions.
It does not cover all revised items. For details on the revised points, see the actual locations
in the manual.
The following documents have been prepared for the SH7670 Group. Before using any of the
documents, please visit our web site to verify that you have the most up-to-date available
version of the document.
Document Type
Contents
Document Title
Document No.
Data Sheet
Overview of hardware and electrical ⎯
characteristics
⎯
User's manual for
Hardware
Hardware specifications (pin
assignments, memory maps,
peripheral specifications, electrical
characteristics, and timing charts)
and descriptions of operation
SH7670 Group
User's Manual: Hardware
This User's
manual
User's manual for
Software
Detailed descriptions of the CPU
and instruction set
SH-2A, SH2A-FPU
Software Manual
REJ09B0051
Application Note
Examples of applications and
sample programs
The latest versions are available from our
web site.
Renesas Technical
Update
Preliminary report on the
specifications of a product,
document, etc.
Page v of xxvi
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.
(1) Overall notation
In descriptions involving the names of bits and bit fields within this manual, the modules and
registers to which the bits belong may be clarified by giving the names in the forms
"module name"."register name"."bit name" or "register name"."bit name".
(2) Register notation
The style "register name"_"instance number" is used in cases where there is more than one
instance of the same function or similar functions.
[Example] CMCSR_0: Indicates the CMCSR register for the compare-match timer of channel 0.
(3) Number notation
Binary numbers are given as B'nnnn (B' may be omitted if the number is obviously binary),
hexadecimal numbers are given as H'nnnn or 0xnnnn, and decimal numbers are given as nnnn.
[Examples] Binary:
B'11 or 11
Hexadecimal: H'EFA0 or 0xEFA0
Decimal:
1234
(4) Notation for active-low
An overbar on the name indicates that a signal or pin is active-low.
[Example] WDTOVF
(4)
(2)
14.2.2 Compare Match Control/Status Register_0, _1 (CMCSR_0, CMCSR_1)
CMCSR indicates compare match generation, enables or disables interrupts, and selects the counter
input clock. Generation of a WDTOVF signal or interrupt initializes the TCNT value to 0.
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 xxvi
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.
[Bit Chart]
Bit:
Initial value:
R/W:
15
14
⎯
⎯
13
12
11
ASID2 ASID1 ASID0
10
9
8
7
6
5
4
⎯
⎯
⎯
⎯
⎯
⎯
Q
3
2
1
ACMP2 ACMP1 ACMP0
0
IFE
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
R/W
R/W
R/W
R/W
R/W
R
R
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
(1)
[Table of Bits]
Bit
(2)
(3)
(4)
(5)
Bit Name
−
−
Initial Value R/W
Description
0
0
R
R
Reserved
These bits are always read as 0.
13 to 11
ASID2 to
ASID0
All 0
R/W
Address Identifier
These bits enable or disable the pin function.
10
−
0
R
Reserved
This bit is always read as 0.
9
−
1
R
Reserved
This bit is always read as 1.
−
0
15
14
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.
The bit or field is readable.
R:
"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.
The bit or field is writable.
W:
(5) Description
Describes the function of the bit or field and specifies the values for writing.
Page vii of xxvi
4. Description of Abbreviations
The abbreviations used in this manual are listed below.
•
Abbreviations specific to this product
Abbreviation
Description
BSC
Bus controller
CPG
DTC
INTC
Clock pulse generator
Data transfer controller
Interrupt controller
• Abbreviations other than those listed above
Abbreviation
Description
ACIA
Asynchronous communications interface adapter
bps
CRC
DMA
Bits per second
Cyclic redundancy check
Direct memory access
DMAC
GSM
Hi-Z
I/O
IrDA
LSB
MSB
NC
PLL
PWM
SFR
SIM
UART
VCO
Direct memory access controller
Global System for Mobile Communications
High impedance
Input/output
Infrared Data Association
Least significant bit
Most significant bit
No connection
Phase-locked loop
Pulse width modulation
Special function register
Subscriber Identity Module
Universal asynchronous receiver/transmitter
Voltage-controlled oscillator
All trademarks and registered trademarks are the property of their respective owners.
Page viii of xxvi
Contents
Section 1 Overview................................................................................................1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
Features.................................................................................................................................. 1
Applications ........................................................................................................................... 2
Overview of Specifications.................................................................................................... 2
Product Lineup..................................................................................................................... 12
Block Diagram ..................................................................................................................... 13
Pin Assignments................................................................................................................... 14
Pin Functions ....................................................................................................................... 15
Section 2 CPU......................................................................................................31
2.1
2.2
2.3
2.4
2.5
Register Configuration......................................................................................................... 31
2.1.1 General Registers.................................................................................................... 31
2.1.2 Control Registers .................................................................................................... 32
2.1.3 System Registers..................................................................................................... 34
2.1.4 Register Banks ........................................................................................................ 35
2.1.5 Initial Values of Registers....................................................................................... 35
Data Formats........................................................................................................................ 36
2.2.1 Data Format in Registers ........................................................................................ 36
2.2.2 Data Formats in Memory ........................................................................................ 36
2.2.3 Immediate Data Format .......................................................................................... 37
Instruction Features.............................................................................................................. 38
2.3.1 RISC-Type Instruction Set...................................................................................... 38
2.3.2 Addressing Modes .................................................................................................. 42
2.3.3 Instruction Format................................................................................................... 47
Instruction Set ...................................................................................................................... 51
2.4.1 Instruction Set by Classification ............................................................................. 51
2.4.2 Data Transfer Instructions....................................................................................... 57
2.4.3 Arithmetic Operation Instructions .......................................................................... 61
2.4.4 Logic Operation Instructions .................................................................................. 64
2.4.5 Shift Instructions..................................................................................................... 65
2.4.6 Branch Instructions ................................................................................................. 66
2.4.7 System Control Instructions.................................................................................... 67
2.4.8 Floating-Point Operation Instructions..................................................................... 69
2.4.9 FPU-Related CPU Instructions ............................................................................... 71
2.4.10 Bit Manipulation Instructions ................................................................................. 72
Processing States.................................................................................................................. 74
Page ix of xxvi
Section 3 Floating-Point Unit (FPU)................................................................... 77
3.1
3.2
3.3
3.4
3.5
Features................................................................................................................................ 77
Data Formats........................................................................................................................ 78
3.2.1 Floating-Point Format............................................................................................. 78
3.2.2 Non-Numbers (NaN) .............................................................................................. 81
3.2.3 Denormalized Numbers .......................................................................................... 82
Register Descriptions........................................................................................................... 83
3.3.1 Floating-Point Registers ......................................................................................... 83
3.3.2 Floating-Point Status/Control Register (FPSCR) ................................................... 84
3.3.3 Floating-Point Communication Register (FPUL) ................................................... 85
Rounding.............................................................................................................................. 86
Floating-Point Exceptions.................................................................................................... 87
3.5.1 FPU Exception Sources .......................................................................................... 87
3.5.2 FPU Exception Handling ........................................................................................ 88
Section 4 Cache ................................................................................................... 89
4.1
4.2
4.3
4.4
Features................................................................................................................................ 89
4.1.1 Cache Structure....................................................................................................... 89
Register Descriptions........................................................................................................... 92
4.2.1 Cache Control Register 1 (CCR1) .......................................................................... 92
4.2.2 Cache Control Register 2 (CCR2) .......................................................................... 94
Operation ............................................................................................................................. 98
4.3.1 Searching Cache ..................................................................................................... 98
4.3.2 Read Access.......................................................................................................... 100
4.3.3 Prefetch Operation (Only for Operand Cache) ..................................................... 100
4.3.4 Write Operation (Only for Operand Cache) ......................................................... 101
4.3.5 Write-Back Buffer (Only for Operand Cache) ..................................................... 101
4.3.6 Coherency of Cache and External Memory.......................................................... 103
Memory-Mapped Cache .................................................................................................... 104
4.4.1 Address Array....................................................................................................... 104
4.4.2 Data Array ............................................................................................................ 105
4.4.3 Usage Examples.................................................................................................... 107
4.4.4 Notes..................................................................................................................... 108
Section 5 Exception Handling ........................................................................... 109
5.1
5.2
Overview............................................................................................................................ 109
5.1.1 Types of Exception Handling and Priority ........................................................... 109
5.1.2 Exception Handling Operations............................................................................ 111
5.1.3 Exception Handling Vector Table ........................................................................ 113
Resets................................................................................................................................. 115
Page x of xxvi
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.2.1 Input/Output Pins.................................................................................................. 115
5.2.2 Types of Reset ...................................................................................................... 115
5.2.3 Power-On Reset .................................................................................................... 116
5.2.4 Manual Reset ........................................................................................................ 118
Address Errors ................................................................................................................... 119
5.3.1 Address Error Sources .......................................................................................... 119
5.3.2 Address Error Exception Handling ....................................................................... 120
Register Bank Errors.......................................................................................................... 121
5.4.1 Register Bank Error Sources................................................................................. 121
5.4.2 Register Bank Error Exception Handling ............................................................. 121
Interrupts............................................................................................................................ 122
5.5.1 Interrupt Sources................................................................................................... 122
5.5.2 Interrupt Priority Level ......................................................................................... 123
5.5.3 Interrupt Exception Handling ............................................................................... 124
Exceptions Triggered by Instructions ................................................................................ 125
5.6.1 Types of Exceptions Triggered by Instructions .................................................... 125
5.6.2 Trap Instructions ................................................................................................... 126
5.6.3 Slot Illegal Instructions ......................................................................................... 126
5.6.4 General Illegal Instructions................................................................................... 126
5.6.5 Integer Division Instructions................................................................................. 127
5.6.6 Floating-Point Operation Instruction .................................................................... 128
When Exception Sources Are Not Accepted ..................................................................... 129
Stack Status after Exception Handling Ends...................................................................... 130
Usage Notes ....................................................................................................................... 132
5.9.1 Value of Stack Pointer (SP) .................................................................................. 132
5.9.2 Value of Vector Base Register (VBR) .................................................................. 132
5.9.3 Address Errors Caused by Stacking of Address Error Exception Handling ......... 132
Section 6 Interrupt Controller (INTC) ...............................................................133
6.1
6.2
6.3
6.4
Features.............................................................................................................................. 133
Input/Output Pins ............................................................................................................... 135
Register Descriptions ......................................................................................................... 136
6.3.1 Interrupt Priority Registers 01, 02, 06 to 16 (IPR01, IPR02, IPR06 to IPR16) .... 137
6.3.2 Interrupt Control Register 0 (ICR0)...................................................................... 139
6.3.3 Interrupt Control Register 1 (ICR1)...................................................................... 140
6.3.4 IRQ Interrupt Request Register (IRQRR)............................................................. 141
6.3.5 Bank Control Register (IBCR).............................................................................. 143
6.3.6 Bank Number Register (IBNR) ............................................................................ 144
Interrupt Sources................................................................................................................ 145
6.4.1 NMI Interrupt........................................................................................................ 145
Page xi of xxvi
6.4.2 User Break Interrupt ............................................................................................. 145
6.4.3 H-UDI Interrupt .................................................................................................... 145
6.4.4 IRQ Interrupts....................................................................................................... 146
6.4.5 On-Chip Peripheral Module Interrupts ................................................................. 147
6.5 Interrupt Exception Handling Vector Table and Priority................................................... 148
6.6 Operation ........................................................................................................................... 153
6.6.1 Interrupt Operation Sequence ............................................................................... 153
6.6.2 Stack after Interrupt Exception Handling ............................................................. 156
6.7 Interrupt Response Time.................................................................................................... 157
6.8 Register Banks ................................................................................................................... 163
6.8.1 Banked Register and Input/Output of Banks ........................................................ 164
6.8.2 Bank Save and Restore Operations....................................................................... 164
6.8.3 Save and Restore Operations after Saving to All Banks....................................... 166
6.8.4 Register Bank Exception ...................................................................................... 167
6.8.5 Register Bank Error Exception Handling ............................................................. 167
6.9 Data Transfer with Interrupt Request Signals.................................................................... 168
6.9.1 Handling Interrupt Request Signals as Sources for CPU Interrupt but Not
DMAC Activating ................................................................................................ 169
6.9.2 Handling Interrupt Request Signals as Sources for Activating DMAC but Not
CPU Interrupt........................................................................................................ 169
6.10 Usage Note......................................................................................................................... 170
6.10.1 Timing to Clear an Interrupt Source ..................................................................... 170
Section 7 Bus State Controller (BSC) ............................................................... 171
7.1
7.2
7.3
7.4
7.5
Features.............................................................................................................................. 171
Input/Output Pins............................................................................................................... 174
Area Overview................................................................................................................... 176
7.3.1 Address Map......................................................................................................... 176
7.3.2 Data Bus Width and Pin Function Setting in Each Area ...................................... 177
Register Descriptions......................................................................................................... 178
7.4.1 Common Control Register (CMNCR) .................................................................. 179
7.4.2 CSn Space Bus Control Register (CSnBCR) (n = 0, 3 to 6) ................................. 181
7.4.3 CSn Space Wait Control Register (CSnWCR) (n = 0, 3 to 6) .............................. 186
7.4.4 SDRAM Control Register (SDCR)....................................................................... 207
7.4.5 Refresh Timer Control/Status Register (RTCSR)................................................. 210
7.4.6 Refresh Timer Counter (RTCNT)......................................................................... 212
7.4.7 Refresh Time Constant Register (RTCOR) .......................................................... 213
7.4.8 Internal Bus Master Bus Priority Register (IBMPR) ............................................ 214
Operation ........................................................................................................................... 216
7.5.1 Endian/Access Size and Data Alignment.............................................................. 216
Page xii of xxvi
7.5.2
7.5.3
7.5.4
7.5.5
7.5.6
7.5.7
7.5.8
7.5.9
Normal Space Interface......................................................................................... 223
Access Wait Control ............................................................................................. 228
CSn Assert Period Expansion ............................................................................... 230
SDRAM Interface ................................................................................................. 231
SRAM Interface with Byte Selection.................................................................... 271
PCMCIA Interface................................................................................................ 276
Wait between Access Cycles ................................................................................ 283
Others.................................................................................................................... 289
Section 8 Direct Memory Access Controller (DMAC) .....................................293
8.1
8.2
8.3
8.4
8.5
Features.............................................................................................................................. 293
Input/Output Pins ............................................................................................................... 296
Register Descriptions ......................................................................................................... 297
8.3.1 DMA Source Address Registers (SAR)................................................................ 301
8.3.2 DMA Destination Address Registers (DAR)........................................................ 302
8.3.3 DMA Transfer Count Registers (DMATCR) ....................................................... 302
8.3.4 DMA Channel Control Registers (CHCR) ........................................................... 303
8.3.5 DMA Reload Source Address Registers (RSAR) ................................................. 312
8.3.6 DMA Reload Destination Address Registers (RDAR) ......................................... 313
8.3.7 DMA Reload Transfer Count Registers (RDMATCR)......................................... 314
8.3.8 DMA Operation Register (DMAOR) ................................................................... 315
8.3.9 DMA Extension Resource Selectors 0 to 3 (DMARS0 to DMARS3).................. 319
Operation ........................................................................................................................... 321
8.4.1 Transfer Flow........................................................................................................ 321
8.4.2 DMA Transfer Requests ....................................................................................... 323
8.4.3 Channel Priority.................................................................................................... 327
8.4.4 DMA Transfer Types............................................................................................ 330
8.4.5 Number of Bus Cycles and DREQ Pin Sampling Timing .................................... 339
Usage Notes ....................................................................................................................... 343
8.5.1 NMIF Bit (NMI Flag) in DMA Operation Register (DMAOR) ........................... 343
8.5.2 Half-End Flag Setting and Half-End Interrupt Generation ................................... 343
Section 9 Clock Pulse Generator (CPG)............................................................345
9.1
9.2
9.3
9.4
9.5
Features.............................................................................................................................. 345
Input/Output Pins ............................................................................................................... 349
Clock Operating Modes ..................................................................................................... 351
Register Descriptions ......................................................................................................... 356
9.4.1 Frequency Control Register (FRQCR) ................................................................. 356
Changing the Frequency .................................................................................................... 359
9.5.1 Changing the Multiplication Rate ......................................................................... 359
Page xiii of xxvi
9.6
9.5.2 Changing the Division Ratio................................................................................. 360
Notes on Board Design ...................................................................................................... 361
9.6.1 Note on Inputting External Clock ......................................................................... 361
9.6.2 Note on Using an External Crystal Resonator ...................................................... 361
9.6.3 Note on Resonator ................................................................................................ 362
9.6.4 Note on Using a PLL Oscillation Circuit.............................................................. 362
Section 10 Watchdog Timer (WDT) ................................................................. 363
10.1 Features.............................................................................................................................. 363
10.2 Input/Output Pin ................................................................................................................ 364
10.3 Register Descriptions......................................................................................................... 365
10.3.1 Watchdog Timer Counter (WTCNT).................................................................... 365
10.3.2 Watchdog Timer Control/Status Register (WTCSR)............................................ 366
10.3.3 Watchdog Reset Control/Status Register (WRCSR) ............................................ 368
10.3.4 Notes on Register Access ..................................................................................... 369
10.4 WDT Usage ....................................................................................................................... 371
10.4.1 Canceling Software Standby Mode ...................................................................... 371
10.4.2 Changing the Frequency ....................................................................................... 371
10.4.3 Using Watchdog Timer Mode .............................................................................. 372
10.4.4 Using Interval Timer Mode .................................................................................. 374
10.5 Usage Notes ....................................................................................................................... 375
10.5.1 Timer Variation .................................................................................................... 375
10.5.2 Prohibition against Setting H'FF to WTCNT........................................................ 375
10.5.3 System Reset by WDTOVF Signal....................................................................... 375
10.5.4 Manual Reset in Watchdog Timer Mode.............................................................. 376
Section 11 Power-Down Modes........................................................................ 377
11.1 Features.............................................................................................................................. 377
11.1.1 Power-Down Modes ............................................................................................. 377
11.2 Register Descriptions......................................................................................................... 378
11.2.1 Standby Control Register (STBCR)...................................................................... 379
11.2.2 Standby Control Register 2 (STBCR2)................................................................. 380
11.2.3 Standby Control Register 3 (STBCR3)................................................................. 382
11.2.4 Standby Control Register 4 (STBCR4)................................................................. 384
11.2.5 System Control Register 1 (SYSCR1) .................................................................. 386
11.2.6 System Control Register 2 (SYSCR2) .................................................................. 388
11.2.7 System Control Register 3 (SYSCR3) .................................................................. 390
11.3 Operation ........................................................................................................................... 391
11.3.1 Sleep Mode ........................................................................................................... 391
11.3.2 Software Standby Mode........................................................................................ 392
Page xiv of xxvi
11.3.3 Software Standby Mode Application Example..................................................... 394
11.3.4 Module Standby Function..................................................................................... 395
11.4 Usage Notes ....................................................................................................................... 396
Section 12 Ethernet Controller (EtherC)............................................................397
12.1 Features.............................................................................................................................. 397
12.2 Input/Output Pins ............................................................................................................... 399
12.3 Register Description........................................................................................................... 401
12.3.1 EtherC Mode Register (ECMR)............................................................................ 402
12.3.2 EtherC Status Register (ECSR) ............................................................................ 405
12.3.3 EtherC Interrupt Permission Register (ECSIPR) .................................................. 407
12.3.4 PHY Interface Register (PIR) ............................................................................... 408
12.3.5 MAC Address High Register (MAHR) ................................................................ 409
12.3.6 MAC Address Low Register (MALR).................................................................. 410
12.3.7 Receive Frame Length Register (RFLR) .............................................................. 411
12.3.8 PHY Status Register (PSR)................................................................................... 412
12.3.9 Transmit Retry Over Counter Register (TROCR) ................................................ 413
12.3.10 Delayed Collision Detect Counter Register (CDCR)............................................ 414
12.3.11 Lost Carrier Counter Register (LCCR)................................................................. 415
12.3.12 Carrier Not Detect Counter Register (CNDCR) ................................................... 416
12.3.13 CRC Error Frame Counter Register (CEFCR)...................................................... 417
12.3.14 Frame Receive Error Counter Register (FRECR)................................................. 418
12.3.15 Too-Short Frame Receive Counter Register (TSFRCR)....................................... 419
12.3.16 Too-Long Frame Receive Counter Register (TLFRCR)....................................... 420
12.3.17 Residual-Bit Frame Counter Register (RFCR) ..................................................... 421
12.3.18 Multicast Address Frame Counter Register (MAFCR)......................................... 422
12.3.19 IPG Register (IPGR)............................................................................................. 423
12.3.20 Automatic PAUSE Frame Set Register (APR) ..................................................... 424
12.3.21 Manual PAUSE Frame Set Register (MPR) ......................................................... 425
12.3.22 PAUSE Frame Retransfer Count Set Register (TPAUSER)................................. 426
12.4 Operation ........................................................................................................................... 427
12.4.1 Transmission......................................................................................................... 427
12.4.2 Reception .............................................................................................................. 429
12.4.3 MII Frame Timing ................................................................................................ 430
12.4.4 Accessing MII Registers ....................................................................................... 432
12.4.5 Magic Packet Detection ........................................................................................ 435
12.4.6 Operation by IPG Setting...................................................................................... 436
12.4.7 Flow Control......................................................................................................... 436
12.5 Connection to PHY-LSI..................................................................................................... 437
12.6 Usage Notes ....................................................................................................................... 438
Page xv of xxvi
Section 13 Ethernet Controller Direct Memory Access Controller
(E-DMAC)....................................................................................... 439
13.1 Features.............................................................................................................................. 439
13.2 Register Descriptions......................................................................................................... 440
13.2.1 E-DMAC Mode Register (EDMR)....................................................................... 441
13.2.2 E-DMAC Transmit Request Register (EDTRR) .................................................. 443
13.2.3 E-DMAC Receive Request Register (EDRRR).................................................... 444
13.2.4 Transmit Descriptor List Address Register (TDLAR).......................................... 445
13.2.5 Receive Descriptor List Address Register (RDLAR) ........................................... 446
13.2.6 EtherC/E-DMAC Status Register (EESR)............................................................ 447
13.2.7 EtherC/E-DMAC Status Interrupt Permission Register (EESIPR)....................... 452
13.2.8 Transmit/Receive Status Copy Enable Register (TRSCER)................................. 455
13.2.9 Receive Missed-Frame Counter Register (RMFCR) ............................................ 457
13.2.10 Transmit FIFO Threshold Register (TFTR).......................................................... 458
13.2.11 FIFO Depth Register (FDR) ................................................................................. 459
13.2.12 Receiving Method Control Register (RMCR) ...................................................... 460
13.2.13 E-DMAC Operation Control Register (EDOCR) ................................................. 461
13.2.14 Receiving-Buffer Write Address Register (RBWAR) .......................................... 462
13.2.15 Receiving-Descriptor Fetch Address Register (RDFAR) ..................................... 463
13.2.16 Transmission-Buffer Read Address Register (TBRAR)....................................... 463
13.2.17 Transmission-Descriptor Fetch Address Register (TDFAR) ................................ 464
13.2.18 Flow Control FIFO Threshold Register (FCFTR) ................................................ 464
13.2.19 Receive Data Padding Setting Register (RPADIR) .............................................. 466
13.2.20 Transmit Interrupt Register (TRIMD) .................................................................. 467
13.2.21 Checksum Mode Register (CSMR) ...................................................................... 467
13.2.22 Checksum Skipped Bytes Monitor Register (CSSBM ) ....................................... 469
13.2.23 Checksum Monitor Register (CSSMR) ................................................................ 470
13.3 Operation ........................................................................................................................... 471
13.3.1 Descriptor List and Data Buffers .......................................................................... 471
13.3.2 Transmission......................................................................................................... 483
13.3.3 Reception .............................................................................................................. 485
13.3.4 Multi-Buffer Frame Transmit/Receive Processing ............................................... 487
13.3.5 Padding Receive Data........................................................................................... 489
13.3.6 Checksum Calculation Function ........................................................................... 490
13.3.7 Usage Notes .......................................................................................................... 493
Section 14 DMAC That Works with Encryption/Decryption and Forward
Error Correction Core (A-DMAC) .................................................. 495
14.1 Overview............................................................................................................................ 495
14.1.1 Features................................................................................................................. 495
Page xvi of xxvi
14.2
14.3
14.4
14.5
14.1.2 Overall Configuration of the A-DMAC................................................................ 496
14.1.3 Restrictions on the A-DMAC ............................................................................... 499
Register Descriptions ......................................................................................................... 500
14.2.1 Channel [i] Processing Control Register (C[i]C) (i = 0, 1) ................................... 501
14.2.2 Channel [i] Processing Mode Register (C[i]M) (i = 0, 1) ..................................... 504
14.2.3 Channel [i] Processing Interrupt Request Register (C[i]I) (i = 0, 1) ..................... 505
14.2.4 Channel [i] Processing Descriptor Start Address Register (C[i]DSA)
(i = 0, 1) ................................................................................................................ 507
14.2.5 Channel [i] Processing Descriptor Current Address Register (C[i]DCA)
(i = 0, 1) ................................................................................................................ 508
14.2.6 Channel [i] Processing Descriptor 0 Register (C[i]D0) [Control] (i = 0, 1).......... 509
14.2.7 Channel [i] Processing Descriptor 1 Register (C[i]D1)
[Source Address] (i = 0, 1).................................................................................... 515
14.2.8 Channel [i] Processing Descriptor 2 Register (C[i]D2)
[Destination Address] (i = 0, 1) ............................................................................ 516
14.2.9 Channel [i] Processing Descriptor 3 Register (C[i]D3)
[Data Length] (i = 0, 1)......................................................................................... 516
14.2.10 Channel [i] Processing Descriptor 4 Register (C[i]D4)
[Checksum Value Write Address] (i = 0, 1) ......................................................... 518
14.2.11 FEC DMAC Processing Control Register (FECC) ............................................... 519
14.2.12 FEC DMAC Processing Interrupt Request Register (FECI)................................. 522
14.2.13 FEC DMAC Processing Descriptor Start Address Register (FECDSA)............... 525
14.2.14 FEC DMAC Processing Descriptor Current Address Register (FECDCA) ......... 526
14.2.15 FEC DMAC Processing Descriptor 0 Register (FECD00) [Control] ................... 527
14.2.16 FEC DMAC Processing Descriptor 1 Register (FECD01D0A)
[Destination Address] ........................................................................................... 531
14.2.17 FEC DMAC Processing Descriptor 2 Register (FECD02S0A)
[Source 0 Address]................................................................................................ 531
14.2.18 FEC DMAC Processing Descriptor 3 Register (FECD03S1A)
[Source 1 Address]................................................................................................ 532
Functions............................................................................................................................ 533
14.3.1 DMAC Channel Function ..................................................................................... 534
14.3.2 Checksum ............................................................................................................. 534
14.3.3 FEC Channel......................................................................................................... 534
14.3.4 FEC Operation ...................................................................................................... 535
Channel Operation ............................................................................................................. 536
14.4.1 Descriptor Format ................................................................................................. 536
14.4.2 Basic Channel Operation ...................................................................................... 537
14.4.3 Checksum ............................................................................................................. 538
FEC Channel Operation ..................................................................................................... 540
Page xvii of xxvi
14.5.1 Descriptor Format for FEC Channel..................................................................... 540
14.5.2 Basic FEC Channel Operation .............................................................................. 541
14.6 Usage Notes ....................................................................................................................... 543
14.6.1 Data Transfer Size Set in Descriptor for A-DMAC Channel Operation............... 543
Section 15 Stream Interface (STIF)................................................................... 545
15.1 Features.............................................................................................................................. 545
15.2 Input/Output Pins............................................................................................................... 547
15.3 Register Descriptions......................................................................................................... 548
15.3.1 STIF Mode Select Register (STMDR) ................................................................. 549
15.3.2 STIF Control Register (STCTLR) ........................................................................ 552
15.3.3 STIF Internal Counter Control Register (STCNTCR) .......................................... 554
15.3.4 STIF Internal Counter Set Register (STCNTVR)................................................. 555
15.3.5 STIF Status Register (STSTR) ............................................................................. 555
15.3.6 STIF Interrupt Enable Register (STIER) .............................................................. 558
15.3.7 STIF Transfer Size Register (STSIZER) (n = 0,1) ............................................... 559
15.3.8 STIFPWM Mode Register (STPWMMR) ............................................................ 560
15.3.9 STIFPWM Control Register (STPWMCR) .......................................................... 564
15.3.10 STIFPWM Register (STPWMR).......................................................................... 566
15.3.11 STIFPCR0, STIFPCR01 Registers (STPCR0R, STPCR1R) ................................ 567
15.3.12 STIFSTC0, STIFSTC1 Registers (STSTC0R, STSTC1R)................................... 568
15.3.13 STIF Lock Control Register (STLKCR)............................................................... 569
15.3.14 STIF Debugging Status Register (STDBGR) ....................................................... 572
15.4 Examples of Clock Connection to Another Device ........................................................... 572
15.4.1 A Basic Example .................................................................................................. 572
15.4.2 An Example of Clock Connection When Another Device Has No Clock
Input...................................................................................................................... 573
15.4.3 An Example of Clock Connection When Another Device Has No Clock
Output ................................................................................................................... 573
15.5 Input/Output Timing .......................................................................................................... 573
15.6 PCR Clock Recovery Module (PCRRCV) ........................................................................ 580
15.6.1 Operation of PCR Clock Recovery....................................................................... 581
15.6.2 PCR Clock Recovery Operation ........................................................................... 583
15.7 Usage Notes ....................................................................................................................... 587
Section 16 Serial Sound Interface (SSI)............................................................ 591
16.1 Features.............................................................................................................................. 591
16.2 Input/Output Pins............................................................................................................... 593
16.3 Register Description .......................................................................................................... 594
16.3.1 Control Register (SSICR) ..................................................................................... 595
Page xviii of xxvi
16.3.2 Status Register (SSISR) ........................................................................................ 601
16.3.3 Transmit Data Register (SSITDR)........................................................................ 606
16.3.4 Receive Data Register (SSIRDR) ......................................................................... 606
16.3.5 SSI Clock Selection Register (SCSR)................................................................... 607
16.4 Operation Description ........................................................................................................ 608
16.4.1 Bus Format............................................................................................................ 608
16.4.2 Non-Compressed Modes....................................................................................... 609
16.4.3 Operation Modes................................................................................................... 619
16.4.4 Transmit Operation ............................................................................................... 620
16.4.5 Receive Operation................................................................................................. 623
16.4.6 Temporary Stop and Restart Procedures in Transmit Mode ................................. 626
16.4.7 Serial Bit Clock Control........................................................................................ 627
16.5 Usage Notes ....................................................................................................................... 628
16.5.1 Limitations from Overflow during Receive DMA Operation............................... 628
Section 17 USB 2.0 Host/Function Module (USB) ...........................................629
17.1 Features.............................................................................................................................. 629
17.2 Input / Output Pins ............................................................................................................. 632
17.3 Register Description........................................................................................................... 634
17.3.1 System Configuration Control Register (SYSCFG) ............................................. 641
17.3.2 CPU Bus Wait Setting Register (BUSWAIT) ...................................................... 645
17.3.3 System Configuration Status Register (SYSSTS)................................................. 646
17.3.4 Device State Control Register (DVSTCTR) ......................................................... 648
17.3.5 Test Mode Register (TESTMODE) ...................................................................... 654
17.3.6 DMA-FIFO Bus Configuration Registers (D0FBCFG, D1FBCFG) .................... 657
17.3.7 FIFO Port Registers (CFIFO, D0FIFO, D1FIFO) ................................................ 658
17.3.8 FIFO Port Select Registers (CFIFOSEL, D0FIFOSEL, D1FIFOSEL)................. 660
17.3.9 FIFO Port Control Registers (CFIFOCTR, D0FIFOCTR, D1FIFOCTR) ............ 667
17.3.10 Interrupts Enable Register 0 (INTENB0) ............................................................. 671
17.3.11 Interrupt Enable Register 1 (INTENB1) ............................................................... 673
17.3.12 BRDY Interrupt Enable Register (BRDYENB) ................................................... 675
17.3.13 NRDY Interrupt Enable Register (NRDYENB) ................................................... 677
17.3.14 BEMP Interrupt Enable Register (BEMPENB).................................................... 679
17.3.15 SOF Control Register (SOFCFG) ......................................................................... 681
17.3.16 Interrupt Status Register 0 (INTSTS0) ................................................................. 683
17.3.17 Interrupt Status Register 1 (INTSTS1) ................................................................. 688
17.3.18 BRDY Interrupt Status Register (BRDYSTS)...................................................... 694
17.3.19 NRDY Interrupt Status Register (NRDYSTS) ..................................................... 695
17.3.20 BEMP Interrupt Status Register (BEMPSTS) ...................................................... 697
17.3.21 Frame Number Register (FRMNUM)................................................................... 698
Page xix of xxvi
17.3.22 μFrame Number Register (UFRMNUM) ............................................................. 701
17.3.23 USB Address Register (USBADDR).................................................................... 702
17.3.24 USB Request Type Register (USBREQ) .............................................................. 703
17.3.25 USB Request Value Register (USBVAL) ............................................................ 705
17.3.26 USB Request Index Register (USBINDX) ........................................................... 706
17.3.27 USB Request Length Register (USBLENG) ........................................................ 707
17.3.28 DCP Configuration Register (DCPCFG).............................................................. 708
17.3.29 DCP Maximum Packet Size Register (DCPMAXP) ............................................ 709
17.3.30 DCP Control Register (DCPCTR) ........................................................................ 710
17.3.31 Pipe Window Select Register (PIPESEL)............................................................. 720
17.3.32 Pipe Configuration Register (PIPECFG) .............................................................. 722
17.3.33 Pipe Buffer Setting Register (PIPEBUF).............................................................. 729
17.3.34 Pipe Maximum Packet Size Register (PIPEMAXP)............................................. 732
17.3.35 Pipe Timing Control Register (PIPEPERI)........................................................... 734
17.3.36 PIPEn Control Registers (PIPEnCTR) (n = 1 to 9)............................................... 736
17.3.37 PIPEn Transaction Counter Enable Registers (PIPEnTRE) (n = 1 to 5)............... 756
17.3.38 PIPEn Transaction Counter Registers (PIPEnTRN) (n = 1 to 5) .......................... 758
17.3.39 Device Address n Configuration Registers (DEVADDn) (n = 0 to A)................. 760
17.3.40 Bus Wait Register (D0FWAIT, D1FWAIT)......................................................... 763
17.4 Operation ........................................................................................................................... 764
17.4.1 System Control and Oscillation Control ............................................................... 764
17.4.2 Interrupt Functions................................................................................................ 767
17.4.3 Pipe Control.......................................................................................................... 790
17.4.4 FIFO Buffer Memory............................................................................................ 800
17.4.5 Control Transfers (DCP)....................................................................................... 810
17.4.6 Bulk Transfers (PIPE1 to PIPE5) ......................................................................... 814
17.4.7 Interrupt Transfers (PIPE6 to PIPE9) ................................................................... 816
17.4.8 Isochronous Transfers (PIPE1 and PIPE2) ........................................................... 817
17.4.9 SOF Interpolation Function .................................................................................. 829
17.4.10 Pipe Schedule........................................................................................................ 830
17.5 Usage Notes ....................................................................................................................... 832
17.5.1 Power Supplies for the USB Module.................................................................... 832
17.5.2 DTCH Interrupt .................................................................................................... 834
17.5.3 Pin Treatment when USB is Not Used ................................................................. 834
17.5.4 Usage Precautions of USB Disconnection Process at the Time of Using the
Function Controller Function and Full-Speed Operations .................................... 834
Section 18 SD Host Interface (SDHI) ............................................................... 837
Page xx of xxvi
Section 19 I2C Bus Interface 3 (IIC3) ................................................................839
19.1 Features.............................................................................................................................. 839
19.2 Input/Output Pins ............................................................................................................... 841
19.3 Register Descriptions ......................................................................................................... 842
19.3.1 I2C Bus Control Register 1 (ICCR1)..................................................................... 842
19.3.2 I2C Bus Control Register 2 (ICCR2)..................................................................... 845
19.3.3 I2C Bus Mode Register (ICMR)............................................................................ 847
19.3.4 I2C Bus Interrupt Enable Register (ICIER) ........................................................... 849
19.3.5 I2C Bus Status Register (ICSR)............................................................................. 851
19.3.6 Slave Address Register (SAR).............................................................................. 854
19.3.7 I2C Bus Transmit Data Register (ICDRT)............................................................. 854
19.3.8 I2C Bus Receive Data Register (ICDRR).............................................................. 855
19.3.9 I2C Bus Shift Register (ICDRS)............................................................................ 855
19.3.10 NF2CYC Register (NF2CYC) .............................................................................. 856
19.4 Operation ........................................................................................................................... 857
19.4.1 I2C Bus Format...................................................................................................... 857
19.4.2 Master Transmit Operation ................................................................................... 858
19.4.3 Master Receive Operation..................................................................................... 860
19.4.4 Slave Transmit Operation ..................................................................................... 862
19.4.5 Slave Receive Operation....................................................................................... 865
19.4.6 Clocked Synchronous Serial Format..................................................................... 866
19.4.7 Noise Filter ........................................................................................................... 870
19.4.8 Example of Use..................................................................................................... 871
19.5 Interrupt Requests .............................................................................................................. 875
19.6 Bit Synchronous Circuit..................................................................................................... 876
19.7 Usage Notes ....................................................................................................................... 879
19.7.1 Notes on Working in Multi-master Mode............................................................. 879
19.7.2 Notes on Working in Master Receive Mode......................................................... 879
19.7.3 Notes on Setting ACKBT in Master Receive Mode ............................................. 879
19.7.4 Notes on the States of MST and TRN Bits when Arbitration Is Lost ................... 880
19.7.5 Note Regarding Master Receive Mode of I2C-Bus Interface Mode...................... 880
19.7.6 Accessing ICE and IICRST during I2C Bus Operation......................................... 881
Section 20 Host Interface (HIF).........................................................................883
20.1 Features.............................................................................................................................. 883
20.2 Input/Output Pins ............................................................................................................... 885
20.3 Parallel Access ................................................................................................................... 886
20.3.1 Operation .............................................................................................................. 886
20.3.2 Connection Method............................................................................................... 886
Page xxi of xxvi
20.4 Register Descriptions......................................................................................................... 887
20.4.1 HIF Index Register (HIFIDX) .............................................................................. 888
20.4.2 HIF General Status Register (HIFGSR)................................................................ 890
20.4.3 HIF Status/Control Register (HIFSCR) ................................................................ 891
20.4.4 HIF Memory Control Register (HIFMCR)........................................................... 894
20.4.5 HIF Internal Interrupt Control Register (HIFIICR) .............................................. 896
20.4.6 HIF External Interrupt Control Register (HIFEICR) ............................................ 897
20.4.7 HIF Address Register (HIFADR) ......................................................................... 898
20.4.8 HIF Data Register (HIFDATA) ............................................................................ 899
20.4.9 HIF Boot Control Register (HIFBCR).................................................................. 899
20.4.10 HIFDREQ Trigger Register (HIFDTR)................................................................ 901
20.4.11 HIF Bank Interrupt Control Register (HIFBICR)................................................. 902
20.5 Memory Map ..................................................................................................................... 904
20.6 Interface ............................................................................................................................. 905
20.6.1 Basic Sequence ..................................................................................................... 905
20.6.2 Reading/Writing of HIF Registers other than HIFIDX and HIFIDX ................... 906
20.6.3 Consecutive Data Writing to HIFRAM by External Device................................. 907
20.6.4 Consecutive Data Reading from HIFRAM to External Device ............................ 908
20.7 External DMAC Interface.................................................................................................. 909
20.8 Alignment Control ............................................................................................................. 914
20.9 Interface When External Device Power is Cut Off ............................................................ 915
20.10 Usage Notes ....................................................................................................................... 918
Section 21 Compare Match Timer (CMT) ........................................................ 919
21.1 Features.............................................................................................................................. 919
21.2 Register Descriptions......................................................................................................... 920
21.2.1 Compare Match Timer Start Register (CMSTR) .................................................. 921
21.2.2 Compare Match Timer Control/Status Register (CMCSR) .................................. 922
21.2.3 Compare Match Counter (CMCNT)..................................................................... 924
21.2.4 Compare Match Constant Register (CMCOR) ..................................................... 924
21.3 Operation ........................................................................................................................... 925
21.3.1 Interval Count Operation ...................................................................................... 925
21.3.2 CMCNT Count Timing......................................................................................... 925
21.4 Interrupts............................................................................................................................ 926
21.4.1 Interrupt Sources and DMA Transfer Requests .................................................... 926
21.4.2 Timing of Compare Match Flag Setting ............................................................... 926
21.4.3 Timing of Compare Match Flag Clearing............................................................. 927
21.5 Usage Notes ....................................................................................................................... 928
21.5.1 Conflict between Write and Compare-Match Processes of CMCNT ................... 928
21.5.2 Conflict between Word-Write and Count-Up Processes of CMCNT ................... 929
Page xxii of xxvi
21.5.3 Conflict between Byte-Write and Count-Up Processes of CMCNT..................... 930
21.5.4 Compare Match Between CMCNT and CMCOR ................................................ 930
Section 22 Serial Communication Interface with FIFO (SCIF) ........................931
22.1 Features.............................................................................................................................. 931
22.2 Input/Output Pins ............................................................................................................... 933
22.3 Register Descriptions ......................................................................................................... 934
22.3.1 Receive Shift Register (SCRSR)........................................................................... 936
22.3.2 Receive FIFO Data Register (SCFRDR) .............................................................. 936
22.3.3 Transmit Shift Register (SCTSR) ......................................................................... 937
22.3.4 Transmit FIFO Data Register (SCFTDR) ............................................................. 937
22.3.5 Serial Mode Register (SCSMR)............................................................................ 938
22.3.6 Serial Control Register (SCSCR).......................................................................... 941
22.3.7 Serial Status Register (SCFSR) ............................................................................ 945
22.3.8 Bit Rate Register (SCBRR) .................................................................................. 953
22.3.9 FIFO Control Register (SCFCR) .......................................................................... 960
22.3.10 FIFO Data Count Set Register (SCFDR) .............................................................. 963
22.3.11 Serial Port Register (SCSPTR) ............................................................................. 964
22.3.12 Line Status Register (SCLSR) .............................................................................. 967
22.4 Operation ........................................................................................................................... 968
22.4.1 Overview............................................................................................................... 968
22.4.2 Operation in Asynchronous Mode ........................................................................ 971
22.4.3 Operation in Clocked Synchronous Mode ............................................................ 982
22.5 SCIF Interrupts .................................................................................................................. 991
22.6 Usage Notes ....................................................................................................................... 992
22.6.1 SCFTDR Writing and TDFE Flag ........................................................................ 992
22.6.2 SCFRDR Reading and RDF Flag ......................................................................... 992
22.6.3 Break Detection and Processing ........................................................................... 993
22.6.4 Sending a Break Signal......................................................................................... 993
22.6.5 Receive Data Sampling Timing and Receive Margin (Asynchronous Mode) ...... 993
Section 23 Pin Function Controller (PFC).........................................................995
23.1 Register Descriptions ....................................................................................................... 1011
23.1.1 Port A I/O Register H (PAIORH) ....................................................................... 1012
23.1.2 Port A Control Registers H2 and H1 (PACRH2, PACRH1) .............................. 1013
23.1.3 Port B I/O Register L (PBIORL) ........................................................................ 1016
23.1.4 Port B Control Register L1 (PBCRL1) ............................................................... 1017
23.1.5 Port C I/O Registers H and L (PCIORH, PCIORL)............................................ 1019
23.1.6 Port C Control Registers H1, L2, and L1 (PCCRH1, PCCRL2, PCCRL1) ........ 1020
23.1.7 Port D I/O Register L (PDIORL)........................................................................ 1026
Page xxiii of xxvi
23.1.8 Port D Control Register L1 (PDCRL1) .............................................................. 1027
23.1.9 Port E I/O Register L (PEIORL)......................................................................... 1029
23.1.10 Port E Control Registers L2 and L1 (PECRL2, PECRL1) ................................. 1030
23.1.11 Port F I/O Register L (PFIORL) ......................................................................... 1034
23.1.12 Port F Control Registers L2 and L1 (PFCRL2, PFCRL1) .................................. 1035
23.1.13 Port G I/O Registers H and L (PGIORH, PGIORL)........................................... 1039
23.1.14 Port G Control Registers H2, L2, and L1 (PGCRH2, PGCRL2, PGCRL1) ....... 1040
Section 24 I/O Ports......................................................................................... 1049
24.1 Port A............................................................................................................................... 1049
24.1.1 Register Descriptions.......................................................................................... 1049
24.1.2 Port A Data Register H (PADRH) ...................................................................... 1050
24.2 Port B ............................................................................................................................... 1052
24.2.1 Register Descriptions.......................................................................................... 1052
24.2.2 Port B Data Register L (PBDRL) ....................................................................... 1053
24.3 Port C ............................................................................................................................... 1055
24.3.1 Register Descriptions.......................................................................................... 1055
24.3.2 Port C Data Registers H and L (PCDRH and PCDRL) ...................................... 1056
24.4 Port D............................................................................................................................... 1059
24.4.1 Register Descriptions.......................................................................................... 1059
24.4.2 Port D Data Register L (PDDRL)....................................................................... 1060
24.5 Port E ............................................................................................................................... 1062
24.5.1 Register Descriptions.......................................................................................... 1062
24.5.2 Port E Data Register L (PEDRL)........................................................................ 1063
24.6 Port F ............................................................................................................................... 1065
24.6.1 Register Descriptions.......................................................................................... 1065
24.6.2 Port F Data Register L (PFDRL) ........................................................................ 1066
24.7 Port G............................................................................................................................... 1068
24.7.1 Register Descriptions.......................................................................................... 1069
24.7.2 Port G Data Registers H and L (PGDRH and PGDRL)...................................... 1069
Section 25 User Break Controller (UBC)........................................................ 1073
25.1 Features............................................................................................................................ 1073
25.2 Register Descriptions....................................................................................................... 1075
25.2.1 Break Address Register (BAR)........................................................................... 1076
25.2.2 Break Address Mask Register (BAMR) ............................................................. 1077
25.2.3 Break Data Register (BDR) ................................................................................ 1078
25.2.4 Break Data Mask Register (BDMR)................................................................... 1079
25.2.5 Break Bus Cycle Register (BBR) ....................................................................... 1080
25.2.6 Break Control Register (BRCR) ......................................................................... 1082
Page xxiv of xxvi
25.3 Operation ......................................................................................................................... 1084
25.3.1 Flow of the User Break Operation ...................................................................... 1084
25.3.2 Break on Instruction Fetch Cycle........................................................................ 1085
25.3.3 Break on Data Access Cycle............................................................................... 1086
25.3.4 Value of Saved Program Counter ....................................................................... 1087
25.3.5 Usage Examples.................................................................................................. 1088
25.4 Usage Notes ..................................................................................................................... 1091
Section 26 High-Performance User Debugging Interface (H-UDI) ................1093
26.1 Features............................................................................................................................ 1093
26.2 Input/Output Pins ............................................................................................................. 1094
26.3 Register Descriptions ....................................................................................................... 1095
26.3.1 Bypass Register (SDBPR) .................................................................................. 1095
26.3.2 Instruction Register (SDIR) ................................................................................ 1096
26.4 Operation ......................................................................................................................... 1097
26.4.1 TAP Controller ................................................................................................... 1097
26.4.2 Reset Configuration ............................................................................................ 1098
26.4.3 TDO Output Timing ........................................................................................... 1099
26.4.4 H-UDI Reset ....................................................................................................... 1100
26.4.5 H-UDI Interrupt .................................................................................................. 1100
26.5 Usage Notes ..................................................................................................................... 1101
Section 27 On-Chip RAM ...............................................................................1103
27.1 Features............................................................................................................................ 1103
27.2 Usage Notes ..................................................................................................................... 1104
27.2.1 Page Conflict ...................................................................................................... 1104
27.2.2 RAME and RAMWE Bits .................................................................................. 1104
Section 28 List of Registers .............................................................................1105
28.1 Register Addresses
(by Functional Module, in Order of the Manual's Section Numbers) .............................. 1106
28.2 Register Bits..................................................................................................................... 1124
28.3 Register States in Each Operating Mode ......................................................................... 1167
Section 29 Electrical Characteristics ...............................................................1181
29.1
29.2
29.3
29.4
Absolute Maximum Ratings ............................................................................................ 1181
Power-on/Power-off Sequence ........................................................................................ 1182
DC Characteristics ........................................................................................................... 1183
AC Characteristics ........................................................................................................... 1189
29.4.1 Clock Timing ...................................................................................................... 1190
Page xxv of xxvi
29.4.2 Control Signal Timing ........................................................................................ 1194
29.4.3 Bus Timing ......................................................................................................... 1195
29.4.4 DMAC Module Timing ...................................................................................... 1224
29.4.5 Watchdog Timer Timing .................................................................................... 1225
29.4.6 SCIF Module Timing.......................................................................................... 1226
29.4.7 IIC3 Module Timing........................................................................................... 1227
29.4.8 SSI Module Timing ............................................................................................ 1229
29.4.9 USB Transceiver Timing .................................................................................... 1231
29.4.10 SDHI Module Timing......................................................................................... 1233
29.4.11 I/O Port Timing................................................................................................... 1234
29.4.12 HIF Module Signal Timing................................................................................. 1235
29.4.13 EtherC Module Signal Timing............................................................................ 1237
29.4.14 H-UDI Related Pin Timing................................................................................. 1241
29.4.15 STIF Module Signal Timing (1) ......................................................................... 1243
29.4.16 STIF Module Signal Timing (2) ......................................................................... 1244
29.4.17 STIF Module Signal Timing (3)
(With Stream Input/Output Set Synchronized with STn_CLKIN Rise Time).... 1245
29.4.18 STIF Module Signal Timing (4)
(With Stream Input/Output Set Synchronized with STn_CLKIN Fall Time)..... 1247
29.4.19 STIF Module Signal Timing (5)
(With Stream Output Set Synchronized with STn_CLKOUT Rise Time) ......... 1249
29.4.20 STIF Module Signal Timing (6)
(With Stream Output Set Synchronized with STn_CLKOUT Fall Time) .......... 1250
29.4.21 STIF Module Signal Timing (7) ......................................................................... 1251
29.4.22 AC Characteristics Measurement Conditions ..................................................... 1252
Appendix
A.
B.
C.
D.
....................................................................................................... 1253
Pin States ......................................................................................................................... 1253
Product Lineup................................................................................................................. 1258
Package Dimensions ........................................................................................................ 1259
Treatment of Unused Pins................................................................................................ 1260
Main Revisions and Additions in this Edition................................................... 1265
Index
Page xxvi of xxvi
....................................................................................................... 1271
SH7670 Group
Section 1 Overview
Section 1 Overview
1.1
Features
This LSI is a CMOS single-chip microcontroller that integrates a Renesas original RISC (Reduced
Instruction Set Computer) CPU core with peripheral functions required for an Ethernet system.
The CPU incorporated in this LSI is the SH-2A CPU, which features upward compatibility on the
object code level with the SH-1 and SH-2 microcomputers. The CPU has a RISC-type instruction
set and employs a superscalar architecture and the Harvard architecture, which greatly improves
instruction execution speed. In addition, the 32-bit internal-bus architecture enhances data
processing power. This CPU realizes low-cost, high-performance, and high-functioning systems
for applications such as high-speed realtime control, which was previously impossible with the
conventional microcomputers.
This LSI includes an Ethernet controller (EtherC) that incorporates a media access controller
(MAC) conforming to the IEEE802.3u standard, which offers the LAN connection in the rate of
10 or 100 Mbps.
In addition, this LSI includes on-chip peripheral functions required for systems, such as, cache
memory, RAM, a direct memory access controller (DMAC), a host interface (HIF), an USB2.0
host/function module (USB), an SD host interface (SDHI), an interrupt controller (INTC), a
compare match timer (CMT), a serial communication interface with FIFO (SCIF), and I/O ports.
Moreover, this LSI includes encryption functions (AES, DES and 3DES), message authentication
code generating functions (HMAC-SHA-1, HMAC-SHA-224, and HMAC-SHA-256), an AV
stream interface (STIF), and a serial sound interface (SSI), which can be applied to digital AV
equipment with network features.
This LSI also provides an external memory access support function to enable direct connection to
various memory devices or peripheral LSIs. These on-chip functions significantly reduce costs of
designing and manufacturing application systems.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 1 of 1278
SH7670 Group
Section 1 Overview
1.2
Applications
Main applications: Network application equipment, consumer equipment, digital AV equipment
1.3
Overview of Specifications
Table 1.1 shows the overview of the specifications of this LSI.
Table 1.1
Overview of SH7670 Group Specifications
Classification
Module/Function Description
Memory
On-chip RAM
•
RAM size: 32 Kbytes (four 8-Kbyte banks)
Cache memory
•
Instruction cache: 8 Kbytes
•
Operand cache: 8 Kbytes
•
128-entry, 4-way set associative, 16-byte block length
configuration each for the instruction cache and operand
cache
•
Write-back, write-through and LRU replacement algorithm
•
Cache locking function available (only for operand cache);
ways 2 and 3 can be locked
Page 2 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
CPU
CPU
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
•
Renesas original SuperH architecture
•
Compatible with SH-1, SH-2, and SH-2E at object code
level
•
32-bit internal data bus
•
General-register architecture
•
Sixteen 32-bit general registers
•
Four 32-bit control registers
•
Four 32-bit system registers
•
Register bank for high-speed response to interrupts
•
RISC-type instruction set
(upward compatible with SH series)
•
Instruction length: 16-bit fixed-length basic instructions for
improved code efficiency and 32-bit instructions for high
performance and usability
•
Load/store architecture
•
Delayed branch instructions
•
Instruction set based on C language
•
Superscalar architecture to execute two instructions at
one time including FPU
•
Instruction execution time: Up to two instructions/cycle
•
Address space: 4 Gbytes
•
Internal multiplier
•
Five-stage pipeline
•
Harvard architecture
Page 3 of 1278
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
CPU
Floating-point unit •
(FPU)
•
Floating-point co-processor included
Supports single-precision (32-bit) and double-precision
(64-bit)
•
Supports data type and exceptions that conform to
IEEE754 standard
•
Two rounding modes: Round to nearest and round to zero
•
Denormalization modes: Flush to zero
•
Floating-point registers
•
Sixteen 32-bit floating-point registers (single-precision ×
16 words or double-precision × 8 words)
•
Two 32-bit floating-point system registers
•
Supports FMAC (multiplication and accumulation)
instructions
•
Supports FDIV (division) and FSQRT (square root)
instructions
•
Supports FLDI0/FLDI1 (load constant 0/1) instructions
•
Instruction execution time
Latency (FMAC/FADD/FSUB/FMUL): Three cycles
(single-precision), eight cycles (double-precision)
Pitch (FMAC/FADD/FSUB/FMUL): One cycle (singleprecision), six cycles (double-precision)
Note: FMAC only supports single-precision.
•
Interrupts
(sources)
Page 4 of 1278
Interrupt controller •
(INTC)
•
Five-stage pipeline
Nine external interrupt pins (NMI and IRQ7 to IRQ0)
On-chip peripheral interrupts: Priority level set for each
module
•
Sixteen priority levels available
•
Register bank enabling fast register saving and restoring
in interrupt handling
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
External bus
extension
Bus state
controller (BSC)
•
Address space for five areas (64 Mbytes each) and 32-bit
external bus
•
The following features settable independently for each
area:
⎯ Bus size: 8, 16, or 32 bits (depending on area)
⎯ Access wait cycle count
⎯ Idle wait cycle setting (same area/different area)
⎯ Supports SRAM, SRAM with byte selection, and
SDRAM by specifying memory to be connected for
each area
⎯ Supports the PCMCIA interface
⎯ Chip select signal output to an applicable area
(Timings of CS asserting and negating are selectable
by programming)
•
SDRAM refreshing function
⎯ Supports auto-refreshing mode and self-refreshing
mode
DMA
Direct memory
access controller
(DMAC)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
•
SDRAM burst access function
•
For area 0, only big endian is supported
•
Eight channels (External DMA requests available for two
of them)
•
Can be activated by on-chip peripheral modules
•
Burst mode and cycle steal mode
•
Supports intermittent mode (16 or 64 cycles)
•
Auto-reloading of transfer information
Page 5 of 1278
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
Clock
Clock pulse
generator (CPG)
•
Clock mode: Input clock can be selected from external
input (EXTAL or CKIO) or crystal resonator (EXTAL/XTAL
or USB_X1/USB_X2).
•
Three types of clocks generated
⎯ CPU clock:
200 MHz (maximum) (regular specifications)
133 MHz (maximum) (wide temperature
specifications)
⎯ Bus clock:
100 MHz (maximum) (regular specifications)
66 MHz (maximum) (wide temperature specifications)
⎯ Peripheral clock:
50 MHz (maximum) (regular specifications)
33 MHz (maximum) (wide temperature specifications)
Power-down
modes
•
Three power-down modes provided to reduce the current
consumption in this LSI
⎯ Sleep mode
⎯ Software standby mode
⎯ Module standby mode
Timer
Compare match
timer (CMT)
Watchdog timer
(WDT)
Page 6 of 1278
•
Two-channel 16-bit counter
•
Four types of clocks selectable (Pφ/8, Pφ/32, Pφ/128, or
Pφ/512)
•
Generates a compare match interrupt
•
One-channel watchdog timer
A counter overflow can reset this LSI
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
Advanced
communication
Ethernet controller •
(EtherC)
MAC (Media Access Control) function
⎯ Data frame assembly/deassembly (frame format
conforming to IEEE802.3)
⎯ CSMA/CD link management (for collision avoidance
and processing in case of collision)
⎯ CRC processing
⎯ On-chip FIFOs (512 bytes for transmission and
reception each)
⎯ Supports full-duplex data transmission and reception
⎯ Sends and receives short and long packets
•
Conforms to the MII (Media Independent Interface)
standard
⎯ Converts an 8-bit data stream from the MAC layer to a
4-bit MII nibble stream
⎯ Station management (STA feature)
⎯ Eighteen TTL-level signals
⎯ Transfer rate: 10 or 100 Mbps
•
DMAC for
•
Ethernet controller
(E-DMAC)
•
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Magic Packet
TM
with WOL (Wake On LAN) output
Reduces CPU load using the descriptor management
system
One channel for transfer from the EtherC receive FIFO to
the receive buffer
•
One channel for transfer from the transmit buffer to the
EtherC transmit FIFO
•
Allows 16-byte burst transfer for efficient use of the
system bus
•
Supports single frame and multibuffer
•
Calculates receive data checksum
Page 7 of 1278
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
Advanced
interface
Stream interface
(STIF)
Serial sound
interface (SSI)
USB2.0
host/function
module (USB)
SD host interface
(SDHI)
(Not supported in
SH7672 and
SH7670)
•
Two-channel port in conjunction with A-DMAC
•
Serial mode or parallel mode selectable for each channel
•
Supports MPEG2-TS and MPEG-PS transfer modes
•
Supports push-type transfer and pull-type transfer to each
device
•
External VCO control PWM timer and its output provided
for each channel
•
Stream clock output common to all channels and stream
clock input for each channel
•
Two-channel bidirectional serial transfer
•
Supports various serial audio formats
•
Supports master and slave functions
•
Generates programmable word clock and bit clock
•
Multichannel formats
•
Supports 8-, 16-, 18-, 20-, 22-, 24-, and 32-bit data
formats
•
Conforms to USB version 2.0
•
Supports three transfer rates: 480 Mbps, 12 Mbps, and
1.5 Mbps
•
Software and functions switchable
•
Connectable to multiple peripheral devices through onestage hub while the software is running
•
Software settable
•
On-chip 8-Kbyte RAM as a communication buffer
•
SD memory/IO card interface (1-bit/4-bit SD bus)
•
Error check functions: CRC7 (for commands) and CRC16
(for data)
•
Interrupt requests: Card access interrupt, SDIO access
interrupt, and card detect interrupt
•
DMAC transfer requests: SD_BUF write and SD_BUF
read
•
Supports card detection and write protection functions
I2C bus interface 3 •
(IIC3)
•
Page 8 of 1278
One channel
On-chip master mode and slave mode
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
Advanced
interface
Host interface
(HIF)
Serial
communication
interface with
FIFO (SCIF)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
•
On-chip 4-Kbyte buffer RAM (two 2-Kbyte banks)
•
Parallel connection of buffer RAM and external device
with sixteen data pins
•
Parallel connection of buffer RAM and the CPU of this LSI
with the internal bus
•
A connected external device can access desired register
after the register index was specified (However,
addresses can be automatically updated during
continuous buffer RAM access)
•
Endian switchable
•
An interrupt can be requested to a connected external
device
•
An internal interrupt can be requested to the CPU of this
LSI
•
Allows booting from the buffer RAM by storing the
instruction code beforehand from the external device in
the buffer RAM
•
Three channels
•
Clock synchronous mode or asynchronous mode
selectable
•
Supports simultaneous transmission and reception (fullduplex communication)
•
Dedicated baud rate generator
•
Separate 16-byte FIFO registers for transmission and
reception
•
Modem control function (asynchronous mode)
Page 9 of 1278
SH7670 Group
Section 1 Overview
Classification
Module/Function Description
Encryption,
hash, and error
correction
Encryption
functions (AES,
DES and 3DES)
(SH7671 and
SH7670 support
only DMAC
function. They do
not support
encryption
function.)
•
Encryption/decryption engine can be activated by 2channel dedicated DMAC (A-DMAC) or CPU
•
By reading the descriptor using the A-DMAC, continuous
encryption/decryption available by switching the source
address (unprocessed data pointer), destination address
(processed data storage address), and various settings
(including encryption/decryption algorithm,
encryption/decryption, ECB/CBC/OFB, keys, and IV) in
real time
•
Block-by-block encryption and decryption enabled by
activation from the CPU
Message
•
authentication
code generating
functions (HMACSHA-1, HMACSHA-224, and
HMAC-SHA-256)
By reading the descriptor using the A-DMAC, generation
of message authentication codes and checksum
calculation in conjunction with encryption/decryption
processing are available
(Not supported in
SH7671 and
SH7670)
•
By reading the descriptor using the dedicated F-DMAC,
missing packets can be restored quickly by switching the
source address (read packet pointer), destination address
(restoration packet storage address), and packet size in
real time
•
Arbitrary values can be used for the read packet pointer,
read packet count, restoration packet storage address,
and packet size
User break
controller (UBC)
•
Two break channels
•
Addresses, data values, type of access, and data size
can be set as break conditions
User debugging
interface (H-UDI)
•
Supports E10A emulator
•
JTAG-standard pin assignment
•
Supports boundary scan
•
Eighty-six general input/output pins and eight general
input pins
•
Input or output of I/O ports can be selected for each bit
Forward error
correction (FEC)
Debugging
function
I/O ports
Page 10 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Classification
Section 1 Overview
Module/Function Description
Package
•
P-FBGA1717-256 (0.8 pitch)
Power supply voltage
•
I/O: 3.3 ± (0.2) V, internal: 1.2 ± (0.1) V
Operating temperature (°C)
•
-20 to +70°C (regular specifications)
•
-40 to +85°C (wide temperature specifications)
Notes: * Magic Packet
TM
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
is a registered trademark of Advanced Micro Devices, Inc.
Page 11 of 1278
SH7670 Group
Section 1 Overview
1.4
Product Lineup
Table 1.2 lists the products and figure 1.1 shows how to read their type names.
Table 1.2
Product Lineup
Type Name
(Abbreviation)
ROM
Size
RAM Size
Package
Encryption
SDHI
R5S76700
–
32 Kbytes
P-FBGA256 –17 × 17 –0.8
Not mounted
Not mounted SH7670
R5S76710
–
32 Kbytes
P-FBGA256 –17 × 17 –0.8
Not mounted
Mounted
R5S76720
–
32 Kbytes
P-FBGA256 –17 × 17 –0.8
Mounted
Not mounted SH7672
R5S76730
–
32 Kbytes
P-FBGA256 –17 × 17 –0.8
Mounted
Mounted
Type Name
R
5
S
76730
B
200
Remarks
SH7671
SH7673
BG
Package type
BG: BGA
Maximum operating frequency
200: 200MHz
133: 133MHz
Characteristic code
B: - 20˚C to +70˚C
C: - 40˚C to +85˚C
Product code
ROM device type
S: ROMless
Classification
5 : Microcontroller
R: Renesas semiconductor Family
Figure 1.1 How to Read Type Names
• Small package
Package
Code
Body Size
Pin Pitch
P-FBGA256 –17 × 17 –0.8
PRBG0256GA-A
17 × 17 mm
0.8 mm
Page 12 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
1.5
Section 1 Overview
Block Diagram
Floatingpoint unit
(FPU)
SH-2A
CPU
Cache
controller
Instruction cache
memory
8Kbytes
Operand cache
memory
8Kbytes
On-chip RAM
32Kbytes
Bus state
controller
(BSC)
DMAC for
Ethernet
controller
(E-DMAC)
Ethernet
controller
(EtherC)
32-bit width, synchronized I-clock (200MHz max.)
CPU memory access bus (M-bus)
32-bit width, synchronized I-clock (200MHz max.)
User break
controller
(UBC)
32-bit width, synchronized B-clock (100MHz max.)
Encryption,
hash, and
error correction
(A-DMAC)
Stream
interface
(STIF)*1
Direct memory
access controller
(DMAC) *2
USB2.0/
host/function
module
(USB)
Peripheral bus
controller
Ports
Ports
Ports
Ports
Ports
Internal bus
CPU Instruction fetch bus (F-bus)
Peripheral bus
Clock pulse
generator
(CPG)
Watchdog
timer
(WDT)
Low Power
mode module
Serial sound
interface
(SSI) *3
SD host
interface
(SDHI) *4
I2C bus
interface
(IIC3)
Ports
Ports
Ports
Ports
Ports
Ports
Interrupt
controller
(INTC)
32-bit width, synchronized P-clock (50MHz max.)
Peripheral bus
High-performance
user debugging
interface
(H-UDI)
I/O ports
Ports
Ports
Pin function
controller
(PFC)
32-bit width, synchronized P-clock (50MHz max.)
Serial
communication
interface with FIFO
(SCIF)*6
Ports
Compare match
timer
(CMT)*5
Ports
Host interface
(HIF)
Ports
Notes: 1. 2 channels
2. 8 channels
3. 2 channels
4. Only for SH7673, SH7671. N/A to SH7672, SH7670.
5. 2 channels
6. 3 channels
The modules, having bold segment, can be an initiator on the bus which is facing to the bold segment.
Figure 1.2 Block Diagram
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 13 of 1278
SH7670 Group
Section 1 Overview
1.6
Pin Assignments
← Location of index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
A
PA17/
A17
A00
PB04/
CE2A/
IRQ2/
DACK1
PB00/
WAIT/
SDA
PB06/
CS4
WE1/
DQMLU/
WE
D09
D12
D15
D05
D02
A16
A13
A10
A07
A04
A01
RAS
CAS
VssQ
B
PA19/
A19
PA18/
A18
PB05/CS5/
CE1A/
IRQ3/
TEND1
PB02/
CE2B/
IRQ0
RD
PB07/
BS
D08
D10
D14
D06
D03
D00
A14
A11
A08
A05
A02
CS3
VssQ
CKE
PB01/
IOIS16/
SCL
CS0
WE0/
DQMLL
D11
D13
D07
D04
D01
A15
A12
A09
A06
A03
VssQ
RDWR
CKIO
C
PA22/
A22
PA21/
A21
PA20/
A20
PB03/CS6/
CE1B/
IRQ1/
DREQ1
D
HIFMD/
PA25/
A25
PA24/
A24
PA23/
A23
VssQ_14 Vss_07 VccQ_14 Vcc_07 VssQ_13 VccQ_13 VccQ_12
E
PC18/
PC19/
LNKSTA EXOUT
PC20/
VssQ_00
WOL
VssQ_09
D24
D26
D28
F
PC13/
TX_CLK
PC16/
MDIO
PC17/ VccQ_00
MDC
VccQ_10
D27
D29
D30
G
PC07/
MII_TXD3
PC11/ PC12/
TX_ER TX_EN
VccQ_09
D31
D23
D22
H
PC04/
PC06/
PC05/
Vcc_00
MII_TXD0 MII_TXD1 MII_TXD2
VccQ_08 VccQ_07
D21
D20
J
PC10/
RX_CLK
VssQ_08 VssQ_07
D19
D18
K
PC08/
PC03/
MII_RXD3 RX_DV
PC14/
COL
PC15/
CRS
PC01/
PC02/ VccQ_02
PC00/
MII_RXD0 MII_RXD1 MII_RXD2
M
TESTMD ASEMD
P
PD04/
IRQ4/
SDWP
PD05/
IRQ5/
SDCD
WE3/
WE2/
Vss_06 VccQ_11 VssQ_11 VssQ_10 DQMUU/ DQMUL/
ICIOWR ICIORD
VssQ_01
L
N
VssQ_12 Vcc_06
Vss_00
PC09/ VccQ_01
RX_ER
PD07/
IRQ7/
SDCLK
VssQ
SH7673/SH7672/SH7671/SH7670
Top view
VssQ
PD06/
IRQ6/ VssQ_02
SDCMD
Vcc_05
VssQ
D17
D16
Vss_05
PF05/
ST0_D5/
RTS0
PF06/
ST0_D6/
SSIDATA0
PF07/
ST0_D7/
SSIWS0
VssQ
PF02/
ST0_D2/
RxD0
PF03/
ST0_D3/
SCK0
PF04/
ST0_D4/
CTS0
PF01/
VccQ_06 ST0_D1/
TxD0
PD01/
PD02/
PD03/
Vcc_01
IRQ1/
IRQ2/
IRQ3/
SDDAT1 SDDAT2 SDDAT3
PF11/
PG15/
HIFD15
PD00/
IRQ0/
SDDAT0
Vcc_02
Vcc_04 WDTOVF
T
PG11/
HIFD11
PG12/
PG13/
HIFD12 HIFD13
Vss_01
Vss_04
U
PG09/
HIFD09
PG10/
HIFD10
Vss_02 VssQ_03 VccQ_03
V
PG07/
HIFD07
VssQ
W
VssQ
PG06/
HIFD06
Y
PG08/
HIFD08
DG12
DV12
UV12
AV12
Vcc_03
VssQ
VssQ
VssQ
UG12
AG12
PE07/
PE06/
PE01/
ST1_VCO_
PE03/
CLKIN/
ST1_D7/ ST1_D6/ ST1_D1/ ST1_D3/
SSIWS1 SSIDATA1 TxD1
SCK1 AUDIO_CLK
DG33
VBUS
AG33
VssQ
USB_X1 ST1_D5/ ST1_D2/ ST1_SYC/ ST1_PWM/
PG22/
HIFRS
PG03/
HIFD03
PG21/
PG16/
PG18/
HIFWR HIFDREQ HIFEBL
PG23/
HIFCS
PG20/
HIFRD
PG17/
HIFRDY
PG19/
HIFINT
DV33
DM
DP
AV33
VssQ
Vss_03 VccQ_04 VccQ_05 VssQ_04 VssQ_05 MD_CK1
VssQ
PG04/
PG01/
HIFD04 HIFD01
PG05/ PG02/
HIFD05 HIFD02
PF08/
PF09/
DREQ0
TEND0
PG14/
HIFD14
PG00/
HIFD00
PF10/
PF00/
ST0_SYC/ ST0_D0
DACK0
VssQ_06 ST0_PWM/
ST0_VLD/
ST0_REQ
R
VssQ
D25
PE05/
PE02/
RTS1
RxD1
PE10/
PE11/
CTS2
RTS2
ST0_
CLKIN/
SSISCK0
ST0_
VCO_
CLKIN
MD_BW
ASEBRK/
ASEBRKAK
NMI
PLLVcc
TCK
TDI
MD_CK0
EXTAL
ST1_
CLKIN/
SSISCK1
RES
TDO
XTAL
TRST
TMS
PLLVss
PE08/
PE04/
PE00/
PE09/
ST_
REFRIN USB_X2 ST1_D4/ ST1_VLD/ ST1_D0/ ST1_REQ/
CLKOUT
SCK2
TxD2
CTS1
RxD2
Figure 1.3 Pin Assignments
Page 14 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
1.7
Section 1 Overview
Pin Functions
Table 1.3
Pin Functions
Classification Symbol
I/O Name
Function
Power supply
Vcc
I
Power supply
Power supply pin for the internal logic
circuit. All the Vcc pins must be
connected to the system power
supply. This LSI does not operate
correctly if there is a pin left open.
Vss
I
Ground
Ground pin. All the Vss pins must be
connected to the system power supply
(0 V). This LSI does not operate
correctly if there is a pin left open.
VccQ
I
Power supply
Power supply pin for I/O pins. All the
VccQ pins must be connected to the
system power supply. This LSI does
not operate correctly if there is a pin
left open.
VssQ
I
Ground
Ground pin. All the VssQ pins must be
connected to the system power supply
(0 V). This LSI does not operate
correctly if there is a pin left open.
PLLVcc
I
Power supply
Power supply pin for the PLL circuit.
This pin must be connected to the
system power supply.
PLLVss
I
Ground
Ground pin for the PLL circuit. This pin
must be connected to the system
power supply (0 V).
EXTAL
I
External clock
Pin connected to a crystal resonator.
An external clock signal may also be
input to the EXTAL pin.
XTAL
O
Crystal resonator Pin connected to a crystal resonator
CKIO
I/O System clock
Pin to supply the system clock to
external devices
MD_BW
I
Mode set
Pin to set the operating mode. Do not
change signal levels on this pin during
operation.
MD_CK1,
MD_CK0
I
Clock mode set
Pins to set the clock operating mode.
Do not change signal levels on these
pins during operation.
Clock
Operating
mode control
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 15 of 1278
SH7670 Group
Section 1 Overview
Classification Symbol
I/O Name
Function
System control RES
I
Power-on reset
This LSI enters the power-on reset
state when this signal goes low.
WDTOVF
O
Watchdog timer
overflow
An overflow signal from the WDT is
output on this pin.
NMI
I
Non-maskable
interrupt
Non-maskable interrupt request pin.
Fix it high when not in use.
IRQ7 to IRQ0
I
Interrupt requests Maskable interrupt request pins
7 to 0
Level-input or edge-input detection
can be selected. When the edge-input
detection is selected, the rising edge
or falling edge can also be selected.
Address bus
A25 to A00
O
Address bus
Data bus
D31 to D00
I/O Data bus
Bus control
CS0, CS3 to CS6
O
Chip select 0, 3 to Chip-select signal pins for external
6
memory or devices
RD
O
Read
Indicates that data is read from an
external device.
RD/WR
O
Read/write
Read/write signal pin
BS
O
Bus start
Bus cycle start signal pin
WE3
O
Most significant
byte write
Indicates that data is written to data
bits 31 to 24 of the external memory or
device.
WE2
O
Second byte write Indicates that data is written to data
bits 23 to 16 of the external memory or
device.
WE1
O
Third byte write
Indicates that data is written to data
bits 15 to 8 of the external memory or
device.
WE0
O
Least significant
byte write
Indicates that data is written to data
bits 7 to 0 of the external memory or
device.
WAIT
I
Wait
Input pin to insert a wait cycle into bus
cycles during access to the external
space
RAS
O
RAS
Pin connected to the RAS pin of
SDRAM
CAS
O
CAS
Pin connected to the CAS pin of
SDRAM
Interrupts
Page 16 of 1278
Addresses are output on these pins.
Bidirectional data bus pins
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification Symbol
I/O Name
Function
Bus control
CKE
O
Clock enable
Pin connected to the CKE pin of
SDRAM
DQMUU
O
Most significant
byte select
Selects data bus bits 31 to 24 of
SDRAM.
DQMUL
O
Second byte
select
Selects data bus bits 23 to 16 of
SDRAM.
DQMLU
O
Third byte select
Selects data bus bits 15 to 8 of
SDRAM.
DQMLL
O
Least significant
byte select
Selects data bus bits 7 to 0 of
SDRAM.
CE1A
O
PCMCIA card
select (lower)
Chip enable signal pin for PCMCIA
connected to area 5
CE1B
O
PCMCIA card
select (lower)
Chip enable signal pin for PCMCIA
connected to area 6
CE2A
O
PCMCIA card
select (upper)
Chip enable signal pin for PCMCIA
connected to area 5
CE2B
O
PCMCIA card
select (upper)
Chip enable signal pin for PCMCIA
connected to area 6
ICIOWR
O
PCMCIA I/O write Pin connected to the PCMCIA I/O
strobe
write strobe
ICIORD
O
PCMCIA I/O read Pin connected to the PCMCIA I/O
strobe
read strobe
WE
O
PCMCIA memory Pin connected to the PCMCIA
write strobe
memory write strobe
IOIS16
I
PCMCIA dynamic Indicates the 16-bit I/O of PCMCIA in
bus sizing
little-endian mode. Fix this pin low in
big-endian mode.
I
DMA-transfer
request
Input pins to receive external requests
for DMA transfer
O
DMA-transfer
request
acknowledge
Output pins for signals indicating
acknowledge of external requests
from external devices
TEND0, TEND1
O
DMA-transfer end Output pins for DMA transfer end
output
CRS
I
Carrier sense
Carrier sensing pin
COL
I
Collision
Collision detecting pin
MII_TXD3 to
MII_TXD0
O
Transmit data
4-bit transmit data pins
Direct memory DREQ0, DREQ1
access
controller
DACK0, DACK1
(DMAC)
Ethernet
controller
(EtherC)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 17 of 1278
SH7670 Group
Section 1 Overview
Classification Symbol
I/O Name
Function
Ethernet
controller
(EtherC)
TX_EN
O
Transmit enable
Indicates that transmit data is ready
on the MII_TXD3 to MII_TXD0 pins.
TX_CLK
I
Transmit clock
Input reference timing signal of
TX_EN, TX_ER, and MII_TXD3 to
MII_TXD0
TX_ER
O
Transmit error
Pin to notify the PHY-LSI of an error
detected during transmission
MII_RXD3 to
MII_RXD0
I
Receive data
4-bit receive data pins
RX_DV
I
Receive data
valid
Indicates that valid receive data is
present on the MII_RXD3 to
MII_RXD0 pins
RX_CLK
I
Receive clock
Input reference timing signal of
RX_DV, RX_ER, and MII_RXD3 to
MII_RXD0
RX_ER
I
Receive error
Pin to recognize the state of an error
detected during reception
MDC
O
Clock for
management
Input reference timing signal of
transfer data on the MDIO pin
MDIO
I/O Management data Bidirectional pin to exchange
I/O
management data
WOL
O
MAGIC packet
reception
Indicates that a Magic PacketTM* was
received.
LNKSTA
I
Link status
Input pin to receive the link status
signal from the PHY-LSI
EXOUT
O
General output
External output pin
ST_CLKOUT
O
Data clock output pin
ST1_CLKIN,
ST0_CLKIN
I
Data clock input pins
ST1_SYC,
ST0_SYC
I/O
Synchronizing signal pins
ST1_REQ,
ST0_REQ
I/O
Request signal pins
ST1_VLD,
ST0_VLD
I/O
Data enable pins
ST1_D[7:0],
ST0_D[7:0]
I/O
Data pins (The value 0 is used in
serial mode)
Stream
interface
(STIF)
Page 18 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification Symbol
Stream
interface
(STIF)
I/O Name
ST1_VCO_CLKIN, I
ST0_VCO_CLKIN
VCX0 clock pins
ST1_PWM,
ST0_PWM
O
PWM output pins
I/O SSI data I/O
Serial data I/O pins
I/O SSI clock I/O
Serial clock I/O pins
Serial sound
SSIDATA1,
interface (SSI) SSIDATA0
SSISCK1,
SSISCK0
SSIWS1, SSIWS0 I/O SSI clock LR I/O
USB2.0
host/function
module (USB)
Function
Word select I/O pins
AUDIO_CLK
I
DP
I/O USB D+ data
USB bus D+ data pin
DM
I/O USB D- data
USB bus D- data pin
VBUS
I
VBUS input
Connect this pin to VBUS of the USB
bus.
REFRIN
I
Reference input
Connect this pin to AG33 through a
resistor of 5.6 kΩ ±1%.
USB_X1
I
USB_X2
O
Crystal
resonator/external
clock input for
USB
Pins connected to the crystal
resonator for USB. When an external
clock is used, connect it to the USB_1
pin with the USB_2 pin open.
AV33
I
Analog power
supply for
transceiver
Power supply pin for the core (3.3 V
(Typ.) supplied)
AG33
I
Analog ground for Ground pin for the core
transceiver
AV12
I
Analog power
supply for
transceiver
AG12
I
Analog ground for Ground pin for the core
transceiver
DV33
I
Power supply for
transceiver pins
Power supply pin for pins (3.3 V (Typ.)
supplied)
DG33
I
Ground for
transceiver pins
Ground pin for transceiver pins
DV12
I
Power supply for
transceiver pins
Power supply pin for transceiver pins
(1.2 V (Typ.) supplied)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
External clock for The external clock for audio is input to
SSI audio
this pin.
Power supply pin for the core (1.2 V
(Typ.) supplied)
Page 19 of 1278
SH7670 Group
Section 1 Overview
Classification Symbol
I/O Name
Function
USB2.0
host/function
module (USB)
DG12
I
Ground for
transceiver pins
Ground pin for transceiver pins
UV12
I
Digital power
supply for
transceiver
Power supply pin for the core (1.2V
(Typ.) supplied)
UG12
I
Digital ground for Ground pin for the core
transceiver
SDCLK
O
SD clock
SDCMD
I/O SD command
SD command output/response input
signal pin
SDDATA3 to
SDDATA0
I/O SD data
SD data bus signal pins
SDCD
I
SD card detect
SD card detection pin
SDWP
I
SD write protect
SD write protect signal pin
I C bus
interface 3
(IIC3)
SCL
I/O Serial clock pin
Serial clock I/O pin
SDA
I/O Serial data pin
Serial data I/O pin
Host interface
(HIF)
HIFD15 to HIFD00 I/O HIF data bus
HIF address, data, and command I/O
pins
HIFCS
I
HIF chip select
Input pin to receive the HIF chip select
signal
HIFRS
I
HIF register
select
Pin for access type switching
instruction to the HIF
HIFWR
I
HIF write
Write strobe signal pin
HIFRD
I
HIF read
Read strobe signal pin
HIFINT
O
HIF interrupt
Pin to make an interrupt request from
the HIF to the external device
HIFMD
I
HIF mode
Pin to specify HIF boot mode
HIFDREQ
O
HIFDMAC
transfer request
Pin to request the external device for
DMA transfer to the HIFRAM
HIFEBL
I
HIF pin enable
A high-level input on this pin activates
all the HIF pins other than this pin.
HIFRDY
O
HIF boot ready
Indicates that the HIF module reset
was canceled in this LSI and that
accesses to the HIF module from the
external device are acceptable.
SD host
interface
(SDHI)
2
Page 20 of 1278
SD clock output pin
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Classification Symbol
I/O Name
Function
Serial
TXD2 to TXD0
communication
RXD2 to RXD0
interface with
SCK2 to SCK0
FIFO (SCIF)
O
Transmit data
Transmit data pins
I
Receive data
Receive data pins
I/O ports
I/O Serial clock
Clock input pins
RTS2 to RTS0
O
Request to send
Modem control pins
CTS2 to CTS0
I
Clear to send
Modem control pins
PA25 to PA17
I/O General port
9-bit general I/O port pins
PB07, PB05, PB04 I/O General port
3-bit general I/O port pins
PB06, PB03 to
PB00
I
General port
5-bit general input port pins
PC20 to PC01
I/O General port
20-bit general I/O port pins
PC00
I
1-bit general input port pin
General port
PD07, PD06, PD03 I/O General port
to PD00
6-bit general I/O port pins
PD05, PD04
I
General port
2-bit general input port pins
PE11 to PE00
I/O General port
12-bit general I/O port pins
PF11 to PF00
I/O General port
12-bit general I/O port pins
PG23 to PG00
I/O General port
24-bit general I/O port pins
TCK
I
Test clock
Test clock input pin
TMS
I
Test mode select Test mode selection signal input pin
TDI
I
Test data input
Serial input pin for instructions and
data
TDO
O
Test data output
Serial output pin for instructions and
data
TRST
I
Test reset
Initialization signal input pin
Emulator
interface
ASEMD
I
ASE mode
Pin to set ASE mode
Test mode
TESTMD
User
debugging
interface
(H-UDI)
A low-level input on this pin enables
ASE mode, and a high-level input
enables normal mode. The emulatorspecific functions are available in ASE
mode.
I
Test mode
Pin to set test mode.
A low-level input on this pin enables
test mode. Fix this input pin high.
Note:
*
Magic PacketTM is a registered trademark of Advanced Micro Devices, Inc.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 21 of 1278
SH7670 Group
Section 1 Overview
Table 1.4
Pin Number
List of I/O Attributes of Each Pin
Function Name
I/O Attribute
A1
PA17/A17
IO/O
A2
A00
O
A3
PB04/CE2A/IRQ2/DACK1
IO/O/I/O
A4
PB00/WAIT/SDA
I/I/IO
A5
PB06/CS4
I/O
A6
WE1/DQMLU/WE
O/O/O
A7
D09
IO
A8
D12
IO
A9
D15
IO
A10
D05
IO
A11
D02
IO
A12
A16
O
A13
A13
O
A14
A10
O
A15
A07
O
A16
A04
O
A17
A01
O
A18
RAS
O
A19
CAS
O
A20
VssQ
Power
B1
PA19/A19
IO/O
B2
PA18/A18
IO/O
B3
PB05/CS5/CE1A/IRQ3/TEND1
IO/O/O/I/O
B4
PB02/CE2B/IRQ0
I/O/I
B5
RD
O
B6
PB07/BS
IO/O
B7
D08
IO
B8
D10
IO
B9
D14
IO
B10
D06
IO
B11
D03
IO
Page 22 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
B12
D00
IO
B13
A14
O
B14
A11
O
B15
A08
O
B16
A05
O
B17
A02
O
B18
CS3
O
B19
VSSQ
Power
B20
CKE
O
C1
PA22/A22
IO/O
C2
PA21/A21
IO/O
C3
PA20/A20
IO/O
C4
PB03/CS6/CE1B/IRQ1/DREQ1
I/O/O/I/I
C5
PB01/IOIS16/SCL
I/I/IO
C6
CS0
O
C7
WE0/DQMLL
O/O
C8
D11
IO
C9
D13
IO
C10
D07
IO
C11
D04
IO
C12
D01
IO
C13
A15
O
C14
A12
O
C15
A09
O
C16
A06
O
C17
A03
O
C18
VSSQ
Power
C19
RDWR
O
C20
CKIO
IO
D1
HIFMD/PA25/A25
I/IO/o
D2
PA24/A24
IO/O
D3
PA23/A23
IO/O
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 23 of 1278
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
D4
VSSQ_14
Power
D5
VSS_07
Power
D6
VCCQ_14
Power
D7
VCC_07
Power
D8
VSSQ_13
Power
D9
VCCQ_13
Power
D10
VCCQ_12
Power
D11
VSSQ
Power
D12
VSSQ _12
Power
D13
VCC_06
Power
D14
VSS_06
Power
D15
VCCQ_11
Power
D16
VSSQ_11
Power
D17
VSSQ_10
Power
D18
WE3/DQMUU/ICIOWR
O/O/O
D19
WE2/DQMUL/ICIORD
O/O/O
D20
D25
IO
E1
PC18/LNKSTA
IO/I
E2
PC19/EXOUT
IO/O
E3
PC20/WOL
IO/O
E4
VSSQ_00
Power
E17
VSSQ_09
Power
E18
D24
IO
E19
D26
IO
E20
D28
IO
F1
PC13/TX_CLK
IO/I
F2
PC16/MDIO
IO/IO
F3
PC17/MDC
IO/I
F4
VCCQ_00
Power
F17
VCCQ_10
Power
F18
D27
IO
F19
D29
IO
Page 24 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
F20
D30
IO
G1
PC07/MII_TXD3
IO/O
G2
PC11/TX_ER
IO/O
G3
PC12/TX_EN
IO/O
G4
VSS_00
Power
G17
VCCQ_09
Power
G18
D31
IO
G19
D23
IO
G20
D22
IO
H1
PC04/MII_TXD0
IO/O
H2
PC05/MILL_TXD1
IO/O
H3
PC06/MII_TXD2
IO/O
H4
VCC_00
Power
H17
VCCQ_08
Power
H18
VCCQ_07
Power
H19
D21
IO
H20
D20
IO
J1
PC10/RX_CLK
IO/I
J2
PC14/COL
IO/I
J3
PC15/CRS
IO/I
J4
VSSQ_01
Power
J17
VSSQ_08
Power
J18
VSSQ_07
Power
J19
D19
IO
J20
D18
IO
K1
PC03/MII_RXD3
IO/I
K2
PC08/RX_DV
IO/I
K3
PC09/RX_ER
IO/I
K4
VCCQ_01
Power
K17
VCC_05
Power
K18
VSSQ
Power
K19
D17
IO
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 25 of 1278
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
K20
D16
IO
L1
PC00/MII_RXD0
I/I
L2
PC01/MII_RXD1
IO/I
L3
PC02/MII_RXD2
IO/I
L4
VCCQ_02
Power
L17
VSS_05
Power
L18
PF05/ST0_D5/RTS0
IO/IO/IO
L19
PF06/ST0_D6/SSIDATA0
IO/IO/IO
L20
PF07/ST0_D7/SSIWS0
IO/IO/IO
M1
TESTMD
I
M2
ASEMD
I
M3
PD07/IRQ7/SDCLK
IO/I/O
M4
VSSQ
Power
M17
VSSQ
Power
M18
PF02/ST0_D2/RxD0
IO/IO/I
M19
PF03/ST0_D3/SCK0
IO/IO/IO
M20
PF04/ST0_D4/CTS0
IO/IO/IO
N1
PD04/IRQ4/SDWP
I/I/I
N2
PD05/IRQ5/SDCD
I/I/I
N3
PD06/IRQ6/SDCMD
IO/I/IO
N4
VSSQ_02
Power
N17
VCCQ_06
Power
N18
PF01/ST0_D1/TxD0
IO/IO/O
N19
PF10/ST0_SYC/DACK0
IO/O/O
N20
PF00/ST0_D0
IO/IO
P1
PD01/IRQ1/SDDAT1
IO/I/I
P2
PD02/IRQ2/SDDAT2
IO/I/IO
P3
PD03/IRQ3/SDDAT3
IO/I/IO
P4
VCC_01
Power
P17
VSSQ_06
Power
P18
PF11/ST0_PWM/TEND0
IO/O/O
P19
PF08/ST0_REQ
IO/IO
Page 26 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
P20
PF09_ST0_VLD/DREQ0
IO/IO/I
R1
PG14/HIFD14
IO/IO
R2
PG15/HIFD15
IO/IO
R3
PD00/IRQ0/SDDAT0
IO/I/IO
R4
VCC_02
Power
R17
VCC_04
Power
R18
WDTOVF
O
R19
ST0_CLKIN/SSISCK0
I/IO
R20
ST0_VCO_CLKIN
I
T1
PG11/HIFD11
IO/IO
T2
PG12/HIFD12
IO/IO
T3
PG13/HIFD13
IO/IO
T4
VSS_01
Power
T17
VSS_04
Power
T18
VSSQ
Power
T19
MD_BW
I
T20
ASEBRK/ASEBRKAK
I/O
U1
PG09/HIFD09
IO/IO
U2
PG10/HIFD10
IO/IO
U3
VSSQ
Power
U4
VSS_02
Power
U5
VSSQ_03
Power
U6
VCCQ_03
Power
U7
VSSQ
Power
U8
DG12
Power
U9
DV12
Power
U10
UV12
Power
U11
AV12
Power
U12
VCC_03
Power
U13
VSS_03
Power
U14
VCCQ_04
Power
U15
VCCQ_05
Power
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 27 of 1278
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
U16
VSSQ_04
Power
U17
VSSQ _05
Power
U18
MD_CK1
I
U19
NMI
I
U20
PLLVCC
Power
V1
PG07/HIFD07
IO/IO
V2
VSSQ
Power
V3
PG04/HIFD04
IO/IO
V4
PG01/HIFD01
IO/IO
V5
PG22/HIFRS
IO/I
V6
PG17/HIFRDY
IO/O
V7
VSSQ
Power
V8
VSSQ
Power
V9
VSSQ
Power
V10
UG12
Power
V11
AG12
Power
V12
PE07/ST1_D7/SSIWS1
IO/IO/IO
V13
PE06/ST1_D6/SSIDATA1
IO/IO/IO
V14
PE01/ST1_D1/TxD1
IO/IO/O
V15
PE03/ST1_D3/SCK1
IO/O/IO
V16
ST1_VCO_CLKIN/AUDIO_CLK
I/I
V17
TCK
I
V18
TDI
I
V19
MD_CK0
I
V20
EXTAL
I
W1
VSSQ
Power
W2
PG06/HIFD06
IO/IO
W3
PG03/HIFD03
IO/IO
W4
PG00/HIFD00
IO/IO
W5
PG21/HIFWR
IO/I
W6
PG18/HIFDREQ
IO/O
W7
PG16/HIFEBL
IO/I
Page 28 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 1 Overview
Pin Number
Function Name
I/O Attribute
W8
DG33
Power
W9
VBUS
I
W10
AG33
Power
W11
VSSQ
Power
W12
USB_X1
I
W13
PE05/ST1_D5/RTS1
IO/IO/IO
W14
PE02/ST1_D2/RxD1
IO/IO/I
W15
PE10/ST1_SYC/CTS2
IO/IO/IO
W16
PE11/ST1_PWM/RTS2
IO/O/IO
W17
ST1_CLKIN/SSISCK1
I/IO
W18
RES
I
W19
TDO
O
W20
XTAL
O
Y1
PG08/HIFD08
IO/IO
Y2
PG05/HIFD05
IO/IO
Y3
PG02/HIFD02
IO/IO
Y4
PG23/HIFCS
IO/I
Y5
PG20/HIFRD
IO/I
Y6
PG19/HIFINT
IO/O
Y7
DV33
Power
Y8
DM
IO
Y9
DP
IO
Y10
AV33
Power
Y11
REFRIN
I
Y12
USB_X2
O
Y13
PE04/ST1_D4/CTS1
IO/IO/IO
Y14
PE09/ST1_VLD/SCK2
IO/IO/IO
Y15
PE00/ST1_D0/RxD2
IO/IO/I
Y16
PE08/ST1_REQ/TxD2
IO/IO/O
Y17
ST_CLKOUT
O
Y18
TRST
I
Y19
TMS
I
Y20
PLLVSS
Power
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 29 of 1278
Section 1 Overview
Page 30 of 1278
SH7670 Group
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Section 2 CPU
2.1
Register Configuration
The register set consists of sixteen 32-bit general registers, four 32-bit control registers, and four
32-bit system registers.
2.1.1
General Registers
Figure 2.1 shows the general registers.
The sixteen 32-bit general registers are numbered R0 to R15. General registers are used for data
processing and address calculation. R0 is also used as an index register. Several instructions have
R0 fixed as their only usable register. R15 is used as the hardware stack pointer (SP). Saving and
restoring the status register (SR) and program counter (PC) in exception handling is accomplished
by referencing the stack using R15.
31
0
R0*1
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13
R14
R15, SP (hardware stack pointer)*2
Notes: 1. R0 functions as an index register in the indexed register indirect addressing mode and indexed GBR indirect
addressing mode. In some instructions, R0 functions as a fixed source register or destination register.
2. R15 functions as a hardware stack pointer (SP) during exception processing.
Figure 2.1 General Registers
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 31 of 1278
SH7670 Group
Section 2 CPU
2.1.2
Control Registers
The control registers consist of four 32-bit registers: the status register (SR), the global base
register (GBR), the vector base register (VBR), and the jump table base register (TBR).
The status register indicates instruction processing states.
The global base register functions as a base address for the GBR indirect addressing mode to
transfer data to the registers of on-chip peripheral modules.
The vector base register functions as the base address of the exception handling vector area
(including interrupts).
The jump table base register functions as the base address of the function table area.
31
14 13
9 8 7 6 5 4 3 2 1 0
BO CS
M Q
I[3:0]
S T
31
Status register (SR)
0
GBR
Global base register (GBR)
31
0
VBR
Vector base register (VBR)
0
31
TBR
Jump table base register (TBR)
Figure 2.2 Control Registers
(1)
Status Register (SR)
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
BO
CS
-
-
-
M
Q
-
-
S
T
0
R
0
R/W
0
R/W
0
R
0
R
0
R
R/W
R/W
0
R
0
R
R/W
R/W
Initial value:
R/W:
Page 32 of 1278
I[3:0]
1
R/W
1
R/W
1
R/W
1
R/W
16
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Bit
Section 2 CPU
Bit Name Initial Value
31 to 15 —
All 0
R/W
Description
R
Reserved
These bits are always read as 0. The write value
should always be 0.
14
BO
0
R/W
BO Bit
Indicates that a register bank has overflowed.
13
CS
0
R/W
CS Bit
Indicates that, in CLIP instruction execution, the value
has exceeded the saturation upper-limit value or
fallen below the saturation lower-limit value.
12 to 10 —
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
9
M
—
R/W
M Bit
8
Q
—
R/W
Q Bit
Used by the DIV0S, DIV0U, and DIV1 instructions.
7 to 4
I[3:0]
1111
R/W
Interrupt Mask Level
3, 2
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
1
S
—
R/W
S Bit
Specifies a saturation operation for a MAC
instruction.
0
T
—
R/W
T Bit
True/false condition or carry/borrow bit
(2)
Global Base Register (GBR)
GBR is referenced as the base address in a GBR-referencing MOV instruction.
(3)
Vector Base Register (VBR)
VBR is referenced as the branch destination base address in the event of an exception or an
interrupt.
(4)
Jump Table Base Register (TBR)
TBR is referenced as the start address of a function table located in memory in a
JSR/N@@(disp8,TBR) table-referencing subroutine call instruction.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 33 of 1278
SH7670 Group
Section 2 CPU
2.1.3
System Registers
The system registers consist of four 32-bit registers: the high and low multiply and accumulate
registers (MACH and MACL), the procedure register (PR), and the program counter (PC). MACH
and MACL store the results of multiply or multiply and accumulate operations. PR stores the
return address from a subroutine procedure. PC indicates the program address being executed and
controls the flow of the processing.
31
0
Multiply and accumulate register high (MACH) and multiply
and accumulate register low (MACL):
Store the results of multiply or multiply and accumulate operations.
0
Procedure register (PR):
Stores the return address from a subroutine procedure.
0
Program counter (PC):
Indicates the four bytes ahead of the current instruction.
MACH
MACL
31
PR
31
PC
Figure 2.3 System Registers
(1)
Multiply and Accumulate Register High (MACH) and Multiply and Accumulate
Register Low (MACL)
MACH and MACL are used as the addition value in a MAC instruction, and store the result of a
MAC or MUL instruction.
(2)
Procedure Register (PR)
PR stores the return address of a subroutine call using a BSR, BSRF, or JSR instruction, and is
referenced by a subroutine return instruction (RTS).
(3)
Program Counter (PC)
PC indicates the address of the instruction being executed.
Page 34 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.1.4
Section 2 CPU
Register Banks
For the nineteen 32-bit registers comprising general registers R0 to R14, control register GBR, and
system registers MACH, MACL, and PR, high-speed register saving and restoration can be carried
out using a register bank. The register contents are automatically saved in the bank after the CPU
accepts an interrupt that uses a register bank. Restoration from the bank is executed by issuing a
RESBANK instruction in an interrupt processing routine.
This LSI has 15 banks. For details, see the SH-2A, SH2A-FPU Software Manual and section 6.8,
Register Banks.
2.1.5
Initial Values of Registers
Table 2.1 lists the values of the registers after a reset.
Table 2.1
Initial Values of Registers
Classification
Register
General registers
R0 to R14
Undefined
R15 (SP)
Value of the stack pointer in the vector
address table
SR
Bits I[3:0] are 1111 (H'F), BO and CS are
0, reserved bits are 0, and other bits are
undefined
GBR, TBR
Undefined
VBR
H'00000000
MACH, MACL, PR
Undefined
PC
Value of the program counter in the vector
address table
Control registers
System registers
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Initial Value
Page 35 of 1278
SH7670 Group
Section 2 CPU
2.2
Data Formats
2.2.1
Data Format in Registers
Register operands are always longwords (32 bits). If the size of memory operand is a byte (8 bits)
or a word (16 bits), it is changed into a longword by expanding the sign-part when loaded into a
register.
31
0
Longword
Figure 2.4 Data Format in Registers
2.2.2
Data Formats in Memory
Memory data formats are classified into bytes, words, and longwords. Memory can be accessed in
8-bit bytes, 16-bit words, or 32-bit longwords. A memory operand of fewer than 32 bits is stored
in a register in sign-extended or zero-extended form.
A word operand should be accessed at a word boundary (an even address of multiple of two bytes:
address 2n), and a longword operand at a longword boundary (an even address of multiple of four
bytes: address 4n). Otherwise, an address error will occur. A byte operand can be accessed at any
address.
Only big-endian byte order can be selected for the data format.
Data formats in memory are shown in figure 2.5.
Address m + 1
Address m
31
Address m + 2
23
Byte
Address 2n
Address 4n
Address m + 3
15
Byte
7
Byte
Word
0
Byte
Word
Longword
Big endian
Figure 2.5 Data Formats in Memory
Page 36 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.2.3
Section 2 CPU
Immediate Data Format
Byte (8-bit) immediate data is located in an instruction code. Immediate data accessed by the
MOV, ADD, and CMP/EQ instructions is sign-extended and handled in registers as longword
data. Immediate data accessed by the TST, AND, OR, and XOR instructions is zero-extended and
handled as longword data. Consequently, AND instructions with immediate data always clear the
upper 24 bits of the destination register.
20-bit immediate data is located in the code of a MOVI20 or MOVI20S 32-bit transfer instruction.
The MOVI20 instruction stores immediate data in the destination register in sign-extended form.
The MOVI20S instruction shifts immediate data by eight bits in the upper direction, and stores it
in the destination register in sign-extended form.
Word or longword immediate data is not located in the instruction code, but rather is stored in a
memory table. The memory table is accessed by an immediate data transfer instruction (MOV)
using the PC relative addressing mode with displacement.
See examples given in section 2.3.1 (10), Immediate Data.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 37 of 1278
SH7670 Group
Section 2 CPU
2.3
Instruction Features
2.3.1
RISC-Type Instruction Set
Instructions are RISC type. This section details their functions.
(1)
16-Bit Fixed-Length Instructions
Basic instructions have a fixed length of 16 bits, improving program code efficiency.
(2)
32-Bit Fixed-Length Instructions
The SH-2A additionally features 32-bit fixed-length instructions, improving performance and ease
of use.
(3)
One Instruction per State
Each basic instruction can be executed in one cycle using the pipeline system.
(4)
Data Length
Longword is the standard data length for all operations. Memory can be accessed in bytes, words,
or longwords. Byte or word data in memory is sign-extended and handled as longword data.
Immediate data is sign-extended for arithmetic operations or zero-extended for logic operations. It
is also handled as longword data.
Table 2.2
Sign Extension of Word Data
SH2-A CPU
MOV.W
ADD
.DATA.W
Description
@(disp,PC),R1 Data is sign-extended to 32
bits, and R1 becomes
R1,R0
H'00001234. It is next
.........
operated upon by an ADD
instruction.
H'1234
Example of Other CPU
ADD.W
#H'1234,R0
Note: @(disp, PC) accesses the immediate data.
(5)
Load-Store Architecture
Basic operations are executed between registers. For operations that involve memory access, data
is loaded to the registers and executed (load-store architecture). Instructions such as AND that
manipulate bits, however, are executed directly in memory.
Page 38 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(6)
Section 2 CPU
Delayed Branch Instructions
With the exception of some instructions, unconditional branch instructions, etc., are executed as
delayed branch instructions. With a delayed branch instruction, the branch is taken after execution
of the instruction immediately following the delayed branch instruction. This reduces disturbance
of the pipeline control when a branch is taken.
In a delayed branch, the actual branch operation occurs after execution of the slot instruction.
However, instruction execution such as register updating excluding the actual branch operation, is
performed in the order of delayed branch instruction → delay slot instruction. For example, even
though the contents of the register holding the branch destination address are changed in the delay
slot, the branch destination address remains as the register contents prior to the change.
Table 2.3
Delayed Branch Instructions
SH-2A CPU
Description
Example of Other CPU
BRA
TRGET
R1,R0
R1,R0
Executes the ADD before
branching to TRGET.
ADD.W
ADD
BRA
TRGET
(7)
Unconditional Branch Instructions with No Delay Slot
The SH-2A additionally features unconditional branch instructions in which a delay slot
instruction is not executed. This eliminates unnecessary NOP instructions, and so reduces the code
size.
(8)
Multiply/Multiply-and-Accumulate Operations
16-bit × 16-bit → 32-bit multiply operations are executed in one to two cycles. 16-bit × 16-bit +
64-bit → 64-bit multiply-and-accumulate operations are executed in two to three cycles. 32-bit ×
32-bit → 64-bit multiply and 32-bit × 32-bit + 64-bit → 64-bit multiply-and-accumulate
operations are executed in two to four cycles.
(9)
T Bit
The T bit in the status register (SR) changes according to the result of the comparison. Whether a
conditional branch is taken or not taken depends upon the T bit condition (true/false). The number
of instructions that change the T bit is kept to a minimum to improve the processing speed.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 39 of 1278
SH7670 Group
Section 2 CPU
Table 2.4
T Bit
SH-2A CPU
Description
Example of Other CPU
CMP/GE
R1,R0
T bit is set when R0 ≥ R1.
CMP.W
R1,R0
BT
TRGET0
BGE
TRGET0
BF
TRGET1
The program branches to TRGET0
when R0 ≥ R1 and to TRGET1
when R0 < R1.
BLT
TRGET1
ADD
#−1,R0
T bit is not changed by ADD.
SUB.W
#1,R0
CMP/EQ
#0,R0
T bit is set when R0 = 0.
BEQ
TRGET
BT
TRGET
The program branches if R0 = 0.
(10) Immediate Data
Byte immediate data is located in an instruction code. Word or longword immediate data is not
located in instruction codes but in a memory table. The memory table is accessed by an immediate
data transfer instruction (MOV) using the PC relative addressing mode with displacement.
With the SH-2A, 17- to 28-bit immediate data can be located in an instruction code. However, for
21- to 28-bit immediate data, an OR instruction must be executed after the data is transferred to a
register.
Table 2.5
Immediate Data Accessing
Classification
SH-2A CPU
8-bit immediate
MOV
#H'12,R0
MOV.B
#H'12,R0
16-bit immediate
MOVI20
#H'1234,R0
MOV.W
#H'1234,R0
20-bit immediate
MOVI20
#H'12345,R0
MOV.L
#H'12345,R0
28-bit immediate
MOVI20S
#H'12345,R0
MOV.L
#H'1234567,R0
OR
#H'67,R0
MOV.L
@(disp,PC),R0
MOV.L
#H'12345678,R0
32-bit immediate
Example of Other CPU
.................
.DATA.L
H'12345678
Note: @(disp, PC) accesses the immediate data.
Page 40 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
(11) Absolute Address
When data is accessed by an absolute address, the absolute address value should be placed in the
memory table in advance. That value is transferred to the register by loading the immediate data
during the execution of the instruction, and the data is accessed in register indirect addressing
mode.
With the SH-2A, when data is referenced using an absolute address not exceeding 28 bits, it is also
possible to transfer immediate data located in the instruction code to a register and to reference the
data in register indirect addressing mode. However, when referencing data using an absolute
address of 21 to 28 bits, an OR instruction must be used after the data is transferred to a register.
Table 2.6
Absolute Address Accessing
Classification
SH-2A CPU
Up to 20 bits
MOVI20
#H'12345,R1
MOV.B
@R1,R0
MOVI20S
#H'12345,R1
OR
#H'67,R1
MOV.B
@R1,R0
MOV.L
@(disp,PC),R1
MOV.B
@R1,R0
21 to 28 bits
29 bits or more
Example of Other CPU
MOV.B
@H'12345,R0
MOV.B
@H'1234567,R0
MOV.B
@H'12345678,R0
..................
.DATA.L
H'12345678
(12) 16-Bit/32-Bit Displacement
When data is accessed by 16-bit or 32-bit displacement, the displacement value should be placed
in the memory table in advance. That value is transferred to the register by loading the immediate
data during the execution of the instruction, and the data is accessed in the indexed indirect
register addressing mode.
Table 2.7
Displacement Accessing
Classification
SH-2A CPU
Example of Other CPU
16-bit displacement
MOV.W
@(disp,PC),R0
MOV.W
@(R0,R1),R2
MOV.W
@(H'1234,R1),R2
..................
.DATA.W
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
H'1234
Page 41 of 1278
SH7670 Group
Section 2 CPU
2.3.2
Addressing Modes
Addressing modes and effective address calculation are as follows:
Table 2.8
Addressing Modes and Effective Addresses
Addressing
Mode
Instruction
Format
Effective Address Calculation
Register direct
Rn
Register indirect @Rn
The effective address is register Rn. (The operand
is the contents of register Rn.)
—
The effective address is the contents of register Rn. Rn
Rn
Register indirect @Rn+
with postincrement
Equation
Rn
The effective address is the contents of register Rn.
A constant is added to the contents of Rn after the
instruction is executed. 1 is added for a byte
operation, 2 for a word operation, and 4 for a
longword operation.
Rn
Rn
Rn + 1/2/4
+
Rn
(After
instruction
execution)
Byte:
Rn + 1 → Rn
Word:
Rn + 2 → Rn
1/2/4
Longword:
Rn + 4 → Rn
Register indirect @-Rn
with predecrement
The effective address is the value obtained by
subtracting a constant from Rn. 1 is subtracted for
a byte operation, 2 for a word operation, and 4 for
a longword operation.
Rn
Rn – 1/2/4
1/2/4
Page 42 of 1278
–
Rn – 1/2/4
Byte:
Rn – 1 → Rn
Word:
Rn – 2 → Rn
Longword:
Rn – 4 → Rn
(Instruction is
executed with
Rn after this
calculation)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Addressing
Mode
Section 2 CPU
Instruction
Format
Register indirect @(disp:4,
with
Rn)
displacement
Effective Address Calculation
Equation
The effective address is the sum of Rn and a 4-bit
displacement (disp). The value of disp is zeroextended, and remains unchanged for a byte
operation, is doubled for a word operation, and is
quadrupled for a longword operation.
Byte:
Rn + disp
Rn
disp
(zero-extended)
Word:
Rn + disp × 2
Longword:
Rn + disp × 4
Rn + disp × 1/2/4
+
×
1/2/4
Register indirect @(disp:12, The effective address is the sum of Rn and a 12with
Rn)
bit
displacement
displacement (disp). The value of disp is zeroextended.
Rn
+
Rn + disp
Byte:
Rn + disp
Word:
Rn + disp
Longword:
Rn + disp
disp
(zero-extended)
Indexed register @(R0,Rn)
indirect
The effective address is the sum of Rn and R0.
Rn + R0
Rn
+
Rn + R0
R0
GBR indirect
with
displacement
@(disp:8,
GBR)
The effective address is the sum of GBR value
and an 8-bit displacement (disp). The value of
disp is zero-extended, and remains unchanged for
a byte operation, is doubled for a word operation,
and is quadrupled for a longword operation.
GBR
disp
(zero-extended)
+
Byte:
GBR + disp
Word:
GBR + disp × 2
Longword:
GBR + disp × 4
GBR
+ disp × 1/2/4
×
1/2/4
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 43 of 1278
SH7670 Group
Section 2 CPU
Addressing
Mode
Instruction
Format
Effective Address Calculation
Equation
Indexed GBR
indirect
@(R0, GBR) The effective address is the sum of GBR value
and R0.
GBR + R0
GBR
+
GBR + R0
R0
TBR duplicate
indirect with
displacement
@@
(disp:8,
TBR)
The effective address is the sum of TBR value
and an 8-bit displacement (disp). The value of
disp is zero-extended, and is multiplied by 4.
Contents of
address (TBR
+ disp × 4)
TBR
disp
(zero-extended)
TBR
+
+ disp × 4
×
(TBR
4
PC indirect with @(disp:8,
displacement
PC)
+ disp × 4)
The effective address is the sum of PC value and
an 8-bit displacement (disp). The value of disp is
zero-extended, and is doubled for a word
operation, and quadrupled for a longword
operation. For a longword operation, the lowest
two bits of the PC value are masked.
Word:
PC + disp × 2
Longword:
PC &
H'FFFFFFFC +
disp × 4
PC
&
H'FFFFFFFC
(for longword)
+
disp
(zero-extended)
PC + disp × 2
or
PC & H'FFFFFFFC
+ disp × 4
×
2/4
Page 44 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Addressing
Mode
Instruction
Format
Effective Address Calculation
PC relative
disp:8
The effective address is the sum of PC value and
the value that is obtained by doubling the signextended 8-bit displacement (disp).
Equation
PC + disp × 2
PC
disp
(sign-extended)
+
PC + disp × 2
×
2
disp:12
The effective address is the sum of PC value and
the value that is obtained by doubling the signextended 12-bit displacement (disp).
PC + disp × 2
PC
disp
(sign-extended)
+
PC + disp × 2
×
2
Rn
The effective address is the sum of PC value and
Rn.
PC + Rn
PC
+
PC + Rn
Rn
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 45 of 1278
SH7670 Group
Section 2 CPU
Addressing
Mode
Instruction
Format
Effective Address Calculation
Immediate
#imm:20
Equation
The 20-bit immediate data (imm) for the MOVI20
instruction is sign-extended.
—
31
19
0
Signextended imm (20 bits)
The 20-bit immediate data (imm) for the MOVI20S
—
instruction is shifted by eight bits to the left, the
upper bits are sign-extended, and the lower bits are
padded with zero.
31 27
8
0
imm (20 bits) 00000000
Sign-extended
Page 46 of 1278
#imm:8
The 8-bit immediate data (imm) for the TST, AND,
OR, and XOR instructions is zero-extended.
—
#imm:8
The 8-bit immediate data (imm) for the MOV, ADD,
and CMP/EQ instructions is sign-extended.
—
#imm:8
The 8-bit immediate data (imm) for the TRAPA
instruction is zero-extended and then quadrupled.
—
#imm:3
The 3-bit immediate data (imm) for the BAND, BOR, —
BXOR, BST, BLD, BSET, and BCLR instructions
indicates the target bit location.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.3.3
Section 2 CPU
Instruction Format
The instruction formats and the meaning of source and destination operands are described below.
The meaning of the operand depends on the instruction code. The symbols used are as follows:
•
•
•
•
•
xxxx: Instruction code
mmmm: Source register
nnnn: Destination register
iiii: Immediate data
dddd: Displacement
Table 2.9
Instruction Formats
Instruction Formats
0 format
15
Source
Operand
Destination
Operand
Example
—
—
NOP
—
nnnn: Register
direct
MOVT
Rn
Control register or
system register
nnnn: Register
direct
STS
MACH,Rn
R0 (Register direct) nnnn: Register
direct
DIVU
R0,Rn
Control register or
system register
nnnn: Register
indirect with predecrement
STC.L SR,@-Rn
mmmm: Register
direct
R15 (Register
indirect with predecrement)
MOVMU.L
Rm,@-R15
R15 (Register
indirect with postincrement)
nnnn: Register
direct
MOVMU.L
@R15+,Rn
0
xxxx xxxx xxxx xxxx
n format
15
xxxx
0
nnnn
xxxx
xxxx
R0 (Register direct) nnnn: (Register
indirect with postincrement)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
MOV.L R0,@Rn+
Page 47 of 1278
SH7670 Group
Section 2 CPU
Instruction Formats
m format
15
0
xxxx
mmmm
xxxx
xxxx
nm format
15
0
xxxx
nnnn
mmmm
xxxx
Source
Operand
Destination
Operand
mmmm: Register
direct
Control register or
system register
LDC
mmmm: Register
indirect with postincrement
Control register or
system register
LDC.L @Rm+,SR
mmmm: Register
indirect
—
JMP
mmmm: Register
indirect with predecrement
R0 (Register direct) MOV.L @-Rm,R0
Example
Rm,SR
@Rm
mmmm: PC relative —
using Rm
BRAF
Rm
mmmm: Register
direct
nnnn: Register
direct
ADD
Rm,Rn
mmmm: Register
direct
nnnn: Register
indirect
MOV.L Rm,@Rn
mmmm: Register
MACH, MACL
indirect with postincrement (multiplyand-accumulate)
MAC.W
@Rm+,@Rn+
nnnn*: Register
indirect with postincrement (multiplyand-accumulate)
md format
15
0
xxxx
xxxx
Page 48 of 1278
mmmm
dddd
mmmm: Register
indirect with postincrement
nnnn: Register
direct
MOV.L
@Rm+,Rn
mmmm: Register
direct
nnnn: Register
indirect with predecrement
MOV.L
Rm,@-Rn
mmmm: Register
direct
nnnn: Indexed
register indirect
MOV.L
Rm,@(R0,Rn)
mmmmdddd:
Register indirect
with displacement
R0 (Register direct) MOV.B
@(disp,Rm),R0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Source
Operand
Instruction Formats
nd4 format
15
0
xxxx
xxxx
nnnn
dddd
nmd format
15
0
xxxx
nnnn
mmmm
32
xxxx
15
xxxx
16
nnnn
mmmm
dddd
dddd
d format
15
0
xxxx
xxxx
dddd
dddd
15
0
xxxx
dddd
dddd
mmmmdddd:
Register indirect
with displacement
nnnn: Register
direct
mmmm: Register
direct
nnnndddd: Register MOV.L
indirect with
Rm,@(disp12,Rn)
displacement
mmmmdddd:
Register indirect
with displacement
nnnn: Register
direct
dddddddd: GBR
indirect with
displacement
R0 (Register direct) MOV.L
@(disp,GBR),R0
15
0
xxxx
nnnn
dddd
dddd
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
MOV.L
@(disp,Rm),Rn
MOV.L
@(disp12,Rm),Rn
MOV.L
R0,@(disp,GBR)
dddddddd: PC
relative with
displacement
R0 (Register direct) MOVA
@(disp,PC),R0
dddddddd: TBR
duplicate indirect
with displacement
—
JSR/N
@@(disp8,TBR)
dddddddd: PC
relative
—
BF
label
dddddddddddd: PC —
relative
BRA
label
dddddddd: PC
relative with
displacement
MOV.L
@(disp,PC),Rn
dddd
nd8 format
MOV.B
R0,@(disp,Rn)
nnnndddd: Register MOV.L
indirect with
Rm,@(disp,Rn)
displacement
R0 (Register direct) dddddddd: GBR
indirect with
displacement
d12 format
Example
mmmm: Register
direct
xxxx
0
dddd
R0 (Register direct) nnnndddd:
Register indirect
with displacement
dddd
nmd12 format
Destination
Operand
nnnn: Register
direct
(label = disp +
PC)
Page 49 of 1278
SH7670 Group
Section 2 CPU
Instruction Formats
Source
Operand
Destination
Operand
Example
i format
iiiiiiii: Immediate
Indexed GBR
indirect
AND.B
#imm,@(R0,GBR)
iiiiiiii: Immediate
R0 (Register direct)
AND
#imm,R0
iiiiiiii: Immediate
—
TRAPA
#imm
iiiiiiii: Immediate
nnnn: Register direct ADD
15
xxxx
xxxx
iiii
0
iiii
ni format
15
#imm,Rn
0
xxxx
nnnn
iiii iiii
ni3 format
nnnn: Register direct —
15
0
xxxx
xxxx
nnnn x iii
BLD
#imm3,Rn
nnnn: Register direct BST
#imm3,Rn
iii: Immediate
—
iii: Immediate
ni20 format
32
xxxx
nnnn
iiii
xxxx
15
iiii
iiii
iiii
iiii
16
15
xxxx
nnnn: Register direct MOVI20
#imm20, Rn
0
nid format
32
xxxx
iiiiiiiiiiiiiiiiiiii:
Immediate
16
nnnn
xiii
xxxx
0
dddd
dddd
dddd
nnnndddddddddddd: —
Register indirect with
displacement
BLD.B
#imm3,@(disp12,Rn
)
iii: Immediate
—
nnnndddddddddddd: BST.B
Register indirect with #imm3,@(disp12,Rn
displacement
)
iii: Immediate
Note:
*
In multiply-and-accumulate instructions, nnnn is the source register.
Page 50 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
2.4
Instruction Set
2.4.1
Instruction Set by Classification
Table 2.10 lists the instructions according to their classification.
Table 2.10 Classification of Instructions
Classification Types
Operation
Code
Function
No. of
Instructions
Data transfer
MOV
62
13
Data transfer
Immediate data transfer
Peripheral module data transfer
Structure data transfer
Reverse stack transfer
MOVA
Effective address transfer
MOVI20
20-bit immediate data transfer
MOVI20S
20-bit immediate data transfer
8-bit left-shit
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
MOVML
R0–Rn register save/restore
MOVMU
Rn–R14 and PR register save/restore
MOVRT
T bit inversion and transfer to Rn
MOVT
T bit transfer
MOVU
Unsigned data transfer
NOTT
T bit inversion
PREF
Prefetch to operand cache
SWAP
Swap of upper and lower bytes
XTRCT
Extraction of the middle of registers connected
Page 51 of 1278
SH7670 Group
Section 2 CPU
Classification Types
Arithmetic
operations
26
Operation
Code
Function
No. of
Instructions
ADD
Binary addition
40
ADDC
Binary addition with carry
ADDV
Binary addition with overflow check
CMP/cond Comparison
Page 52 of 1278
CLIPS
Signed saturation value comparison
CLIPU
Unsigned saturation value comparison
DIVS
Signed division (32 ÷ 32)
DIVU
Unsigned division (32 ÷ 32)
DIV1
One-step division
DIV0S
Initialization of signed one-step division
DIV0U
Initialization of unsigned one-step division
DMULS
Signed double-precision multiplication
DMULU
Unsigned double-precision multiplication
DT
Decrement and test
EXTS
Sign extension
EXTU
Zero extension
MAC
Multiply-and-accumulate, double-precision
multiply-and-accumulate operation
MUL
Double-precision multiply operation
MULR
Signed multiplication with result storage in Rn
MULS
Signed multiplication
MULU
Unsigned multiplication
NEG
Negation
NEGC
Negation with borrow
SUB
Binary subtraction
SUBC
Binary subtraction with borrow
SUBV
Binary subtraction with underflow
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Classification Types
Logic
operations
Shift
Branch
6
12
10
Operation
Code
Function
No. of
Instructions
AND
Logical AND
14
NOT
Bit inversion
OR
Logical OR
TAS
Memory test and bit set
TST
Logical AND and T bit set
XOR
Exclusive OR
ROTL
One-bit left rotation
ROTR
One-bit right rotation
ROTCL
One-bit left rotation with T bit
ROTCR
One-bit right rotation with T bit
SHAD
Dynamic arithmetic shift
SHAL
One-bit arithmetic left shift
16
SHAR
One-bit arithmetic right shift
SHLD
Dynamic logical shift
SHLL
One-bit logical left shift
SHLLn
n-bit logical left shift
SHLR
One-bit logical right shift
SHLRn
n-bit logical right shift
BF
Conditional branch, conditional delayed branch 15
(branch when T = 0)
BT
Conditional branch, conditional delayed branch
(branch when T = 1)
BRA
Unconditional delayed branch
BRAF
Unconditional delayed branch
BSR
Delayed branch to subroutine procedure
BSRF
Delayed branch to subroutine procedure
JMP
Unconditional delayed branch
JSR
Branch to subroutine procedure
Delayed branch to subroutine procedure
RTS
Return from subroutine procedure
Delayed return from subroutine procedure
RTV/N
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Return from subroutine procedure with Rm →
R0 transfer
Page 53 of 1278
SH7670 Group
Section 2 CPU
Classification Types
System
control
14
Operation
Code
Function
No. of
Instructions
CLRT
T bit clear
36
CLRMAC
MAC register clear
LDBANK
Register restoration from specified register
bank entry
LDC
Load to control register
LDS
Load to system register
NOP
No operation
RESBANK Register restoration from register bank
Floating-point 19
instructions
Page 54 of 1278
RTE
Return from exception handling
SETT
T bit set
SLEEP
Transition to power-down mode
STBANK
Register save to specified register bank entry
STC
Store control register data
STS
Store system register data
TRAPA
Trap exception handling
FABS
Floating-point absolute value
FADD
Floating-point addition
FCMP
Floating-point comparison
FCNVDS
Conversion from double-precision to singleprecision
FCNVSD
Conversion from single-precision to double precision
FDIV
Floating-point division
FLDI0
Floating-point load immediate 0
FLDI1
Floating-point load immediate 1
48
FLDS
Floating-point load into system register FPUL
FLOAT
Conversion from integer to floating-point
FMAC
Floating-point multiply and accumulate
operation
FMOV
Floating-point data transfer
FMUL
Floating-point multiplication
FNEG
Floating-point sign inversion
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Classification Types
Floating-point 19
instructions
FPU-related
CPU
instructions
2
Bit
manipulation
10
Operation
Code
Function
No. of
Instructions
FSCHG
SZ bit inversion
48
FSQRT
Floating-point square root
FSTS
Floating-point store from system register FPUL
FSUB
Floating-point subtraction
FTRC
Floating-point conversion with rounding to
integer
LDS
Load into floating-point system register
STS
Store from floating-point system register
BAND
Bit AND
BCLR
Bit clear
BLD
Bit load
BOR
Bit OR
BSET
Bit set
BST
Bit store
BXOR
Bit exclusive OR
8
14
BANDNOT Bit NOT AND
Total:
112
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
BORNOT
Bit NOT OR
BLDNOT
Bit NOT load
253
Page 55 of 1278
SH7670 Group
Section 2 CPU
The table below shows the format of instruction codes, operation, and execution states. They are
described by using this format according to their classification.
Execution
States
T Bit
Value when no
wait states are
inserted.*1
Value of T bit after
instruction is
executed.
Instruction
Instruction Code
Operation
Indicated by mnemonic.
Indicated in MSB ↔
LSB order.
Indicates summary of
operation.
[Legend]
[Legend]
[Legend]
Explanation of
Symbols
Rm:
Source register
mmmm: Source register
→, ←:
Transfer direction
—: No change
Rn:
Destination register
nnnn: Destination register
0000: R0
0001: R1
.........
(xx):
Memory operand
imm: Immediate data
disp: Displacement*2
1111: R15
iiii:
Immediate data
dddd:
Displacement
M/Q/T: Flag bits in SR
&:
Logical AND of each bit
|:
Logical OR of each bit
^:
Exclusive logical OR of
each bit
~:
Logical NOT of each bit
n: n-bit right shift
Notes: 1. Instruction execution cycles: The execution cycles shown in the table are minimums. In
practice, the number of instruction execution states will be increased in cases such as
the following:
a. When there is a conflict between an instruction fetch and a data access
b. When the destination register of a load instruction (memory → register) is the same
as the register used by the next instruction.
2. Depending on the operand size, displacement is scaled by ×1, ×2, or ×4. For details,
refer to the SH-2A, SH2A-FPU Software Manual.
Page 56 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.4.2
Section 2 CPU
Data Transfer Instructions
Table 2.11 Data Transfer Instructions
Compatibility
Execution
SH2,
Cycles
T Bit SH2E SH4
SH-2A
1110nnnniiiiiiii imm → sign extension → Rn
1
⎯
Yes
Yes
Yes
1001nnnndddddddd (disp × 2 + PC) → sign
1
⎯
Yes
Yes
Yes
Instruction
Instruction Code
MOV
#imm,Rn
MOV.W
@(disp,PC),Rn
Operation
extension → Rn
MOV.L
@(disp,PC),Rn
1101nnnndddddddd (disp × 4 + PC) → Rn
1
⎯
Yes
Yes
Yes
MOV
Rm,Rn
0110nnnnmmmm0011 Rm → Rn
1
⎯
Yes
Yes
Yes
MOV.B
Rm,@Rn
0010nnnnmmmm0000 Rm → (Rn)
1
⎯
Yes
Yes
Yes
MOV.W
Rm,@Rn
0010nnnnmmmm0001 Rm → (Rn)
1
⎯
Yes
Yes
Yes
MOV.L
Rm,@Rn
0010nnnnmmmm0010 Rm → (Rn)
1
⎯
Yes
Yes
Yes
MOV.B
@Rm,Rn
0110nnnnmmmm0000 (Rm) → sign extension → Rn
1
⎯
Yes
Yes
Yes
MOV.W
@Rm,Rn
0110nnnnmmmm0001 (Rm) → sign extension → Rn
1
⎯
Yes
Yes
Yes
MOV.L
@Rm,Rn
0110nnnnmmmm0010 (Rm) → Rn
1
⎯
Yes
Yes
Yes
MOV.B
Rm,@-Rn
0010nnnnmmmm0100 Rn-1 → Rn, Rm → (Rn)
1
⎯
Yes
Yes
Yes
MOV.W
Rm,@-Rn
0010nnnnmmmm0101 Rn-2 → Rn, Rm → (Rn)
1
⎯
Yes
Yes
Yes
MOV.L
Rm,@-Rn
0010nnnnmmmm0110 Rn-4 → Rn, Rm → (Rn)
1
⎯
Yes
Yes
Yes
MOV.B
@Rm+,Rn
0110nnnnmmmm0100 (Rm) → sign extension → Rn, 1
⎯
Yes
Yes
Yes
⎯
Yes
Yes
Yes
Rm + 1 → Rm
MOV.W
@Rm+,Rn
0110nnnnmmmm0101 (Rm) → sign extension → Rn, 1
Rm + 2 → Rm
MOV.L
@Rm+,Rn
0110nnnnmmmm0110 (Rm) → Rn, Rm + 4 → Rm
1
⎯
Yes
Yes
Yes
MOV.B
R0,@(disp,Rn)
10000000nnnndddd R0 → (disp + Rn)
1
⎯
Yes
Yes
Yes
MOV.W
R0,@(disp,Rn)
10000001nnnndddd R0 → (disp × 2 + Rn)
1
⎯
Yes
Yes
Yes
MOV.L
Rm,@(disp,Rn)
0001nnnnmmmmdddd Rm → (disp × 4 + Rn)
1
⎯
Yes
Yes
Yes
MOV.B
@(disp,Rm),R0
10000100mmmmdddd (disp + Rm) → sign extension
1
⎯
Yes
Yes
Yes
1
⎯
Yes
Yes
Yes
→ R0
MOV.W
@(disp,Rm),R0
10000101mmmmdddd (disp × 2 + Rm) →
sign extension → R0
MOV.L
@(disp,Rm),Rn
0101nnnnmmmmdddd (disp × 4 + Rm) → Rn
1
⎯
Yes
Yes
Yes
MOV.B
Rm,@(R0,Rn)
0000nnnnmmmm0100 Rm → (R0 + Rn)
1
⎯
Yes
Yes
Yes
MOV.W
Rm,@(R0,Rn)
0000nnnnmmmm0101 Rm → (R0 + Rn)
1
⎯
Yes
Yes
Yes
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 57 of 1278
SH7670 Group
Section 2 CPU
Compatibility
Execution
SH2,
Cycles
T Bit SH2E SH4
SH-2A
0000nnnnmmmm0110 Rm → (R0 + Rn)
1
⎯
Yes
Yes
Yes
0000nnnnmmmm1100 (R0 + Rm) →
1
⎯
Yes
Yes
Yes
1
⎯
Yes
Yes
Yes
Instruction
Instruction Code
MOV.L
Rm,@(R0,Rn)
MOV.B
@(R0,Rm),Rn
Operation
sign extension → Rn
MOV.W
@(R0,Rm),Rn
0000nnnnmmmm1101 (R0 + Rm) →
sign extension → Rn
MOV.L
@(R0,Rm),Rn
0000nnnnmmmm1110 (R0 + Rm) → Rn
1
⎯
Yes
Yes
Yes
MOV.B
R0,@(disp,GBR)
11000000dddddddd R0 → (disp + GBR)
1
⎯
Yes
Yes
Yes
MOV.W
R0,@(disp,GBR)
11000001dddddddd R0 → (disp × 2 + GBR)
1
⎯
Yes
Yes
Yes
MOV.L
R0,@(disp,GBR)
11000010dddddddd R0 → (disp × 4 + GBR)
1
⎯
Yes
Yes
Yes
MOV.B
@(disp,GBR),R0
11000100dddddddd (disp + GBR) →
1
⎯
Yes
Yes
Yes
1
⎯
Yes
Yes
Yes
Yes
Yes
Yes
sign extension → R0
MOV.W
@(disp,GBR),R0
11000101dddddddd (disp × 2 + GBR) →
sign extension → R0
MOV.L
@(disp,GBR),R0
11000110dddddddd (disp × 4 + GBR) → R0
1
⎯
MOV.B
R0,@Rn+
0100nnnn10001011 R0 → (Rn), Rn + 1 → Rn
1
⎯
Yes
MOV.W
R0,@Rn+
0100nnnn10011011 R0 → (Rn), Rn + 2 → Rn
1
⎯
Yes
MOV.L
R0,@Rn+
0100nnnn10101011 R0 → Rn), Rn + 4 → Rn
1
⎯
Yes
MOV.B
@-Rm,R0
0100mmmm11001011 Rm-1 → Rm, (Rm) →
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
sign extension → R0
MOV.W
@-Rm,R0
0100mmmm11011011 Rm-2 → Rm, (Rm) →
sign extension → R0
0100mmmm11101011 Rm-4 → Rm, (Rm) → R0
MOV.L
@-Rm,R0
MOV.B
Rm,@(disp12,Rn) 0011nnnnmmmm0001 Rm → (disp + Rn)
0000dddddddddddd
MOV.W
Rm,@(disp12,Rn) 0011nnnnmmmm0001 Rm → (disp × 2 + Rn)
0001dddddddddddd
MOV.L
Rm,@(disp12,Rn) 0011nnnnmmmm0001 Rm → (disp × 4 + Rn)
MOV.B
@(disp12,Rm),Rn 0011nnnnmmmm0001 (disp + Rm) →
0010dddddddddddd
0100dddddddddddd
MOV.W
sign extension → Rn
@(disp12,Rm),Rn 0011nnnnmmmm0001 (disp × 2 + Rm) →
0101dddddddddddd
Page 58 of 1278
sign extension → Rn
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Compatibility
Execution
Instruction
MOV.L
Instruction Code
Operation
@(disp12,Rm),Rn 0011nnnnmmmm0001 (disp × 4 + Rm) → Rn
SH2,
Cycles
T Bit SH2E SH4
SH-2A
1
⎯
Yes
0110dddddddddddd
MOVA
@(disp,PC),R0
11000111dddddddd disp × 4 + PC → R0
1
⎯
MOVI20
#imm20,Rn
0000nnnniiii0000 imm → sign extension → Rn
1
⎯
Yes
1
⎯
Yes
1 to 16
⎯
Yes
1 to 16
⎯
Yes
1 to 16
⎯
Yes
1 to 16
⎯
Yes
Yes
Yes
Yes
Yes
iiiiiiiiiiiiiiii
MOVI20S #imm20,Rn
0000nnnniiii0001 imm Rm (unsigned),
1
Com-
1→T
parison
Otherwise, 0 → T
result
When Rn > Rm (signed),
1
Com-
1→T
parison
Otherwise, 0 → T
result
When Rn > 0, 1 → T
1
Otherwise, 0 → T
Comparison
result
CMP/PZ
Rn
0100nnnn00010001
When Rn ≥ 0, 1 → T
1
Otherwise, 0 → T
Comparison
result
CMP/STR Rm,Rn
0010nnnnmmmm1100
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
When any bytes are equal,
1
Com-
1→T
parison
Otherwise, 0 → T
result
Page 61 of 1278
SH7670 Group
Section 2 CPU
Compatibility
Execution
SH2,
Instruction
Instruction Code
Operation
Cycles
T Bit
CLIPS.B
0100nnnn10010001
When Rn > (H'0000007F),
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
1
⎯
Yes
Rn
SH2E SH4
SH-2A
(H'0000007F) → Rn, 1 → CS
when Rn < (H'FFFFFF80),
(H'FFFFFF80) → Rn, 1 → CS
CLIPS.W
Rn
0100nnnn10010101
When Rn > (H'00007FFF),
(H'00007FFF) → Rn, 1 → CS
When Rn < (H'FFFF8000),
(H'FFFF8000) → Rn, 1 → CS
CLIPU.B
Rn
0100nnnn10000001
When Rn > (H'000000FF),
(H'000000FF) → Rn, 1 → CS
CLIPU.W Rn
0100nnnn10000101
When Rn > (H'0000FFFF),
(H'0000FFFF) → Rn, 1 → CS
DIV1
Rm,Rn
0011nnnnmmmm0100
1-step division (Rn ÷ Rm)
1
Calcu-
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
lation
result
DIV0S
Rm,Rn
0010nnnnmmmm0111
MSB of Rn → Q,
1
MSB of Rm → M, M ^ Q → T
Calculation
result
DIV0U
DIVS
0000000000011001
R0,Rn
0100nnnn10010100
0 → M/Q/T
1
0
Signed operation of Rn ÷ R0
36
⎯
Yes
Unsigned operation of Rn ÷ R0 34
⎯
Yes
→ Rn 32 ÷ 32 → 32 bits
DIVU
R0,Rn
0100nnnn10000100
→ Rn 32 ÷ 32 → 32 bits
DMULS.L Rm,Rn
0011nnnnmmmm1101
Signed operation of Rn × Rm
2
⎯
Yes
Yes
Yes
2
⎯
Yes
Yes
Yes
1
Compa- Yes
Yes
Yes
→ MACH, MACL
32 × 32 → 64 bits
DMULU.L Rm,Rn
0011nnnnmmmm0101
Unsigned operation of Rn ×
Rm → MACH, MACL
32 × 32 → 64 bits
DT
EXTS.B
Rn
Rm,Rn
0100nnnn00010000
0110nnnnmmmm1110
Rn – 1 → Rn
When Rn is 0, 1 → T
rison
When Rn is not 0, 0 → T
result
Byte in Rm is
1
⎯
Yes
Yes
Yes
1
⎯
Yes
Yes
Yes
sign-extended → Rn
EXTS.W
Rm,Rn
0110nnnnmmmm1111
Word in Rm is
sign-extended → Rn
Page 62 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Compatibility
Execution
SH2,
Instruction
Instruction Code
Operation
Cycles
T Bit
SH2E SH4 SH-2A
EXTU.B
0110nnnnmmmm1100
Byte in Rm is
1
⎯
Yes
Yes
Yes
1
⎯
Yes
Yes
Yes
4
⎯
Yes
Yes
Yes
3
⎯
Yes
Yes
Yes
2
⎯
Yes
Yes
Yes
Rm,Rn
zero-extended → Rn
EXTU.W
Rm,Rn
0110nnnnmmmm1101
Word in Rm is
zero-extended → Rn
MAC.L
@Rm+,@Rn+
0000nnnnmmmm1111
Signed operation of (Rn) ×
(Rm) + MAC → MAC
32 × 32 + 64 → 64 bits
MAC.W
@Rm+,@Rn+
0100nnnnmmmm1111
Signed operation of (Rn) ×
(Rm) + MAC → MAC
16 × 16 + 64 → 64 bits
MUL.L
Rm,Rn
0000nnnnmmmm0111
Rn × Rm → MACL
32 × 32 → 32 bits
MULR
R0,Rn
0100nnnn10000000
R0 × Rn → Rn
2
Yes
32 × 32 → 32 bits
MULS.W
Rm,Rn
0010nnnnmmmm1111
Signed operation of Rn × Rm
1
⎯
Yes
Yes
Yes
1
⎯
Yes
Yes
Yes
→ MACL
16 × 16 → 32 bits
MULU.W
Rm,Rn
0010nnnnmmmm1110
Unsigned operation of Rn ×
Rm → MACL
16 × 16 → 32 bits
NEG
Rm,Rn
0110nnnnmmmm1011
0-Rm → Rn
1
⎯
Yes
Yes
Yes
NEGC
Rm,Rn
0110nnnnmmmm1010
0-Rm-T → Rn, borrow → T
1
Borrow Yes
Yes
Yes
SUB
Rm,Rn
0011nnnnmmmm1000
Rn-Rm → Rn
1
⎯
Yes
Yes
Yes
SUBC
Rm,Rn
0011nnnnmmmm1010
Rn-Rm-T → Rn, borrow → T
1
Borrow Yes
Yes
Yes
SUBV
Rm,Rn
0011nnnnmmmm1011
Rn-Rm → Rn, underflow → T
1
Over-
Yes
Yes
Yes
flow
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 63 of 1278
SH7670 Group
Section 2 CPU
2.4.4
Logic Operation Instructions
Table 2.13 Logic Operation Instructions
Compatibility
Execution
SH2,
Instruction
Instruction Code
Operation
Cycles
T Bit SH2E SH4
SH-2A
AND
Rm,Rn
0010nnnnmmmm1001
Rn & Rm → Rn
1
⎯
Yes
Yes
Yes
AND
#imm,R0
11001001iiiiiiii
R0 & imm → R0
1
⎯
Yes
Yes
Yes
AND.B
#imm,@(R0,GBR)
11001101iiiiiiii
(R0 + GBR) & imm →
3
⎯
Yes
Yes
Yes
(R0 + GBR)
NOT
Rm,Rn
0110nnnnmmmm0111
~Rm → Rn
1
⎯
Yes
Yes
Yes
OR
Rm,Rn
0010nnnnmmmm1011
Rn | Rm → Rn
1
⎯
Yes
Yes
Yes
OR
#imm,R0
11001011iiiiiiii
R0 | imm → R0
1
⎯
Yes
Yes
Yes
OR.B
#imm,@(R0,GBR)
11001111iiiiiiii
(R0 + GBR) | imm →
3
⎯
Yes
Yes
Yes
3
Test
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
(R0 + GBR)
TAS.B
@Rn
0100nnnn00011011
When (Rn) is 0, 1 → T
Otherwise, 0 → T,
result
1 → MSB of(Rn)
TST
Rm,Rn
0010nnnnmmmm1000
Rn & Rm
1
When the result is 0, 1 → T
Test
result
Otherwise, 0 → T
TST
#imm,R0
11001000iiiiiiii
R0 & imm
1
When the result is 0, 1 → T
Test
result
Otherwise, 0 → T
TST.B
#imm,@(R0,GBR)
11001100iiiiiiii
(R0 + GBR) & imm
3
When the result is 0, 1 → T
Test
result
Otherwise, 0 → T
XOR
Rm,Rn
0010nnnnmmmm1010
Rn ^ Rm → Rn
1
⎯
Yes
Yes
Yes
XOR
#imm,R0
11001010iiiiiiii
R0 ^ imm → R0
1
⎯
Yes
Yes
Yes
XOR.B
#imm,@(R0,GBR)
11001110iiiiiiii
(R0 + GBR) ^ imm →
3
⎯
Yes
Yes
Yes
(R0 + GBR)
Page 64 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.4.5
Section 2 CPU
Shift Instructions
Table 2.14 Shift Instructions
Compatibility
Execution
SH2,
Instruction
Instruction Code
Operation
Cycles
T Bit SH2E SH4
SH-2A
ROTL
Rn
0100nnnn00000100
T ← Rn ← MSB
1
MSB
Yes
Yes
Yes
ROTR
Rn
0100nnnn00000101
LSB → Rn → T
1
LSB
Yes
Yes
Yes
ROTCL
Rn
0100nnnn00100100
T ← Rn ← T
1
MSB
Yes
Yes
Yes
ROTCR
Rn
0100nnnn00100101
T → Rn → T
1
LSB
Yes
Yes
Yes
SHAD
Rm,Rn
0100nnnnmmmm1100
When Rm ≥ 0, Rn > |Rm| →
[MSB → Rn]
SHAL
Rn
0100nnnn00100000
T ← Rn ← 0
1
MSB
Yes
Yes
Yes
SHAR
Rn
0100nnnn00100001
MSB → Rn → T
1
LSB
Yes
Yes
Yes
SHLD
Rm,Rn
0100nnnnmmmm1101
When Rm ≥ 0, Rn > |Rm| →
[0 → Rn]
SHLL
Rn
0100nnnn00000000
T ← Rn ← 0
1
MSB
Yes
Yes
Yes
SHLR
Rn
0100nnnn00000001
0 → Rn → T
1
LSB
Yes
Yes
Yes
SHLL2
Rn
0100nnnn00001000
Rn > 2 → Rn
1
⎯
Yes
Yes
Yes
SHLL8
Rn
0100nnnn00011000
Rn > 8 → Rn
1
⎯
Yes
Yes
Yes
SHLL16
Rn
0100nnnn00101000
Rn > 16 → Rn
1
⎯
Yes
Yes
Yes
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 65 of 1278
SH7670 Group
Section 2 CPU
2.4.6
Branch Instructions
Table 2.15 Branch Instructions
Compatibility
Execution
SH2,
Instruction
Instruction Code
Operation
Cycles
T Bit SH2E SH4
SH-2A
BF
10001011dddddddd
When T = 0, disp × 2 + PC →
3/1*
⎯
Yes
Yes
Yes
2/1*
⎯
Yes
Yes
Yes
3/1*
⎯
Yes
Yes
Yes
2/1*
⎯
Yes
Yes
Yes
2
⎯
Yes
Yes
Yes
2
⎯
Yes
Yes
Yes
2
⎯
Yes
Yes
Yes
2
⎯
Yes
Yes
Yes
label
PC,
When T = 1, nop
BF/S
label
10001111dddddddd
Delayed branch
When T = 0, disp × 2 + PC →
PC,
When T = 1, nop
BT
label
10001001dddddddd
When T = 1, disp × 2 + PC →
PC,
When T = 0, nop
BT/S
label
10001101dddddddd
Delayed branch
When T = 1, disp × 2 + PC →
PC,
When T = 0, nop
BRA
label
1010dddddddddddd
Delayed branch,
disp × 2 + PC → PC
BRAF
Rm
0000mmmm00100011
Delayed branch,
Rm + PC → PC
BSR
label
1011dddddddddddd
Delayed branch, PC → PR,
disp × 2 + PC → PC
BSRF
Rm
0000mmmm00000011
Delayed branch, PC → PR,
Rm + PC → PC
JMP
@Rm
0100mmmm00101011
Delayed branch, Rm → PC
2
⎯
Yes
Yes
Yes
JSR
@Rm
0100mmmm00001011
Delayed branch, PC → PR,
2
⎯
Yes
Yes
Yes
PC-2 → PR, Rm → PC
3
⎯
Yes
PC-2 → PR,
5
⎯
Yes
2
⎯
Rm → PC
0100mmmm01001011
JSR/N
@Rm
JSR/N
@@(disp8,TBR) 10000011dddddddd
(disp × 4 + TBR) → PC
RTS
RTS/N
RTV/N
Note:
Rm
*
0000000000001011
Delayed branch, PR → PC
0000000001101011
PR → PC
3
⎯
Yes
0000mmmm01111011
Rm → R0, PR → PC
3
⎯
Yes
Yes
Yes
Yes
One cycle when the program does not branch.
Page 66 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.4.7
Section 2 CPU
System Control Instructions
Table 2.16 System Control Instructions
Compatibility
Execution
Cycles
SH2,
Instruction
Instruction Code
Operation
CLRT
0000000000001000
0→T
1
0
Yes
Yes
Yes
CLRMAC
0000000000101000
0 → MACH,MACL
1
⎯
Yes
Yes
Yes
0100mmmm11100101
(Specified register bank entry) 6
⎯
LDBANK
@Rm,R0
T Bit SH2E SH4
SH-2A
Yes
→ R0
LDC
Rm,SR
0100mmmm00001110
Rm → SR
3
LSB
LDC
Rm,TBR
0100mmmm01001010
Rm → TBR
1
⎯
LDC
Rm,GBR
0100mmmm00011110
Rm → GBR
1
⎯
Yes
Yes
Yes
LDC
Rm,VBR
0100mmmm00101110
Rm → VBR
1
⎯
Yes
Yes
Yes
LDC.L
@Rm+,SR
0100mmmm00000111
(Rm) → SR, Rm + 4 → Rm
5
LSB
Yes
Yes
Yes
LDC.L
@Rm+,GBR
0100mmmm00010111
(Rm) → GBR, Rm + 4 → Rm
1
⎯
Yes
Yes
Yes
LDC.L
@Rm+,VBR
0100mmmm00100111
(Rm) → VBR, Rm + 4 → Rm
1
⎯
Yes
Yes
Yes
LDS
Rm,MACH
0100mmmm00001010
Rm → MACH
1
⎯
Yes
Yes
Yes
LDS
Rm,MACL
0100mmmm00011010
Rm → MACL
1
⎯
Yes
Yes
Yes
LDS
Rm,PR
0100mmmm00101010
Rm → PR
1
⎯
Yes
Yes
Yes
LDS.L
@Rm+,MACH
0100mmmm00000110
(Rm) → MACH, Rm + 4 → Rm 1
⎯
Yes
Yes
Yes
LDS.L
@Rm+,MACL
0100mmmm00010110
(Rm) → MACL, Rm + 4 → Rm 1
⎯
Yes
Yes
Yes
LDS.L
@Rm+,PR
0100mmmm00100110
(Rm) → PR, Rm + 4 → Rm
1
⎯
Yes
Yes
Yes
NOP
0000000000001001
No operation
1
⎯
Yes
Yes
Yes
RESBANK
0000000001011011
Bank → R0 to R14, GBR,
9*
⎯
6
⎯
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
MACH, MACL, PR
0000000000101011
RTE
Delayed branch,
stack area → PC/SR
SETT
0000000000011000
1→T
1
1
Yes
Yes
Yes
SLEEP
0000000000011011
Sleep
5
⎯
Yes
Yes
Yes
0100nnnn11100001
R0 →
7
⎯
STBANK
R0,@Rn
Yes
(specified register bank entry)
STC
SR,Rn
0000nnnn00000010
SR → Rn
2
⎯
STC
TBR,Rn
0000nnnn01001010
TBR → Rn
1
⎯
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Yes
Yes
Yes
Yes
Page 67 of 1278
SH7670 Group
Section 2 CPU
Compatibility
Execution
SH2,
Instruction
Instruction Code
Operation
Cycles
T Bit SH2E SH4
SH-2A
STC
GBR,Rn
0000nnnn00010010
GBR → Rn
1
⎯
Yes
Yes
Yes
STC
VBR,Rn
0000nnnn00100010
VBR → Rn
1
⎯
Yes
Yes
Yes
STC.L
SR,@-Rn
0100nnnn00000011
Rn-4 → Rn, SR → (Rn)
2
⎯
Yes
Yes
Yes
STC.L
GBR,@-Rn
0100nnnn00010011
Rn-4 → Rn, GBR → (Rn)
1
⎯
Yes
Yes
Yes
STC.L
VBR,@-Rn
0100nnnn00100011
Rn-4 → Rn, VBR → (Rn)
1
⎯
Yes
Yes
Yes
STS
MACH,Rn
0000nnnn00001010
MACH → Rn
1
⎯
Yes
Yes
Yes
STS
MACL,Rn
0000nnnn00011010
MACL → Rn
1
⎯
Yes
Yes
Yes
STS
PR,Rn
0000nnnn00101010
PR → Rn
1
⎯
Yes
Yes
Yes
STS.L
MACH,@-Rn
0100nnnn00000010
Rn-4 → Rn, MACH → (Rn)
1
⎯
Yes
Yes
Yes
STS.L
MACL,@-Rn
0100nnnn00010010
Rn-4 → Rn, MACL → (Rn)
1
⎯
Yes
Yes
Yes
STS.L
PR,@-Rn
0100nnnn00100010
Rn-4 → Rn, PR → (Rn)
1
⎯
Yes
Yes
Yes
TRAPA
#imm
11000011iiiiiiii
PC/SR → stack area,
5
⎯
Yes
Yes
Yes
(imm × 4 + VBR) → PC
Notes: 1. Instruction execution cycles: The execution cycles shown in the table are minimums. In
practice, the number of instruction execution states in cases such as the following:
a. When there is a conflict between an instruction fetch and a data access
b. When the destination register of a load instruction (memory → register) is the same
as the register used by the next instruction.
* In the event of bank overflow, the number of cycles is 19.
Page 68 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
2.4.8
Section 2 CPU
Floating-Point Operation Instructions
Table 2.17 Floating-Point Operation Instructions
Compatibility
Execu-
SH-2A/
tion
SH2A-
Instruction
Instruction Code
Operation
Cycles T Bit
SH2E
SH4
FPU
FABS
FRn
1111nnnn01011101
|FRn| → FRn
1
⎯
Yes
Yes
Yes
FABS
DRn
1111nnn001011101
|DRn| → DRn
1
⎯
Yes
Yes
FADD
FRm, FRn
1111nnnnmmmm0000
FRn + FRm → FRn
1
⎯
Yes
Yes
FADD
DRm, DRn
1111nnn0mmm00000
DRn + DRm → DRn
6
⎯
Yes
Yes
FCMP/EQ FRm, FRn
1111nnnnmmmm0100
(FRn = FRm)? 1:0 → T
1
Compa- Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
rison
result
FCMP/EQ DRm, DRn
1111nnn0mmm00100
(DRn = DRm)? 1:0 → T
2
Comparison
result
FCMP/GT FRm, FRn
1111nnnnmmmm0101
(FRn > FRm)? 1:0 → T
1
Compa
Yes
-rison
result
FCMP/GT DRm, DRn
1111nnn0mmm00101
(DRn > DRm)? 1:0 → T
2
Comparison
result
FCNVDS
DRm, FPUL
1111mmm010111101
(float) DRm → FPUL
2
⎯
Yes
Yes
FCNVSD
FPUL, DRn
1111nnn010101101
(double) FPUL → DRn
2
⎯
Yes
Yes
FDIV
FRm, FRn
1111nnnnmmmm0011
FRn/FRm → FRn
10
⎯
Yes
Yes
FDIV
DRm, DRn
1111nnn0mmm00011
DRn/DRm → DRn
23
⎯
Yes
Yes
FLDI0
FRn
1111nnnn10001101
0 × 00000000 → FRn
1
⎯
Yes
Yes
Yes
FLDI1
FRn
1111nnnn10011101
0 × 3F800000 → FRn
1
⎯
Yes
Yes
Yes
FLDS
FRm, FPUL
1111mmmm00011101
FRm → FPUL
1
⎯
Yes
Yes
Yes
FLOAT
FPUL,FRn
1111nnnn00101101
(float)FPUL → FRn
1
⎯
Yes
Yes
Yes
FLOAT
FPUL,DRn
1111nnn000101101
(double)FPUL → DRn
2
⎯
Yes
Yes
FMAC
FR0,FRm,FRn
1111nnnnmmmm1110
FR0 × FRm+FRn →
1
⎯
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
FRn
FMOV
FRm, FRn
1111nnnnmmmm1100
FRm → FRn
1
⎯
FMOV
DRm, DRn
1111nnn0mmm01100
DRm → DRn
2
⎯
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 69 of 1278
SH7670 Group
Section 2 CPU
Compatibility
Execu-
SH-2A/
tion
SH2A-
Instruction
Instruction Code
Operation
Cycles T Bit
SH2E
SH4
FPU
FMOV.S
@(R0, Rm), FRn
1111nnnnmmmm0110
(R0 + Rm) → FRn
1
⎯
Yes
Yes
Yes
FMOV.D
@(R0, Rm), DRn
1111nnn0mmmm0110
(R0 + Rm) → DRn
2
⎯
Yes
Yes
FMOV.S
@Rm+, FRn
1111nnnnmmmm1001
(Rm) → FRn, Rm+=4
1
⎯
FMOV.D
@Rm+, DRn
1111nnn0mmmm1001
(Rm) → DRn, Rm += 8
2
⎯
Yes
Yes
Yes
Yes
FMOV.S
@Rm, FRn
1111nnnnmmmm1000
(Rm) → FRn
1
⎯
Yes
Yes
FMOV.D
@Rm, DRn
1111nnn0mmmm1000
(Rm) → DRn
2
⎯
Yes
Yes
FMOV.S
@(disp12,Rm),FRn 0011nnnnmmmm0001
(disp × 4 + Rm) → FRn
1
⎯
Yes
(disp × 8 + Rm) → DRn
2
⎯
Yes
Yes
Yes
0111dddddddddddd
FMOV.D
@(disp12,Rm),DRn 0011nnn0mmmm0001
0111dddddddddddd
FMOV.S
FRm, @(R0,Rn)
1111nnnnmmmm0111
FRm → (R0 + Rn)
1
⎯
FMOV.D
DRm, @(R0,Rn)
1111nnnnmmm00111
DRm → (R0 + Rn)
2
⎯
FMOV.S
FRm, @-Rn
1111nnnnmmmm1011
Rn-=4, FRm → (Rn)
1
⎯
FMOV.D
DRm, @-Rn
1111nnnnmmm01011
Rn-=8, DRm → (Rn)
2
⎯
FMOV.S
FRm, @Rn
1111nnnnmmmm1010
FRm → (Rn)
1
⎯
FMOV.D
DRm, @Rn
1111nnnnmmm01010
DRm → (Rn)
2
⎯
FMOV.S
FRm,
0011nnnnmmmm0001
FRm → (disp × 4 + Rn)
1
⎯
Yes
DRm → (disp × 8 + Rn)
2
⎯
Yes
@(disp12,Rn)
0011dddddddddddd
FMOV.D
0011nnnnmmm00001
DRm,
@(disp12,Rn)
0011dddddddddddd
FMUL
FRm, FRn
1111nnnnmmmm0010
FRn × FRm → FRn
1
⎯
FMUL
DRm, DRn
1111nnn0mmm00010
DRn × DRm → DRn
6
⎯
FNEG
FRn
1111nnnn01001101
-FRn → FRn
1
⎯
FNEG
DRn
1111nnn001001101
-DRn → DRn
1
⎯
1111001111111101
FPSCR.SZ=~FPSCR.S
1
FSCHG
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
⎯
Yes
Yes
Yes
Z
FSQRT
FRn
1111nnnn01101101
√FRn → FRn
9
⎯
Yes
Yes
FSQRT
DRn
1111nnn001101101
√DRn → DRn
22
⎯
Yes
Yes
FSTS
FPUL,FRn
1111nnnn00001101
FPUL → FRn
1
⎯
Yes
Yes
Yes
FSUB
FRm, FRn
1111nnnnmmmm0001
FRn-FRm → FRn
1
⎯
Yes
Yes
Yes
Page 70 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Compatibility
Execu-
SH-2A/
tion
SH2A-
Instruction
Instruction Code
Operation
Cycles T Bit
FSUB
DRm, DRn
1111nnn0mmm00001
DRn-DRm → DRn
6
⎯
FTRC
FRm, FPUL
1111mmmm00111101
(long)FRm → FPUL
1
⎯
FTRC
DRm, FPUL
1111mmm000111101
(long)DRm → FPUL
2
⎯
2.4.9
FPU-Related CPU Instructions
SH2E
Yes
SH4
FPU
Yes
Yes
Yes
Yes
Yes
Yes
Table 2.18 FPU-Related CPU Instructions
Compatibility
Execu-
SH-2A/
tion
SH2A-
Instruction
Instruction Code
Operation
Cycles T Bit
SH2E
SH4
FPU
LDS
Rm,FPSCR
0100mmmm01101010
Rm → FPSCR
1
⎯
Yes
Yes
Yes
LDS
Rm,FPUL
0100mmmm01011010
Rm → FPUL
1
⎯
Yes
Yes
Yes
LDS.L
@Rm+, FPSCR
0100mmmm01100110
(Rm) → FPSCR, Rm+=4 1
⎯
Yes
Yes
Yes
LDS.L
@Rm+, FPUL
0100mmmm01010110
(Rm) → FPUL, Rm+=4
1
⎯
Yes
Yes
Yes
STS
FPSCR, Rn
0000nnnn01101010
FPSCR → Rn
1
⎯
Yes
Yes
Yes
STS
FPUL,Rn
0000nnnn01011010
FPUL → Rn
1
⎯
Yes
Yes
Yes
STS.L
FPSCR,@-Rn
0100nnnn01100010
Rn-=4, FPCSR → (Rn)
1
⎯
Yes
Yes
Yes
STS.L
FPUL,@-Rn
0100nnnn01010010
Rn-=4, FPUL → (Rn)
1
⎯
Yes
Yes
Yes
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 71 of 1278
SH7670 Group
Section 2 CPU
2.4.10
Bit Manipulation Instructions
Table 2.19 Bit Manipulation Instructions
Compatibility
Execution
Instruction
BAND.B
#imm3,@(disp12,Rn)
BANDNOT.B #imm3,@(disp12,Rn)
BCLR.B
#imm3,@(disp12,Rn)
SH2,
Instruction Code
Operation
Cycles T Bit SH2E SH4 SH-2A
0011nnnn0iii1001
(imm of (disp + Rn)) & T →
3
Ope-
0100dddddddddddd
ration
0011nnnn0iii1001 ~(imm of (disp + Rn)) & T → T 3
Ope-
1100dddddddddddd
ration
Yes
result
Yes
result
0011nnnn0iii1001 0 → (imm of (disp + Rn))
3
⎯
Yes
⎯
Yes
Ope-
Yes
0000dddddddddddd
BCLR
#imm3,Rn
10000110nnnn0iii 0 → imm of Rn
1
BLD.B
#imm3,@(disp12,Rn)
0011nnnn0iii1001 (imm of (disp + Rn)) →
3
ration
0011dddddddddddd
BLD
#imm3,Rn
result
10000111nnnn1iii imm of Rn → T
1
Ope-
Yes
ration
result
BLDNOT.B
#imm3,@(disp12,Rn)
0011nnnn0iii1001 ~(imm of (disp + Rn))
1011dddddddddddd
BOR.B
#imm3,@(disp12,Rn)
3
→T
0011nnnn0iii1001 ( imm of (disp + Rn)) | T → T
BSET.B
#imm3,@(disp12,Rn)
#imm3,@(disp12,Rn)
result
3
Ope-
Yes
ration
result
0011nnnn0iii1001 ~( imm of (disp + Rn)) | T → T 3
Ope-
1101dddddddddddd
ration
0011nnnn0iii1001 1 → ( imm of (disp + Rn))
Yes
ration
0101dddddddddddd
BORNOT.B
Ope-
Yes
result
3
⎯
Yes
0001dddddddddddd
BSET
#imm3,Rn
10000110nnnn1iii 1 → imm of Rn
1
⎯
Yes
BST.B
#imm3,@(disp12,Rn)
0011nnnn0iii1001 T → (imm of (disp + Rn))
3
⎯
Yes
1
⎯
Yes
0010dddddddddddd
BST
#imm3,Rn
Page 72 of 1278
10000111nnnn0iii T → imm of Rn
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 2 CPU
Compatibility
Execution
Instruction
BXOR.B
Instruction Code
#imm3,@(disp12,Rn)
0011nnnn0iii1001 (imm of (disp + Rn)) ^ T → T
0110dddddddddddd
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Operation
SH2,
Cycles T Bit SH2E SH4 SH-2A
3
Ope-
Yes
ration
result
Page 73 of 1278
SH7670 Group
Section 2 CPU
2.5
Processing States
The CPU has five processing states: reset, exception handling, bus-released, program execution,
and power-down. Figure 2.6 shows the transitions between the states.
Power-on reset from any state
Manual reset from any state
Power-on reset state
Manual reset state
Reset state
Reset canceled
Interrupt source or
DMA address error occurs
Exception
handling state
Bus request
cleared
Exception
handling
Bus request source
generated
occurs
Bus-released state
Bus request
generated
Bus request
generated
Bus request
cleared
Sleep mode
NMI interrupt or
IRQ interrupt occurs
Exception
handling
ends
Bus request
cleared
Program execution state
STBY bit cleared
for SLEEP
instruction
STBY and DEEP bits set
for SLEEP
instruction
Software standby mode
Power-down state
Figure 2.6 Transitions between Processing States
Page 74 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(1)
Section 2 CPU
Reset State
In the reset state, the CPU is reset. There are two kinds of reset, power-on reset and manual reset.
(2)
Exception Handling State
The exception handling state is a transient state that occurs when exception handling sources such
as resets or interrupts alter the CPU’s processing state flow.
For a reset, the initial values of the program counter (PC) (execution start address) and stack
pointer (SP) are fetched from the exception handling vector table and stored; the CPU then
branches to the execution start address and execution of the program begins.
For an interrupt, the stack pointer (SP) is accessed and the program counter (PC) and status
register (SR) are saved to the stack area. The exception service routine start address is fetched
from the exception handling vector table; the CPU then branches to that address and the program
starts executing, thereby entering the program execution state.
(3)
Program Execution State
In the program execution state, the CPU sequentially executes the program.
(4)
Power-Down State
In the power-down state, the CPU stops operating to reduce power consumption. The SLEEP
instruction places the CPU in sleep mode or software standby mode.
(5)
Bus-Released State
In the bus-released state, the CPU releases bus to a device that has requested it.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 75 of 1278
Section 2 CPU
Page 76 of 1278
SH7670 Group
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 3 Floating-Point Unit (FPU)
Section 3 Floating-Point Unit (FPU)
3.1
Features
The FPU has the following features.
• Conforms to IEEE754 standard
• 16 single-precision floating-point registers (can also be referenced as eight double-precision
registers)
• Two rounding modes: Round to nearest and round to zero
• Denormalization modes: Flush to zero
• Five exception sources: Invalid operation, divide by zero, overflow, underflow, and inexact
• Comprehensive instructions: Single-precision, double-precision, and system control
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 77 of 1278
SH7670 Group
Section 3 Floating-Point Unit (FPU)
3.2
Data Formats
3.2.1
Floating-Point Format
A floating-point number consists of the following three fields:
• Sign (s)
• Exponent (e)
• Fraction (f)
This LSI can handle single-precision and double-precision floating-point numbers, using the
formats shown in figures 3.1 and 3.2.
31
30
s
23
0
22
f
e
Figure 3.1 Format of Single-Precision Floating-Point Number
63
62
s
52
0
51
e
f
Figure 3.2 Format of Double-Precision Floating-Point Number
The exponent is expressed in biased form, as follows:
e = E + bias
The range of unbiased exponent E is Emin – 1 to Emax + 1. The two values Emin – 1 and Emax + 1 are
distinguished as follows. Emin – 1 indicates zero (both positive and negative sign) and a
denormalized number, and Emax + 1 indicates positive or negative infinity or a non-number (NaN).
Table 3.1 shows Emin and Emax values.
Page 78 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Table 3.1
Section 3 Floating-Point Unit (FPU)
Floating-Point Number Formats and Parameters
Parameter
Single-Precision
Double-Precision
Total bit width
32 bits
64 bits
Sign bit
1 bit
1 bit
Exponent field
8 bits
11 bits
Fraction field
23 bits
52 bits
Precision
24 bits
53 bits
Bias
+127
+1023
Emax
+127
+1023
Emin
–126
–1022
Floating-point number value v is determined as follows:
If E = Emax + 1 and f ≠ 0, v is a non-number (NaN) irrespective of sign s
If E = Emax + 1 and f = 0, v = (–1)s (infinity) [positive or negative infinity]
If Emin ≤ E ≤ Emax , v = (–1)s2E (1.f) [normalized number]
If E = Emin – 1 and f ≠ 0, v = (–1)s2Emin (0.f) [denormalized number]
If E = Emin – 1 and f = 0, v = (–1)s0 [positive or negative zero]
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 79 of 1278
SH7670 Group
Section 3 Floating-Point Unit (FPU)
Table 3.2 shows the ranges of the various numbers in hexadecimal notation.
Table 3.2
Floating-Point Ranges
Type
Single-Precision
Double-Precision
Signaling non-number
H'7FFF FFFF to H'7FC0 0000
H'7FFF FFFF FFFF FFFF to
H'7FF8 0000 0000 0000
Quiet non-number
H'7FBF FFFF to H'7F80 0001
H'7FF7 FFFF FFFF FFFF to
H'7FF0 0000 0000 0001
Positive infinity
H'7F80 0000
H'7FF0 0000 0000 0000
Positive normalized
number
H'7F7F FFFF to H'0080 0000
H'7FEF FFFF FFFF FFFF to
H'0010 0000 0000 0000
Positive denormalized
number
H'007F FFFF to H'0000 0001
H'000F FFFF FFFF FFFF to
H'0000 0000 0000 0001
Positive zero
H'0000 0000
H'0000 0000 0000 0000
Negative zero
H'8000 0000
H'8000 0000 0000 0000
Negative denormalized
number
H'8000 0001 to H'807F FFFF
H'8000 0000 0000 0001 to
H'800F FFFF FFFF FFFF
Negative normalized
number
H'8080 0000 to H'FF7F FFFF
H'8010 0000 0000 0000 to
H'FFEF FFFF FFFF FFFF
Negative infinity
H'FF80 0000
H'FFF0 0000 0000 0000
Quiet non-number
H'FF80 0001 to H'FFBF FFFF
H'FFF0 0000 0000 0001 to
H'FFF7 FFFF FFFF FFFF
Signaling non-number
H'FFC0 0000 to H'FFFF FFFF
H'FFF8 0000 0000 0000 to
H'FFFF FFFF FFFF FFFF
Page 80 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
3.2.2
Section 3 Floating-Point Unit (FPU)
Non-Numbers (NaN)
Figure 3.3 shows the bit pattern of a non-number (NaN). A value is NaN in the following case:
• Sign bit: Don't care
• Exponent field: All bits are 1
• Fraction field: At least one bit is 1
The NaN is a signaling NaN (sNaN) if the MSB of the fraction field is 1, and a quiet NaN (qNaN)
if the MSB is 0.
31
30
x
23
11111111
22
0
Nxxxxxxxxxxxxxxxxxxxxxx
N = 1: sNaN
N = 0: qNaN
Figure 3.3 Single-Precision NaN Bit Pattern
An sNaN is input in an operation, except copy, FABS, and FNEG, that generates a floating-point
value.
• When the EN.V bit in FPSCR is 0, the operation result (output) is a qNaN.
• When the EN.V bit in FPSCR is 1, an invalid operation exception will be generated. In this
case, the contents of the operation destination register are unchanged.
If a qNaN is input in an operation that generates a floating-point value, and an sNaN has not been
input in that operation, the output will always be a qNaN irrespective of the setting of the EN.V bit
in FPSCR. An exception will not be generated in this case.
The qNAN values as operation results are as follows:
• Single-precision qNaN: H'7FBF FFFF
• Double-precision qNaN: H'7FF7 FFFF FFFF FFFF
See the individual instruction descriptions for details of floating-point operations when a nonnumber (NaN) is input.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 81 of 1278
Section 3 Floating-Point Unit (FPU)
3.2.3
SH7670 Group
Denormalized Numbers
For a denormalized number floating-point value, the exponent field is expressed as 0, and the
fraction field as a non-zero value.
In the SH2A-FPU, the DN bit in the status register FPSCR is always set to 1, therefore a
denormalized number (source operand or operation result) is always flushed to 0 in a floatingpoint operation that generates a value (an operation other than copy, FNEG, or FABS).
When the DN bit in FPSCR is 0, a denormalized number (source operand or operation result) is
processed as it is. See the individual instruction descriptions for details of floating-point
operations when a denormalized number is input.
Page 82 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 3 Floating-Point Unit (FPU)
3.3
Register Descriptions
3.3.1
Floating-Point Registers
Figure 3.4 shows the floating-point register configuration. There are sixteen 32-bit floating-point
registers FPR0 to FPR15, referenced by specifying FR0 to FR15, DR0/2/4/6/8/10/12/14. The
correspondence between FRPn and the reference name is determined by the PR and SZ bits in
FPSCR. Refer figure 3.4.
1. Floating-point registers, FPRi (16 registers)
FPR0 to FPR15
2. Single-precision floating-point registers, FRi (16 registers)
FR0 to FR15 indicate FPR0 to FPR15
3. Double-precision floating-point registers or single-precision floating-point vector registers in
pairs, DRi (8 registers)
A DR register comprises two FR registers.
DR0 = {FR0, FR1}, DR2 = {FR2, FR3}, DR4 = {FR4, FR5}, DR6 = {FR6, FR7},
DR8 = {FR8, FR9}, DR10 = {FR10, FR11}, DR12 = {FR12, FR13}, DR14 = {FR14, FR15}
Reference name
Register name
Transfer instruction case:
FPSCR.SZ = 0 FPSCR.SZ = 1
Operation instruction case: FPSCR.PR = 0 FPSCR.PR = 1
FR0
DR0
FR1
FR2
DR2
FR3
FR4
DR4
FR5
FR6
DR6
FR7
FR8
DR8
FR9
FR10
DR10
FR11
FR12
DR12
FR13
FR14
DR14
FR15
FPR0
FPR1
FPR2
FPR3
FPR4
FPR5
FPR6
FPR7
FPR8
FPR9
FPR10
FPR11
FPR12
FPR13
FPR14
FPR15
Figure 3.4 Floating-Point Registers
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 83 of 1278
SH7670 Group
Section 3 Floating-Point Unit (FPU)
3.3.2
Floating-Point Status/Control Register (FPSCR)
FPSCR is a 32-bit register that controls floating-point instructions, sets FPU exceptions, and
selects the rounding mode.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
-
-
-
-
-
-
-
-
-
QIS
-
SZ
PR
DN
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R/W
0
R/W
1
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
Cause
Initial value:
0
R/W: R/W
0
R/W
Enable
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Flag
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
31 to 23
—
All 0
R
Reserved
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
17
16
Cause
0
R/W
0
R/W
1
0
RM1
RM0
0
R/W
1
R/W
These bits are always read as 0. The write value should
always be 0.
22
QIS
0
R/W
Nonnunerical Processing Mode
0: Processes qNaN or ±∞ as such
1: Treats qNaN or ±∞ as the same as sNaN (valid only
when FPSCR.Enable.V = 1)
21
—
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
20
SZ
0
R/W
Transfer Size Mode
0: Data size of FMOV instruction is 32-bits
1: Data size of FMOV instruction is a 32-bit register pair
(64 bits)
19
PR
0
R/W
Precision Mode
0: Floating-point instructions are executed as singleprecision operations
1: Floating-point instructions are executed as doubleprecision operations (graphics support instructions
are undefined)
18
DN
1
R
Denormalization Mode (Always fixed to 1 in SH2AFPU)
1: Denormalized number is treated as zero
Page 84 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 3 Floating-Point Unit (FPU)
Bit
Bit Name
Initial
Value
R/W
Description
17 to 12
Cause
All 0
R/W
FPU Exception Cause Field
11 to 7
Enable
All 0
R/W
FPU Exception Enable Field
6 to 2
Flag
All 0
R/W
FPU Exception Flag Field
When an FPU exception occurs, the bits corresponding
to the FPU exception cause field and FPU exception
flag field are set to 1. Each time an FPU operation
instruction is executed, the FPU exception cause field
is cleared to 0. The FPU exception flag field remains
set to 1 until it is cleared to 0 by software.
For bit allocations of each field, see table 3.3.
1
RM1
0
R/W
0
RM0
1
R/W
Rounding Mode
These bits select the rounding mode.
00: Round to Nearest
01: Round to Zero
10: Reserved
11: Reserved
Table 3.3
Bit Allocation for FPU Exception Handling
Field Name
FPU
Error (E)
Invalid
Division
Operation (V) by Zero (Z)
Overflow Underflow Inexact
(O)
(U)
(I)
Cause
FPU exception
cause field
Bit 17
Bit 16
Bit 15
Bit 14
Bit 13
Bit 12
Enable
FPU exception
enable field
None
Bit 11
Bit 10
Bit 9
Bit 8
Bit 7
Flag
FPU exception flag None
field
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Note: No FPU error occurs in the SH2A-FPU.
3.3.3
Floating-Point Communication Register (FPUL)
Information is transferred between the FPU and CPU via FPUL. FPUL is a 32-bit system register
that is accessed from the CPU side by means of LDS and STS instructions. For example, to
convert the integer stored in general register R1 to a single-precision floating-point number, the
processing flow is as follows:
R1 → (LDS instruction) → FPUL → (single-precision FLOAT instruction) → FR1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 85 of 1278
Section 3 Floating-Point Unit (FPU)
3.4
SH7670 Group
Rounding
In a floating-point instruction, rounding is performed when generating the final operation result
from the intermediate result. Therefore, the result of combination instructions such as FMAC will
differ from the result when using a basic instruction such as FADD, FSUB, or FMUL. Rounding is
performed once in FMAC, but twice in FADD, FSUB, and FMUL.
Which of the two rounding methods is to be used is determined by the RM bits in FPSCR.
FPSCR.RM[1:0] = 00: Round to Nearest
FPSCR.RM[1:0] = 01: Round to Zero
(1)
Round to Nearest
The operation result is rounded to the nearest expressible value. If there are two nearest
expressible values, the one with an LSB of 0 is selected.
If the unrounded value is 2Emax (2 – 2–P) or more, the result will be infinity with the same sign as the
unrounded value. The values of Emax and P, respectively, are 127 and 24 for single-precision, and
1023 and 53 for double-precision.
(2)
Round to Zero
The digits below the round bit of the unrounded value are discarded.
If the unrounded value is larger than the maximum expressible absolute value, the value will
become the maximum expressible absolute value.
Page 86 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
3.5
Floating-Point Exceptions
3.5.1
FPU Exception Sources
Section 3 Floating-Point Unit (FPU)
The exception sources are as follows:
• FPU error (E): When FPSCR.DN = 0 and a denormalized number is input (No error occurs in
the SH2A-FPU)
• Invalid operation (V): In case of an invalid operation, such as NaN input
• Division by zero (Z): Division with a zero divisor
• Overflow (O): When the operation result overflows
• Underflow (U): When the operation result underflows
• Inexact exception (I): When overflow, underflow, or rounding occurs
The FPU exception cause field in FPSCR contains bits corresponding to all of above sources E, V,
Z, O, U, and I, and the FPU exception flag and enable fields in FPSCR contain bits corresponding
to sources V, Z, O, U, and I, but not E. Thus, FPU errors cannot be disabled.
When an FPU exception occurs, the corresponding bit in the FPU exception cause field is set to 1,
and 1 is added to the corresponding bit in the FPU exception flag field. When an FPU exception
does not occur, the corresponding bit in the FPU exception cause field is cleared to 0, but the
corresponding bit in the FPU exception flag field remains unchanged.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 87 of 1278
Section 3 Floating-Point Unit (FPU)
3.5.2
SH7670 Group
FPU Exception Handling
FPU exception handling is initiated in the following cases:
• FPU error (E): FPSCR.DN = 0 and a denormalized number is input (No error occurs in the
SH2A-FPU)
• Invalid operation (V): FPSCR.Enable.V = 1 and invalid operation
• Division by zero (Z): FPSCR.Enable.Z = 1 and division with a zero divisor
• Overflow (O): FPSCR.Enable.O = 1 and instruction with possibility of operation result
overflow
• Underflow (U): FPSCR.Enable.U = 1 and instruction with possibility of operation result
underflow
• Inexact exception (I): FPSCR.Enable.I = 1 and instruction with possibility of inexact operation
result
These possibilities are shown in the individual instruction descriptions. All exception events that
originate in the FPU are assigned as the same exception event. The meaning of an exception is
determined by software by reading from FPSCR and interpreting the information it contains. If no
bits are set in the FPU exception cause field of FPSCR when one or more of bits O, U, I, and V are
set in the FPU exception enable field, this indicates that an actual exception source is not
generated. Also, the destination register is not changed by any FPU exception handling operation.
Except for the above, the FPU disables exception handling. In every processing, the bit
corresponding to source V, Z, O, U, or I is set to 1, and a default value is generated as the
operation result.
• Invalid operation (V): qNaN is generated as the result.
• Division by zero (Z): Infinity with the same sign as the unrounded value is generated.
• Overflow (O):
When rounding mode = RZ, the maximum normalized number, with the same sign as the
unrounded value, is generated.
When rounding mode = RN, infinity with the same sign as the unrounded value is generated.
• Underflow (U):
Zero with the same sign as the unrounded value is generated.
• Inexact exception (I): An inexact result is generated.
Page 88 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 4 Cache
Section 4 Cache
4.1
Features
• Capacity
Instruction cache: 8 Kbytes
Operand cache: 8 Kbytes
• Structure: Instructions/data separated, 4-way set associative
• Cache lock function (only for operand cache): Way 2 and way 3 are lockable
• Line size: 16 bytes
• Number of entries: 128 entries/way
• Write system: Write-back/write-through selectable
• Replacement method: Least-recently-used (LRU) algorithm
4.1.1
Cache Structure
The cache separates data and instructions and uses a 4-way set associative system. It is composed
of four ways (banks), each of which is divided into an address section and a data section.
Each of the address and data sections is divided into 128 entries. The data section of the entry is
called a line. Each line consists of 16 bytes (4 bytes × 4). The data capacity per way is 2 Kbytes
(16 bytes × 128 entries), with a total of 8 Kbytes in the cache as a whole (4 ways). Figure 4.1
shows the operand cache structure. The instruction cache structure is the same as the operand
cache structure except for not having the U bit.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 89 of 1278
SH7670 Group
Section 4 Cache
Address array (ways 0 to 3)
Entry 0
V
U Tag address
Entry 1
.
.
.
.
.
.
Entry 127
23 (1 + 1 + 21) bits
LRU
Data array (ways 0 to 3)
0
LW0
LW1
LW2
LW3
0
1
1
.
.
.
.
.
.
.
.
.
.
.
.
127
127
128 (32 × 4) bits
6 bits
LW0 to LW3: Longword data 0 to 3
Figure 4.1 Operand Cache Structure
(1)
Address Array
The V bit indicates whether the entry data is valid. When the V bit is 1, data is valid; when 0, data
is not valid.
The U bit (only for operand cache) indicates whether the entry has been written to in write-back
mode. When the U bit is 1, the entry has been written to; when 0, it has not.
The tag address holds the physical address used in the external memory access. It consists of 21
bits (address bits 31 to 11) used for comparison during cache searches. In this LSI, the addresses
of the cache-enabled space are H'00000000 to H'1FFFFFFF (see section 7, Bus State Controller
(BSC)), and therefore the upper three bits of the tag address are cleared to 0.
The V and U bits are initialized to 0 by a power-on reset but not initialized by a manual reset or in
software standby mode. The tag address is not initialized by a power-on reset or manual reset or in
software standby mode.
(2)
Data Array
Holds a 16-byte instruction or data. Entries are registered in the cache in line units (16 bytes).
The data array is not initialized by a power-on reset or manual reset or in software standby mode.
Page 90 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(3)
Section 4 Cache
LRU
With the 4-way set associative system, up to four instructions or data with the same entry address
can be registered in the cache. When an entry is registered, LRU shows which of the four ways it
is recorded in. There are six LRU bits, controlled by hardware. A least-recently-used (LRU)
algorithm is used to select the way that has been least recently accessed.
Six LRU bits indicate the way to be replaced in case of a cache miss. The relationship between
LRU and way replacement is shown in table 4.1 when the cache lock function (only for operand
cache) is not used (concerning the case where the cache lock function is used, see section 4.2.2,
Cache Control Register 2 (CCR2)). If a bit pattern other than those listed in table 4.1 is set in the
LRU bits by software, the cache will not function correctly. When modifying the LRU bits by
software, set one of the patterns listed in table 4.1.
The LRU bits are initialized to B'000000 by a power-on reset but not initialized by a manual reset
or in software standby mode.
Table 4.1
LRU and Way Replacement (Cache Lock Function Not Used)
LRU (Bits 5 to 0)
Way to be Replaced
000000, 000100, 010100, 100000, 110000, 110100
3
000001, 000011, 001011, 100001, 101001, 101011
2
000110, 000111, 001111, 010110, 011110, 011111
1
111000, 111001, 111011, 111100, 111110, 111111
0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 91 of 1278
SH7670 Group
Section 4 Cache
4.2
Register Descriptions
The cache has the following registers.
Table 4.2
Register Configuration
Register Name
Abbreviation
R/W
Initial Value
Address
Access Size
Cache control register 1
CCR1
R/W
H'00000000
H'FFFC1000
32
Cache control register 2
CCR2
R/W
H'00000000
H'FFFC1004
32
4.2.1
Cache Control Register 1 (CCR1)
The instruction cache is enabled or disabled using the ICE bit. The ICF bit controls disabling of all
instruction cache entries. The operand cache is enabled or disabled using the OCE bit. The OCF
bit controls disabling of all operand cache entries. The WT bit selects either write-through mode or
write-back mode for operand cache.
Programs that change the contents of CCR1 should be placed in a cache-disabled space, and a
cache-enabled space should be accessed after reading the contents of CCR1.
CCR1 is initialized to H'00000000 by a power-on reset but not initialized by a manual reset or in
software standby mode.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
ICF
-
-
ICE
-
-
-
-
OCF
-
WT
OCE
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R/W
0
R/W
Initial value:
R/W:
Page 92 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 4 Cache
Bit
Bit Name
Initial
Value
R/W
Description
31 to 12
⎯
All 0
R
11
ICF
0
R/W
10, 9
⎯
All 0
R
8
ICE
0
R/W
Reserved
These bits are always read as 0. The write value should
always be 0.
Instruction Cache Flush
Writing 1 flushes all instruction cache entries (clears the
V and LRU bits of all instruction cache entries to 0).
Always reads 0. Write-back to external memory is not
performed when the instruction cache is flushed.
Reserved
These bits are always read as 0. The write value should
always be 0.
Instruction Cache Enable
Indicates whether the instruction cache function is
enabled/disabled.
0: Instruction cache disable
1: Instruction cache enable
7 to 4
⎯
All 0
R
3
OCF
0
R/W
2
⎯
0
R
1
WT
0
R/W
Reserved
These bits are always read as 0. The write value should
always be 0.
Operand Cache Flush
Writing 1 flushes all operand cache entries (clears the
V, U, and LRU bits of all operand cache entries to 0).
Always reads 0. Write-back to external memory is not
performed when the operand cache is flushed.
Reserved
This bit is always read as 0. The write value should
always be 0.
Write Through
Selects write-back mode or write-through mode.
0: Write-back mode
1: Write-through mode
0
OCE
0
R/W
Operand Cache Enable
Indicates whether the operand cache function is
enabled/disabled.
0: Operand cache disable
1: Operand cache enable
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 93 of 1278
SH7670 Group
Section 4 Cache
4.2.2
Cache Control Register 2 (CCR2)
CCR2 is used to enable or disable the cache locking function for operand cache and is valid in
cache locking mode only. In cache locking mode, the lock enable bit (the LE bit) in CCR2 is set to
1. In non-cache-locking mode, the cache locking function is invalid.
When a cache miss occurs in cache locking mode by executing the prefetch instruction (PREF
@Rn), the line of data pointed to by Rn is loaded into the cache according to bits 9 and 8 (the
W3LOAD and W3LOCK bits) and bits 1 and 0 (the W2LOAD and W2LOCK bits) in CCR2. The
relationship between the setting of each bit and a way, to be replaced when the prefetch instruction
is executed, are listed in table 4.3. On the other hand, when the prefetch instruction is executed
and a cache hit occurs, new data is not fetched and the entry which is already enabled is held. For
example, when the prefetch instruction is executed with W3LOAD = 1 and W3LOCK = 1
specified in cache locking mode while one-line data already exists in way 0 which is specified by
Rn, a cache hit occurs and data is not fetched to way 3.
In the cache access other than the prefetch instruction in cache locking mode, ways to be replaced
by bits W3LOCK and W2LOCK are restricted. The relationship between the setting of each bit in
CCR2 and ways to be replaced are listed in table 4.4.
Programs that change the contents of CCR2 should be placed in a cache-disabled space, and a
cache-enabled space should be accessed after reading the contents of CCR2.
CCR2 is initialized to H'00000000 by a power-on reset but not initialized by a manual reset or in
software standby mode.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
LE
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Initial value:
R/W:
W3
W3
LOAD* LOCK
0
R/W
0
R/W
W2
W2
LOAD* LOCK
0
R/W
0
R/W
Note: * The W3LOAD and W2LOAD bits should not be set to 1 at the same time.
Page 94 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 4 Cache
Bit
Bit Name
Initial
Value
R/W
Description
31 to 17
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
16
LE
0
R/W
Lock Enable
Controls the cache locking function.
0: Not cache locking mode
1: Cache locking mode
15 to 10
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
9
W3LOAD*
0
R/W
Way 3 Load
8
W3LOCK
0
R/W
Way 3 Lock
When a cache miss occurs by the prefetch instruction
while W3LOAD = 1 and W3LOCK = 1 in cache locking
mode, the data is always loaded into way 3. Under any
other condition, the cache miss data is loaded into the
way to which LRU points.
⎯
7 to 2
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
1
W2LOAD*
0
R/W
Way 2 Load
0
W2LOCK
0
R/W
Way 2 Lock
When a cache miss occurs by the prefetch instruction
while W2LOAD = 1 and W2LOCK =1 in cache locking
mode, the data is always loaded into way 2. Under any
other condition, the cache miss data is loaded into the
way to which LRU points.
Note:
*
The W3LOAD and W2LOAD bits should not be set to 1 at the same time.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 95 of 1278
SH7670 Group
Section 4 Cache
Table 4.3
Way to be Replaced when a Cache Miss Occurs in PREF Instruction
LE
W3LOAD*
W3LOCK
W2LOAD*
W2LOCK
Way to be Replaced
0
x
x
x
x
Decided by LRU (table 4.1)
1
x
0
x
0
Decided by LRU (table 4.1)
1
x
0
0
1
Decided by LRU (table 4.5)
1
0
1
x
0
Decided by LRU (table 4.6)
1
0
1
0
1
Decided by LRU (table 4.7)
1
0
x
1
1
Way 2
1
1
1
0
x
Way 3
[Legend]
x:
Don't care
Note: * The W3LOAD and W2LOAD bits should not be set to 1 at the same time.
Table 4.4
Way to be Replaced when a Cache Miss Occurs in Other than PREF Instruction
LE
W3LOAD*
W3LOCK
W2LOAD*
W2LOCK
Way to be Replaced
0
x
x
x
x
Decided by LRU (table 4.1)
1
x
0
x
0
Decided by LRU (table 4.1)
1
x
0
x
1
Decided by LRU (table 4.5)
1
x
1
x
0
Decided by LRU (table 4.6)
1
x
1
x
1
Decided by LRU (table 4.7)
[Legend]
x:
Don't care
Note: * The W3LOAD and W2LOAD bits should not be set to 1 at the same time.
Table 4.5
LRU and Way Replacement (when W2LOCK=1 and W3LOCK=0)
LRU (Bits 5 to 0)
Way to be Replaced
000000, 000001, 000100, 010100, 100000, 100001, 110000, 110100
3
000011, 000110, 000111, 001011, 001111, 010110, 011110, 011111
1
101001, 101011, 111000, 111001, 111011, 111100, 111110, 111111
0
Page 96 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Table 4.6
Section 4 Cache
LRU and Way Replacement (when W2LOCK=0 and W3LOCK=1)
LRU (Bits 5 to 0)
Way to be Replaced
000000, 000001, 000011, 001011, 100000, 100001, 101001, 101011
2
000100, 000110, 000111, 001111, 010100, 010110, 011110, 011111
1
110000, 110100, 111000, 111001, 111011, 111100, 111110, 111111
0
Table 4.7
LRU and Way Replacement (when W2LOCK=1 and W3LOCK=1)
LRU (Bits 5 to 0)
Way to be Replaced
000000, 000001, 000011, 000100, 000110, 000111, 001011, 001111,
010100, 010110, 011110, 011111
1
100000, 100001, 101001, 101011, 110000, 110100, 111000, 111001,
111011, 111100, 111110, 111111
0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 97 of 1278
Section 4 Cache
4.3
SH7670 Group
Operation
Operations for the operand cache are described here. Operations for the instruction cache are
similar to those for the operand cache except for the address array not having the U bit, and there
being no prefetch operation or write operation, or a write-back buffer.
4.3.1
Searching Cache
If the operand cache is enabled (OCE bit in CCR1 is 1), whenever data in a cache-enabled area is
accessed, the cache will be searched to see if the desired data is in the cache. Figure 4.2 illustrates
the method by which the cache is searched.
Entries are selected using bits 10 to 4 of the address used to access memory and the tag address of
that entry is read. At this time, the upper three bits of the tag address are always cleared to 0. Bits
31 to 11 of the address used to access memory are compared with the read tag address. The
address comparison uses all four ways. When the comparison shows a match and the selected
entry is valid (V = 1), a cache hit occurs. When the comparison does not show a match or the
selected entry is not valid (V = 0), a cache miss occurs. Figure 4.2 shows a hit on way 1.
Page 98 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 4 Cache
Access address
31
11 10
4 3 21 0
Entry selection
Longword (LW) selection
Data array
(ways 0 to 3)
Address array
(ways 0 to 3)
Entry 0
V
Entry 0
U Tag address
LW0
LW1
LW2
LW3
Entry 1
Entry 1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Entry 127
Entry 127
CMP0 CMP1 CMP2 CMP3
Hit signal (way 1)
[Legend]
CMP0 to CMP3: Comparison circuits 0 to 3
Figure 4.2 Cache Search Scheme
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 99 of 1278
Section 4 Cache
4.3.2
(1)
SH7670 Group
Read Access
Read Hit
In a read access, data is transferred from the cache to the CPU. LRU is updated so that the hit way
is the latest.
(2)
Read Miss
An external bus cycle starts and the entry is updated. The way replaced follows table 4.4. Entries
are updated in 16-byte units. When the desired data that caused the miss is loaded from external
memory to the cache, the data is transferred to the CPU in parallel with being loaded to the cache.
When it is loaded in the cache, the V bit is set to 1, and LRU is updated so that the replaced way
becomes the latest. In operand cache, the U bit is additionally cleared to 0. When the U bit of the
entry to be replaced by updating the entry in write-back mode is 1, the cache update cycle starts
after the entry is transferred to the write-back buffer. After the cache completes its update cycle,
the write-back buffer writes the entry back to the memory. The write-back unit is 16 bytes.
4.3.3
(1)
Prefetch Operation (Only for Operand Cache)
Prefetch Hit
LRU is updated so that the hit way becomes the latest. The contents in other caches are not
modified. No data is transferred to the CPU.
(2)
Prefetch Miss
No data is transferred to the CPU. The way to be replaced follows table 4.3. Other operations are
the same in case of read miss.
Page 100 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
4.3.4
(1)
Section 4 Cache
Write Operation (Only for Operand Cache)
Write Hit
In a write access in write-back mode, the data is written to the cache and no external memory
write cycle is issued. The U bit of the entry written is set to 1 and LRU is updated so that the hit
way becomes the latest.
In write-through mode, the data is written to the cache and an external memory write cycle is
issued. The U bit of the written entry is not updated and LRU is updated so that the replaced way
becomes the latest.
(2)
Write Miss
In write-back mode, an external bus cycle starts when a write miss occurs, and the entry is
updated. The way to be replaced follows table 4.4. When the U bit of the entry to be replaced is 1,
the cache update cycle starts after the entry is transferred to the write-back buffer. Data is written
to the cache, the U bit is set to 1, and the V bit is set to 1. LRU is updated so that the replaced way
becomes the latest. After the cache completes its update cycle, the write-back buffer writes the
entry back to the memory. The write-back unit is 16 bytes.
In write-through mode, no write to cache occurs in a write miss; the write is only to the external
memory.
4.3.5
Write-Back Buffer (Only for Operand Cache)
When the U bit of the entry to be replaced in the write-back mode is 1, it must be written back to
the external memory. To increase performance, the entry to be replaced is first transferred to the
write-back buffer and fetching of new entries to the cache takes priority over writing back to the
external memory. After the cache completes to fetch the new entry, the write-back buffer writes
the entry back to external memory. During the write-back cycles, the cache can be accessed. The
write-back buffer can hold one line of cache data (16 bytes) and its physical address. Figure 4.3
shows the configuration of the write-back buffer.
A (31 to 4)
Longword 0
Longword 1
Longword 2
Longword 3
A (31 to 4):
Physical address written to external memory (upper three bits are 0)
Longword 0 to 3: One line of cache data to be written to external memory
Figure 4.3 Write-Back Buffer Configuration
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 101 of 1278
SH7670 Group
Section 4 Cache
Operations in sections 4.3.2 to 4.3.5 are compiled in table 4.8.
Table 4.8
Cache Operations
External Memory
Cache
CPU Cycle
Instructio Instruction
n cache
Accession
Hit/
Write-back mode/
miss
write through mode
U Bit
(through internal bus)
Cache Contents
Hit
⎯
⎯
Not generated
Not renewed
Miss
⎯
⎯
Cache renewal cycle is
Renewed to new values by
generated
cache renewal cycle
x
Not generated
Not renewed
⎯
Cache renewal cycle is
Renewed to new values by
generated
cache renewal cycle
Cache renewal cycle is
Renewed to new values by
generated
cache renewal cycle
Cache renewal cycle is
Renewed to new values by
generated. Succeedingly
cache renewal cycle
fetch
Operand
Prefetch/
cache
read
Hit
Either mode is
available
Miss
Write-through mode
Write-back mode
0
1
write-back cycle in write-back
buffer is generated.
Write
Hit
Write-through mode
Write-back mode
⎯
x
Write cycle CPU issues is
Renewed to new values by write
generated.
cycle the CPU issues
Not generated
Renewed to new values by write
cycle the CPU issues
Miss
Write-through mode
⎯
Write cycle CPU issues is
Not renewed*
generated.
Write-back mode
0
Cache renewal cycle is
Renewed to new values by
generated
cache renewal cycle.
Subsequently renewed again to
new values in write cycle CPU
issues.
1
Cache renewal cycle is
Renewed to new values by
generated. Succeedingly
cache renewal cycle.
write-back cycle in write-back Subsequently renewed again to
buffer is generated.
new values in write cycle CPU
issues.
[Legend]
x:
Don't care.
Note: Cache renewal cycle: 16-byte read access, write-back cycle in write-back buffer: 16-byte
write access
* Neither LRU renewed. LRU is renewed in all other cases.
Page 102 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
4.3.6
Section 4 Cache
Coherency of Cache and External Memory
Use software to ensure coherency between the cache and the external memory. When memory
shared by this LSI and another device is mapped in the cache-enabled space, operate the memorymapped cache to invalidate and write back as required.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 103 of 1278
Section 4 Cache
4.4
SH7670 Group
Memory-Mapped Cache
To allow software management of the cache, cache contents can be read and written by means of
MOV instructions. The instruction cache address array is mapped onto addresses H'F0000000 to
H'F07FFFFF, and the data array onto addresses H'F1000000 to H'F17FFFFF. The operand cache
address array is mapped onto addresses H'F0800000 to H'F0FFFFFF, and the data array onto
addresses H'F1800000 to H'F1FFFFFF. Only longword can be used as the access size for the
address array and data array, and instruction fetches cannot be performed.
4.4.1
Address Array
To access an address array, the 32-bit address field (for read/write accesses) and 32-bit data field
(for write accesses) must be specified.
In the address field, specify the entry address selecting the entry, The W bit for selecting the way,
and the A bit for specifying the existence of associative operation. In the W bit, B'00 is way 0,
B'01 is way 1, B'10 is way 2, and B'11 is way 3. Since the access size of the address array is fixed
at longword, specify B'00 for bits 1 and 0 of the address.
The tag address, LRU bits, U bit (only for operand cache), and V bit are specified as data. Always
specify 0 for the upper three bits (bits 31 to 29) of the tag address.
For the address and data formats, see figure 4.4.
The following three operations are possible for the address array.
(1)
Address Array Read
The tag address, LRU bits, U bit (only for operand cache), and V bit are read from the entry
address specified by the address and the entry corresponding to the way. For the read operation,
associative operation is not performed regardless of whether the associative bit (A bit) specified by
the address is 1 or 0.
(2)
Address-Array Write (Non-Associative Operation)
When the associative bit (A bit) in the address field is cleared to 0, write the tag address, LRU bits,
U bit (only for operand cache), and V bit, specified by the data field, to the entry address specified
by the address and the entry corresponding to the way. When writing to a cache line for which the
U bit = 1 and the V bit =1 in the operand cache address array, write the contents of the cache line
back to memory, then write the tag address, LRU bits, U bit, and V bit specified by the data field.
When 0 is written to the V bit, 0 must also be written to the U bit of that entry.
Page 104 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(3)
Section 4 Cache
Address-Array Write (Associative Operation)
When writing with the associative bit (A bit) of the address field set to 1, the addresses in the four
ways for the entry specified by the address field are compared with the tag address that is specified
by the data field. Write the U bit (only for operand cache) and the V bit specified by the data field
to the entry of the way that has a hit. However, the tag address and LRU bits remain unchanged.
When there is no way that has a hit, nothing is written and there is no operation.
This function is used to invalidate a specific entry in the cache. When the U bit of the entry that
has had a hit is 1 in the operand cache, writing back should be performed. However, when 0 is
written to the V bit, 0 must also be written to the U bit of that entry.
4.4.2
Data Array
To access a data array, the 32-bit address field (for read/write accesses) and 32-bit data field (for
write accesses) must be specified. The address field specifies information for selecting the entry to
be accessed; the data field specifies the longword data to be written to the data array.
Specify the entry address for selecting the entry, the L bit indicating the longword position within
the (16-byte) line, and the W bit for selecting the way. In the L bit, B'00 is longword 0, B'01 is
longword 1, B'10 is longword 2, and B'11 is longword 3. In the W bit, B'00 is way 0, B'01 is way
1, B'10 is way 2, and B'11 is way 3. Since the access size of the data array is fixed at longword,
specify B'00 for bits 1 and 0 of the address.
For the address and data formats, see figure 4.4.
The following two operations are possible for the data array. Information in the address array is
not modified by this operation.
(1)
Data Array Read
The data specified by the L bit in the address is read from the entry address specified by the
address and the entry corresponding to the way.
(2)
Data Array Write
The longword data specified by the data is written to the position specified by the L bit in the
address from the entry address specified by the address and the entry corresponding to the way.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 105 of 1278
SH7670 Group
Section 4 Cache
1. Instruction cache
2. Operand cache
1.1 Address array access
2.1 Address array access
(a) Address specification
(a) Address specification
Read access
31
23 22
Read access
13 12 11 10
111100000 *----------*
Write access
31
23 22
4
Entry address
W
3
2
1
0
31
0
*
0
0
111100001 *----------*
3
2
1
0
31
A
*
0
0
111100001 *----------*
3
2
1
0
31
X
X
X
V
0 0 0 Tag address (28 to 11) E
13 12 11 10
W
4
Entry address
W
4
Entry address
4
11 10 9
29 28
0 0 0 Tag address (28 to 11) E
LRU
23 22
13 12 11 10
W
4
Entry address
4
11 10 9
29 28
LRU
1.2 Data array access (both read and write accesses)
2.2 Data array access (both read and write accesses)
(a) Address specification
(a) Address specification
23 22
2
1
0
*
0
0
13 12 11 10
111100010 *----------*
W
4
3
2
1
0
A
*
0
0
(b) Data specification (both read and write accesses)
(b) Data specification (both read and write accesses)
31
3
0
Write access
13 12 11 10
111100000 *----------*
31
23 22
3
Entry address
2
L
1
0
31
0
0
111100011 *----------*
23 22
13 12 11 10
W
Entry address
4
3
2
1
0
X
X
U
V
1
0
0
0
3
2
L
(b) Data specification
(b) Data specification
31
0
Longword data
31
0
Longword data
[Legend]
*:
Don't care
E:
Bit 10 of entry address for read, don't care for write
X:
0 for read, don't care for write
Figure 4.4 Specifying Address and Data for Memory-Mapped Cache Access
Page 106 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
4.4.3
(1)
Section 4 Cache
Usage Examples
Invalidating Specific Entries
Specific cache entries can be invalidated by writing 0 to the entry's V bit in the memory mapping
cache access. When the A bit is 1, the tag address specified by the write data is compared to the
tag address within the cache selected by the entry address, and data is written to the bits V and U
specified by the write data when a match is found. If no match is found, there is no operation.
When the V bit of an entry in the address array is set to 0, the entry is written back if the entry's U
bit is 1.
An example when a write data is specified in R0 and an address is specified in R1 is shown below.
; R0=H'0110 0010; tag address(28-11)=B'0 0001 0001 0000 0000 0, U=0, V=0
; R1=H'F080 0088; operand cache address array access, entry=B'000 1000, A=1
;
MOV.L R0,@R1
(2)
Reading the Data of a Specific Entry
The data section of a specific cache entry can be read by the memory mapping cache access. The
longword indicated in the data field of the data array in figure 4.4 is read into the register.
An example when an address is specified in R0 and data is read in R1 is shown below.
; R0=H'F100 004C; instruction cache data array access, entry=B'000 0100,
; Way=0, longword address=3
;
MOV.L @R0,R1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 107 of 1278
Section 4 Cache
4.4.4
SH7670 Group
Notes
1. Programs that access memory-mapped operand cache should be placed in a cache-disabled
space. Programs that access memory-mapped instruction cache should also be placed in a
cache-disabled space and an on-chip peripheral module or an external address space (a cachedisabled address) should be read at least twice each at the beginning and end of the programs.
2. Rewriting the address array contents so that two or more ways are hit simultaneously is
prohibited. Operation is not guaranteed if the address array contents are changed so that two or
more ways are hit simultaneously.
3. Memory-mapped cache can be accessed only by the CPU and not by the DMAC. Registers can
be accessed by the CPU and the DMAC.
Page 108 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 5 Exception Handling
Section 5 Exception Handling
5.1
Overview
5.1.1
Types of Exception Handling and Priority
Exception handling is started by sources, such as resets, address errors, register bank errors,
interrupts, and instructions. Table 5.1 shows their priorities. When several exception handling
sources occur at once, they are processed according to the priority shown.
Table 5.1
Types of Exception Handling and Priority Order
Type
Exception Handling
Priority
Reset
Power-on reset
High
Manual reset
Address
error
DMAC address error
CPU address error
Instruction
FPU exception
Integer division exception (division by zero)
Integer division exception (overflow)
Register
bank error
Interrupt
Bank underflow
Bank overflow
NMI
User break
H-UDI
IRQ
On-chip peripheral modules
Direct memory access controller (DMAC)
USB2.0 host/function module (USB)
Compare match timer (CMT)
Bus state controller (BSC)
Watchdog timer (WDT)
Host interface (HIF)
Encryption/decryption and forward error
correction core conjunction DMAC (ADMAC)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Low
Page 109 of 1278
SH7670 Group
Section 5 Exception Handling
Type
Exception Handling
Interrupt
On-chip peripheral modules
Priority
Ethernet controller (EtherC)
High
2
I C bus interface 3 (IIC3)
Stream interface (STIF)
Serial communication interface with FIFO
(SCIF)
Serial sound interface_0 (SSI_0)
Serial sound interface_1 (SSI_1)
SD host interface (SDHI)
Instruction
Trap instruction (TRAPA instruction)
General illegal instructions (undefined code)
Slot illegal instructions (undefined code placed directly after a delayed
1
branch instruction* (including an FPU instruction or FPU-related CPU
instruction in FPU module standby mode), instructions that rewrite the
PC*2, 32-bit instructions*3, RESBANK instruction, DIVS instruction, and
DIVU instruction)
Low
Notes: 1. Delayed branch instructions: JMP, JSR, BRA, BSR, RTS, RTE, BF/S, BT/S, BSRF,
BRAF.
2. Instructions that rewrite the PC: JMP, JSR, BRA, BSR, RTS, RTE, BT, BF, TRAPA,
BF/S, BT/S, BSRF, BRAF, JSR/N, RTV/N.
3. 32-bit instructions: BAND.B, BANDNOT.B, BCLR.B, BLD.B, BLDNOT.B, BOR.B,
BORNOT.B, BSET.B, BST.B, BXOR.B, MOV.B@disp12, MOV.W@disp12,
MOV.L@disp12, MOVI20, MOVI20S, MOVU.B, MOVU.W.
Page 110 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
5.1.2
Section 5 Exception Handling
Exception Handling Operations
The exception handling sources are detected and begin processing according to the timing shown
in table 5.2.
Table 5.2
Timing of Exception Source Detection and Start of Exception Handling
Exception
Source
Timing of Source Detection and Start of Handling
Reset
Power-on reset
Starts when the RES pin changes from low to high, when the
H-UDI reset negate command is set after the H-UDI reset
assert command has been set, or when the WDT overflows.
Manual reset
Starts when the WDT overflows.
Address error
Detected when instruction is decoded and starts when the
previous executing instruction finishes executing.
Interrupts
Detected when instruction is decoded and starts when the
previous executing instruction finishes executing.
Register bank Bank underflow
error
Starts upon attempted execution of a RESBANK instruction
when saving has not been performed to register banks.
Instructions
Bank overflow
In the state where saving has been performed to all register
bank areas, starts when acceptance of register bank overflow
exception has been set by the interrupt controller (the BOVE bit
in IBNR of the INTC is 1) and an interrupt that uses a register
bank has occurred and been accepted by the CPU.
Trap instruction
Starts from the execution of a TRAPA instruction.
General illegal
instructions
Starts from the decoding of an undefined code (including an
FPU instruction or FPU-related CPU instruction in FPU module
standby mode) anytime except immediately after a delayed
branch instruction (delay slot).
Slot illegal
instructions
Starts from the decoding of an undefined code placed
(including an FPU instruction or FPU-related CPU instruction in
FPU module standby mode) immediately after a delayed
branch instruction (delay slot), of instructions that rewrite the
PC, of 32-bit instructions, of the RESBANK instruction, of the
DIVS instruction, or of the DIVU instruction.
Integer division
instructions
Starts when detecting division-by-zero exception or overflow
exception caused by division of the negative maximum value
(H'80000000) by −1.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 111 of 1278
Section 5 Exception Handling
SH7670 Group
When exception handling starts, the CPU operates as follows:
(1)
Exception Handling Triggered by Reset
The initial values of the program counter (PC) and stack pointer (SP) are fetched from the
exception handling vector table (PC and SP are respectively the H'00000000 and H'00000004
addresses for power-on resets and the H'00000008 and H'0000000C addresses for manual resets).
See section 5.1.3, Exception Handling Vector Table, for more information. The vector base
register (VBR) is then initialized to H'00000000, the interrupt mask level bits (I3 to I0) of the
status register (SR) are initialized to H'F (B'1111), and the BO and CS bits are initialized. The BN
bit in IBNR of the interrupt controller (INTC) is also initialized to 0. The program begins running
from the PC address fetched from the exception handling vector table.
(2)
Exception Handling Triggered by Address Errors, Register Bank Errors, Interrupts,
and Instructions
SR and PC are saved to the stack indicated by R15. In the case of interrupt exception handling
other than NMI or user breaks with usage of the register banks enabled, general registers R0 to
R14, control register GBR, system registers MACH, MACL, and PR, and the vector table address
offset of the interrupt exception handling to be executed are saved to the register banks. In the case
of exception handling due to an address error, register bank error, NMI interrupt, user break
interrupt, or instruction, saving to a register bank is not performed. When saving is performed to
all register banks, automatic saving to the stack is performed instead of register bank saving. In
this case, an interrupt controller setting must have been made so that register bank overflow
exceptions are not accepted (the BOVE bit in IBNR of the INTC is 0). If a setting to accept
register bank overflow exceptions has been made (the BOVE bit in IBNR of the INTC is 1),
register bank overflow exception will be generated. In the case of interrupt exception handling, the
interrupt priority level is written to the I3 to I0 bits in SR. In the case of exception handling due to
an address error or instruction, the I3 to I0 bits are not affected. The exception service routine start
address is then fetched from the exception handling vector table and the program begins running
from that address.
Page 112 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
5.1.3
Section 5 Exception Handling
Exception Handling Vector Table
Before exception handling begins running, the exception handling vector table must be set in
memory. The exception handling vector table stores the start addresses of exception service
routines. (The reset exception handling table holds the initial values of PC and SP.)
All exception sources are given different vector numbers and vector table address offsets, from
which the vector table addresses are calculated. During exception handling, the start addresses of
the exception service routines are fetched from the exception handling vector table, which is
indicated by this vector table address.
Table 5.3 shows the vector numbers and vector table address offsets. Table 5.4 shows how vector
table addresses are calculated.
Table 5.3
Exception Handling Vector Table
Vector
Numbers
Vector Table Address Offset
PC
0
H'00000000 to H'00000003
SP
1
H'00000004 to H'00000007
PC
2
H'00000008 to H'0000000B
SP
3
H'0000000C to H'0000000F
General illegal instruction
4
H'00000010 to H'00000013
(Reserved by system)
5
H'00000014 to H'00000017
Slot illegal instruction
6
H'00000018 to H'0000001B
(Reserved by system)
7
H'0000001C to H'0000001F
8
H'00000020 to H'00000023
9
H'00000024 to H'00000027
Exception Sources
Power-on reset
Manual reset
CPU address error
DMAC address error
10
H'00000028 to H'0000002B
NMI
11
H'0000002C to H'0000002F
User break
12
H'00000030 to H'00000033
FPU exception
13
H'00000034 to H'00000037
H-UDI
14
H'00000038 to H'0000003B
Bank overflow
15
H'0000003C to H'0000003F
Bank underflow
16
H'00000040 to H'00000043
Interrupts
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 113 of 1278
SH7670 Group
Section 5 Exception Handling
Vector
Numbers
Vector Table Address Offset
Integer division exception
(division by zero)
17
H'00000044 to H'00000047
Integer division exception (overflow)
18
H'00000048 to H'0000004B
(Reserved by system)
19
H'0000004C to H'0000004F
Exception Sources
:
Trap instruction (user vector)
31
H'0000007C to H'0000007F
32
H'00000080 to H'00000083
:
External interrupts (IRQ),
on-chip peripheral module interrupts*
*
Table 5.4
:
63
H'000000FC to H'000000FF
64
H'00000100 to H'00000103
:
511
Note:
:
:
H'000007FC to H'000007FF
The vector numbers and vector table address offsets for each external interrupt and onchip peripheral module interrupt are given in table 6.4 in section 6, Interrupt Controller
(INTC).
Calculating Exception Handling Vector Table Addresses
Exception Source
Vector Table Address Calculation
Resets
Vector table address = (vector table address offset)
= (vector number) × 4
Address errors, register bank
errors, interrupts, instructions
Vector table address = VBR + (vector table address offset)
= VBR + (vector number) × 4
Notes: 1. Vector table address offset: See table 5.3.
2. Vector number: See table 5.3.
Page 114 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 5 Exception Handling
5.2
Resets
5.2.1
Input/Output Pins
Table 5.5 shows the reset-related pin configuration.
Table 5.5
Pin Configuration
Pin Name
Symbol
I/O
Function
Power-on reset
RES
Input
When this pin is driven low, this LSI shifts to the poweron reset processing
5.2.2
Types of Reset
A reset is the highest-priority exception handling source. There are two kinds of reset, power-on
and manual. As shown in table 5.6, the CPU state is initialized in both a power-on reset and a
manual reset. The FPU state is initialized by a power-on reset, but not by a manual reset. On-chip
peripheral module registers are initialized by a power-on reset, but not by a manual reset.
Table 5.6
Reset States
Conditions for Transition to Reset State
Internal States
On-Chip
WRCSR of
Peripheral
WDT, FRQCR of
Modules, I/O Port CPG
Type
RES
H-UDI Command
MRES
WDT
Overflow
Power-on
reset
Low
—
—
—
Initialized Initialized
Initialized
High
H-UDI reset assert —
command is set
—
Initialized Initialized
Initialized
High
Command other
than H-UDI reset
assert is set
—
Power-on
reset
Initialized Initialized
Not initialized
High
Command other
than H-UDI reset
assert is set
Low
—
Initialized Not initialized*
Not initialized
High
Command other
than H-UDI reset
assert is set
High
Manual
reset
Initialized Not initialized*
Not initialized
Manual
reset
Note:
*
CPU
The BN bit in IBNR of the INTC is initialized.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 115 of 1278
Section 5 Exception Handling
5.2.3
(1)
SH7670 Group
Power-On Reset
Power-On Reset by Means of RES Pin
When the RES pin is driven low, this LSI enters the power-on reset state. To reliably reset this
LSI, the RES pin should be kept at the low level for the duration of the oscillation settling time at
power-on or when in software standby mode (when the clock is halted), or at least 20-tcyc
(unfixed) when the clock is running. In the power-on reset state, the internal state of the CPU and
all the on-chip peripheral module registers are initialized. See appendix A, Pin States, for the
status of individual pins during the power-on reset state.
In the power-on reset state, power-on reset exception handling starts when the RES pin is first
driven low for a fixed period and then returned to high. The CPU operates as follows:
1. The initial value (execution start address) of the program counter (PC) is fetched from the
exception handling vector table.
2. The initial value of the stack pointer (SP) is fetched from the exception handling vector table.
3. The vector base register (VBR) is cleared to H'00000000, the interrupt mask level bits (I3 to
I0) of the status register (SR) are initialized to H'F (B'1111), and the BO and CS bits are
initialized. The BN bit in IBNR of the INTC is also initialized to 0.
4. The values fetched from the exception handling vector table are set in the PC and SP, and the
program begins executing.
Be certain to always perform power-on reset processing when turning the system power on.
(2)
Power-On Reset by Means of H-UDI Reset Assert Command
When the H-UDI reset assert command is set, this LSI enters the power-on reset state. Power-on
reset by means of an H-UDI reset assert command is equivalent to power-on reset by means of the
RES pin. Setting the H-UDI reset negate command cancels the power-on reset state. The time
required between an H-UDI reset assert command and H-UDI reset negate command is the same
as the time to keep the RES pin low to initiate a power-on reset. In the power-on reset state
generated by an H-UDI reset assert command, setting the H-UDI reset negate command starts
power-on reset exception handling. The CPU operates in the same way as when a power-on reset
was caused by the RES pin.
Page 116 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(3)
Section 5 Exception Handling
Power-On Reset Initiated by WDT
When a setting is made for a power-on reset to be generated in the WDT’s watchdog timer mode,
and WTCNT of the WDT overflows, this LSI enters the power-on reset state.
In this case, WRCSR of the WDT and FRQCR of the CPG are not initialized by the reset signal
generated by the WDT.
If a reset caused by the RES pin or the H-UDI reset assert command occurs simultaneously with a
reset caused by WDT overflow, the reset caused by the RES pin or the H-UDI reset assert
command has priority, and the WOVF bit in WRCSR is cleared to 0. When power-on reset
exception processing is started by the WDT, the CPU operates in the same way as when a poweron reset was caused by the RES pin.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 117 of 1278
SH7670 Group
Section 5 Exception Handling
5.2.4
(1)
Manual Reset
Manual Reset by Means of WDT
When a manual reset is set to occur in the WDT’s watchdog timer mode, if the WDT’s WTCNT
overflows, the manual reset state is established. In the manual reset state, the internal state of the
CPU is initialized, but the registers in on-chip peripheral modules are not initialized.
When manual reset exception handling is started, the CPU operates as follows.
1. The initial value (execution start address) of the program counter (PC) is fetched from the
exception handling vector table.
2. The initial value of the stack pointer (SP) is fetched from the exception handling vector table.
3. The vector base register (VBR) is cleared to H'00000000, the interrupt mask level bits (I3 to
I0) of the status register (SR) are initialized to H'F (B'1111), and the BO and CS bits are
initialized. The BN bit in IBNR of the INTC is also initialized to 0.
4. The values fetched from the exception handling vector table are set in the PC and SP, and the
program begins executing.
When a manual reset is generated, the bus cycle is retained, but if a manual reset occurs while the
bus is released or during DMAC burst transfer, manual reset exception handling will be deferred
until the CPU acquires the bus. However, if the interval from generation of the manual reset until
the end of the bus cycle is equal to or longer than the fixed internal manual reset interval cycles,
the internal manual reset source is ignored instead of being deferred, and manual reset exception
handling is not executed. The FPU and other modules are not initialized.
Page 118 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 5 Exception Handling
5.3
Address Errors
5.3.1
Address Error Sources
Address errors occur when instructions are fetched or data read or written, as shown in table 5.7.
Table 5.7
Bus Cycles and Address Errors
Bus Cycle
Type
Instruction
fetch
Data
read/write
Note:
*
Bus
Master
Bus Cycle Description
Address Errors
CPU
Instruction fetched from even address
None (normal)
Instruction fetched from odd address
Address error occurs
Instruction fetched from other than on-chip
peripheral module space* or H'F0000000 to
H'F5FFFFFF in on-chip RAM space*
None (normal)
Instruction fetched from on-chip peripheral
module space* or H'F0000000 to
H'F5FFFFFF in on-chip RAM space*
Address error occurs
Word data accessed from even address
None (normal)
Word data accessed from odd address
Address error occurs
Longword data accessed from a longword
boundary
None (normal)
Longword data accessed from other than a
long-word boundary
Address error occurs
Byte or word data accessed in on-chip
peripheral module space*
None (normal)
Longword data accessed in 16-bit on-chip
peripheral module space*
None (normal)
Longword data accessed in 8-bit on-chip
peripheral module space*
None (normal)
CPU or
DMAC
See section 7, Bus State Controller (BSC), for details of the on-chip peripheral module
space and on-chip RAM space.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 119 of 1278
Section 5 Exception Handling
5.3.2
SH7670 Group
Address Error Exception Handling
When an address error occurs, the bus cycle in which the address error occurred ends.* When the
executing instruction then finishes, address error exception handling starts. The CPU operates as
follows:
1. The exception service routine start address which corresponds to the address error that
occurred is fetched from the exception handling vector table.
2. The status register (SR) is saved on the stack.
3. The program counter (PC) is saved on the stack. The PC value saved is the start address of the
instruction to be executed after the last executed instruction.
4. After jumping to the exception service routine start address fetched from the exception
handling vector table, program execution starts. The jump that occurs is not a delayed branch.
Note: This sequence only applies to address errors in the reading and writing of data. In case of
an address error due to instruction fetching, if the bus cycle in which the address error
occurred is not completed by the end of step 3 above, address-error exception handling by
the CPU is restarted. This continues until the bus cycle is complete.
Page 120 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
5.4
Register Bank Errors
5.4.1
Register Bank Error Sources
(1)
Section 5 Exception Handling
Bank Overflow
In the state where saving has already been performed to all register bank areas, bank overflow
occurs when acceptance of register bank overflow exception has been set by the interrupt
controller (the BOVE bit in IBNR of the INTC is set to 1) and an interrupt that uses a register
bank has occurred and been accepted by the CPU.
(2)
Bank Underflow
Bank underflow occurs when an attempt is made to execute a RESBANK instruction while saving
has not been performed to register banks.
5.4.2
Register Bank Error Exception Handling
When a register bank error occurs, register bank error exception handling starts. The CPU operates
as follows:
1. The exception service routine start address which corresponds to the register bank error that
occurred is fetched from the exception handling vector table.
2. The status register (SR) is saved to the stack.
3. The program counter (PC) is saved to the stack. The PC value saved is the start address of the
instruction to be executed after the last executed instruction for a bank overflow, and the start
address of the executed RESBANK instruction for a bank underflow.
To prevent multiple interrupts from occurring at a bank overflow, the interrupt priority level
that caused the bank overflow is written to the interrupt mask level bits (I3 to I0) of the status
register (SR).
4. After jumping to the exception service routine start address fetched from the exception
handling vector table, program execution starts. The jump that occurs is not a delayed branch.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 121 of 1278
SH7670 Group
Section 5 Exception Handling
5.5
Interrupts
5.5.1
Interrupt Sources
Table 5.8 shows the sources that start up interrupt exception handling. These are divided into
NMI, user breaks, H-UDI, IRQ, PINT, and on-chip peripheral modules.
Table 5.8
Interrupt Sources
Type
Request Source
Number of
Sources
NMI
NMI pin (external input)
1
User break
User break controller (UBC)
1
H-UDI
High-performance user debugging interface (H-UDI)
1
IRQ
IRQ0 to IRQ7 pins (external input)
8
On-chip peripheral module
Direct memory access controller (DMAC)
16
Ethernet controller (EtherC)
1
Compare match timer (CMT)
2
Bus state controller (BSC)
1
Watchdog timer (WDT)
1
Encryption/decryption and forward error correction
core conjunction DMAC (A-DMAC)
7
Stream interface (STIF)
2
Host interface (HIF)
2
Serial sound interface_0 (SSI_0)
1
Serial sound interface_1 (SSI_1)
1
SD host interface (SDHI)
3
USB2.0 host/function module (USB)
1
2
I C bus interface 3 (IIC3)
5
Serial communication interface with FIFO (SCIF)
16
Each interrupt source is allocated a different vector number and vector table offset. See table 6.4 in
section 6, Interrupt Controller (INTC), for more information on vector numbers and vector table
address offsets.
Page 122 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
5.5.2
Section 5 Exception Handling
Interrupt Priority Level
The interrupt priority order is predetermined. When multiple interrupts occur simultaneously
(overlap), the interrupt controller (INTC) determines their relative priorities and starts processing
according to the results.
The priority order of interrupts is expressed as priority levels 0 to 16, with priority 0 the lowest
and priority 16 the highest. The NMI interrupt has priority 16 and cannot be masked, so it is
always accepted. The user break interrupt and H-UDI interrupt priority level is 15. Priority levels
of IRQ interrupts, and on-chip peripheral module interrupts can be set freely using the interrupt
priority registers 01, 02, and 06 to 16 (IPR01, IPR02, and IPR06 to IPR16) of the INTC as shown
in table 5.9. The priority levels that can be set are 0 to 15. Level 16 cannot be set. See section
6.3.1, Interrupt Priority Registers 01, 02, 06 to 16 (IPR01, IPR02, IPR06 to IPR16), for details of
IPR01, IPR02, and IPR06 to IPR16.
Table 5.9
Interrupt Priority Order
Type
Priority Level
Comment
NMI
16
Fixed priority level. Cannot be masked.
User break
15
Fixed priority level.
H-UDI
15
Fixed priority level.
IRQ
0 to 15
Set with interrupt priority registers 01, 02, and 06
to 16 (IPR01, IPR02, and IPR06 to IPR16).
On-chip peripheral module
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 123 of 1278
Section 5 Exception Handling
5.5.3
SH7670 Group
Interrupt Exception Handling
When an interrupt occurs, its priority level is ascertained by the interrupt controller (INTC). NMI
is always accepted, but other interrupts are only accepted if they have a priority level higher than
the priority level set in the interrupt mask level bits (I3 to I0) of the status register (SR).
When an interrupt is accepted, interrupt exception handling begins. In interrupt exception
handling, the CPU fetches the exception service routine start address which corresponds to the
accepted interrupt from the exception handling vector table, and saves SR and the program counter
(PC) to the stack. In the case of interrupt exception handling other than NMI or user breaks with
usage of the register banks enabled, general registers R0 to R14, control register GBR, system
registers MACH, MACL, and PR, and the vector table address offset of the interrupt exception
handling to be executed are saved in the register banks. In the case of exception handling due to an
address error, NMI interrupt, user break interrupt, or instruction, saving is not performed to the
register banks. If saving has been performed to all register banks (0 to 14), automatic saving to the
stack is performed instead of register bank saving. In this case, an interrupt controller setting must
have been made so that register bank overflow exceptions are not accepted (the BOVE bit in
IBNR of the INTC is 0). If a setting to accept register bank overflow exceptions has been made
(the BOVE bit in IBNR of the INTC is 1), register bank overflow exception occurs. Next, the
priority level value of the accepted interrupt is written to the I3 to I0 bits in SR. For NMI,
however, the priority level is 16, but the value set in the I3 to I0 bits is H'F (level 15). Then, after
jumping to the start address fetched from the exception handling vector table, program execution
starts. The jump that occurs is not a delayed branch. See section 6.6, Operation, for further details
of interrupt exception handling.
Page 124 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 5 Exception Handling
5.6
Exceptions Triggered by Instructions
5.6.1
Types of Exceptions Triggered by Instructions
Exception handling can be triggered by trap instructions, general illegal instructions, slot illegal
instructions, and integer division exceptions, as shown in table 5.10.
Table 5.10 Types of Exceptions Triggered by Instructions
Type
Source Instruction
Trap instruction
TRAPA
Slot illegal
instructions
Undefined code placed
immediately after a delayed
branch instruction (delay slot)
(including the FPU instruction and
FPU-related CPU instruction in
FPU module standby mode),
instructions that rewrite the PC,
32-bit instructions, RESBANK
instruction, DIVS instruction, and
DIVU instruction
Comment
Delayed branch instructions: JMP, JSR,
BRA, BSR, RTS, RTE, BF/S, BT/S, BSRF,
BRAF
Instructions that rewrite the PC: JMP, JSR,
BRA, BSR, RTS, RTE, BT, BF, TRAPA,
BF/S, BT/S, BSRF, BRAF, JSR/N, RTV/N
32-bit instructions: BAND.B, BANDNOT.B,
BCLR.B, BLD.B, BLDNOT.B, BOR.B,
BORNOT.B, BSET.B, BST.B, BXOR.B,
MOV.B@disp12, MOV.W@disp12,
MOV.L@disp12, MOVI20, MOVI20S,
MOVU.B, MOVU.W.
General illegal
instructions
Undefined code anywhere
besides in a delay slot (including
the FPU instruction and FPUrelated CPU instruction in FPU
module standby mode)
Integer division
exceptions
Division by zero
DIVU, DIVS
Negative maximum value ÷ (−1)
DIVS
Floating-point
operation
instruction
Instructions that will cause Invalid FADD, FSUB, FMUL, FDIV, FMAC,
Operation Exception or Divide by FCMP/EQ, FCMP/GT, FLOAT,
Zero Exception defined in the
FTRC,FCNVDS, FCNVSD, FSQRT
IEEE754 standard, and
instructions that may cause
Overflow Exception, Underflow
Exception, or Incorrectness
Exception
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 125 of 1278
Section 5 Exception Handling
5.6.2
SH7670 Group
Trap Instructions
When a TRAPA instruction is executed, trap instruction exception handling starts. The CPU
operates as follows:
1. The exception service routine start address which corresponds to the vector number specified
in the TRAPA instruction is fetched from the exception handling vector table.
2. The status register (SR) is saved to the stack.
3. The program counter (PC) is saved to the stack. The PC value saved is the start address of the
instruction to be executed after the TRAPA instruction.
4. After jumping to the exception service routine start address fetched from the exception
handling vector table, program execution starts. The jump that occurs is not a delayed branch.
5.6.3
Slot Illegal Instructions
An instruction placed immediately after a delayed branch instruction is said to be placed in a delay
slot. When the instruction placed in the delay slot is an undefined code (including an FPU
instruction or FPU-related CPU instruction in FPU module standby mode), an instruction that
rewrites the PC, a 32-bit instruction, an RESBANK instruction, a DIVS instruction, or a DIVU
instruction, slot illegal exception handling starts if such kind of instruction is decoded. When the
FPU is in the module standby state, the floating-point operation instruction and FPU-related CPU
instruction are handled as an undefined code; when such an instruction is placed in the delay slot,
slot illegal exception handling starts if the instruction is decoded. The CPU operates as follows:
1. The exception service routine start address is fetched from the exception handling vector table.
2. The status register (SR) is saved to the stack.
3. The program counter (PC) is saved to the stack. The PC value saved is the jump address of the
delayed branch instruction immediately before the undefined code, the instruction that rewrites
the PC, the 32-bit instruction, the RESBANK instruction, the DIVS instruction, or the DIVU
instruction.
4. After jumping to the exception service routine start address fetched from the exception
handling vector table, program execution starts. The jump that occurs is not a delayed branch.
5.6.4
General Illegal Instructions
When an undefined code (including an FPU instruction or FPU-related CPU instruction in FPU
module standby mode) placed anywhere other than immediately after a delayed branch instruction
(i.e., in a delay slot) is decoded, general illegal instruction exception handling starts. When the
FPU is in the module standby state, the floating-point operation instruction and FPU-related CPU
Page 126 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 5 Exception Handling
instruction are handled as an undefined code; when such an instruction is placed anywhere other
than immediately after a delayed branch instruction (i.e., in a delay slot), general illegal instruction
exception handling starts if the instruction is decoded.
The CPU handles general illegal instruction exception in the same way as slot illegal instruction
exception. Unlike processing of slot illegal instruction exception, however, the program counter
value stored is the start address of the undefined code.
5.6.5
Integer Division Instructions
When an integer division instruction performs division by zero or the result of integer division
overflows, integer division instruction exception handling starts. The instructions that may become
the source of division-by-zero exception are DIVU and DIVS. The only source instruction of
overflow exception is DIVS, and overflow exception occurs only when the negative maximum
value is divided by −1. The CPU operates as follows:
1. The exception service routine start address which corresponds to the integer division
instruction exception that occurred is fetched from the exception handling vector table.
2. The status register (SR) is saved to the stack.
3. The program counter (PC) is saved to the stack. The PC value saved is the start address of the
integer division instruction at which the exception occurred.
4. After jumping to the exception service routine start address fetched from the exception
handling vector table, program execution starts. The jump that occurs is not a delayed branch.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 127 of 1278
SH7670 Group
Section 5 Exception Handling
5.6.6
Floating-Point Operation Instruction
In the floating-point status/control register (FPSCR), FPU exception occurs if the V, Z, O, U, or I
bit in the FPU exception enable field (Enable) is set. This indicates that a floating-point operation
instruction has caused any of the exceptions defined in the IEEE754 standard: invalid operation
exception, overflow exception (likely instruction), underflow exception (likely instruction), or
incorrectness exception (likely instruction).
The following floating-point operation instructions may become exception sources:
FADD, FSUB, FMUL, FDIV, FMAC, FCMP/EQ, FCMP/GT, FLOAT, FTRC, FCNVDS,
FCNVSD, FSQRT
An FPU exception occurs only when the corresponding enable bit is set. When the FPU detects an
exception source, the FPU discontinues its operation and notifies the CPU of the occurrence of an
exception. When exception handling is started, the CPU operates as follows:
1. The start address of the exception service routine corresponding to the FPU exception that has
occurred is fetched from the exception handling vector table.
2. The status register (SR) is saved in the stack.
3. The program counter (PC) is saved in the stack. The start address of the instruction following
the instruction executed last is the value to be saved in the PC.
4. To start executing the program, a jump occurs to the start address of the exception service
routine fetched from the exception handling vector table. This jump is not a delayed branch.
The FPU exception flag filed (Flag) in the FPSCR is always updated irrespective of whether it is
capable of accepting FPU exceptions and remains set until it is cleared explicitly by an instruction
from the user. The FPU exception source field (Cause) in the FPSCR changes each time an FPU
instruction is executed.
When the FPU exception enable field (Enable) in the FPSCR is set and when the QIS bit in the
FPSCR is set, FPU exception starts if qNaN or ±∞ is entered into the source of the floating-point
operation instruction.
Page 128 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
5.7
Section 5 Exception Handling
When Exception Sources Are Not Accepted
When an address error, FPU exception, register bank error (overflow), or interrupt is generated
immediately after a delayed branch instruction, it is sometimes not accepted immediately but
stored instead, as shown in table 5.11. When this happens, it will be accepted when an instruction
that can accept the exception is decoded.
Table 5.11 Exception Source Generation Immediately after Delayed Branch Instruction
Exception Source
Point of Occurrence
Address Error
Immediately after a
Not accepted
delayed branch instruction*
Note:
*
FPU
exception
Register Bank
Error (Overflow) Interrupt
Not accepted
Not accepted
Not accepted
Delayed branch instructions: JMP, JSR, BRA, BSR, RTS, RTE, BF/S, BT/S, BSRF,
BRAF
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 129 of 1278
SH7670 Group
Section 5 Exception Handling
5.8
Stack Status after Exception Handling Ends
The status of the stack after exception handling ends is as shown in table 5.12.
Table 5.12 Stack Status After Exception Handling Ends
Exception Type
Stack Status
Address error
SP
Address of instruction
after executed instruction
32 bits
SR
32 bits
Address of instruction
after executed instruction
32 bits
SR
32 bits
Address of instruction
after executed instruction
32 bits
SR
32 bits
Start address of relevant
RESBANK instruction
32 bits
SR
32 bits
Address of instruction
after TRAPA instruction
32 bits
SR
32 bits
Jump destination address
of delayed branch instruction
32 bits
SR
32 bits
Interrupt
SP
Register bank error (overflow)
SP
Register bank error (underflow)
SP
Trap instruction
SP
Slot illegal instruction
SP
Page 130 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Exception Type
Section 5 Exception Handling
Stack Status
General illegal instruction
SP
Start address of general
illegal instruction
32 bits
SR
32 bits
Start address of relevant
integer division instruction
32 bits
SR
32 bits
Address of the instruction
following the instruction executed
32 bits
SR
32 bits
Integer division instruction
SP
FPU exception
SP
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 131 of 1278
Section 5 Exception Handling
5.9
Usage Notes
5.9.1
Value of Stack Pointer (SP)
SH7670 Group
The value of the stack pointer must always be a multiple of four. If it is not, an address error will
occur when the stack is accessed during exception handling.
5.9.2
Value of Vector Base Register (VBR)
The value of the vector base register must always be a multiple of four. If it is not, an address error
will occur when the stack is accessed during exception handling.
5.9.3
Address Errors Caused by Stacking of Address Error Exception Handling
When the stack pointer is not a multiple of four, an address error will occur during stacking of the
exception handling (interrupts, etc.) and address error exception handling will start up as soon as
the first exception handling is ended. Address errors will then also occur in the stacking for this
address error exception handling. To ensure that address error exception handling does not go into
an endless loop, no address errors are accepted at that point. This allows program control to be
shifted to the address error exception service routine and enables error processing.
When an address error occurs during exception handling stacking, the stacking bus cycle (write) is
executed. During stacking of the status register (SR) and program counter (PC), the SP is
decremented by 4 for both, so the value of SP will not be a multiple of four after the stacking
either. The address value output during stacking is the SP value, so the address where the error
occurred is itself output. This means the write data stacked will be undefined.
Page 132 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 6 Interrupt Controller (INTC)
Section 6 Interrupt Controller (INTC)
The interrupt controller (INTC) ascertains the priority of interrupt sources and controls interrupt
requests to the CPU. The INTC registers set the order of priority of each interrupt, allowing the
user to process interrupt requests according to the user-set priority.
6.1
Features
• 16 levels of interrupt priority can be set
By setting the nine interrupt priority registers, the priorities of IRQ interrupts, and on-chip
peripheral module interrupts can be selected from 16 levels for request sources.
• NMI noise canceler function
An NMI input-level bit indicates the NMI pin state. By reading this bit in the interrupt
exception service routine, the pin state can be checked, enabling it to be used as the noise
canceler function.
• Register banks
This LSI has register banks that enable register saving and restoration required in the interrupt
processing to be performed at high speed.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 133 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
Figure 6.1 shows a block diagram of the INTC.
IRQOUT
UBC
H-UDI
DMAC
CMT
BSC
WDT
MTU2
MTU2S
POE2
ADC
IIC3
SCIF
Input control
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
(Interrupt request)
Comparator
Priority
identifier
SR
I3 I2 I1 I0
CPU
ICR0
ICR1
ICR2
IRQRR
PINTER
PIRR
IBCR
Interrupt
request
IPR
IPR01, IPR02,
IPR06 to IPR16
IBNR
Module bus
Bus
interface
INTC
[Legend]
User break controller
UBC:
H-UDI: High-performance user debugging interface
DMAC: Direct memory access controller
Compare match timer
CMT:
Bus state controller
BSC:
Watchdog timer
WDT:
EtherC: Ethernet controller
A-DMAC: DMAC with encryption/decryption
and forward error correction core
Host interface
HIF:
USB2.0 host/function module
USB:
Stream interface
STIF:
Serial sound interface
SSI:
Peripheral bus
NMI
IRQ7 to IRQ0
PINT7 to PINT0
SD host interface
SDHI:
I2C bus interface 3
IIC3:
Serial communication interface with FIFO
SCIF:
Interrupt control register 0
ICR0:
Interrupt control register 1
ICR1:
Interrupt control register 2
ICR2:
IRQ interrupt request register
IRQRR:
PINT interrupt enable register
PINTER:
PINT interrupt request register
PIRR:
Bank control register
IBCR:
Bank number register
IBNR:
IPR01, IPR02, IPR06 to IPR16: Interrupt priority registers 01, 02,
06 to 16
Figure 6.1 Block Diagram of INTC
Page 134 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.2
Section 6 Interrupt Controller (INTC)
Input/Output Pins
Table 6.1 shows the pin configuration of the INTC.
Table 6.1
Pin Configuration
Pin Name
Symbol
Nonmaskable interrupt input pin NMI
Interrupt request input pins
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
I/O
Function
Input
Input of nonmaskable interrupt
request signal
IRQ7 to IRQ0 Input
Input of maskable interrupt request
signals
Page 135 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.3
Register Descriptions
The INTC has the following registers. These registers are used to set the interrupt priorities and
control detection of the external interrupt input signal.
Table 6.2
Register Configuration
Register Name
Abbreviation R/W
Initial
Value
Address
Access
Size
Interrupt control register 0
ICR0
R/W
*1
H'FFFE0800
16, 32
Interrupt control register 1
ICR1
R/W
H'0000
H'FFFE0802
16, 32
2
IRQ interrupt request register
IRQRR
R/(W)*
H'0000
H'FFFE0806
16, 32
Bank control register
IBCR
R/W
H'0000
H'FFFE080C
16, 32
Bank number register
IBNR
R/W
H'0000
H'FFFE080E
16, 32
Interrupt priority register 01
IPR01
R/W
H'0000
H'FFFE0818
16, 32
Interrupt priority register 02
IPR02
R/W
H'0000
H'FFFE081A
16, 32
Interrupt priority register 06
IPR06
R/W
H'0000
H'FFFE0C00
16, 32
Interrupt priority register 07
IPR07
R/W
H'0000
H'FFFE0C02
16, 32
Interrupt priority register 08
IPR08
R/W
H'0000
H'FFFE0C04
16, 32
Interrupt priority register 09
IPR09
R/W
H'0000
H'FFFE0C06
16, 32
Interrupt priority register 10
IPR10
R/W
H'0000
H'FFFE0C08
16, 32
Interrupt priority register 11
IPR11
R/W
H'0000
H'FFFE0C0A
16, 32
Interrupt priority register 12
IPR12
R/W
H'0000
H'FFFE0C0C
16, 32
Interrupt priority register 13
IPR13
R/W
H'0000
H'FFFE0C0E
16, 32
Interrupt priority register 14
IPR14
R/W
H'0000
H'FFFE0C10
16, 32
Interrupt priority register 15
IPR15
R/W
H'0000
H'FFFE0C12
16, 32
Interrupt priority register 16
IPR16
R/W
H'0000
H'FFFE0C14
16, 32
Notes: 1. When the NMI pin is high, becomes H'8000; when low, becomes H'0000.
2. Only 0 can be written after reading 1, to clear the flag.
Page 136 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.3.1
Section 6 Interrupt Controller (INTC)
Interrupt Priority Registers 01, 02, 06 to 16 (IPR01, IPR02, IPR06 to IPR16)
IPR01, IPR02, and IPR06 to IPR16 are 16-bit readable/writable registers in which priority levels
from 0 to 15 are set for IRQ interrupts, PINT interrupts, and on-chip peripheral module interrupts.
Table 6.3 shows the correspondence between the interrupt request sources and the bits in IPR01,
IPR02, and IPR06 to IPR16.
Bit:
Initial value:
R/W:
Table 6.3
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Interrupt Request Sources and IPR01, IPR02, and IPR06 to IPR16
Register Name
Bits 15 to 12
Bits 11 to 8
Bits 7 to 4
Bits 3 to 0
Interrupt priority
register 01
IRQ0
IRQ1
IRQ2
IRQ3
Interrupt priority
register 02
IRQ4
IRQ5
IRQ6
IRQ7
Interrupt priority
register 06
DMAC0
DMAC1
DMAC2
DMAC3
Interrupt priority
register 07
DMAC4
DMAC5
DMAC6
DMAC7
Interrupt priority
register 08
USB
Reserved
CMT0
CMT1
WDT
HIF0
HIF1
C[0]I
C[1]I
Reserved
Reserved
FECI
Reserved
Interrupt priority BSC
register 09
Interrupt priority ADM1I
register 10
Interrupt priority Reserved
register 11
Interrupt priority
register 12
ETC
IIC3
Reserved
STIF0
Interrupt priority
register 13
STIF1
SCIF0
SCIF1
SCIF2
Interrupt priority
register 14
Reserved
Reserved
Reserved
SSI0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 137 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
Register Name
Bits 15 to 12
Bits 11 to 8
Bits 7 to 4
Bits 3 to 0
Interrupt priority
register 15
SSI1
Reserved
Reserved
Reserved
Interrupt priority
register 16
Reserved
SDHI
Reserved
Reserved
As shown in table 6.3, by setting the 4-bit groups (bits 15 to 12, bits 11 to 8, bits 7 to 4, and bits 3
to 0) with values from H'0 (0000) to H'F (1111), the priority of each corresponding interrupt is set.
Setting of H'0 means priority level 0 (the lowest level) and H'F means priority level 15 (the
highest level).
IPR01, IPR02, and IPR06 to IPR16 are initialized to H'0000 by a power-on reset.
Page 138 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.3.2
Section 6 Interrupt Controller (INTC)
Interrupt Control Register 0 (ICR0)
ICR0 is a 16-bit register that sets the input signal detection mode for the external interrupt input
pin NMI, and indicates the input level at the NMI pin. ICR0 is initialized by a power-on reset.
Bit:
Initial value:
R/W:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
NMIL
-
-
-
-
-
-
NMIE
-
-
-
-
-
-
-
-
*
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Note: * 1 when the NMI pin is high, and 0 when the NMI pin is low.
Bit
Bit Name
Initial
Value
R/W
Description
15
NMIL
*
R
NMI Input Level
Sets the level of the signal input at the NMI pin. The
NMI pin level can be obtained by reading this bit. This
bit cannot be modified.
0: Low level is input to NMI pin
1: High level is input to NMI pin
14 to 9
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
8
NMIE
0
R/W
NMI Edge Select
Selects whether the falling or rising edge of the
interrupt request signal on the NMI pin is detected.
0: Interrupt request is detected on falling edge of NMI
input
1: Interrupt request is detected on rising edge of NMI
input
7 to 0
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 139 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.3.3
Interrupt Control Register 1 (ICR1)
ICR1 is a 16-bit register that specifies the detection mode for external interrupt input pins IRQ7 to
IRQ0 individually: low level, falling edge, rising edge, or both edges. ICR1 is initialized by a
power-on reset.
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
IRQ71S IRQ70S IRQ61S IRQ60S IRQ51S IRQ50S IRQ41S IRQ40S IRQ31S IRQ30S IRQ21S IRQ20S IRQ11S IRQ10S IRQ01S IRQ00S
Initial value:
R/W:
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
15
IRQ71S
0
R/W
IRQ Sense Select
14
IRQ70S
0
R/W
13
IRQ61S
0
R/W
These bits select whether interrupt signals
corresponding to pins IRQ7 to IRQ0 are detected by a
low level, falling edge, rising edge, or both edges.
12
IRQ60S
0
R/W
11
IRQ51S
0
R/W
10
IRQ50S
0
R/W
9
IRQ41S
0
R/W
8
IRQ40S
0
R/W
7
IRQ31S
0
R/W
6
IRQ30S
0
R/W
5
IRQ21S
0
R/W
4
IRQ20S
0
R/W
3
IRQ11S
0
R/W
2
IRQ10S
0
R/W
1
IRQ01S
0
R/W
0
IRQ00S
0
R/W
00: Interrupt request is detected on low level of IRQn
input
01: Interrupt request is detected on falling edge of IRQn
input
10: Interrupt request is detected on rising edge of IRQn
input
11: Interrupt request is detected on both edges of IRQn
input
[Legend]
n = 7 to 0
Page 140 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.3.4
Section 6 Interrupt Controller (INTC)
IRQ Interrupt Request Register (IRQRR)
IRQRR is a 16-bit register that indicates interrupt requests from external input pins IRQ7 to IRQ0.
If edge detection is set for the IRQ7 to IRQ0 interrupts, writing 0 to the IRQ7F to IRQ0F bits after
reading IRQ7F to IRQ0F = 1 cancels the retained interrupts.
IRQRR is initialized by a power-on reset.
Bit:
Initial value:
R/W:
15
14
13
12
11
10
9
8
-
-
-
-
-
-
-
-
IRQ7F IRQ6F IRQ5F IRQ4F IRQ3F IRQ2F IRQ1F IRQ0F
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
0
0
0
0
0
0
0
R/(W)* R/(W)* R/(W)* R/(W)* R/(W)* R/(W)* R/(W)* R/(W)*
Note: * Only 0 can be written to clear the flag after 1 is read.
Bit
Bit Name
Initial
Value
R/W
Description
15 to 8
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 141 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
Bit
Bit Name
Initial
Value
7
IRQ7F
0
6
IRQ6F
0
5
IRQ5F
0
4
IRQ4F
0
3
IRQ3F
0
2
IRQ2F
0
1
IRQ1F
0
0
IRQ0F
0
R/W
Description
R/(W)* IRQ Interrupt Request
R/(W)* These bits indicate the status of the IRQ7 to IRQ0
interrupt requests.
R/(W)*
Level detection:
R/(W)* 0: IRQn interrupt request has not occurred
R/(W)* [Clearing condition]
R/(W)* • IRQn input is high
R/(W)* 1: IRQn interrupt has occurred
[Setting condition]
R/(W)*
• IRQn input is low
Edge detection:
0: IRQn interrupt request is not detected
[Clearing conditions]
•
Cleared by reading IRQnF while IRQnF = 1, then
writing 0 to IRQnF
•
Cleared by executing IRQn interrupt exception
handling
1: IRQn interrupt request is detected
[Setting condition]
•
Edge corresponding to IRQn1S or IRQn0S of
ICR1 has occurred at IRQn pin
[Legend]
n = 7 to 0
Page 142 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.3.5
Section 6 Interrupt Controller (INTC)
Bank Control Register (IBCR)
IBCR is a 16-bit register that enables or disables use of register banks for each interrupt priority
level. IBCR is initialized to H'0000 by a power-on reset.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
E15
E14
E13
E12
E11
E10
E9
E8
E7
E6
E5
E4
E3
E2
E1
-
Initial value:
R/W:
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R
Bit
Bit Name
Initial
Value
R/W
Description
15
E15
0
R/W
Enable
14
E14
0
R/W
13
E13
0
R/W
These bits enable or disable use of register banks for
interrupt priority levels 15 to 1. However, use of register
banks is always disabled for the user break interrupts.
12
E12
0
R/W
11
E11
0
R/W
10
E10
0
R/W
9
E9
0
R/W
8
E8
0
R/W
7
E7
0
R/W
6
E6
0
R/W
5
E5
0
R/W
4
E4
0
R/W
3
E3
0
R/W
2
E2
0
R/W
1
E1
0
R/W
0
⎯
0
R
Bit:
0: Use of register banks is disabled
1: Use of register banks is enabled
Reserved
This bit is always read as 0. The write value should
always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 143 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.3.6
Bank Number Register (IBNR)
IBNR is a 16-bit register that enables or disables use of register banks and register bank overflow
exception. IBNR also indicates the bank number to which saving is performed next through the
bits BN3 to BN0.
IBNR is initialized to H'0000 by a power-on reset.
15
Bit:
14
BE[1:0]
Initial value:
R/W:
0
R/W
0
R/W
13
12
11
10
9
8
7
6
5
4
BOVE
-
-
-
-
-
-
-
-
-
0
R/W
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit
Initial
Bit Name Value
R/W
Description
15, 14
BE[1:0]
R/W
Register Bank Enable
00
3
2
1
0
BN[3:0]
0
R
0
R
0
R
0
R
These bits enable or disable use of register banks.
00: Use of register banks is disabled for all interrupts. The
setting of IBCR is ignored.
01: Use of register banks is enabled for all interrupts except
NMI and user break. The setting of IBCR is ignored.
10: Reserved (setting prohibited)
11: Use of register banks is controlled by the setting of IBCR.
13
BOVE
0
R/W
Register Bank Overflow Enable
Enables of disables register bank overflow exception.
0: Generation of register bank overflow exception is disabled
1: Generation of register bank overflow exception is enabled
12 to 4 ⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
3 to 0
BN[3:0]
0000
R
Bank Number
These bits indicate the bank number to which saving is
performed next. When an interrupt using register banks is
accepted, saving is performed to the register bank indicated
by these bits, and BN is incremented by 1. After BN is
decremented by 1 due to execution of a RESBANK (restore
from register bank) instruction, restoration from the register
bank is performed.
Page 144 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.4
Section 6 Interrupt Controller (INTC)
Interrupt Sources
There are five types of interrupt sources: NMI, user break, H-UDI, IRQ, and on-chip peripheral
modules. Each interrupt has a priority level (0 to 16), with 0 the lowest and 16 the highest. When
set to level 0, that interrupt is masked at all times.
6.4.1
NMI Interrupt
The NMI interrupt has a priority level of 16 and is accepted at all times. NMI interrupt requests
are edge-detected, and the NMI edge select bit (NMIE) in interrupt control register 0 (ICR0)
selects whether the rising edge or falling edge is detected.
Though the priority level of the NMI interrupt is 16, the NMI interrupt exception handling sets the
interrupt mask level bits (I3 to I0) in the status register (SR) to level 15.
6.4.2
User Break Interrupt
A user break interrupt which occurs when a break condition set in the user break controller (UBC)
matches has a priority level of 15. The user break interrupt exception handling sets the I3 to I0 bits
in SR to level 15. For user break interrupts, see section 25, User Break Controller (UBC).
6.4.3
H-UDI Interrupt
The high-performance user debugging interface (H-UDI) interrupt has a priority level of 15, and
occurs at serial input of an H-UDI interrupt instruction. H-UDI interrupt requests are edgedetected and retained until they are accepted. The H-UDI interrupt exception handling sets the I3
to I0 bits in SR to level 15. For H-UDI interrupts, see section 26, High-Performance User
Debugging Interface (H-UDI).
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 145 of 1278
Section 6 Interrupt Controller (INTC)
6.4.4
SH7670 Group
IRQ Interrupts
IRQ interrupts are input from pins IRQ7 to IRQ0. For the IRQ interrupts, low-level, falling-edge,
rising-edge, or both-edge detection can be selected individually for each pin by the IRQ sense
select bits (IRQ71S to IRQ01S and IRQ70S to IRQ00S) in interrupt control register 1 (ICR1). The
priority level can be set individually in a range from 0 to 15 for each pin by interrupt priority
registers 01 and 02 (IPR01 and IPR02).
When using low-level sensing for IRQ interrupts, an interrupt request signal is sent to the INTC
while the IRQ7 to IRQ0 pins are low. An interrupt request signal is stopped being sent to the
INTC when the IRQ7 to IRQ0 pins are driven high. The status of the interrupt requests can be
checked by reading the IRQ interrupt request bits (IRQ7F to IRQ0F) in the IRQ interrupt request
register (IRQRR).
When using edge-sensing for IRQ interrupts, an interrupt request is detected due to change of the
IRQ7 to IRQ0 pin states, and an interrupt request signal is sent to the INTC. The result of IRQ
interrupt request detection is retained until that interrupt request is accepted. Whether IRQ
interrupt requests have been detected or not can be checked by reading the IRQ7F to IRQ0F bits in
IRQRR. Writing 0 to these bits after reading them as 1 clears the result of IRQ interrupt request
detection.
The IRQ interrupt exception handling sets the I3 to I0 bits in SR to the priority level of the
accepted IRQ interrupt.
When returning from IRQ interrupt exception service routine, execute the RTE instruction after
confirming that the interrupt request has been cleared by the IRQ interrupt request register
(IRQRR) so as not to accidentally receive the interrupt request again.
Page 146 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.4.5
Section 6 Interrupt Controller (INTC)
On-Chip Peripheral Module Interrupts
On-chip peripheral module interrupts are generated by the following on-chip peripheral modules:
•
•
•
•
•
•
•
•
•
•
•
•
•
Direct memory access controller (DMAC)
Ethernet controller (EtherC)
Compare match timer (CMT)
Bus state controller (BSC)
Watchdog timer (WDT)
DMAC with encryption/decryption and forward error correction core (A-DMAC)
Stream interface (STIF)
Host interface (HIF)
Serial sound interface (SSI)
SD host interface (SDHI)
USB2.0 host/function module (USB)
I2C bus interface 3 (IIC3)
Serial communication interface with FIFO (SCIF)
As every source is assigned a different interrupt vector, the source does not need to be identified in
the exception service routine. A priority level in a range from 0 to 15 can be set for each module
by interrupt priority registers 06 to 16 (IPR06 to IPR16). The on-chip peripheral module interrupt
exception handling sets the I3 to I0 bits in SR to the priority level of the accepted on-chip
peripheral module interrupt.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 147 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.5
Interrupt Exception Handling Vector Table and Priority
Table 6.4 lists interrupt sources and their vector numbers, vector table address offsets, and
interrupt priorities.
Each interrupt source is allocated a different vector number and vector table address offset. Vector
table addresses are calculated from the vector numbers and vector table address offsets. In
interrupt exception handling, the interrupt exception service routine start address is fetched from
the vector table indicated by the vector table address. For details of calculation of the vector table
address, see table 5.4, Calculating Exception Handling Vector Table Addresses, in section 5,
Exception Handling.
The priorities of IRQ interrupts, and on-chip peripheral module interrupts can be set freely
between 0 and 15 for each pin or module by setting interrupt priority registers 01, 02, and 06 to 16
(IPR01, IPR02, and IPR06 to IPR16). However, if two or more interrupts specified by the same
IPR among IPR06 to IPR16 occur, the priorities are defined as shown in the IPR setting unit
internal priority of table 6.4, and the priorities cannot be changed. A power-on reset assigns
priority level 0 to IRQ interrupts, and on-chip peripheral module interrupts. If the same priority
level is assigned to two or more interrupt sources and interrupts from those sources occur
simultaneously, they are processed by the default priorities indicated in table 6.4.
Page 148 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Table 6.4
Section 6 Interrupt Controller (INTC)
Interrupt Exception Handling Vectors and Priorities
Interrupt Vector
Interrupt Source Number Vector
Interrupt
Vector Table
Priority
Corresponding
Address Offset (Initial Value) IPR (Bit)
IPR
Setting
Unit
Internal
Priority
Default
Priority
High
NMI
11
H'0000002C to
H'0000002F
16
⎯
⎯
User break
12
H'00000030 to
H'00000033
15
⎯
⎯
H-UDI
14
H'00000038 to
H'0000003B
15
⎯
⎯
IRQ0
64
H'00000100 to
H'00000103
0 to 15 (0)
IPR01 (15 to 12) ⎯
IRQ1
65
H'00000104 to
H'00000107
0 to 15 (0)
IPR01 (11 to 8)
⎯
IRQ2
66
H'00000108 to
H'0000010B
0 to 15 (0)
IPR01 (7 to 4)
⎯
IRQ3
67
H'0000010C to
H'0000010F
0 to 15 (0)
IPR01 (3 to 0)
⎯
IRQ4
68
H'00000110 to
H'00000113
0 to 15 (0)
IPR02 (15 to 12) ⎯
IRQ5
69
H'00000114 to
H'00000117
0 to 15 (0)
IPR02 (11 to 8)
⎯
IRQ6
70
H'00000118 to
H'0000011B
0 to 15 (0)
IPR02 (7 to 4)
⎯
IRQ7
71
H'0000011C to
H'0000011F
0 to 15 (0)
IPR02 (3 to 0)
⎯
DEI0
108
H'000001B0 to
H'000001B3
0 to 15 (0)
IPR06 (15 to 12) 1
HEI0
109
H'000001B4 to
H'000001B7
DEI1
112
H'000001C0 to
H'000001C3
HEI1
113
H'000001C4 to
H'000001C7
IRQ
DMAC0
DMAC1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
2
0 to 15 (0)
IPR06 (11 to 8)
1
2
Low
Page 149 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
Interrupt Vector
Interrupt Source Number Vector
DMAC2
Interrupt
Vector Table
Priority
Corresponding
Address Offset (Initial Value) IPR (Bit)
1
High
116
H'000001D0 to
H'000001D3
HEI2
117
H'000001D4 to
H'000001D7
DEI3
120
H'000001E0 to
H'000001E3
HEI3
121
H'000001E4 to
H'000001E7
DEI4
124
H'000001F0 to
H'000001F3
HEI4
125
H'000001F4 to
H'000001F7
DEI5
128
H'00000200 to
H'00000203
HEI5
129
H'00000204 to
H'00000207
DEI6
132
H'00000210 to
H'00000213
HEI6
133
H'00000214 to
H'00000217
DEI7
136
H'00000220 to
H'00000223
HEI7
137
H'00000224 to
H'00000227
USB
USBI
140
H'00000230 to
H'00000233
0 to 15 (0)
IPR08 (15 to 12) ⎯
CMT
CMI0
142
H'00000238 to
H'0000023B
0 to 15 (0)
IPR08 (7 to 4)
⎯
CMI1
143
H'0000023C to
H'0000023F
0 to 15 (0)
IPR08 (3 to 0)
⎯
BSC
CMI
144
H'00000240 to
H'00000243
0 to 15 (0)
IPR09 (15 to 12) ⎯
WDT
ITI
145
H'00000244 to
H'00000247
0 to 15 (0)
IPR09 (11 to 8)
DMAC4
DMAC5
DMAC6
DMAC7
Page 150 of 1278
IPR06 (7 to 4)
Default
Priority
DEI2
DMAC3
0 to 15 (0)
IPR
Setting
Unit
Internal
Priority
2
0 to 15 (0)
IPR06 (3 to 0)
1
2
0 to 15 (0)
IPR07 (15 to 12) 1
2
0 to 15 (0)
IPR07 (11 to 8)
1
2
0 to 15 (0)
IPR07 (7 to 4)
1
2
0 to 15 (0)
IPR07 (3 to 0)
1
2
⎯
Low
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 6 Interrupt Controller (INTC)
Interrupt Vector
Interrupt Source Number Vector
Interrupt
Vector Table
Priority
Corresponding
Address Offset (Initial Value) IPR (Bit)
IPR
Setting
Unit
Internal
Priority
Default
Priority
High
HIFI
146
H'00000248 to
H'0000024B
0 to 15 (0)
IPR09 (7 to 4)
⎯
HIFBI
150
H'00000258 to
H'0000025B
0 to 15 (0)
IPR09 (3 to 0)
⎯
153
H'00000264 to
H'00000267
0 to 15 (0)
IPR10 (15 to 12) ⎯
C[0]I
155
H'0000026C to
H'0000026F
0 to 15 (0)
IPR10 (11 to 8)
⎯
C[1]I
157
H'00000274 to
H'00000277
0 to 15 (0)
IPR10 (7 to 4)
⎯
FECI
159
H'0000027C to
H'0000027F
0 to 15 (0)
IPR11 (7 to 4)
⎯
ETC
EINT0
171
H'000002AC to
H'000002AF
0 to 15 (0)
IPR12 (15 to 12) ⎯
IIC3-0
STPI0
172
H'000002B0 to
H'000002B3
0 to 15 (0)
IPR12 (11 to 8)
NAKI0
173
H'000002B4 to
H'000002B7
2
RXI0
174
H'000002B8 to
H'000002BB
3
TXI0
175
H'000002BC to
H'000002BF
4
TEI0
176
H'000002C0 to
H'000002C3
5
STI0
182
H'000002D8 to
H'000002DB
0 to 15 (0)
IPR12 (3 to 0)
STI1
187
H'000002EC to
H'000002EF
0 to 15 (0)
IPR13 (15 to 12) ⎯
HIF
A-DMAC ADM1I
STIF
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
1
⎯
Low
Page 151 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
Interrupt Vector
Interrupt Source Number Vector
SCIF0
Interrupt
Vector Table
Priority
Corresponding
Address Offset (Initial Value) IPR (Bit)
0 to 15 (0)
IPR13 (11 to 8)
IPR
Setting
Unit
Internal
Priority
Default
Priority
1
High
BRI0
192
H'00000300 to
H'00000303
ERI0
193
H'00000304 to
H'00000307
2
RXI0
194
H'00000308 to
H'0000030B
3
TXI0
195
H'0000030C to
H'0000030F
4
BRI1
196
H'00000310 to
H'00000313
ERI1
197
H'00000314 to
H'00000317
2
RXI1
198
H'00000318 to
H'0000031B
3
TXI1
199
H'0000031C to
H'0000031F
4
BRI2
200
H'00000320 to
H'00000323
ERI2
201
H'00000324 to
H'00000327
2
RXI2
202
H'00000328 to
H'0000032B
3
TXI2
203
H'0000032C to
H'0000032F
4
SSI0
SSII0
214
H'00000358 to
H'0000035B
0 to 15 (0)
IPR14 (3 to 0)
SSI1
SSII1
215
H'0000035C to
H'0000035F
0 to 15 (0)
IPR15 (15 to 12) ⎯
SDIO
SDII3
228
H'00000390 to
H'00000393
0 to 15 (0)
IPR16 (11 to 8)
SDII0
229
H'00000394 to
H'00000397
2
SDII1
230
H'00000398 to
H'0000039B
3
SCIF1
SCIF2
Page 152 of 1278
0 to 15 (0)
0 to 15 (0)
IPR13 (7 to 4)
IPR13 (3 to 0)
1
1
⎯
1
Low
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.6
Operation
6.6.1
Interrupt Operation Sequence
Section 6 Interrupt Controller (INTC)
The sequence of interrupt operations is described below. Figure 6.2 shows the operation flow.
1. The interrupt request sources send interrupt request signals to the interrupt controller.
2. The interrupt controller selects the highest-priority interrupt from the interrupt requests sent,
following the priority levels set in interrupt priority registers 01, 02, and 06 to 16 (IPR01,
IPR02, and IPR06 to IPR16). Lower priority interrupts are ignored*. If two of these interrupts
have the same priority level or if multiple interrupts occur within a single IPR, the interrupt
with the highest priority is selected, according to the default priority and IPR setting unit
internal priority shown in table 6.4.
3. The priority level of the interrupt selected by the interrupt controller is compared with the
interrupt level mask bits (I3 to I0) in the status register (SR) of the CPU. If the interrupt
request priority level is equal to or less than the level set in bits I3 to I0, the interrupt request is
ignored. If the interrupt request priority level is higher than the level in bits I3 to I0, the
interrupt controller accepts the interrupt and sends an interrupt request signal to the CPU.
5. The CPU detects the interrupt request sent from the interrupt controller when the CPU decodes
the instruction to be executed. Instead of executing the decoded instruction, the CPU starts
interrupt exception handling (figure 6.4).
6. The interrupt exception service routine start address is fetched from the exception handling
vector table corresponding to the accepted interrupt.
7. The status register (SR) is saved onto the stack, and the priority level of the accepted interrupt
is copied to bits I3 to I0 in SR.
8. The program counter (PC) is saved onto the stack.
9. The CPU jumps to the fetched interrupt exception service routine start address and starts
executing the program. The jump that occurs is not a delayed branch.
10. A high level is output from the IRQOUT pin. However, if the interrupt controller accepts an
interrupt with a higher priority than the interrupt just being accepted, the IRQOUT pin holds
low level.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 153 of 1278
Section 6 Interrupt Controller (INTC)
SH7670 Group
Notes: The interrupt source flag should be cleared in the interrupt handler. After clearing the
interrupt source flag, "time from occurrence of interrupt request until interrupt controller
identifies priority, compares it with mask bits in SR, and sends interrupt request signal to
CPU" shown in table 6.5 is required before the interrupt source sent to the CPU is actually
cancelled. To ensure that an interrupt request that should have been cleared is not
inadvertently accepted again, read the interrupt source flag after it has been cleared, and
then execute an RTE instruction.
* Interrupt requests that are designated as edge-sensing are held pending until the
interrupt requests are accepted. IRQ interrupts, however, can be cancelled by accessing
the IRQ interrupt request register (IRQRR). For details, see section 6.4.4, IRQ
Interrupts.
Interrupts held pending due to edge-sensing are cleared by a power-on reset.
Page 154 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 6 Interrupt Controller (INTC)
Program
execution state
No
Interrupt?
Yes
No
NMI?
Yes
No
User break?
Yes
No
H-UDI
interrupt?
Yes
Level 15
interrupt?
Yes
Yes
No
Level 14
interrupt?
I3 to I0 ≤
level 14?
No
No
Yes
Level 1
interrupt?
I3 to I0 ≤
level 13?
No
No
Yes
Yes
I3 to I0 =
level 0?
No
IRQOUT = low
Read exception
handling vector table
Save SR to stack
Copy accept-interrupt
level to I3 to I0
Save PC to stack
Branch to interrupt
exception service routine
IRQOUT = high
Figure 6.2 Interrupt Operation Flow
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 155 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.6.2
Stack after Interrupt Exception Handling
Figure 6.3 shows the stack after interrupt exception handling.
Address
4n – 8
PC*1
32 bits
4n – 4
SR
32 bits
SP*2
4n
Notes:
1.
2.
PC: Start address of the next instruction (return destination instruction)
after the executed instruction
Always make sure that SP is a multiple of 4.
Figure 6.3 Stack after Interrupt Exception Handling
Page 156 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.7
Section 6 Interrupt Controller (INTC)
Interrupt Response Time
Table 6.5 lists the interrupt response time, which is the time from the occurrence of an interrupt
request until the interrupt exception handling starts and fetching of the first instruction in the
exception service routine begins. The interrupt processing operations differ in the cases when
banking is disabled, when banking is enabled without register bank overflow, and when banking is
enabled with register bank overflow. Figures 6.4 and 6.5 show examples of pipeline operation
when banking is disabled. Figures 6.6 and 6.7 show examples of pipeline operation when banking
is enabled without register bank overflow. Figures 6.8 and 6.9 show examples of pipeline
operation when banking is enabled with register bank overflow.
Table 6.5
Interrupt Response Time
Number of States
Peripheral
Item
NMI
User Break
H-UDI
IRQ, PINT
Module
Time from occurrence of interrupt
request until interrupt controller
identifies priority, compares it with
mask bits in SR, and sends interrupt
request signal to CPU
2 Icyc +
2 Bcyc +
1 Pcyc
3 Icyc
2 Icyc +
1 Pcyc
2 Icyc +
3 Bcyc +
1 Pcyc
2 Icyc +
1 Bcyc +
1 Pcyc
Time from
No register
Min.
3 Icyc + m1 + m2
input of
interrupt
request signal
to CPU until
sequence
currently being
executed is
completed,
interrupt
exception
handling starts,
and first
instruction in
interrupt
exception
service routine
is fetched
banking
Max.
4 Icyc + 2(m1 + m2) + m3
Min.
⎯
3 Icyc + m1 + m2
Max.
⎯
12 Icyc + m1 + m2
Min.
⎯
3 Icyc + m1 + m2
⎯
3 Icyc + m1 + m2 + 19(m4)
Register
banking
without
register
bank
overflow
Register
banking
Max.
with register
bank
overflow
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Remarks
Min. is when the interrupt
wait time is zero.
Max. is when a higher-priority
interrupt request has
occurred during interrupt
exception handling.
Min. is when the interrupt
wait time is zero.
Max. is when an interrupt
request has occurred during
execution of the RESBANK
instruction.
Min. is when the interrupt
wait time is zero.
Max. is when an interrupt
request has occurred during
execution of the RESBANK
instruction.
Page 157 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
Number of States
Item
Interrupt
No register
response time
banking
Min.
Max.
Register
banking
without
register
bank
overflow
Register
banking
with register
bank
overflow
Min.
Max.
Min.
Max.
NMI
User Break
H-UDI
IRQ, PINT
Peripheral
Module
Remarks
5 Icyc +
6 Icyc +
5 Icyc +
5 Icyc +
5 Icyc +
200-MHz operation*1*2:
2 Bcyc +
1 Pcyc +
m1 + m2
m1 + m2
1 Pcyc +
m1 + m2
3 Bcyc +
1 Pcyc +
m1 + m2
1 Bcyc +
1 Pcyc +
m1 + m2
0.040 to 0.110 μs
6 Icyc +
7 Icyc +
6 Icyc +
6 Icyc +
6 Icyc +
200-MHz operation*1*2:
2 Bcyc +
1 Pcyc +
2(m1 + m2) +
m3
2(m1 + m2) +
m3
1 Pcyc +
2(m1 + m2) +
m3
3 Bcyc +
1 Pcyc +
2(m1 + m2) +
m3
1 Bcyc +
1 Pcyc +
2(m1 + m2) +
m3
0.060 to 0.130 μs
⎯
⎯
5 Icyc +
5 Icyc +
5 Icyc +
200-MHz operation*1*2:
1 Pcyc +
m1 + m2
3 Bcyc +
1 Pcyc +
m1 + m2
1 Bcyc +
1 Pcyc +
m1 + m2
0.040 to 0.110 μs
14 Icyc +
14 Icyc +
14 Icyc +
200-MHz operation*1*2:
1 Pcyc +
m1 + m2
3 Bcyc +
1 Pcyc +
m1 + m2
1 Bcyc +
1 Pcyc +
m1 + m2
0.085 to 0.155 μs
5 Icyc +
5 Icyc +
5 Icyc +
200-MHz operation*1*2:
1 Pcyc +
3 Bcyc +
1 Bcyc +
0.040 to 0.110 μs
m1 + m2
1 Pcyc +
m1 + m2
1 Pcyc +
m1 + m2
5 Icyc +
5 Icyc +
5 Icyc +
⎯
⎯
⎯
⎯
⎯
⎯
200-MHz operation*1*2:
1 Pcyc + m1 + 3 Bcyc +
1 Bcyc +
0.135 to 0.205 μs
m2 + 19(m4) 1 Pcyc + m1 + 1 Pcyc + m1 +
m2 + 19(m4) m2 + 19(m4)
Notes: m1 to m4 are the number of states needed for the following memory accesses.
m1: Vector address read (longword read)
m2: SR save (longword write)
m3: PC save (longword write)
m4: Banked registers (R0 to R14, GBR, MACH, MACL, and PR) are restored from the
stack.
1. In the case that m1 = m2 = m3 = m4 = 1 Icyc.
2. In the case that (Iφ, Bφ, Pφ) = (200 MHz, 66 MHz, 33 MHz).
Page 158 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 6 Interrupt Controller (INTC)
Interrupt acceptance
3 Icyc + m1 + m2
2 Icyc + 3 Bcyc + 1 Pcyc
3 Icyc
m1
m2
m3
M
M
M
IRQ
Instruction (instruction replacing
interrupt exception handling)
First instruction in interrupt exception
service routine
F
D
E
E
F
D
E
[Legend]
m1: Vector address read
m2: Saving of SR (stack)
m3: Saving of PC (stack)
F:
Instruction fetch. Instruction is fetched from memory in which program is stored.
D:
Instruction decoding. Fetched instruction is decoded.
E:
Instruction execution. Data operation or address calculation is performed in accordance with the result of decoding.
M:
Memory access. Memory data access is performed.
Figure 6.4 Example of Pipeline Operation when IRQ Interrupt is Accepted
(No Register Banking)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 159 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
2 Icyc + 3 Bcyc + 1 Pcyc
1 Icyc + m1 + 2(m2) + m3
3 Icyc + m1
IRQ
F
D
E
E
m1
m2
m3
M
M
M
First instruction in interrupt exception
service routine
First instruction in multiple interrupt
exception service routine
D
F
D
E
E
m1
m2
M
M
M
F
D
Multiple interrupt acceptance
Interrupt acceptance
[Legend]
m1: Vector address read
m2: Saving of SR (stack)
m3: Saving of PC (stack)
Figure 6.5 Example of Pipeline Operation for Multiple Interrupts
(No Register Banking)
Interrupt acceptance
3 Icyc + m1 + m2
2 Icyc + 3 Bcyc + 1 Pcyc
3 Icyc
m1
m2
m3
M
M
M
E
F
D
IRQ
Instruction (instruction replacing
interrupt exception handling)
First instruction in interrupt exception
service routine
F
D
E
E
E
[Legend]
m1: Vector address read
m2: Saving of SR (stack)
m3: Saving of PC (stack)
Figure 6.6 Example of Pipeline Operation when IRQ Interrupt is Accepted
(Register Banking without Register Bank Overflow)
Page 160 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 6 Interrupt Controller (INTC)
2 Icyc + 3 Bcyc + 1 Pcyc
9 Icyc
3 Icyc + m1 + m2
IRQ
F
RESBANK instruction
D
E
E
E
E
E
E
E
E
Instruction (instruction replacing
interrupt exception handling)
E
D
E
E
m1
m2
m3
M
M
M
E
F
D
First instruction in interrupt
exception service routine
Interrupt acceptance
[Legend]
m1:
m2:
m3:
Vector address read
Saving of SR (stack)
Saving of PC (stack)
Figure 6.7 Example of Pipeline Operation when Interrupt is Accepted during RESBANK
Instruction Execution (Register Banking without Register Bank Overflow)
Interrupt acceptance
3 Icyc + m1 + m2
2 Icyc + 3 Bcyc + 1 Pcyc
3 Icyc
m1
m2
m3
M
M
M
...
M
F
...
...
IRQ
Instruction (instruction replacing
interrupt exception handling)
First instruction in interrupt exception
service routine
F
D
E
E
D
[Legend]
m1: Vector address read
m2: Saving of SR (stack)
m3: Saving of PC (stack)
Figure 6.8 Example of Pipeline Operation when IRQ Interrupt is Accepted
(Register Banking with Register Bank Overflow)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 161 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
2 Icyc + 3 Bcyc + 1 Pcyc
2 Icyc + 17(m4)
1 Icyc + m1 + m2 + 2(m4)
IRQ
RESBANK instruction
F
D
Instruction (instruction replacing
interrupt exception handling)
E
M
M
M
...
M
m4
m4
M
M
W
D
E
E
First instruction in interrupt
exception service routine
m1
m2
m3
M
M
M
...
F
...
D
Interrupt acceptance
[Legend]
m1:
m2:
m3:
m4:
Vector address read
Saving of SR (stack)
Saving of PC (stack)
Restoration of banked registers
Figure 6.9 Example of Pipeline Operation when Interrupt is Accepted during RESBANK
Instruction Execution (Register Banking with Register Bank Overflow)
Page 162 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.8
Section 6 Interrupt Controller (INTC)
Register Banks
This LSI has fifteen register banks used to perform register saving and restoration required in the
interrupt processing at high speed. Figure 6.10 shows the register bank configuration.
Registers
Register banks
General
registers
R0
R1
:
:
R0
R1
Interrupt generated
(save)
R14
R15
Bank 0
Bank 1
....
:
:
Bank 14
R14
GBR
Control
registers
System
registers
SR
GBR
VBR
TBR
MACH
MACL
PR
PC
RESBANK
instruction
(restore)
MACH
MACL
PR
VTO
Bank control registers (interrupt controller)
Bank control register
IBCR
Bank number register
IBNR
: Banked register
Note:
VTO:
Vector table address offset
Figure 6.10 Overview of Register Bank Configuration
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 163 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.8.1
(1)
Banked Register and Input/Output of Banks
Banked Register
The contents of the general registers (R0 to R14), global base register (GBR), multiply and
accumulate registers (MACH and MACL), and procedure register (PR), and the vector table
address offset are banked.
(2)
Input/Output of Banks
This LSI has fifteen register banks, bank 0 to bank 14. Register banks are stacked in first-in lastout (FILO) sequence. Saving takes place in order, beginning from bank 0, and restoration takes
place in the reverse order, beginning from the last bank saved to.
6.8.2
(1)
Bank Save and Restore Operations
Saving to Bank
Figure 6.11 shows register bank save operations. The following operations are performed when an
interrupt for which usage of register banks is allowed is accepted by the CPU:
a. Assume that the bank number bit value in the bank number register (IBNR), BN, is i before the
interrupt is generated.
b. The contents of registers R0 to R14, GBR, MACH, MACL, and PR, and the interrupt vector
table address offset (VTO) of the accepted interrupt are saved in the bank indicated by BN,
bank i.
c. The BN value is incremented by 1.
Register banks
+1
(c)
BN
(a)
Bank 0
Bank 1
:
:
Bank i
Bank i + 1
:
:
Registers
R0 to R14
(b)
GBR
MACH
MACL
PR
VTO
Bank 14
Figure 6.11 Bank Save Operations
Page 164 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 6 Interrupt Controller (INTC)
Figure 6.12 shows the timing for saving to a register bank. Saving to a register bank takes place
between the start of interrupt exception handling and the start of fetching the first instruction in the
interrupt exception service routine.
3 Icyc + m1 + m2
2 Icyc + 3 Bcyc + 1 Pcyc
3 Icyc
m1
m2
m3
M
M
M
IRQ
Instruction (instruction replacing
interrupt exception handling)
F
D
E
E
E
(1) VTO, PR, GBR, MACL
(2) R12, R13, R14, MACH
(3) R8, R9, R10, R11
(4) R4, R5, R6, R7
Saved to bank
Overrun fetch
(5) R0, R1, R2, R3
F
First instruction in interrupt exception
service routine
F
D
E
[Legend]
m1: Vector address read
m2: Saving of SR (stack)
m3: Saving of PC (stack)
Figure 6.12 Bank Save Timing
(2)
Restoration from Bank
The RESBANK (restore from register bank) instruction is used to restore data saved in a register
bank. After restoring data from the register banks with the RESBANK instruction at the end of the
interrupt exception service routine, execute the RTE instruction to return from interrupt exception
service routine.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 165 of 1278
Section 6 Interrupt Controller (INTC)
6.8.3
SH7670 Group
Save and Restore Operations after Saving to All Banks
If an interrupt occurs and usage of the register banks is enabled for the interrupt accepted by the
CPU in a state where saving has been performed to all register banks, automatic saving to the
stack is performed instead of register bank saving if the BOVE bit in the bank number register
(IBNR) is cleared to 0. If the BOVE bit in IBNR is set to 1, register bank overflow exception
occurs and data is not saved to the stack.
Save and restore operations when using the stack are as follows:
(1)
Saving to Stack
1. The status register (SR) and program counter (PC) are saved to the stack during interrupt
exception handling.
2. The contents of the banked registers (R0 to R14, GBR, MACH, MACL, and PR) are saved to
the stack. The registers are saved to the stack in the order of MACL, MACH, GBR, PR, R14,
R13, …, R1, and R0.
3. The register bank overflow bit (BO) in SR is set to 1.
4. The bank number bit (BN) value in the bank number register (IBNR) remains set to the
maximum value of 15.
(2)
Restoration from Stack
When the RESBANK (restore from register bank) instruction is executed with the register bank
overflow bit (BO) in SR set to 1, the CPU operates as follows:
1. The contents of the banked registers (R0 to R14, GBR, MACH, MACL, and PR) are restored
from the stack. The registers are restored from the stack in the order of R0, R1, …, R13, R14,
PR, GBR, MACH, and MACL.
2. The bank number bit (BN) value in the bank number register (IBNR) remains set to the
maximum value of 15.
Page 166 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.8.4
Section 6 Interrupt Controller (INTC)
Register Bank Exception
There are two register bank exceptions (register bank errors): register bank overflow and register
bank underflow.
(1)
Register Bank Overflow
This exception occurs if, after data has been saved to all of the register banks, an interrupt for
which register bank use is allowed is accepted by the CPU, and the BOVE bit in the bank number
register (IBNR) is set to 1. In this case, the bank number bit (BN) value in the bank number
register (IBNR) remains set to the bank count of 15 and saving is not performed to the register
bank.
(2)
Register Bank Underflow
This exception occurs if the RESBANK (restore from register bank) instruction is executed when
no data has been saved to the register banks. In this case, the values of R0 to R14, GBR, MACH,
MACL, and PR do not change. In addition, the bank number bit (BN) value in the bank number
register (IBNR) remains set to 0.
6.8.5
Register Bank Error Exception Handling
When a register bank error occurs, register bank error exception handling starts. When this
happens, the CPU operates as follows:
1. The exception service routine start address which corresponds to the register bank error that
occurred is fetched from the exception handling vector table.
2. The status register (SR) is saved to the stack.
3. The program counter (PC) is saved to the stack. The PC value saved is the start address of the
instruction to be executed after the last executed instruction for a register bank overflow, and
the start address of the executed RESBANK instruction for a register bank underflow. To
prevent multiple interrupts from occurring at a register bank overflow, the interrupt priority
level that caused the register bank overflow is written to the interrupt mask level bits (I3 to I0)
of the status register (SR).
4. Program execution starts from the exception service routine start address.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 167 of 1278
SH7670 Group
Section 6 Interrupt Controller (INTC)
6.9
Data Transfer with Interrupt Request Signals
Interrupt request signals can be used to activate the DMAC and transfer data.
Interrupt sources that are designated to activate the DMAC are masked without being input to the
INTC. The mask condition is as follows:
Mask condition = DME • (DE0 • interrupt source select 0 + DE1 • interrupt source select 1
+ DE2 • interrupt source select 2 + DE3 • interrupt source select 3 +
DE4 • interrupt source select 4 + DE5 • interrupt source select 5 + DE6
• interrupt source select 6 + DE7 • interrupt source select 7)
Figure 6.13 shows a block diagram of interrupt control.
Here, DME is bit 0 in DMAOR of the DMAC, and DEn (n = 0 to 7) is bit 0 in CHCR0 to CHCR7
of the DMAC. For details, see section 8, Direct Memory Access Controller (DMAC).
Interrupt source
DMAC
Interrupt source
flag clearing
(by DMAC)
Interrupt source (not specified as DMAC activating source)
CPU interrupt request
INTC
CPU
Figure 6.13 Interrupt Control Block Diagram
Page 168 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
6.9.1
Section 6 Interrupt Controller (INTC)
Handling Interrupt Request Signals as Sources for CPU Interrupt but Not DMAC
Activating
1. Do not select DMAC activating sources or clear the DME bit to 0. If, DMAC activating
sources are selected, clear the DE bit to 0 for the relevant channel of the DMAC.
2. When interrupts occur, interrupt requests are sent to the CPU.
3. The CPU clears the interrupt source and performs the necessary processing in the interrupt
exception service routine.
6.9.2
Handling Interrupt Request Signals as Sources for Activating DMAC but Not CPU
Interrupt
1. Select DMAC activating sources and set both the DE and DME bits to 1. This masks CPU
interrupt sources regardless of the interrupt priority register settings.
2. Activating sources are applied to the DMAC when interrupts occur.
3. The DMAC clears the interrupt sources when starting transfer.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 169 of 1278
Section 6 Interrupt Controller (INTC)
6.10
Usage Note
6.10.1
Timing to Clear an Interrupt Source
SH7670 Group
The interrupt source flags should be cleared in the interrupt exception service routine. After
clearing the interrupt source flag, "time from occurrence of interrupt request until interrupt
controller identifies priority, compares it with mask bits in SR, and sends interrupt request signal
to CPU" shown in table 6.5 is required before the interrupt source sent to the CPU is actually
cancelled. To ensure that an interrupt request that should have been cleared is not inadvertently
accepted again, read the interrupt source flag after it has been cleared, and then execute an RTE
instruction.
Page 170 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Section 7 Bus State Controller (BSC)
The bus state controller (BSC) outputs control signals for various types of memory and external
devices that are connected to the external address space. BSC functions enable this LSI to connect
directly with SRAM, SDRAM, and other memory storage devices, and external devices.
7.1
Features
1. External address space
⎯ A maximum of 64 Mbytes for each of areas CS0 and CS3 to CS6.
⎯ Can specify the normal space interface, SRAM interface with byte selection, SDRAM, and
PCMCIA interface for each address space.
⎯ Can select the data bus width (8, 16, or 32 bits) for each address space.
⎯ Controls insertion of wait cycles for each address space.
⎯ Controls insertion of wait cycles for each read access and write access.
⎯ Can set independent idle cycles during the continuous access for five cases: read-write (in
same space/different spaces), read-read (in same space/different spaces), the first cycle is a
write access.
⎯ For area 0, only big endian is supported.
2. Normal space interface
⎯ Supports the interface that can directly connect to the SRAM.
3. SDRAM interface
⎯ Multiplex output for row address/column address.
⎯ Efficient access by single read/single write.
⎯ High-speed access in bank-active mode.
⎯ Supports an auto-refresh and self-refresh.
⎯ Supports power-down modes.
⎯ Issues MRS and EMRS commands.
4. PCMCIA direct interface
⎯ Supports the IC memory card and I/O card interface defined in JEIDA specifications Ver.
4.2 (PCMCIA2.1 Rev. 2.1).
⎯ Wait-cycle insertion controllable by program.
5. SRAM interface with byte selection
⎯ Can connect directly to a SRAM with byte selection.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 171 of 1278
Section 7 Bus State Controller (BSC)
SH7670 Group
6. Refresh function
⎯ Supports the auto-refresh and self-refresh functions.
⎯ Specifies the refresh interval using the refresh counter and clock selection.
⎯ Can execute concentrated refresh by specifying the refresh counts (1, 2, 4, 6, or 8).
7. Usage as interval timer for refresh counter
⎯ Generates an interrupt request at compare match.
Page 172 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
BREQ
BACK
Bus
mastership
controller
Internal bus
Figure 7.1 shows a block diagram of the BSC.
CMNCR
CS0WCR
...
Wait
controller
...
WAIT
CS7WCR
...
REFOUT
Module bus
CS7BCR
MD
A25 to A0,
D31 to D0
BS, RD/WR,
RD, WE3 to WE0,
RASU, RASL,
CASU, CASL
CKE, DQMxx, AH,
FRAME, IOIS16,
CE2A, CE2B
CS0BCR
...
Area
controller
...
CS0 to CS7
Memory
controller
SDCR
RTCSR
Refresh
controller
RTCNT
Comparator
RTCOR
BSC
[Legend]
CMNCR: Common control register
CSnWCR: CSn space wait control register (n = 0 to 7)
CSnBCR: CSn space bus control register (n = 0 to 7)
SDCR:
SDRAM control register
RTCSR: Refresh timer control/status register
RTCNT: Refresh timer counter
RTCOR: Refresh time constant register
Figure 7.1 Block Diagram of BSC
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 173 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.2
Input/Output Pins
Table 7.1 shows the pin configuration of the BSC.
Table 7.1
Pin Configuration
Name
I/O
Function
A25 to A0
Output Address bus
D31 to D0
I/O
BS
Output Bus cycle start
CS0, CS3, CS4
Output Chip select
CS5/CE1A,
CS6/CE1B
Output Chip select
CE2A, CE2B
Output Function as PCMCIA card select signals for D15 to D8.
RD/WR
Output Read/write
Data bus
Function as PCMCIA card select signals for D7 to D0 when PCMCIA
is used.
Connects to WE pins when SDRAM or SRAM with byte selection is
connected.
RD
Output Read pulse signal (read data output enable signal)
Functions as a strobe signal for indicating memory read cycles when
PCMCIA is used.
WE3/DQMUU/
ICIOWR
Output Indicates that D31 to D24 are being written to.
Connected to the byte select signal when a SRAM with byte
selection is connected.
Functions as the select signals for D31 to D24 when SDRAM is
connected.
Functions as a strobe signal for indicating I/O write cycles when
PCMCIA is used.
WE2/DQMUL/
ICIORD
Output Indicates that D23 to D16 are being written to.
Connected to the byte select signal when a SRAM with byte
selection is connected.
Functions as the select signals for D23 to D16 when SDRAM is
connected.
Functions as a strobe signal for indicating I/O read cycles when
PCMCIA is used.
Page 174 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Name
I/O
Function
WE1/DQMLU/WE
Output Indicates that D15 to D8 are being written to.
Connected to the byte select signal when a SRAM with byte
selection is connected.
Functions as the select signals for D15 to D8 when SDRAM is
connected.
Functions as a strobe signal for indicating memory write cycles when
PCMCIA is used.
WE0/DQMLL
Output Indicates that D7 to D0 are being written to.
Connected to the byte select signal when a SRAM with byte
selection is connected.
Functions as the select signals for D7 to D0 when SDRAM is
connected.
RAS
Output Connects to RAS pin when SDRAM is connected.
CAS
Output Connects to CAS pin when SDRAM is connected.
CKE
Output Connects to CKE pin when SDRAM is connected.
WAIT
Input
External wait input
IOIS16
Input
Indicates 16-bit I/O of PCMIA.
Enabled only in little endian mode. The pin should be driven low in
big endian mode.
MD_BW
Input
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Selects bus width of area 0 and initial bus width of areas 3 to 6.
Page 175 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.3
Area Overview
7.3.1
Address Map
In the architecture, this LSI has a 32-bit address space, which is divided into cache-enabled,
cache-disabled, and on-chip spaces (on-chip RAM, on-chip peripheral modules, and reserved
areas) according to the upper bits of the address.
External address spaces CS0, CS3 to CS6 are cache-enabled when internal address A29 = 0 or
cache-disabled when A29 = 1.
The kind of memory to be connected and the data bus width are specified in each partial space.
The address map for the external address space is listed below.
Table 7.2
Address Map
Internal Address
Space Memory to be Connected
Cache
H'00000000 to H'03FFFFFF
CS0
Normal space, SRAM with byte selection
Cache-enabled
H'04000000 to H'07FFFFFF
Other
Reserved area
H'08000000 to H'0BFFFFFF Other
Reserved area
H'0C000000 to H'0FFFFFFF CS3
Normal space, SRAM with byte selection, SDRAM
H'10000000 to H'13FFFFFF
CS4
Normal space, SRAM with byte selection
H'14000000 to H'17FFFFFF
CS5
Normal space, SRAM with byte selection, PCMCIA
H'18000000 to H'1BFFFFFF CS6
Normal space, SRAM with byte selection, PCMCIA
H'1C000000 to H'1FFFFFFF Other
Reserved area
H'20000000 to H'23FFFFFF
CS0
Normal space, SRAM with byte selection,
burst ROM (asynchronous or synchronous)
H'24000000 to H'27FFFFFF
Other
Reserved area
H'28000000 to H'2BFFFFFF Other
Reserved area
H'2C000000 to H'2FFFFFFF CS3
Normal space, SRAM with byte selection, SDRAM
H'30000000 to H'33FFFFFF
CS4
Normal space, SRAM with byte selection
H'34000000 to H'37FFFFFF
CS5
Normal space, SRAM with byte selection, PCMCIA
H'38000000 to H'3BFFFFFF CS6
Normal space, SRAM with byte selection, PCMCIA
H'3C000000 to H'3FFFFFFF Other
Reserved area
Page 176 of 1278
Cache-disabled
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Internal Address
Space Memory to be Connected
Cache
H'80000000 to H'FFFBFFFF Other
On-chip RAM, reserved area*
⎯
H'FFFC0000 to H'FFFFFFFF Other
On-chip peripheral modules, reserved area*
⎯
Note:
*
7.3.2
For the on-chip RAM space, access the addresses shown in section 27, On-Chip RAM.
For the on-chip peripheral module space, access the addresses shown in section 28,
List of Registers. Do not access addresses which are not described in these sections.
Otherwise, the correct operation cannot be guaranteed.
Data Bus Width and Pin Function Setting in Each Area
In this LSI, the data bus width of area 0 and the initial data bus width of areas 3 to 6 can be set to
8, or 16 bits through external pins during a power-on reset. The bus width of area 0 cannot be
modified after a power-on reset. The initial data bus width of areas 3 to 6 is set to the same size as
that of area 0, but can be modified to 8, 16, or 32 bits through register settings during program
execution. Note that the selectable data bus widths may be limited depending on the connected
memory type.
After a power-on reset, the LSI starts execution of the program stored in the external memory
allocated in area 0. Since ROM is assumed as the external memory in area 0, minimum pin
functions such as the address bus, data bus, CS0, and RD are available. The sample access
waveforms shown in this section include other pins such as BS, RD/WR, and WEn, which are
available after they are selected through the pin function controller. Do not attempt any form of
memory access other than reading of area 0 until the pin function settings have been completed by
the program.
For details on pin function settings, see section 23, Pin Function Controller (PFC).
Table 7.3
Correspondence between External Pin (MD) and Data Bus Width
MD_BW
Data Bus Width
1
8 bits
0
16 bits
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 177 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.4
Register Descriptions
The BSC has the following registers.
Do not access spaces other than area 0 until settings of the connected memory interface are
completed.
Table 7.4
Register Configuration
Register Name
Abbreviation
R/W
Initial Value
Address
Access Size
Common control register
CMNCR
R/W
H'00001010
H'FFFC0000
32
CS0 space bus control register
CS0BCR
R/W
H'36DB0200*
H'FFFC0004
32
CS3 space bus control register
CS3BCR
R/W
H'36DB0200*
H'FFFC0010
32
CS4 space bus control register
CS4BCR
R/W
H'36DB0200*
H'FFFC0014
32
CS5 space bus control register
CS5BCR
R/W
H'36DB0200*
H'FFFC0018
32
CS6 space bus control register
CS6BCR
R/W
H'36DB0200*
H'FFFC001C
32
CS0 space wait control register
CS0WCR
R/W
H'00000500
H'FFFC0028
32
CS3 space wait control register
CS3WCR
R/W
H'00000500
H'FFFC0034
32
CS4 space wait control register
CS4WCR
R/W
H'00000500
H'FFFC0038
32
CS5 space wait control register
CS5WCR
R/W
H'00000500
H'FFFC003C
32
CS6 space wait control register
CS6WCR
R/W
H'00000500
H'FFFC0040
32
SDRAM control register
SDCR
R/W
H'00000000
H'FFFC004C
32
Refresh timer control/status register RTCSR
R/W
H'00000000
H'FFFC0050
32
Refresh timer counter
RTCNT
R/W
H'00000000
H'FFFC0054
32
Refresh time constant register
RTCOR
R/W
H'00000000
H'FFFC0058
32
Internal bus master bus priority
register
IBMPR
R/W
H'12300000
H'FFFC1818
32
Notes: *
This is an initial value when this LSI is started by the external pin (MD_BW) with the bus
width set to 8 bits. The initial value will be H'36DB0400 when the bus width is set to 16
bits.
Page 178 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.4.1
Section 7 Bus State Controller (BSC)
Common Control Register (CMNCR)
CMNCR is a 32-bit register that controls the common items for each area.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial Value:
R/W:
0
R
0
R
0
R
1
R
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
Description
31 to 13
⎯
All 0
R
Reserved
DMAIW[2:0]
0
R/W
0
R/W
0
R/W
5
4
3
2
1
0
DMA
IWA
⎯
⎯
⎯
HIZ
MEM
HIZ
CNT
0
R/W
1
R
0
R
0
R
0
R/W
0
R/W
These bits are always read as 0. The write value
should always be 0.
12
⎯
1
R
Reserved
This bit is always read as 1. The write value should
always be 1.
11 to 9
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
8 to 6
DMAIW[2:0]
000
R/W
Wait states between access cycles when DMA single
address transfer is performed.
Specify the number of idle cycles to be inserted after
an access to an external device with DACK when DMA
single address transfer is performed. The method of
inserting idle cycles depends on the contents of
DMAIWA.
000: No idle cycle inserted
001: 1 idle cycle inserted
010: 2 idle cycles inserted
011: 4 idle cycles inserted
100: 6 idle cycles inserted
101: 8 idle cycles inserted
110: 10 idle cycles inserted
111: 12 idle cycles inserted
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 179 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
5
DMAIWA
0
R/W
Method of inserting wait states between access cycles
when DMA single address transfer is performed.
Specifies the method of inserting the idle cycles
specified by the DMAIW[2:0] bit. Clearing this bit will
make this LSI insert the idle cycles when another
device, which includes this LSI, drives the data bus
after an external device with DACK drove it. However,
when the external device with DACK drives the data
bus continuously, idle cycles are not inserted. Setting
this bit will make this LSI insert the idle cycles after an
access to an external device with DACK, even when
the continuous access cycles to an external device
with DACK are performed.
0: Idle cycles inserted when another device drives the
data bus after an external device with DACK drove
it.
1: Idle cycles always inserted after an access to an
external device with DACK
4
⎯
1
R
Reserved
This bit is always read as 1. The write value should
always be 1.
3, 2
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
1
HIZMEM
0
R/W
High-Z Memory Control
Specifies the pin state in software standby mode for
A25 to A0, BS, CSn, CE2x, RD/WR, WEn/DQMxx, and
RD. At bus-released state, these pin are highimpedance states regardless of the setting value of the
HIZMEM bit.
0: High impedance in software standby mode
1: Driven in software standby mode
Page 180 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
0
HIZCNT*
0
R/W
High-Z Control
Specifies the state of CKE, RAS, and CAS in software
standby mode.
0: High impedance in software standby mode
1: Driven in software standby mode
Note:
*
7.4.2
For High-Z control of CKIO, see section 9, Clock Pulse Generator (CPG).
CSn Space Bus Control Register (CSnBCR) (n = 0, 3 to 6)
CSnBCR is a 32-bit readable/writable register that specifies the function of each area, the number
of idle cycles between bus cycles, and the bus width.
Do not access external memory other than area 0 until CSnBCR initial setting is completed.
Idle cycles may be inserted even when they are not specified. For details, see section 7.5.8, Wait
between Access Cycles.
Bit:
31
30
-
Initial value:
R/W:
0
R
0
R/W
Bit:
15
14
-
Initial value:
R/W:
0
R
29
28
27
IWW[2:0]
1
R/W
1
R/W
13
12
TYPE[2:0]
0
R/W
0
R/W
26
25
24
IWRWD[2:0]
22
21
20
19
18
IWRRD[2:0]
17
16
IWRRS[2:0]
0
R/W
1
R/W
1
R/W
0
R/W
1
R/W
1
R/W
0
R/W
1
R/W
1
R/W
0
R/W
1
R/W
1
R/W
11
10
9
8
7
6
5
4
3
2
1
0
BSZ[1:0]
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
ENDIAN
0
R/W
23
IWRWS[2:0]
0
R/W
1*
R/W
1*
R/W
Note: * CSnBCR samples the external pin (MD) that specify the bus width at power-on reset.
Bit
Bit Name
Initial
Value
R/W
Description
31
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 181 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
30 to 28
IWW[2:0]
011
R/W
Idle Cycles between Write-Read Cycles and WriteWrite Cycles
These bits specify the number of idle cycles to be
inserted after the access to a memory that is
connected to the space. The target access cycles are
the write-read cycle and write-write cycle.
000: No idle cycle inserted
001: 1 idle cycle inserted
010: 2 idle cycles inserted
011: 4 idle cycles inserted
100: 6 idle cycles inserted
101: 8 idle cycles inserted
110: 10 idle cycles inserted
111: 12 idle cycles inserted
27 to 25
IWRWD[2:0] 011
R/W
Idle Cycles for Another Space Read-Write
Specify the number of idle cycles to be inserted after
the access to a memory that is connected to the
space. The target access cycle is a read-write one in
which continuous access cycles switch between
different spaces.
000: No idle cycle inserted
001: 1 idle cycle inserted
010: 2 idle cycles inserted
011: 4 idle cycles inserted
100: 6 idle cycles inserted
101: 8 idle cycles inserted
110: 10 idle cycles inserted
111: 12 idle cycles inserted
Page 182 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Initial
Value
Bit
Bit Name
24 to 22
IWRWS[2:0] 011
R/W
Description
R/W
Idle Cycles for Read-Write in the Same Space
Specify the number of idle cycles to be inserted after
the access to a memory that is connected to the
space. The target cycle is a read-write cycle of which
continuous access cycles are for the same space.
000: No idle cycle inserted
001: 1 idle cycle inserted
010: 2 idle cycles inserted
011: 4 idle cycles inserted
100: 6 idle cycles inserted
101: 8 idle cycles inserted
110: 10 idle cycles inserted
111: 12 idle cycles inserted
21 to 19
IWRRD[2:0]
011
R/W
Idle Cycles for Read-Read in Another Space
Specify the number of idle cycles to be inserted after
the access to a memory that is connected to the
space. The target cycle is a read-read cycle of which
continuous access cycles switch between different
space.
000: No idle cycle inserted
001: 1 idle cycle inserted
010: 2 idle cycles inserted
011: 4 idle cycles inserted
100: 6 idle cycles inserted
101: 8 idle cycles inserted
110: 10 idle cycles inserted
111: 12 idle cycles inserted
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 183 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
18 to 16
IWRRS[2:0]
011
R/W
Idle Cycles for Read-Read in the Same Space
Specify the number of idle cycles to be inserted after
the access to a memory that is connected to the
space. The target cycle is a read-read cycle of which
continuous access cycles are for the same space.
000: No idle cycle inserted
001: 1 idle cycle inserted
010: 2 idle cycles inserted
011: 4 idle cycles inserted
100: 6 idle cycles inserted
101: 8 idle cycles inserted
110: 10 idle cycles inserted
111: 12 idle cycles inserted
15
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
14 to 12
TYPE[2:0]
000
R/W
Specify the type of memory connected to a space.
000: Normal space
001: Setting prohibited
010: Setting prohibited
011: SRAM with byte selection
100: SDRAM
101: PCMCIA
110: Setting prohibited
111: Setting prohibited
For details for memory type in each area, see table
7.2.
11
ENDIAN
0
R/W
Endian Setting
Specifies the arrangement of data in a space.
0: Arranged in big endian
1: Arranged in little endian
Note: Area 0 cannot be set to little endian mode. In the
case of area 0, this bit is always read as 0, and
the write value should always be 0.
Page 184 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
10, 9
BSZ[1:0]
11*
R/W
Data Bus Width Specification
Specify the data bus widths of spaces.
00: Reserved (setting prohibited)
01: 8-bit size
10: 16-bit size
11: 32-bit size
For MPX-I/O, selects bus width by address
Notes:
1. The initial data bus width for areas 3 to 6
is specified by external pins. The BSZ[1:0]
bits settings in CS0BCR are ignored but
the bus width settings in CS1BCR to
CS7BCR can be modified.
2. If area 5 or area 6 is specified as PCMCIA
space, the bus width can be specified as
either 8 bits or 16 bits.
3. If area 3 is specified as SDRAM space,
the bus width can be specified as either 16
bits or 32 bits.
⎯
8 to 0
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Note:
*
CSnBCR samples the external pins (MD_BW) that specify the bus width at power-on
reset.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 185 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.4.3
CSn Space Wait Control Register (CSnWCR) (n = 0, 3 to 6)
CSnWCR specifies various wait cycles for memory access. The bit configuration of this register
varies as shown below according to the memory type (TYPE2 to TYPE0) specified by the CSn
space bus control register (CSnBCR). Specify CSnWCR before accessing the target area. Specify
CSnBCR first, then specify CSnWCR.
(1)
Normal Space, SRAM with Byte Selection
• CS0WCR
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
BAS
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R
0
R
0
R/W
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
1
0
-
-
-
0
R
0
R
0
R
Initial value:
R/W:
SW[1:0]
0
R/W
WR[3:0]
0
R/W
1
R/W
0
R/W
1
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
31 to 22
⎯
All 0
R
Reserved
6
5
4
3
2
WM
-
-
-
-
0
R/W
0
R
0
R
0
R
0
R
16
HW[1:0]
0
R/W
0
R/W
These bits are always read as 0. The write value
should always be 0.
21
⎯
0
R/W
Reserved
These bits are always read as 0. The write value
should always be 0.
20
BAS
0
R/W
Byte Access Selection when SRAM with Byte
Selection is Used
Specifies the WEn and RD/WR signal timing when the
SRAM interface with byte selection is used.
0: Asserts the WEn signal at the read/write timing and
asserts the RD/WR signal during the write access
cycle.
1: Asserts the WEn signal during the read/write access
cycle and asserts the RD/WR signal at the write
timing.
Page 186 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
19, 18
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
17, 16
⎯
All 0
R/W
Reserved
Set this bit to 0 when the interface for normal space or
SRAM with byte selection is used.
15 to 13
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
12, 11
SW[1:0]
00
R/W
Number of Delay Cycles from Address, CS0 Assertion
to RD, WEn Assertion
Specify the number of delay cycles from address and
CS0 assertion to RD and WEn assertion.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 187 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
10 to 7
WR[3:0]
1010
R/W
Number of Access Wait Cycles
Specify the number of cycles that are necessary for
read/write access.
0000: No cycle
0001: 1 cycle
0010: 2 cycles
0011: 3 cycles
0100: 4 cycles
0101: 5 cycles
0110: 6 cycles
0111: 8 cycles
1000: 10 cycles
1001: 12 cycles
1010: 14 cycles
1011: 18 cycles
1100: 24 cycles
1101: Reserved (setting prohibited)
1110: Reserved (setting prohibited)
1111: Reserved (setting prohibited)
6
WM
0
R/W
External Wait Mask Specification
Specifies whether or not the external wait input is valid.
The specification by this bit is valid even when the
number of access wait cycle is 0.
0: External wait input is valid
1: External wait input is ignored
5 to 2
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Page 188 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
1, 0
HW[1:0]
00
R/W
Delay Cycles from RD, WEn Negation to Address, CS0
Negation
Specify the number of delay cycles from RD and WEn
negation to address and CS0 negation.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
• CS3WCR
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
BAS
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
⎯
⎯
⎯
⎯
⎯
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
Description
31 to 21
⎯
All 0
R
Reserved
Initial Value:
R/W:
WR[3:0]
1
R/W
0
R/W
1
R/W
0
R/W
6
5
4
3
2
1
0
WM
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R
0
R
0
R
0
R
0
R
0
R
These bits are always read as 0. The write value
should always be 0.
20
BAS
0
R/W
SRAM with Byte Selection Byte Access Select
Specifies the WEn and RD/WR signal timing when the
SRAM interface with byte selection is used.
0: Asserts the WEn signal at the read timing and
asserts the RD/WR signal during the write access
cycle.
1: Asserts the WEn signal during the read access cycle
and asserts the RD/WR signal at the write timing.
19 to 11
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 189 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
10 to 7
WR[3:0]
1010
R/W
Number of Access Wait Cycles
Specify the number of cycles that are necessary for
read/write access.
0000: No cycle
0001: 1 cycle
0010: 2 cycles
0011: 3 cycles
0100: 4 cycles
0101: 5 cycles
0110: 6 cycles
0111: 8 cycles
1000: 10 cycles
1001: 12 cycles
1010: 14 cycles
1011: 18 cycles
1100: 24 cycles
1101: Reserved (setting prohibited)
1110: Reserved (setting prohibited)
1111: Reserved (setting prohibited)
6
WM
0
R/W
External Wait Mask Specification
Specifies whether or not the external wait input is valid.
The specification by this bit is valid even when the
number of access wait cycle is 0.
0: External wait input is valid
1: External wait input is ignored
5 to 0
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Page 190 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
• CS4WCR
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
-
-
-
-
-
-
-
-
-
-
-
BAS
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R/W
0
R/W
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
1
0
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
31 to 21
⎯
All 0
R
SW[1:0]
0
R/W
WR[3:0]
0
R/W
1
R/W
0
R/W
1
R/W
0
R/W
18
17
16
WW[2:0]
6
5
4
3
2
WM
-
-
-
-
0
R/W
0
R
0
R
0
R
0
R
HW[1:0]
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
20
BAS
0
R/W
SRAM with Byte Selection Byte Access Select
Specifies the WEn and RD/WR signal timing when the
SRAM interface with byte selection is used.
0: Asserts the WEn signal at the read timing and
asserts the RD/WR signal during the write access
cycle.
1: Asserts the WEn signal during the read access cycle
and asserts the RD/WR signal at the write timing.
19
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
18 to 16
WW[2:0]
000
R/W
Number of Write Access Wait Cycles
Specify the number of cycles that are necessary for
write access.
000: The same cycles as WR[3:0] setting (number of
read access wait cycles)
001: No cycle
010: 1 cycle
011: 2 cycles
100: 3 cycles
101: 4 cycles
110: 5 cycles
111: 6 cycles
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 191 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
15 to 13
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
12, 11
SW[1:0]
00
R/W
Number of Delay Cycles from Address, CS4 Assertion
to RD, WE Assertion
Specify the number of delay cycles from address and
CS4 assertion to RD and WE assertion.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
10 to 7
WR[3:0]
1010
R/W
Number of Read Access Wait Cycles
Specify the number of cycles that are necessary for
read access.
0000: No cycle
0001: 1 cycle
0010: 2 cycles
0011: 3 cycles
0100: 4 cycles
0101: 5 cycles
0110: 6 cycles
0111: 8 cycles
1000: 10 cycles
1001: 12 cycles
1010: 14 cycles
1011: 18 cycles
1100: 24 cycles
1101: Reserved (setting prohibited)
1110: Reserved (setting prohibited)
1111: Reserved (setting prohibited)
Page 192 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
6
WM
0
R/W
External Wait Mask Specification
Specifies whether or not the external wait input is valid.
The specification by this bit is valid even when the
number of access wait cycle is 0.
0: External wait input is valid
1: External wait input is ignored
5 to 2
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
1, 0
HW[1:0]
00
R/W
Delay Cycles from RD, WEn Negation to Address, CS4
Negation
Specify the number of delay cycles from RD and WEn
negation to address and CS4 negation.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 193 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
• CS5WCR
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
-
-
-
-
-
-
-
-
-
-
-
MPXW/
BAS
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R/W
0
R/W
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
0
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
Description
31 to 21
⎯
All 0
R
Reserved
SW[1:0]
0
R/W
WR[3:0]
0
R/W
1
R/W
0
R/W
1
R/W
0
R/W
18
17
16
WW[2:0]
6
5
4
3
2
1
WM
-
-
-
-
HW[1:0]
0
R/W
0
R
0
R
0
R
0
R
0
R/W
0
R/W
These bits are always read as 0. The write value
should always be 0.
20
BAS
0
R/W
SRAM with Byte Selection Byte Access Select
Specifies the WEn and RD/WR signal timing when the
SRAM interface with byte selection is used.
0: Asserts the WEn signal at the read timing and
asserts the RD/WR signal during the write access
cycle.
1: Asserts the WEn signal during the read access cycle
and asserts the RD/WR signal at the write timing.
19
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
18 to 16
WW[2:0]
000
R/W
Number of Write Access Wait Cycles
Specify the number of cycles that are necessary for
write access.
000: The same cycles as WR[3:0] setting (number of
read access wait cycles)
001: No cycle
010: 1 cycle
011: 2 cycles
100: 3 cycles
101: 4 cycles
110: 5 cycles
111: 6 cycles
Page 194 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
15 to 13
⎯
All 0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
12, 11
SW[1:0]
00
R/W
Number of Delay Cycles from Address, CS5 Assertion
to RD, WEn Assertion
Specify the number of delay cycles from address and
CS5 assertion to RD and WEn assertion.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
10 to 7
WR[3:0]
1010
R/W
Number of Read Access Wait Cycles
Specify the number of cycles that are necessary for
read access.
0000: No cycle
0001: 1 cycle
0010: 2 cycles
0011: 3 cycles
0100: 4 cycles
0101: 5 cycles
0110: 6 cycles
0111: 8 cycles
1000: 10 cycles
1001: 12 cycles
1010: 14 cycles
1011: 18 cycles
1100: 24 cycles
1101: Reserved (setting prohibited)
1110: Reserved (setting prohibited)
1111: Reserved (setting prohibited)
6
WM
0
R/W
External Wait Mask Specification
Specifies whether or not the external wait input is valid.
The specification by this bit is valid even when the
number of access wait cycle is 0.
0: External wait input is valid
1: External wait input is ignored
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 195 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
5 to 2
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
1, 0
HW[1:0]
00
R/W
Delay Cycles from RD, WEn Negation to Address,
CS5 Negation
Specify the number of delay cycles from RD and WEn
negation to address and CS5 negation.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
• CS6WCR
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
BAS
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
1
0
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
31 to 21
⎯
All 0
R
SW[1:0]
0
R/W
WR[3:0]
0
R/W
1
R/W
0
R/W
1
R/W
0
R/W
6
5
4
3
2
WM
-
-
-
-
0
R/W
0
R
0
R
0
R
0
R
16
HW[1:0]
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
20
BAS
0
R/W
SRAM with Byte Selection Byte Access Select
Specifies the WEn and RD/WR signal timing when the
SRAM interface with byte selection is used.
0: Asserts the WEn signal at the read timing and
asserts the RD/WR signal during the write access
cycle.
1: Asserts the WEn signal during the read/write access
cycle and asserts the RD/WR signal at the write
timing.
Page 196 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
19 to 13
⎯
All 0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
12, 11
SW[1:0]
00
R/W
Number of Delay Cycles from Address, CS6 Assertion
to RD, WEn Assertion
Specify the number of delay cycles from address, CS6
assertion to RD and WEn assertion.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
10 to 7
WR[3:0]
1010
R/W
Number of Access Wait Cycles
Specify the number of cycles that are necessary for
read/write access.
0000: No cycle
0001: 1 cycle
0010: 2 cycles
0011: 3 cycles
0100: 4 cycles
0101: 5 cycles
0110: 6 cycles
0111: 8 cycles
1000: 10 cycles
1001: 12 cycles
1010: 14 cycles
1011: 18 cycles
1100: 24 cycles
1101: Reserved (setting prohibited)
1110: Reserved (setting prohibited)
1111: Reserved (setting prohibited)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 197 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
6
WN
0
R/W
External Wait Mask Specification
Specifies whether or not the external wait input is valid.
The specification of this bit is valid even when the
number of access wait cycles is 0.
0: The external wait input is valid
1: The external wait input is ignored
5 to 2
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
1, 0
HW[1:0]
00
R/W
Number of Delay Cycles from RD, WEn Negation to
Address, CS6 Negation
Specify the number of delay cycles from RD, WEn
negation to address, and CS6 negation.
00: 0.5 cycles
01: 1.5 cycles
10: 2.5 cycles
11: 3.5 cycles
Page 198 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(2)
Section 7 Bus State Controller (BSC)
SDRAM
• CS3WCR
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
0
-
WTRP[1:0]
10
9
8
7
6
5
4
3
2
1
-
WTRCD[1:0]
-
A3CL[1:0]
-
-
TRWL[1:0]
-
WTRC[1:0]
0
R
0
R/W
0
R
0
R
0
R
Initial value:
R/W:
0
R
Bit
Bit Name
Initial
Value
R/W
31 to 15
⎯
All 0
R
0
R/W
0
R/W
16
1
R/W
1
R/W
0
R/W
0
R/W
0
R/W
0
R
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
14, 13
WTRP[1:0]
00
R/W
Number of Auto-Precharge Completion Wait Cycles
Specify the number of minimum precharge completion
wait cycles as shown below.
•
From the start of auto-precharge and issuing of
ACTV command for the same bank
•
From issuing of the PRE/PALL command to issuing
of the ACTV command for the same bank
•
Till entering the power-down mode or deep powerdown mode
•
From the issuing of PALL command to issuing REF
command in auto refresh mode
•
From the issuing of PALL command to issuing
SELF command in self refresh mode
00: No cycle
01: 1 cycle
10: 2 cycles
11: 3 cycles
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 199 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
12
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
11, 10
WTRCD[1:0] 01
R/W
Number of Wait Cycles between ACTV Command and
READ(A)/WRIT(A) Command
Specify the minimum number of wait cycles from
issuing the ACTV command to issuing the
READ(A)/WRIT(A) command.
00: No cycle
01: 1 cycle
10: 2 cycles
11: 3 cycles
9
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
8, 7
A3CL[1:0]
10
R/W
CAS Latency for Area 3
Specify the CAS latency for area 3.
00: 1 cycle
01: 2 cycles
10: 3 cycles
11: 4 cycles
6, 5
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Page 200 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
4, 3
TRWL[1:0]
00
R/W
Number of Auto-Precharge Startup Wait Cycles
Specify the number of minimum auto-precharge
startup wait cycles as shown below.
•
Cycle number from the issuance of the WRITA
command by this LSI until the completion of autoprecharge in the SDRAM.
Equivalent to the cycle number from the issuance
of the WRITA command until the issuance of the
ACTV command. Confirm that how many cycles
are required between the WRITE command receive
in the SDRAM and the auto-precharge activation,
referring to each SDRAM data sheet. And set the
cycle number so as not to exceed the cycle number
specified by this bit.
•
Cycle number from the issuance of the WRITA
command until the issuance of the PRE command.
This is the case when accessing another low
address in the same bank in bank active mode.
00: No cycle
01: 1 cycle
10: 2 cycles
11: 3 cycles
2
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 201 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
1, 0
WTRC[1:0]
00
R/W
Number of Idle Cycles from REF Command/SelfRefresh Release to ACTV/REF/MRS Command
Specify the number of minimum idle cycles in the
periods shown below.
•
From the issuance of the REF command until the
issuance of the ACTV/REF/MRS command
•
From releasing self-refresh until the issuance of the
ACTV/REF/MRS command.
00: 2 cycles
01: 3 cycles
10: 5 cycles
11: 8 cycles
Page 202 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(3)
Section 7 Bus State Controller (BSC)
PCMCIA
• CS5WCR, CS6WCR
Bit:
31
30
29
28
27
26
25
24
23
22
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
-
Initial value:
R/W:
0
R
TED[3:0]
0
R/W
0
R/W
0
R/W
PCW[3:0]
0
R/W
1
R/W
Bit
Bit Name
Initial
Value
R/W
31 to 22
⎯
All 0
R
0
R/W
1
R/W
0
R/W
21
20
19
18
17
-
-
-
-
0
R/W
0
R
0
R
0
R
0
R
3
2
1
0
SA[1:0]
6
5
4
WM
-
-
0
R
0
R
0
R
16
TEH[3:0]
0
R/W
0
R/W
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
21, 20
SA[1:0]
00
R/W
Space Attribute Specification
Select memory card interface or I/O card interface
when PCMCIA interface is selected.
SA1:
0: Selects memory card interface for the space for A25
= 1.
1: Selects I/O card interface for the space for A25 = 1.
SA0:
0: Selects memory card interface for the space for A25
= 0.
1: Selects I/O card interface for the space for A25 = 0.
19 to 15
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 203 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
14 to 11
TED[3:0]
0000
R/W
Number of Delay Cycles from Address Output to
RD/WE Assertion
Specify the number of delay cycles from address
output to RD/WE assertion for the memory card or to
ICIORD/ICIOWR assertion for the I/O card in PCMCIA
interface.
0000: 0.5 cycle
0001: 1.5 cycles
0010: 2.5 cycles
0011: 3.5 cycles
0100: 4.5 cycles
0101: 5.5 cycles
0110: 6.5 cycles
0111: 7.5 cycles
1000: 8.5 cycles
1001: 9.5 cycles
1010: 10.5 cycles
1011: 11.5 cycles
1100: 12.5 cycles
1101: 13.5 cycles
1110: 14.5 cycles
1111: 15.5 cycles
Page 204 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
10 to 7
PCW[3:0]
1010
R/W
Description
Number of Access Wait Cycles
Specify the number of wait cycles to be inserted.
0000: 3 cycles
0001: 6 cycles
0010: 9 cycles
0011: 12 cycles
0100: 15 cycles
0101: 18 cycles
0110: 22 cycles
0111: 26 cycles
1000: 30 cycles
1001: 33 cycles
1010: 36 cycles
1011: 38 cycles
1100: 52 cycles
1101: 60 cycles
1110: 64 cycles
1111: 80 cycles
6
WM
0
R/W
External Wait Mask Specification
Specifies whether or not the external wait input is valid.
The specification by this bit is valid even when the
number of access wait cycles is 0.
0: External wait input is valid
1: External wait input is ignored
5, 4
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 205 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
3 to 0
TEH[3:0]
0000
R/W
Delay Cycles from RD/WE Negation to Address
Specify the number of address hold cycles from
RD/WE negation for the memory card or those from
ICIORD/ICIOWR negation for the I/O card in PCMCIA
interface.
0000: 0.5 cycle
0001: 1.5 cycles
0010: 2.5 cycles
0011: 3.5 cycles
0100: 4.5 cycles
0101: 5.5 cycles
0110: 6.5 cycles
0111: 7.5 cycles
1000: 8.5 cycles
1001: 9.5 cycles
1010: 10.5 cycles
1011: 11.5 cycles
1100: 12.5 cycles
1101: 13.5 cycles
1110: 14.5 cycles
1111: 15.5 cycles
Page 206 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.4.4
Section 7 Bus State Controller (BSC)
SDRAM Control Register (SDCR)
SDCR specifies the method to refresh and access SDRAM, and the types of SDRAMs to be
connected.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
1
0
⎯
⎯
DEEP
⎯
RFSH RMODEPDOWN BACTV
⎯
⎯
⎯
A3ROW[1:0]
⎯
Initial Value:
R/W:
0
R
0
R
0
R/W
0
R
0
R/W
0
R
0
R
0
R
0
R/W
0
R
Bit
Bit Name
Initial
Value
R/W
Description
31 to 14
⎯
All 0
R
Reserved
Initial Value:
R/W:
0
R/W
0
R/W
0
R/W
0
R/W
2
A3COL[1:0]
0
R/W
0
R/W
These bits are always read as 0. The write value
should always be 0.
13
DEEP
0
R/W
Deep Power-Down Mode
This bit is valid for low-power SDRAM. If the RFSH or
RMODE bit is set to 1 while this bit is set to 1, the deep
power-down entry command is issued and the lowpower SDRAM enters the deep power-down mode.
0: Self-refresh mode
1: Deep power-down mode
12
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
11
RFSH
0
R/W
Refresh Control
Specifies whether or not the refresh operation of the
SDRAM is performed.
0: No refresh
1: Refresh
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 207 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
10
RMODE
0
R/W
Refresh Control
Specifies whether to perform auto-refresh or selfrefresh when the RFSH bit is 1. When the RFSH bit is
1 and this bit is 1, self-refresh starts immediately.
When the RFSH bit is 1 and this bit is 0, auto-refresh
starts according to the contents that are set in
registers RTCSR, RTCNT, and RTCOR.
0: Auto-refresh is performed
1: Self-refresh is performed
9
PDOWN
0
R/W
Power-Down Mode
Specifies whether the SDRAM will enter the powerdown mode after the access to the SDRAM. With this
bit being set to 1, after the SDRAM is accessed, the
CKE signal is driven low and the SDRAM enters the
power-down mode.
0: The SDRAM does not enter the power-down mode
after being accessed.
1: The SDRAM enters the power-down mode after
being accessed.
8
BACTV
0
R/W
Bank Active Mode
Specifies to access whether in auto-precharge mode
(using READA and WRITA commands) or in bank
active mode (using READ and WRIT commands).
0: Auto-precharge mode (using READA and WRITA
commands)
1: Bank active mode (using READ and WRIT
commands)
7 to 5
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Page 208 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Initial
Value
Bit
Bit Name
4, 3
A3ROW[1:0] 00
R/W
Description
R/W
Number of Bits of Row Address for Area 3
Specify the number of bits of the row address for
area 3.
00: 11 bits
01: 12 bits
10: 13 bits
11: Reserved (setting prohibited)
2
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
1, 0
A3COL[1:0]
00
R/W
Number of Bits of Column Address for Area 3
Specify the number of bits of the column address for
area 3.
00: 8 bits
01: 9 bits
10: 10 bits
11: Reserved (setting prohibited)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 209 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.4.5
Refresh Timer Control/Status Register (RTCSR)
RTCSR specifies various items about refresh for SDRAM.
When RTCSR is written, the upper 16 bits of the write data must be H'A55A to cancel write
protection.
The phase of the clock for incrementing the count in the refresh timer counter (RTCNT) is
adjusted only by a power-on reset. Note that there is an error in the time until the compare match
flag is set for the first time after the timer is started with the CKS[2:0] bits being set to a value
other than B'000.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
CMF
CMIE
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
Initial value:
R/W:
Bit
Bit Name
Initial
Value
R/W
Description
31 to 8
⎯
All 0
R
Reserved
CKS[2:0]
0
R/W
0
R/W
16
RRC[2:0]
0
R/W
0
R/W
0
R/W
0
R/W
These bits are always read as 0.
7
CMF
0
R/W
Compare Match Flag
Indicates that a compare match occurs between the
refresh timer counter (RTCNT) and refresh time
constant register (RTCOR). This bit is set or cleared in
the following conditions.
0: Clearing condition: When 0 is written in CMF after
reading out RTCSR during CMF = 1.
1: Setting condition: When the condition RTCNT =
RTCOR is satisfied.
Page 210 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
6
CMIE
0
R/W
Compare Match Interrupt Enable
Enables or disables CMF interrupt requests when the
CMF bit in RTCSR is set to 1.
0: Disables CMF interrupt requests.
1: Enables CMF interrupt requests.
5 to 3
CKS[2:0]
000
R/W
Clock Select
Select the clock input to count-up the refresh timer
counter (RTCNT).
000: Stop the counting-up
001: Bφ/4
010: Bφ/16
011: Bφ/64
100: Bφ/256
101: Bφ/1024
110: Bφ/2048
111: Bφ/4096
2 to 0
RRC[2:0]
000
R/W
Refresh Count
Specify the number of continuous refresh cycles, when
the refresh request occurs after the coincidence of the
values of the refresh timer counter (RTCNT) and the
refresh time constant register (RTCOR). These bits
can make the period of occurrence of refresh long.
000: 1 time
001: 2 times
010: 4 times
011: 6 times
100: 8 times
101: Reserved (setting prohibited)
110: Reserved (setting prohibited)
111: Reserved (setting prohibited)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 211 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.4.6
Refresh Timer Counter (RTCNT)
RTCNT is an 8-bit counter that increments using the clock selected by bits CKS[2:0] in RTCSR.
When RTCNT matches RTCOR, RTCNT is cleared to 0. The value in RTCNT returns to 0 after
counting up to 255. When the RTCNT is written, the upper 16 bits of the write data must be
H'A55A to cancel write protection.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
Bit
Initial
Bit Name Value
R/W
Description
31 to 8
⎯
R
Reserved
All 0
16
These bits are always read as 0.
7 to 0
Page 212 of 1278
All 0
R/W
8-Bit Counter
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.4.7
Section 7 Bus State Controller (BSC)
Refresh Time Constant Register (RTCOR)
RTCOR is an 8-bit register. When RTCOR matches RTCNT, the CMF bit in RTCSR is set to 1
and RTCNT is cleared to 0.
When the RFSH bit in SDCR is 1, a memory refresh request is issued by this matching signal.
This request is maintained until the refresh operation is performed. If the request is not processed
when the next matching occurs, the previous request is ignored.
When the CMIE bit in RTCSR is set to 1, an interrupt request is issued by this matching signal.
The request continues to be output until the CMF bit in RTCSR is cleared. Clearing the CMF bit
only affects the interrupt request and does not clear the refresh request. Therefore, a combination
of refresh request and interval timer interrupt can be specified so that the number of refresh
requests are counted by using timer interrupts while refresh is performed periodically.
When RTCOR is written, the upper 16 bits of the write data must be H'A55A to cancel write
protection.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
Bit
Bit Name
Initial
Value
R/W Description
31 to 8
⎯
All 0
R
All 0
R/W 8-Bit Counter
Reserved
These bits are always read as 0.
7 to 0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 213 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.4.8
Internal Bus Master Bus Priority Register (IBMPR)
IBMPR is a 32-bit register that sets the bus priority for the internal bus masters excluding the
CPU.
If internal bus masters excluding the same CPU are set at different priority levels, the highest one
will be effective. After an attempt to set internal bus masters in an overlapping manner, if some of
them failed to be set, then these failing bus masters will not be able to acquire bus mastership.
Rewriting this register while any of the A-DMAC (including F-DMAC), E-DMAC, and DMAC is
operating is prohibited. When rewriting this register, make sure that none of the A-DMAC
(including F-DMAC), E-DMAC, and DMAC is not started.
For details, see section 7.5.9 (2), Access from the Side of the LSI Internal Bus Master.
Bit: 31
30
⎯
⎯
Initial Value 0
R/W: R
0
R
0
R/W
Bit: 15
14
⎯
⎯
Initial Value 0
R/W: R
0
R
29
28
27
26
⎯
⎯
1
R/W
0
R
0
R
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0P1R[1:0]
25
24
0P2R[1:0]
1
R/W
23
22
⎯
⎯
0
R
0
R
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
31, 30
⎯
All 0
R
Reserved
21
20
0P3R[1:0]
1
R/W
1
R/W
19
18
17
16
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
These bits are always read as 0. The write value
should always be 0.
29, 28
0P1R[1:0]
01
R/W
Of the internal bus masters excluding the CPU (that is,
A-DMAC (including F-DMAC), E-DMAC, and DMAC),
set the internal bus master having the highest priority
level.
00: No setting
01: A-DMAC (including F-DMAC)
10: E-DMAC
11: DMAC
Page 214 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Bit
Bit Name
Initial
Value
R/W
Description
27, 26
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
25, 24
0P2R[1:0]
10
R/W
Of the internal bus masters excluding the CPU (that is,
A-DMAC (including F-DMAC), E-DMAC, and DMAC),
set the internal bus master having the second highest
priority level.
00: No setting
01: A-DMAC (including F-DMAC)
10: E-DMAC
11: DMAC
23, 22
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
21, 20
0P3R[1:0]
11
R/W
Of the internal bus masters excluding the CPU (that is,
A-DMAC (including F-DMAC), E-DMAC, and DMAC),
set the internal bus master having the third highest
priority level.
00: No setting
01: A-DMAC (including F-DMAC)
10: E-DMAC
11: DMAC
19 to 0
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 215 of 1278
Section 7 Bus State Controller (BSC)
7.5
Operation
7.5.1
Endian/Access Size and Data Alignment
SH7670 Group
This LSI supports both big endian, in which the most significant byte (MSB) of data is that in the
direction of the 0th address, and little endian, in which the least significant byte (LSB) is that in
the direction of the 0th address. In the initial state after a power-on reset, all areas will be in big
endian mode. Little endian cannot be selected for area 0. However, the endian of areas 3 to 6 can
be changed by the setting in the CSnBCR register setting as long as the target space is not being
accessed.
Three data bus widths (8 bits, 16 bits, and 32 bits) are selectable for areas 3 to 6, allowing the
connection of normal memory and of SRAM with byte selection. Two data bus widths (16 bits and
32 bits) are available for SDRAM. Two data bus widths (8 bits and 16 bits) are available for the
PCMCIA interface. For MPX-I/O, the data bus width can be fixed to either 8 or 16 bits, or made
selectable as 8 bits or 16 bits by one of the address lines. Data alignment is in accord with the data
bus width selected for the device. This also means that four read operations are required to read
longword data from a byte-width device. In this LSI, data alignment and conversion of data length
is performed automatically between the respective interfaces. The data bus width of area 0 is fixed
to 8 bits or 16 bits by the MD_BW pin setting at a power-on reset.
Tables 7.5 to 7.10 show the relationship between device data width and access unit. Note that the
correspondence between addresses and strobe signals for the 32- and 16-bit bus widths depends on
the endian setting. For example, with big endian and a 32-bit bus width, WE3 corresponds to the
0th address, which is represented by WE0 when little endian has been selected. Little endian
cannot be selected for area 0. Note also that 32-bit and 16-bit accesses coincide in instruction
fetching, therefore, it is difficult to allocate instruction to little endian area. Make sure to execute
instruction in big endian area.
Page 216 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Table 7.5
Section 7 Bus State Controller (BSC)
32-Bit External Device Access and Data Alignment in Big Endian
Data Bus
Strobe Signals
Operation
D31 to
D24
D23 to
D16
D15 to
D8
WE3,
D7 to D0 DQMUU
WE2,
DQMUL
WE1,
DQMLU
WE0,
DQMLL
Byte access
at 0
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Byte access
at 1
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
Byte access
at 2
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
Byte access
at 3
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Word access
at 0
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
⎯
⎯
Word access ⎯
at 2
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Longword
access at 0
Data
23 to 16
Data
15 to 8
Data
7 to 0
Assert
Assert
Assert
Assert
Data
31 to 24
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 217 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.6
16-Bit External Device Access and Data Alignment in Big Endian
Data Bus
Strobe Signals
Operation
D31 to D23 to D15 to
D24
D16
D8
D7 to D0
WE3,
DQMUU
WE2,
DQMUL
WE1,
DQMLU
WE0,
DQMLL
Byte access at 0
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
Byte access at 1
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 2
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
Byte access at 3
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Word access at 0
⎯
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Word access at 2
⎯
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Longword
1st
⎯
access at 0 time at 0
⎯
Data
31 to 24
Data
23 to 16
⎯
⎯
Assert
Assert
2nd
⎯
time at 2
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Page 218 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Table 7.7
Section 7 Bus State Controller (BSC)
8-Bit External Device Access and Data Alignment in Big Endian
Data Bus
Strobe Signals
Operation
D31 to D23 to D15 to
D24
D16
D8
D7 to D0
WE3,
DQMUU
WE2,
DQMUL
WE1,
DQMLU
WE0,
DQMLL
Byte access at 0
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 1
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 2
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 3
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Word
access at 0
⎯
⎯
⎯
Data
15 to 8
⎯
⎯
⎯
Assert
2nd time ⎯
at 1
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Data
15 to 8
⎯
⎯
⎯
Assert
2nd time ⎯
at 3
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Data
31 to 24
⎯
⎯
⎯
Assert
2nd time ⎯
at 1
⎯
⎯
Data
23 to 16
⎯
⎯
⎯
Assert
3rd time ⎯
at 2
⎯
⎯
Data
15 to 8
⎯
⎯
⎯
Assert
4th time ⎯
at 3
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Word
access at 2
Longword
access at 0
1st time
at 0
1st time
at 2
1st time
at 0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 219 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.8
32-Bit External Device Access and Data Alignment in Little Endian
Data Bus
Strobe Signals
D31 to
D24
D23 to
D16
D15 to
D8
WE3,
D7 to D0 DQMUU
WE2,
DQMUL
WE1,
DQMLU
WE0,
DQMLL
Byte access
at 0
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access
at 1
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
Byte access
at 2
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
Byte access
at 3
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Word access
at 0
⎯
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Word access Data
at 2
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
⎯
⎯
Longword
access at 0
Data
23 to 16
Data
15 to 8
Data
7 to 0
Assert
Assert
Assert
Assert
Operation
Data
31 to 24
Page 220 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Table 7.9
Section 7 Bus State Controller (BSC)
16-Bit External Device Access and Data Alignment in Little Endian
Data Bus
Strobe Signals
WE3,
DQMUU
WE2,
DQMUL
WE1,
DQMLU
WE0,
DQMLL
Data
7 to 0
⎯
⎯
⎯
Assert
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
⎯
Word access at 0
⎯
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Word access at 2
⎯
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
Longword
1st
⎯
access at 0 time at 0
⎯
Data
15 to 8
Data
7 to 0
⎯
⎯
Assert
Assert
2nd
⎯
time at 2
⎯
Data
31 to 24
Data
23 to 16
⎯
⎯
Assert
Assert
Operation
D31 to D23 to D15 to
D24
D16
D8
Byte access at 0
⎯
⎯
⎯
Byte access at 1
⎯
⎯
Byte access at 2
⎯
Byte access at 3
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
D7 to D0
Page 221 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.10 8-Bit External Device Access and Data Alignment in Little Endian
Data Bus
Strobe Signals
Operation
D31 to D23 to D15 to
D24
D16
D8
D7 to D0
WE3,
DQMUU
WE2,
DQMUL
WE1,
DQMLU
WE0,
DQMLL
Byte access at 0
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 1
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 2
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Byte access at 3
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
Word
access at 0
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
2nd time ⎯
at 1
⎯
⎯
Data
15 to 8
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
2nd time ⎯
at 3
⎯
⎯
Data
15 to 8
⎯
⎯
⎯
Assert
⎯
⎯
⎯
Data
7 to 0
⎯
⎯
⎯
Assert
2nd time ⎯
at 1
⎯
⎯
Data
15 to 8
⎯
⎯
⎯
Assert
3rd time ⎯
at 2
⎯
⎯
Data
23 to 16
⎯
⎯
⎯
Assert
4th time ⎯
at 3
⎯
⎯
Data
31 to 24
⎯
⎯
⎯
Assert
Word
access at 2
Longword
access at 0
1st time
at 0
1st time
at 2
1st time
at 0
Page 222 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.5.2
(1)
Section 7 Bus State Controller (BSC)
Normal Space Interface
Basic Timing
For access to a normal space, this LSI uses strobe signal output in consideration of the fact that
mainly static RAM will be directly connected. When using SRAM with a byte-selection pin, see
section 7.5.6, SRAM Interface with Byte Selection. Figure 7.2 shows the basic timings of normal
space access. A no-wait normal access is completed in two cycles. The BS signal is asserted for
one cycle to indicate the start of a bus cycle.
T1
T2
CKIO
A25 to A0
CSn
RD/WR
Read
RD
D31 to D0
RD/WR
Write
WEn
D31 to D0
BS
DACKn *
Note: * The waveform for DACKn is when active low is specified.
Figure 7.2 Normal Space Basic Access Timing (Access Wait 0)
There is no access size specification when reading. The correct access start address is output in the
least significant bit of the address, but since there is no access size specification, 32 bits are always
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 223 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
read in case of a 32-bit device, and 16 bits in case of a 16-bit device. When writing, only the WEn
signal for the byte to be written is asserted.
It is necessary to output the data that has been read using RD when a buffer is established in the
data bus. The RD/WR signal is in a read state (high output) when no access has been carried out.
Therefore, care must be taken when controlling the external data buffer, to avoid collision.
Figures 7.3 and 7.4 show the basic timings of normal space access. If the WM bit in CSnWCR is
cleared to 0, a Tnop cycle is inserted after the CSn space access to evaluate the external wait
(figure 7.3). If the WM bit in CSnWCR is set to 1, external waits are ignored and no Tnop cycle is
inserted (figure 7.4).
T1
T2
Tnop
T1
T2
CKIO
A25 to A0
CSn
RD/WR
RD
Read
D15 to D0
WEn
Write
D15 to D0
BS
DACKn *
WAIT
Note: * The waveform for DACKn is when active low is specified.
Figure 7.3 Continuous Access for Normal Space 1
Bus Width = 16 Bits, Longword Access, CSnWCR.WM Bit = 0
(Access Wait = 0, Cycle Wait = 0)
Page 224 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
T1
T2
T1
T2
CKIO
A25 to A0
CSn
RD/WR
RD
Read
D15 to D0
WEn
Write
D15 to D0
BS
DACKn *
WAIT
Note: * The waveform for DACKn is when active low is specified.
Figure 7.4 Continuous Access for Normal Space 2
Bus Width = 16 Bits, Longword Access, CSnWCR.WM Bit = 1
(Access Wait = 0, Cycle Wait = 0)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 225 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
128K × 8-bit
SRAM
••••
A0
CS
OE
I/O7
••••
I/O0
WE
••••
••••
••••
••••
A16
A0
CS
OE
I/O7
••••
••••
D8
WE1
D7
••••
••••
D16
WE2
D15
••••
••••
D24
WE3
D23
I/O0
WE
••••
D0
WE0
A16
••••
••••
A2
CSn
RD
D31
A16
••••
••••
••••
A18
••••
This LSI
••••
A0
CS
OE
I/O7
••••
A16
A0
CS
OE
I/O7
••••
••••
••••
I/O0
WE
I/O0
WE
Figure 7.5 Example of 32-Bit Data-Width SRAM Connection
Page 226 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
128K × 8-bit
SRAM
••••
A0
CS
OE
I/O7
••••
I/O0
WE
••••
••••
••••
D0
WE0
A16
••••
••••
D8
WE1
D7
A0
CS
OE
I/O7
••••
••••
A1
CSn
RD
D15
A16
••••
••••
••••
A17
••••
This LSI
I/O0
WE
Figure 7.6 Example of 16-Bit Data-Width SRAM Connection
128K × 8-bit
SRAM
This LSI
A0
CS
RD
OE
D7
I/O7
...
A0
CSn
...
...
A16
...
A16
D0
I/O0
WE0
WE
Figure 7.7 Example of 8-Bit Data-Width SRAM Connection
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 227 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.5.3
Access Wait Control
Wait cycle insertion on a normal space access can be controlled by the settings of bits WR3 to
WR0 in CSnWCR. It is possible for areas 4 and 5 to insert wait cycles independently in read
access and in write access. Areas 0, 3, and 6 have common access wait for read cycle and write
cycle. The specified number of Tw cycles are inserted as wait cycles in a normal space access
shown in figure 7.8.
T1
Tw
T2
CKIO
A25 to A0
CSn
RD/WR
RD
Read
D31 to D0
WEn
Write
D31 to D0
BS
DACKn*
Note: * The waveform for DACKn is when active low is specified.
Figure 7.8 Wait Timing for Normal Space Access (Software Wait Only)
Page 228 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
When the WM bit in CSnWCR is cleared to 0, the external wait input WAIT signal is also
sampled. WAIT pin sampling is shown in figure 7.9. A 2-cycle wait is specified as a software
wait. The WAIT signal is sampled on the falling edge of CKIO at the transition from the T1 or Tw
cycle to the T2 cycle.
T1
Tw
Tw
Wait states inserted
by WAIT signal
Twx
T2
CKIO
A25 to A0
CSn
RD/WR
RD
Read
D31 to D0
WEn
Write
D31 to D0
WAIT
BS
DACKn*
Note: * The waveform for DACKn is when active low is specified.
Figure 7.9 Wait Cycle Timing for Normal Space Access
(Wait Cycle Insertion Using WAIT Signal)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 229 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
7.5.4
CSn Assert Period Expansion
The number of cycles from CSn assertion to RD, WEn assertion can be specified by setting bits
SW1 and SW0 in CSnWCR. The number of cycles from RD, WEn negation to CSn negation can
be specified by setting bits HW1 and HW0. Therefore, a flexible interface to an external device
can be obtained. Figure 7.10 shows an example. A Th cycle and a Tf cycle are added before and
after an ordinary cycle, respectively. In these cycles, RD and WEn are not asserted, while other
signals are asserted. The data output is prolonged to the Tf cycle, and this prolongation is useful
for devices with slow writing operations.
Th
T1
T2
Tf
CKIO
A25 to A0
CSn
RD/WR
RD
Read
D31 to D0
WEn
Write
D31 to D0
BS
DACKn*
Note: * The waveform for DACKn is when active low is specified.
Figure 7.10 CSn Assert Period Expansion
Page 230 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.5.5
(1)
Section 7 Bus State Controller (BSC)
SDRAM Interface
SDRAM Direct Connection
The SDRAM that can be connected to this LSI is a product that has 11/12/13 bits of row address,
8/9/10 bits of column address, 4 or less banks, and uses the A10 pin for setting precharge mode in
read and write command cycles.
The control signals for direct connection of SDRAM are RAS, CAS, RD/WR, DQMUU,
DQMUL, DQMLU, DQMLL, CKE, and CS3. All the signals other than CS3 are common to all
areas, and signals other than CKE are valid when CS2 or CS3 is asserted. SDRAM can be
connected to up to 2 spaces. The data bus width of the area that is connected to SDRAM can be set
to 32 or 16 bits.
Burst read/single write (burst length 1) and burst read/burst write (burst length 1) are supported as
the SDRAM operating mode.
Commands for SDRAM can be specified by RAS, CAS, RD/WR, and specific address signals.
These commands supports:
•
•
•
•
•
•
•
•
•
•
•
NOP
Auto-refresh (REF)
Self-refresh (SELF)
All banks pre-charge (PALL)
Specified bank pre-charge (PRE)
Bank active (ACTV)
Read (READ)
Read with pre-charge (READA)
Write (WRIT)
Write with pre-charge (WRITA)
Write mode register (MRS, EMRS)
The byte to be accessed is specified by DQMUU, DQMUL, DQMLU, and DQMLL. Reading or
writing is performed for a byte whose corresponding DQMxx is low. For details on the
relationship between DQMxx and the byte to be accessed, see section 7.5.1, Endian/Access Size
and Data Alignment.
Figures 7.11 and 7.12 show examples of the connection of the SDRAM with the LSI.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 231 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
64M SDRAM
(1M×16Bits×4Bank)
This LSI
A15
A13
A2
CKE
CKIO
CSn
A0
CKE
CLK
CS
•
•
•
•
RAS
CAS
RD/WR
D31
•
•
•
•
D16
DQMUU
DQMUL
D15
•
•
•
•
D0
DQMLU
DQMLL
•
•
•
•
RAS
CAS
WE
I/O15
•
•
•
•
I/O0
DQMU
DQML
A13
•
•
•
•
A0
CKE
CLK
CS
RAS
CAS
WE
I/O15
•
•
•
•
I/O0
DQMU
DQML
Figure 7.11 Example of 32-Bit Data Width SDRAM Connection
Page 232 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
64M SDRAM
(1M×16Bits×4Bank)
This LSI
A14
A13
A1
CKE
CKIO
CSn
A0
CKE
CLK
CS
•
•
•
•
•
•
•
•
RAS
CAS
RD/WR
D15
RAS
CAS
WE
I/O15
D0
DQMLU
DQMLL
I/O0
DQMU
DQML
•
•
•
•
•
•
•
•
Figure 7.12 Example of 16-Bit Data Width SDRAM Connection
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 233 of 1278
Section 7 Bus State Controller (BSC)
(2)
SH7670 Group
Address Multiplexing
An address multiplexing is specified so that SDRAM can be connected without external
multiplexing circuitry according to the setting of bits BSZ[1:0] in CSnBCR, bits A2ROW[1:0],
and A2COL[1:0], A3ROW[1:0], and A3COL[1:0] in SDCR. Tables 7.11 to 7.16 show the
relationship between the settings of bits BSZ[1:0], A2ROW[1:0], A2COL[1:0], A3ROW[1:0], and
A3COL[1:0] and the bits output at the address pins. Do not specify those bits in the manner other
than this table, otherwise the operation of this LSI is not guaranteed. A25 to A18 are not
multiplexed and the original values of address are always output at these pins.
When the data bus width is 16 bits (BSZ1 and BSZ0 = B'10), A0 of SDRAM specifies a word
address. Therefore, connect this A0 pin of SDRAM to the A1 pin of the LSI; the A1 pin of
SDRAM to the A2 pin of the LSI, and so on. When the data bus width is 32 bits (BSZ1 and BSZ0
= B'11), the A0 pin of SDRAM specifies a longword address. Therefore, connect this A0 pin of
SDRAM to the A2 pin of the LSI; the A1 pin of SDRAM to the A3 pin of the LSI, and so on.
Page 234 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.11 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (1)-1
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
11 (32 bits)
00 (11 bits)
00 (8 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A25
A17
A16
A24
A16
A15
A23
A14
A13
Function
Unused
A15
2
3
A22* *
A21*
SDRAM Pin
2
A22*2*3
A21*
2
1
A12 (BA1)
Specifies bank
A11 (BA0)
A12
A20
L/H*
A10/AP
Specifies
address/precharge
A11
A19
A11
A9
Address
A10
A18
A10
A8
A9
A17
A9
A7
A8
A16
A8
A6
A7
A15
A7
A5
A6
A14
A6
A4
A5
A13
A5
A3
A4
A12
A4
A2
A3
A11
A3
A1
A2
A10
A2
A0
A1
A9
A1
A0
A8
A0
Unused
Example of connected memory
64-Mbit product (512 Kwords × 32 bits × 4 banks, column 8 bits product): 1
16-Mbit product (512 Kwords × 16 bits × 2 banks, column 8 bits product): 2
Notes: 1. L/H is a bit used in the command specification; it is fixed at L or H according to the
access mode.
2. Bank address specification
3. Applicable only to 64-bit products.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 235 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.11 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (1)-2
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
11 (32 bits)
01 (12 bits)
00 (8 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A25
A17
A16
A24
A16
A15
A23*2
A23*2
A13 (BA1)
A14
A22*
2
2
A12 (BA0)
A13
A21
SDRAM Pin
Function
Unused
A22*
A13
1
Specifies bank
A11
Address
A12
A20
L/H*
A10/AP
Specifies
address/precharge
A11
A19
A11
A9
Address
A10
A18
A10
A8
A9
A17
A9
A7
A8
A16
A8
A6
A7
A15
A7
A5
A6
A14
A6
A4
A5
A13
A5
A3
A4
A12
A4
A2
A3
A11
A3
A1
A2
A10
A2
A0
A1
A9
A1
A0
A8
A0
Unused
Example of connected memory
128-Mbit product (1 Mword × 32 bits × 4 banks, column 8 bits product): 1
64-Mbit product (1 Mword × 16 bits × 4 banks, column 8 bits product): 2
Notes: 1. L/H is a bit used in the command specification; it is fixed at L or H according to the
access mode.
2. Bank address specification
3. Applicable only to 64-bit products.
Page 236 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.12 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (2)-1
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
11 (32 bits)
01 (12 bits)
01 (9 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A26
A17
A16
A25
A16
A15
A24*2
A24*2
A13 (BA1)
A14
A23*
2
2
A23*
A12 (BA0)
A13
A22
A13
A11
Address
SDRAM Pin
Function
Unused
1
Specifies bank
A12
A21
L/H*
A10/AP
Specifies
address/precharge
A11
A20
A11
A9
Address
A10
A19
A10
A8
A9
A18
A9
A7
A8
A17
A8
A6
A7
A16
A7
A5
A6
A15
A6
A4
A5
A14
A5
A3
A4
A13
A4
A2
A3
A12
A3
A1
A0
A2
A11
A2
A1
A10
A1
A0
A9
A0
Unused
Example of connected memory
256-Mbit product (2 Mwords × 32 bits × 4 banks, column 9 bits product): 1
128-Mbit product (2 Mwords × 16 bits × 4 banks, column 9 bits product): 2
Notes: 1. L/H is a bit used in the command specification; it is fixed at L or H according to the
access mode.
2. Bank address specification
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 237 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.12 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (2)-2
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
11 (32 bits)
01 (12 bits)
10 (10 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A27
A17
A16
A26
A16
A15
A25*2
A25*2
A13 (BA1)
A14
A24*
2
2
A12 (BA0)
A13
A23
SDRAM Pin
Function
Unused
A24*
A13
1
Specifies bank
A11
Address
A12
A22
L/H*
A10/AP
Specifies
address/precharge
A11
A21
A11
A9
Address
A10
A20
A10
A8
A9
A19
A9
A7
A8
A18
A8
A6
A7
A17
A7
A5
A6
A16
A6
A4
A5
A15
A5
A3
A4
A14
A4
A2
A3
A13
A3
A1
A0
A2
A12
A2
A1
A11
A1
A0
A10
A0
Unused
Example of connected memory
512-Mbit product (4 Mwords × 32 bits × 4 banks, column 10 bits product): 1
256-Mbit product (4 Mwords × 16 bits × 4 banks, column 10 bits product): 2
Notes: 1. L/H is a bit used in the command specification; it is fixed at L or H according to the
access mode.
2. Bank address specification
Page 238 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.13 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (3)
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
11 (32 bits)
10 (13 bits)
01 (9 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A26
A17
A16
A25*2
A25*2
A14 (BA1)
A15
A24*
2
2
A13 (BA0)
A14
A23
A14
A13
A22
A13
SDRAM Pin
Function
Unused
A24*
A12
Specifies bank
Address
A11
1
A12
A21
L/H*
A10/AP
Specifies
address/precharge
A11
A20
A11
A9
Address
A10
A19
A10
A8
A9
A18
A9
A7
A8
A17
A8
A6
A7
A16
A7
A5
A6
A15
A6
A4
A5
A14
A5
A3
A4
A13
A4
A2
A3
A12
A3
A1
A0
A2
A11
A2
A1
A10
A1
A0
A9
A0
Unused
Example of connected memory
512-Mbit product (4 Mwords × 32 bits × 4 banks, column 9 bits product): 1
256-Mbit product (4 Mwords × 16 bits × 4 banks, column 9 bits product): 2
Notes: 1. L/H is a bit used in the command specification; it is fixed at L or H according to the
access mode.
2. Bank address specification
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 239 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.14 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (4)-1
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
10 (16 bits)
00 (11 bits)
00 (8 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A25
A17
A16
A24
A16
A15
A23
A15
A14
A22
A13
A12
SDRAM Pin
Function
Unused
A14
A21*
2
A21*2
A12 (BA1)
A20*
2
2
A11 (BA0)
A20*
1
Specifies bank
A11
A19
L/H*
A10/AP
Specifies
address/precharge
A10
A18
A10
A9
Address
A9
A17
A9
A8
A8
A16
A8
A7
A7
A15
A7
A6
A6
A14
A6
A5
A5
A13
A5
A4
A4
A12
A4
A3
A3
A11
A3
A2
A2
A10
A2
A1
A1
A9
A1
A0
A0
A8
A0
Unused
Example of connected memory
16-Mbit product (512 Kwords × 16 bits × 2 banks, column 8 bits product): 1
Notes: 1. L/H is a bit used in the command specification; it is fixed at low or high according to the
access mode.
2. Bank address specification
Page 240 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.14 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (4)-2
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
10 (16 bits)
01 (12 bits)
00 (8 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A25
A17
A16
A24
A16
A15
A23
SDRAM Pin
Unused
A15
A22*
2
A22*2
A13 (BA1)
A13
A21*
2
2
A12 (BA0)
A12
A20
A14
Function
A21*
A12
1
Specifies bank
A11
Address
A11
A19
L/H*
A10/AP
Specifies
address/precharge
A10
A18
A10
A9
Address
A9
A17
A9
A8
A8
A16
A8
A7
A7
A15
A7
A6
A6
A14
A6
A5
A5
A13
A5
A4
A4
A12
A4
A3
A3
A11
A3
A2
A2
A10
A2
A1
A1
A9
A1
A0
A0
A8
A0
Unused
Example of connected memory
64-Mbit product (1 Mword × 16 bits × 4 banks, column 8 bits product): 1
Notes: 1. L/H is a bit used in the command specification; it is fixed at L or H according to the
access mode.
2. Bank address specification
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 241 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.15 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (5)-1
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
10 (16 bits)
01 (12 bits)
01 (9 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A26
A17
A16
A25
A16
A15
A24
SDRAM Pin
Unused
A15
A23*
2
A23*2
A13 (BA1)
A13
A22*
2
2
A12 (BA0)
A12
A21
A14
Function
A22*
A12
1
Specifies bank
A11
Address
A11
A20
L/H*
A10/AP
Specifies
address/precharge
A10
A19
A10
A9
Address
A9
A18
A9
A8
A8
A17
A8
A7
A7
A16
A7
A6
A6
A15
A6
A5
A5
A14
A5
A4
A4
A13
A4
A3
A3
A12
A3
A2
A2
A11
A2
A1
A1
A10
A1
A0
A0
A9
A0
Unused
Example of connected memory
128-Mbit product (2 Mwords × 16 bits × 4 banks, column 9 bits product): 1
Notes: 1. L/H is a bit used in the command specification; it is fixed at low or high according to the
access mode.
2. Bank address specification
Page 242 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.15 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (5)-2
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
10 (16 bits)
01 (12 bits)
10 (10 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A27
A17
A16
A26
A16
A15
A25
SDRAM Pin
Unused
A15
A24*
2
A24*2
A13 (BA1)
A13
A23*
2
2
A12 (BA0)
A12
A22
A14
Function
A23*
A12
1
Specifies bank
A11
Address
A11
A21
L/H*
A10/AP
Specifies
address/precharge
A10
A20
A10
A9
Address
A9
A19
A9
A8
A8
A18
A8
A7
A7
A17
A7
A6
A6
A16
A6
A5
A5
A15
A5
A4
A4
A14
A4
A3
A3
A13
A3
A2
A2
A12
A2
A1
A1
A11
A1
A0
A0
A10
A0
Unused
Example of connected memory
256-Mbit product (4 Mwords × 16 bits × 4 banks, column 10 bits product): 1
Notes: 1. L/H is a bit used in the command specification; it is fixed at low or high according to the
access mode.
2. Bank address specification
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 243 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.16 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (6)-1
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
10 (16 bits)
10 (13 bits)
01 (9 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A26
A17
A16
A25
A16
A15
A24*2
A24*2
A14 (BA1)
A14
A23*
2
2
A13 (BA0)
A13
A22
A13
A12
A21
A12
SDRAM Pin
Function
Unused
A23*
A12
Specifies bank
Address
A11
1
A11
A20
L/H*
A10/AP
Specifies
address/precharge
A10
A19
A10
A9
Address
A9
A18
A9
A8
A8
A17
A8
A7
A7
A16
A7
A6
A6
A15
A6
A5
A5
A14
A5
A4
A4
A13
A4
A3
A3
A12
A3
A2
A2
A11
A2
A1
A1
A10
A1
A0
A0
A9
A0
Unused
Example of connected memory
256-Mbit product (4 Mwords × 16 bits × 4 banks, column 9 bits product): 1
Notes: 1. L/H is a bit used in the command specification; it is fixed at low or high according to the
access mode.
2. Bank address specification
Page 244 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.16 Relationship between BSZ[1:0], A3ROW[1:0], A3COL[1:0], and Address
Multiplex Output (6)-2
Setting
BSZ[1:0]
A3ROW[1:0]
A3COL[1:0]
10 (16 bits)
10 (13 bits)
10 (10 bits)
Output Pin of
This LSI
Row Address
Output
Column Address
Output
A17
A27
A17
A16
A26
A16
A15
A25*2
A25*2
A14 (BA1)
A14
A24*
2
2
A13 (BA0)
A13
A23
A13
A12
A22
A12
SDRAM Pin
Function
Unused
A24*
A12
Specifies bank
Address
A11
1
A11
A21
L/H*
A10/AP
Specifies
address/precharge
A10
A20
A10
A9
Address
A9
A19
A9
A8
A8
A18
A8
A7
A7
A17
A7
A6
A6
A16
A6
A5
A5
A15
A5
A4
A4
A14
A4
A3
A3
A13
A3
A2
A2
A12
A2
A1
A1
A11
A1
A0
A0
A10
A0
Unused
Example of connected memory
512-Mbit product (8 Mwords × 16 bits × 4 banks, column 10 bits product): 1
Notes: 1. L/H is a bit used in the command specification; it is fixed at low or high according to the
access mode.
2. Bank address specification
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 245 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
(3)
Burst Read
A burst read occurs in the following cases with this LSI.
• Access size in reading is larger than data bus width.
• 16-byte transfer in cache miss.
• 16-byte transfer by DMAC
This LSI always accesses the SDRAM with burst length 1. For example, read access of burst
length 1 is performed consecutively 4 times to read 16-byte continuous data from the SDRAM that
is connected to a 32-bit data bus. This access is called the burst read with the burst number 4.
Table 7.17 shows the relationship between the access size and the number of bursts.
Table 7.17 Relationship between Access Size and Number of Bursts
Bus Width
Access Size
Number of Bursts
16 bits
8 bits
1
16 bits
1
32 bits
2
16 bits
8
8 bits
1
16 bits
1
32 bits
1
16 bytes*
4
32 bits
Page 246 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Figures 7.13 and 7.14 show a timing chart in burst read. In burst read, an ACTV command is
output in the Tr cycle, the READ command is issued in the Tc1, Tc2, and Tc3 cycles, the READA
command is issued in the Tc4 cycle, and the read data is received at the rising edge of the external
clock (CKIO) in the Td1 to Td4 cycles. The Tap cycle is used to wait for the completion of an
auto-precharge induced by the READA command in the SDRAM. In the Tap cycle, a new
command will not be issued to the same bank. However, access to another CS space or another
bank in the same SDRAM space is enabled. The number of Tap cycles is specified by the WTRP1
and WTRP0 bits in CS3WCR.
In this LSI, wait cycles can be inserted by specifying each bit in CS3WCR to connect the SDRAM
in variable frequencies. Figure 7.14 shows an example in which wait cycles are inserted. The
number of cycles from the Tr cycle where the ACTV command is output to the Tc1 cycle where
the READ command is output can be specified using the WTRCD1 and WTRCD0 bits in
CS3WCR. If the WTRCD1 and WTRCD0 bits specify one cycles or more, a Trw cycle where the
NOT command is issued is inserted between the Tr cycle and Tc1 cycle. The number of cycles
from the Tc1 cycle where the READ command is output to the Td1 cycle where the read data is
latched can be specified for the CS2 and CS3 spaces independently, using the A2CL1 and A2CL0
bits in CS2WCR or the A3CL1 and A3CL0 bits in CS3WCR and WTRCD0 bit in CS3WCR. The
number of cycles from Tc1 to Td1 corresponds to the SDRAM CAS latency. The CAS latency for
the SDRAM is normally defined as up to three cycles. However, the CAS latency in this LSI can
be specified as 1 to 4 cycles. This CAS latency can be achieved by connecting a latch circuit
between this LSI and the SDRAM.
A Tde cycle is an idle cycle required to transfer the read data into this LSI and occurs once for
every burst read or every single read.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 247 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tr
Tc1
Td1
Tc2
Td2
Tc3
Td3
Tc4
Td4
Tde
(Tap)
CKIO
A25 to A0
A12/A11*1
CSn
RASL, RASU
CASL, CASU
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.13 Burst Read Basic Timing (CAS Latency 1, Auto Pre-Charge)
Page 248 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Tr
Trw
Tc1
Tw
Tc2
Td1
Tc3
Td2
Tc4
Td3
Td4
Tde
(Tap)
CKIO
A25 to A0
A12/A11*1
CSn
RASL, RASU
CASL, CASU
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.14 Burst Read Wait Specification Timing (CAS Latency 2,
WTRCD[1:0] = 1 Cycle, Auto Pre-Charge)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 249 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
(4)
Single Read
A read access ends in one cycle when data exists in a cache-disabled space and the data bus width
is larger than or equal to the access size. As the SDRAM is set to the burst read with the burst
length 1, only the required data is output. A read access that ends in one cycle is called single read.
Figure 7.15 shows the single read basic timing.
Tr
Tc1
Td1
Tde
(Tap)
CKIO
A25 to A0
A12/A11*1
CSn
RASL, RASU
CASL, CASU
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.15 Basic Timing for Single Read (CAS Latency 1, Auto Pre-Charge)
Page 250 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(5)
Section 7 Bus State Controller (BSC)
Burst Write
A burst write occurs in the following cases in this LSI.
• Access size in writing is larger than data bus width.
• Write-back of the cache
• 16-byte transfer in DMAC
This LSI always accesses SDRAM with burst length 1. For example, write access of burst length 1
is performed continuously 4 times to write 16-byte continuous data to the SDRAM that is
connected to a 32-bit data bus. This access is called burst write with the burst number 4. The
relationship between the access size and the number of bursts is shown in table 7.17. Figure 7.16
shows a timing chart for burst writes. In burst write, an ACTV command is output in the Tr cycle,
the WRIT command is issued in the Tc1, Tc2, and Tc3 cycles, and the WRITA command is issued
to execute an auto-precharge in the Tc4 cycle. In the write cycle, the write data is output
simultaneously with the write command. After the write command with the auto-precharge is
output, the Trw1 cycle that waits for the auto-precharge initiation is followed by the Tap cycle that
waits for completion of the auto-precharge induced by the WRITA command in the SDRAM.
Between the Trwl and the Tap cycle, a new command will not be issued to the same bank.
However, access to another CS space or another bank in the same SDRAM space is enabled. The
number of Trw1 cycles is specified by the TRWL1 and TRWL0 bits in CS3WCR. The number of
Tap cycles is specified by the WTRP1 and WTRP0 bits in CS3WCR.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 251 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tr
Tc1
Tc2
Tc3
Tc4
Trwl
Tap
CKIO
A25 to A0
A12/A11*1
CSn
RASL, RASU
CASL, CASU
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.16 Basic Timing for Burst Write (Auto Pre-Charge)
Page 252 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(6)
Section 7 Bus State Controller (BSC)
Single Write
A write access ends in one cycle when data is written in a cache-disabled space and the data bus
width is larger than or equal to access size. As a single write or burst write with burst length 1 is
set in SDRAM, only the required data is output. The write access that ends in one cycle is called
single write. Figure 7.17 shows the single write basic timing.
Tr
Tc1
Trwl
Tap
CKIO
A25 to A0
A12/A11*1
CSn
RASL, RASU
CASL, CASU
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.17 Single Write Basic Timing (Auto-Precharge)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 253 of 1278
Section 7 Bus State Controller (BSC)
(7)
SH7670 Group
Bank Active
The SDRAM bank function can be used to support high-speed access to the same row address.
When the BACTV bit in SDCR is 1, access is performed using commands without auto-precharge
(READ or WRIT). This function is called bank-active function.
When the bank-active function is used, precharging is not performed when the access ends. When
accessing the same row address in the same bank, it is possible to issue the READ or WRIT
command immediately, without issuing an ACTV command. As SDRAM is internally divided
into several banks, it is possible to activate one row address in each bank. If the next access is to a
different row address, a PRE command is first issued to precharge the relevant bank, then when
precharging is completed, the access is performed by issuing an ACTV command followed by a
READ or WRIT command. If this is followed by an access to a different row address, the access
time will be longer because of the precharging performed after the access request is issued. The
number of cycles between issuance of the PRE command and the ACTV command is determined
by the WTRP1 and WTPR0 bits in CS3WCR.
In a write, when an auto-precharge is performed, a command cannot be issued to the same bank
for a period of Trwl + Tap cycles after issuance of the WRITA command. When bank active mode
is used, READ or WRIT commands can be issued successively if the row address is the same. The
number of cycles can thus be reduced by Trwl + Tap cycles for each write.
There is a limit on tRAS, the time for placing each bank in the active state. If there is no guarantee
that there will not be a cache hit and another row address will be accessed within the period in
which this value is maintained by program execution, it is necessary to set auto-refresh and set the
refresh cycle to no more than the maximum value of tRAS.
A burst read cycle without auto-precharge is shown in figure 7.18, a burst read cycle for the same
row address in figure 7.19, and a burst read cycle for different row addresses in figure 7.20.
Similarly, a burst write cycle without auto-precharge is shown in figure 7.21, a burst write cycle
for the same row address in figure 7.22, and a burst write cycle for different row addresses in
figure 7.23.
In figure 7.19, a Tnop cycle in which no operation is performed is inserted before the Tc cycle that
issues the READ command. The Tnop cycle is inserted to acquire two cycles of CAS latency for
the DQMxx signal that specifies the read byte in the data read from the SDRAM. If the CAS
latency is specified as two cycles or more, the Tnop cycle is not inserted because the two cycles of
latency can be acquired even if the DQMxx signal is asserted after the Tc cycle.
Page 254 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
When bank active mode is set, if only access cycles to the respective banks in the area 3 space are
considered, as long as access cycles to the same row address continue, the operation starts with the
cycle in figure 7.18 or 7.21, followed by repetition of the cycle in figure 7.19 or 7.22. An access to
a different area during this time has no effect. If there is an access to a different row address in the
bank active state, after this is detected the bus cycle in figure 7.20 or 7.23 is executed instead of
that in figure 7.19 or 7.22. In bank active mode, too, all banks become inactive after a refresh
cycle or after the bus is released as the result of bus arbitration.
Tr
Tc1
Td1
Tc2
Td2
Tc3
Td3
Tc4
Td4
Tde
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.18 Burst Read Timing (Bank Active, Different Bank, CAS Latency 1)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 255 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tnop
Tc1
Td1
Tc2
Td2
Tc3
Td3
Tc4
Td4
Tde
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.19 Burst Read Timing (Bank Active, Same Row Addresses in the Same Bank, CAS
Latency 1)
Page 256 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Tp
Tpw
Tr
Tc1
Td1
Tc2
Td2
Tc3
Td3
Tc4
Td4
Tde
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.20 Burst Read Timing (Bank Active, Different Row Addresses in the Same Bank,
CAS Latency 1)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 257 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tr
Tc1
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.21 Single Write Timing (Bank Active, Different Bank)
Page 258 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Tnop
Tc1
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.22 Single Write Timing (Bank Active, Same Row Addresses in the Same Bank)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 259 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tp
Tpw
Tr
Tc1
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.23 Single Write Timing (Bank Active, Different Row Addresses in the Same
Bank)
Page 260 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(8)
Section 7 Bus State Controller (BSC)
Refreshing
This LSI has a function for controlling SDRAM refreshing. Auto-refreshing can be performed by
clearing the RMODE bit to 0 and setting the RFSH bit to 1 in SDCR. A continuous refreshing can
be performed by setting the RRC2 to RRC0 bits in RTCSR. If SDRAM is not accessed for a long
period, self-refresh mode, in which the power consumption for data retention is low, can be
activated by setting both the RMODE bit and the RFSH bit to 1.
(a)
Auto-refreshing
Refreshing is performed at intervals determined by the input clock selected by bits CKS2 to CKS0
in RTCSR, and the value set by in RTCOR. The value of bits CKS2 to CKS0 in RTCOR should
be set so as to satisfy the refresh interval stipulation for the SDRAM used. First make the settings
for RTCOR, RTCNT, and the RMODE and RFSH bits in SDCR, then make the CKS2 to CKS0
and RRC2 to RRC0 settings. When the clock is selected by bits CKS2 to CKS0, RTCNT starts
counting up from the value at that time. The RTCNT value is constantly compared with the
RTCOR value, and if the two values are the same, a refresh request is generated and an autorefresh is performed for the number of times specified by the RRC2 to RRC0. At the same time,
RTCNT is cleared to zero and the count-up is restarted.
Figure 7.24 shows the auto-refresh cycle timing. After starting, the auto refreshing, PALL
command is issued in the Tp cycle to make all the banks to pre-charged state from active state
when some bank is being pre-charged. Then REF command is issued in the Trr cycle after
inserting idle cycles of which number is specified by the WTRP1 and WTRP0 bits in CS3WCR. A
new command is not issued for the duration of the number of cycles specified by the WTRC1 and
WTRC0 bits in CS3WCR after the Trr cycle. The WTRC1 and WTRC0 bits must be set so as to
satisfy the SDRAM refreshing cycle time stipulation (tRC). An idle cycle is inserted between the
Tp cycle and Trr cycle when the setting value of the WTRP1 and WTRP0 bits in CS3WCR is
longer than or equal to 1 cycle.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 261 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tp
Tpw
Trr
Trc
Trc
Trc
CKIO
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
Hi-z
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.24 Auto-Refresh Timing
Page 262 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(b)
Section 7 Bus State Controller (BSC)
Self-refreshing
Self-refresh mode in which the refresh timing and refresh addresses are generated within the
SDRAM. Self-refreshing is activated by setting both the RMODE bit and the RFSH bit in SDCR
to 1. After starting the self-refreshing, PALL command is issued in Tp cycle after the completion
of the pre-charging bank. A SELF command is then issued after inserting idle cycles of which
number is specified by the WTRP1 and WTRP0 bits in CS3WSR. SDRAM cannot be accessed
while in the self-refresh state. Self-refresh mode is cleared by clearing the RMODE bit to 0. After
self-refresh mode has been cleared, command issuance is disabled for the number of cycles
specified by the WTRC1 and WTRC0 bits in CS3WCR.
Self-refresh timing is shown in figure 7.25. Settings must be made so that self-refresh clearing and
data retention are performed correctly, and auto-refreshing is performed at the correct intervals.
When self-refreshing is activated from the state in which auto-refreshing is set, or when exiting
standby mode other than through a power-on reset, auto-refreshing is restarted if the RFSH bit is
set to 1 and the RMODE bit is cleared to 0 when self-refresh mode is cleared. If the transition
from clearing of self-refresh mode to the start of auto-refreshing takes time, this time should be
taken into consideration when setting the initial value of RTCNT. Making the RTCNT value 1 less
than the RTCOR value will enable refreshing to be started immediately.
After self-refreshing has been set, the self-refresh state continues even if the chip standby state is
entered using the LSI standby function, and is maintained even after recovery from standby mode
due to an interrupt. Note that the necessary signals such as CKE must be driven even in standby
state by setting the HIZCNT bit in CMNCR to 1.
In case of a power-on reset, the bus state controller's registers are initialized, and therefore the
self-refresh state is cleared.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 263 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tp
Tpw
Trr
Trc
Trc
Trc
CKIO
CKE
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
Hi-z
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.25 Self-Refresh Timing
(9)
Relationship between Refresh Requests and Bus Cycles
If a refresh request occurs during bus cycle execution, the refresh cycle must wait for the bus cycle
to be completed.
If a new refresh request occurs while waiting for the previous refresh request, the previous refresh
request is deleted. To refresh correctly, a bus cycle longer than the refresh interval must be
prevented from occurring.
Page 264 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
(10) Power-Down Mode
If the PDOWN bit in SDCR is set to 1, the SDRAM is placed in power-down mode by bringing
the CKE signal to the low level in the non-access cycle. This power-down mode can effectively
lower the power consumption in the non-access cycle. However, please note that if an access
occurs in power-down mode, a cycle of overhead occurs because a cycle is needed to assert the
CKE in order to cancel the power-down mode.
Figure 7.26 shows the access timing in power-down mode.
Power-down
Tnop
Tr
Tc1
Td1
Tde
Tap
Power-down
CKIO
CKE
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.26 Power-Down Mode Access Timing
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 265 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
(11) Power-On Sequence
In order to use SDRAM, mode setting must first be made for SDRAM after waiting for 100 μs or
a longer period after powering on. This 100-μs or longer period should be obtained by a power-on
reset generating circuit or software.
To perform SDRAM initialization correctly, the bus state controller registers must first be set,
followed by a write to the SDRAM mode register. In SDRAM mode register setting, the address
signal value at that time is latched by a combination of the CSn, RAS, CAS, and RD/WR signals.
If the value to be set is X, the bus state controller provides for value X to be written to the
SDRAM mode register by performing a write to address H'FFFC5000 + X for area 3 SDRAM. In
this operation the data is ignored, but the mode write is performed as a byte-size access. To set
burst read/single write, CAS latency 2 to 3, wrap type = sequential, and burst length 1 supported
by the LSI, arbitrary data is written in a byte-size access to the addresses shown in table 7.18. In
this time 0 is output at the external address pins of A12 or later.
Table 7.18 Access Address in SDRAM Mode Register Write
• Setting for Area 3
Burst read/single write (burst length 1):
Data Bus Width
CAS Latency
Access Address
External Address Pin
16 bits
2
H'FFFC5440
H'0000440
3
H'FFFC5460
H'0000460
32 bits
2
H'FFFC5880
H'0000880
3
H'FFFC58C0
H'00008C0
Burst read/burst write (burst length 1):
Data Bus Width
CAS Latency
Access Address
External Address Pin
16 bits
2
H'FFFC5040
H'0000040
3
H'FFFC5060
H'0000060
2
H'FFFC5080
H'0000080
3
H'FFFC50C0
H'00000C0
32 bits
Page 266 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Mode register setting timing is shown in figure 7.27. A PALL command (all bank pre-charge
command) is firstly issued. A REF command (auto refresh command) is then issued 8 times. An
MRS command (mode register write command) is finally issued. Idle cycles, of which number is
specified by the WTRP1 and WTRP0 bits in CS3WCR, are inserted between the PALL and the
first REF. Idle cycles, of which number is specified by the WTRC1 and WTRC0 bits in CS3WCR,
are inserted between REF and REF, and between the 8th REF and MRS. Idle cycles, of which
number is one or more, are inserted between the MRS and a command to be issued next.
It is necessary to keep idle time of certain cycles for SDRAM before issuing PALL command after
power-on. Refer to the manual of the SDRAM for the idle time to be needed. When the pulse
width of the reset signal is longer than the idle time, mode register setting can be started
immediately after the reset, but care should be taken when the pulse width of the reset signal is
shorter than the idle time.
Tp
PALL
Tpw
Trr
REF
Trc
Trc
Trr
REF
Trc
Trc
Tmw
MRS
Tnop
CKIO
A25 to A0
A12/A11*1
CSn
RASL, RASU
CASL, CASU
RD/WR
DQMxx
Hi-Z
D31 to D0
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.27 SDRAM Mode Write Timing (Based on JEDEC)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 267 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
(12) Low-Power SDRAM
The low-power SDRAM can be accessed using the same protocol as the normal SDRAM.
The differences between the low-power SDRAM and normal SDRAM are that partial refresh
takes place that puts only a part of the SDRAM in the self-refresh state during the self-refresh
function, and that power consumption is low during refresh under user conditions such as the
operating temperature. The partial refresh is effective in systems in which there is data in a work
area other than the specific area can be lost without severe repercussions.
The low-power SDRAM supports the extension mode register (EMRS) in addition to the mode
registers as the normal SDRAM. This LSI supports issuing of the EMRS command.
The EMRS command is issued according to the conditions specified in table below. For example,
if data H'0YYYYYYY is written to address H'FFFC5XX0 in longword, the commands are issued
to the CS3 space in the following sequence: PALL -> REF × 8 -> MRS -> EMRS. In this case, the
MRS and EMRS issue addresses are H'0000XX0 and H'YYYYYYY, respectively. If data
H'1YYYYYYY is written to address H'FFFC5XX0 in longword, the commands are issued to the
CS3 space in the following sequence: PALL -> MRS -> EMRS.
Table 7.19 Output Addresses when EMRS Command Is Issued
Access Data
Write
Access
Size
MRS
EMRS
Command
Command
Issue Address Issue Address
H'FFFC5XX0
H'********
16 bits
H'0000XX0
⎯
H'FFFC5XX0
H'0YYYYYYY 32 bits
H'0000XX0
H'YYYYYYY
H'FFFC5XX0
H'1YYYYYYY 32 bits
H'0000XX0
H'YYYYYYY
Command to be
Issued
Access
Address
CS3 MRS
CS3 MRS + EMRS
(with refresh)
CS3 MRS + EMRS
(without refresh)
Page 268 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Tp
PALL
Tpw
Trr
REF
Trc
Trc
Trr
REF
Trc
Trc
Tmw
MRS
Tnop
Temw
EMRS
Tnop
CKIO
A25 to A0
BA1*1
BA0*2
A12/A11*3
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
Hi-Z
BS
DACKn*4
Notes:
1. Address pin to be connected to pin BA1 of SDRAM.
2. Address pin to be connected to pin BA0 of SDRAM.
3. Address pin to be connected to pin A10 of SDRAM.
4. The waveform for DACKn is when active low is specified.
Figure 7.28 EMRS Command Issue Timing
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 269 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
• Deep power-down mode
The low-power SDRAM supports the deep power-down mode as a low-power consumption
mode. In the partial self-refresh function, self-refresh is performed on a specific area. In the
deep power-down mode, self-refresh will not be performed on any memory area. This mode is
effective in systems where all of the system memory areas are used as work areas.
If the RMODE bit in the SDCR is set to 1 while the DEEP and RFSH bits in the SDCR are set to
1, the low-power SDRAM enters the deep power-down mode. If the RMODE bit is cleared to 0,
the CKE signal is pulled high to cancel the deep power-down mode. Before executing an access
after returning from the deep power-down mode, the power-up sequence must be re-executed.
Tp
Tpw
Trr
Trc
Trc
Trc
CKIO
CKE
A25 to A0
A12/A11*1
CSn
RAS
CAS
RD/WR
DQMxx
D31 to D0
Hi-z
BS
DACKn*2
Notes: 1. Address pin to be connected to pin A10 of SDRAM.
2. The waveform for DACKn is when active low is specified.
Figure 7.29 Deep Power-Down Mode Transition Timing
Page 270 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.5.6
Section 7 Bus State Controller (BSC)
SRAM Interface with Byte Selection
The SRAM interface with byte selection is for access to an SRAM which has a byte-selection pin
(WEn). This interface has 16-bit data pins and accesses SRAMs having upper and lower byte
selection pins, such as UB and LB.
When the BAS bit in CSnWCR is cleared to 0 (initial value), the write access timing of the SRAM
interface with byte selection is the same as that for the normal space interface. While in read
access of a byte-selection SRAM interface, the byte-selection signal is output from the WEn pin,
which is different from that for the normal space interface. The basic access timing is shown in
figure 7.30. In write access, data is written to the memory according to the timing of the byteselection pin (WEn). For details, please refer to the Data Sheet for the corresponding memory.
If the BAS bit in CSnWCR is set to 1, the WEn pin and RD/WR pin timings change. Figure 7.31
shows the basic access timing. In write access, data is written to the memory according to the
timing of the write enable pin (RD/WR). The data hold timing from RD/WR negation to data write
must be acquired by setting the HW1 and HW0 bits in CSnWCR. Figure 7.32 shows the access
timing when a software wait is specified.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 271 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
T2
T1
CKIO
A25 to A0
CSn
WEn
RD/WR
Read
RD
D31 to D0
RD/WR
Write
RD
High
D31 to D0
BS
DACKn*
Note: * The waveform for DACKn is when active low is specified.
Figure 7.30 Basic Access Timing for SRAM with Byte Selection (BAS = 0)
Page 272 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
T1
T2
CKIO
A25 to A0
CSn
WEn
RD/WR
RD
Read
D31 to D0
RD/WR
High
RD
Write
D31 to D0
BS
DACKn*
Note: * The waveform for DACKn is when active low is specified.
Figure 7.31 Basic Access Timing for SRAM with Byte Selection (BAS = 1)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 273 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Th
T1
Tw
T2
Tf
CKIO
A25 to A0
CSn
WEn
RD/WR
RD
Read
D31 to D0
RD/WR
High
RD
Write
D31 to D0
BS
DACKn*
Note: * The waveform for DACKn is when active low is specified.
Figure 7.32 Wait Timing for SRAM with Byte Selection (BAS = 1)
(SW[1:0] = 01, WR[3:0] = 0001, HW[1:0] = 01)
Page 274 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
64K × 16-bit
SRAM
This LSI
...
A15
...
A17
A2
A0
CSn
CS
RD
OE
RD/WR
WE
I/O15
...
...
D31
D16
I/O0
WE3
UB
WE2
LB
...
D15
...
A15
D0
WE1
A0
WE0
CS
OE
WE
...
I/O15
I/O0
UB
LB
Figure 7.33 Example of Connection with 32-Bit Data-Width SRAM with Byte Selection
64K × 16-bit
SRAM
This LSI
A16
..
.
A1
A15
..
.
A0
CSn
CS
RD
OE
RD/WR
D15
..
.
D0
WE1
WE0
WE
I/O
.. 15
.
I/O 0
UB
LB
Figure 7.34 Example of Connection with 16-Bit Data-Width SRAM with Byte Selection
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 275 of 1278
Section 7 Bus State Controller (BSC)
7.5.7
SH7670 Group
PCMCIA Interface
With this LSI, areas 5 and 6 can be used for the IC memory card and I/O card interface defined in
the JEIDA specifications version 4.2 (PCMCIA2.1 Rev. 2.1) by specifying bits TYPE[2:0] in
CSnBCR (n = 5 and 6) to B'101. In addition, the bits SA[1:0] in CSnWCR (n = 5 and 6) assign the
upper or lower 32 Mbytes of each area to IC memory card or I/O card interface. For example, if
the bits SA1 and SA0 in CS5WCR are set to 1 and cleared to 0, respectively, the upper 32 Mbytes
of area 5 are used for IC memory card interface and the lower 32 Mbytes are used for I/O card
interface.
When the PCMCIA interface is used, the bus size must be specified as 8 bits or 16 bits using the
bits BSZ[1:0] in CS5BCR or CS6BCR.
Figure 7.35 shows an example of connection between this LSI and a PCMCIA card. To enable hot
swapping (insertion and removal of the PCMCIA card with the system power turned on), tri-state
buffers must be connected between the LSI and the PCMCIA card.
In the JEIDA and PCMCIA standards, operation in big endian mode is not clearly defined.
Consequently, the provided PCMCIA interface in big endian mode is available only for this LSI.
Page 276 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
PC card
(memory or I/O)
This LSI
A25 to A0
G
A25 to A0
D7 to D0
D15 to D8
D7 to D0
RD/WR
CS5B/CE1A
CE2A
G
DIR
D15 to D8
G
DIR
CE1
CE2
RD
OE
WE1/WE
WE/PGM
WE2/ICIORD
IORD
WE3/ICIOWR
IOWR
REG (Output port)
REG
G
WAIT
WAIT
IOIS16
IOIS16
Card
detector
CD1, CD2
Figure 7.35 Example of PCMCIA Interface Connection
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 277 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
(1)
Basic Timing for Memory Card Interface
Figure 7.36 shows the basic timing of the PCMCIA IC memory card interface. When areas 5 and 6
are specified as the PCMCIA interface, the bus is accessed with the IC memory card interface
according to the SA[1:0] bit settings in CS5WCR and CS6WCR. If the external bus frequency
(CKIO) increases, the setup times and hold times for the address pins (A25 to A0), card enable
signals (CE1A, CE2A, CE1B, CE2B), and write data (D15 to D0) to the RD and WE signals
become insufficient. To prevent this error, this LSI enables the setup times and hold times for
areas 5 and 6 to be specified independently, using CS5WCR and CS6WCR. In the PCMCIA
interface, as in the normal space interface, a software wait or hardware wait using the WAIT pin
can be inserted. Figure 7.37 shows the PCMCIA memory bus wait timing.
Tpcm1
Tpcm1w
Tpcm1w
Tpcm1w
Tpcm2
CKIO
A25 to A0
CExx
RD/WR
RD
Read
D15 to D0
WE
Write
D15 to D0
BS
Figure 7.36 Basic Access Timing for PCMCIA Memory Card Interface
Page 278 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Tpcm0
Tpcm0w
Tpcm1
Tpcm1w
Tpcm1w Tpcm1w
Tpcm1w
Tpcm2
Tpcm2w
CKIO
A25 to A0
CExx
RD/WR
RD
Read
D15 to D0
WE
Write
D15 to D0
BS
WAIT
Figure 7.37 Wait Timing for PCMCIA Memory Card Interface
(TED[3:0] = B'0010, PCW[3:0] = B'0000, TEH[3:0] = B'0001, Hardware Wait = 1)
A port is used to generate the REG signal that switches between the common memory and
attribute memory. As shown in the example in figure 7.38, when the total memory space necessary
for the common memory and attribute memory is 32 Mbytes or less, pin A24 can be used as the
REG signal to allocate a 16-Mbyte common memory space and a 16-Mbyte attribute memory
space.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 279 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
In case of 32Mbyts capacity (REG = I/O port is used)
Area 5: H'14000000
Attribute memory/Common memory
Area 5: H'16000000
I/O Space
Area 6: H'18000000
Attribute memory/Common memory
Area 6: H'1A000000
I/O Space
In case of 16Mbyts capacity (REG = A24 is used)
Area 5: H'14000000
Area 5: H'15000000
Area 5: H'16000000
Attribute memory
Common memory
I/OSpace
H'17000000
Area 6: H'18000000
Area 6: H'19000000
Area 6: H'1A000000
Attribute memory
Common memory
I/OSpace
H'1B000000
Figure 7.38 Example of PCMCIA Space Allocation (CS5WCR.SA[1:0] = B'10,
CS6WCR.SA[1:0] = B'10)
Page 280 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(2)
Section 7 Bus State Controller (BSC)
Basic Timing for I/O Card Interface
Figures 7.39 and 7.40 show the basic timing for the PCMCIA I/O card interface.
When accessing an I/O card through the PCMCIA interface, be sure to access the space as cachedisabled.
Switching between I/O card and IC memory card interfaces in the respective address spaces is
accomplished by the SA[1:0] bit settings in CS5WCR and CS6WCR.
The IOIS16 pin can be used for dynamic adjustment of the width of the I/O bus in access to an I/O
card via the PCMCIA interface when little endian mode has been selected. When the bus width of
area 5 or 6 is set to 16 bits and the IOIS16 signal is driven high during a cycle of word-unit access
to the I/O card bus, the bus width will be recognized as 8 bits and only 8 bits of data will be
accessed during the current cycle of the I/O card bus. Operation will automatically continue with
access to the remaining 8 bits of data.
The IOIS16 signal is sampled on falling edges of the CKIO in Tpci0 as well as all Tpci0w cycles
for which the TED3 to TED0 bits are set to 1.5 cycles or more, and the CE2A and CE2B signals
are updated after 1.5 cycles of the CKIO signal from the sampling point of Tpci0. Ensure that the
IOIS16 signal is defined at all sampling points and does not change along the way.
Set the TED3 to TED0 bits to satisfy the requirement of the PC card in use with regard to setup
timing from ICIORD or ICIOWR to CE1 or CE2.
The basic waveforms for dynamic bus-size adjustment are shown in figure 7.40.
Since the IOIS16 signal is not supported in big endian mode, the IOIS16 signal should be fixed to
the low level when big endian mode has been selected.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 281 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Tpci1
Tpci1w
Tpci1w
Tpci1w
Tpci2
CKIO
A25 to A0
CExx
RD/WR
ICIORD
Read
D15 to D0
ICIOWR
Write
D15 to D0
BS
Figure 7.39 Basic Access Timing for PCMCIA I/O Card Interface
Tpci0
Tpci0w
Tpci1
Tpci1w
Tpci1w
Tpci1w
Tpci1w
Tpci2
Tpci2w
Tpci0
Tpci0w
Tpci1
Tpci1w
Tpci1w
Tpci1w
Tpci1w
Tpci2
Tpci2w
CKIO
A25 to A0
CE1x
CE2x
RD/WR
ICIORD
Read
D15 to D0
ICIOWR
Write
D15 to D0
BS
WAIT
IOIS16
Figure 7.40 Dynamic Bus-Size Adjustment Timing for PCMCIA I/O Card Interface
(TED[3:0] = B'0010, PCW[3:0] = B'0000, TEH[3:0] = B'0001, Hardware Wait = 1)
Page 282 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.5.8
Section 7 Bus State Controller (BSC)
Wait between Access Cycles
As the operating frequency of LSIs becomes higher, the off-operation of the data buffer often
collides with the next data access when the read operation from devices with slow access speed is
completed. As a result of these collisions, the reliability of the device is low and malfunctions may
occur. A function that avoids data collisions by inserting idle (wait) cycles between continuous
access cycles has been newly added.
The number of wait cycles between access cycles can be set by the WM bit in CSnWCR, bits
IWW2 to IWW0, IWRWD2 to IWRWD0, IWRWS2 to IWRWS0, IWRRD2 to IWRRD0, and
IWRRS2 to IWRRS 0 in CSnBCR, and bits DMAIW2 to DMAIW0 and DMAIWA in CMNCR.
The conditions for setting the idle cycles between access cycles are shown below.
1.
2.
3.
4.
5.
6.
Continuous access cycles are write-read or write-write
Continuous access cycles are read-write for different spaces
Continuous access cycles are read-write for the same space
Continuous access cycles are read-read for different spaces
Continuous access cycles are read-read for the same space
Data output from an external device caused by DMA single address transfer is followed by
data output from another device that includes this LSI (DMAIWA = 0)
7. Data output from an external device caused by DMA single address transfer is followed by any
type of access (DMAIWA = 1)
For the specification of the number of idle cycles between access cycles described above, refer to
the description of each register.
Besides the idle cycles between access cycles specified by the registers, idle cycles must be
inserted to interface with the internal bus or to obtain the minimum pulse width for a multiplexed
pin (WEn). The following gives detailed information about the idle cycles and describes how to
estimate the number of idle cycles.
The number of idle cycles on the external bus from CSn negation to CSn or CSm assertion is
described below. Here, CSn and CSm also include CE2A and CE2B for PCMCIA.
There are eight conditions that determine the number of idle cycles on the external bus as shown
in table 7.20. The effects of these conditions are shown in figure 7.41.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 283 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.20 Conditions for Determining Number of Idle Cycles
No. Condition
Description
[1]
DMAIW[2:0] in
CMNCR
These bits specify the number of
0 to 12
idle cycles for DMA single address
transfer. This condition is effective
only for single address transfer and
generates idle cycles after the
access is completed.
When 0 is specified for the
number of idle cycles, the
DACK signal may be asserted
continuously. This causes a
discrepancy between the
number of cycles detected by
the device with DACK and the
DMAC transfer count, resulting
in a malfunction.
[2]
IW***[2:0] in
CSnBCR
These bits specify the number of
0 to 12
idle cycles for access other than
single address transfer. The
number of idle cycles can be
specified independently for each
combination of the previous and
next cycles. For example, in the
case where reading CS3 space
followed by reading other CS
space, the bits IWRRD[2:0] in
CS3BCR should be set to B'100 to
specify six or more idle cycles. This
condition is effective only for access
cycles other than single address
transfer and generates idle cycles
after the access is completed.
Do not set 0 for the number of
idle cycles between memory
types which are not allowed to
be accessed successively.
[3]
SDRAM-related These bits specify precharge
0 to 3
bits in
completion and startup wait cycles
CSnWCR
and idle cycles between commands
for SDRAM access. This condition
is effective only for SDRAM access
and generates idle cycles after the
access is completed
[4]
WM in
CSnWCR
Page 284 of 1278
Range
Note
Specify these bits in
accordance with the
specification of the target
SDRAM.
This bit enables or disables external 0 or 1
WAIT pin input for the memory
types other than SDRAM. When
this bit is cleared to 0 (external
WAIT enabled), one idle cycle is
inserted to check the external WAIT
pin input after the access is
completed. When this bit is set to 1
(disabled), no idle cycle is
generated.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
No. Condition
Description
Range
Note
[5]
Read data
transfer cycle
One idle cycle is inserted after a
0 or 1
read access is completed. This idle
cycle is not generated for the first or
middle cycles in divided access
cycles. This is neither generated
when the HM[1:0] bits in CSnWCR
are not B'00.
[6]
Internal bus
External bus access requests from 0 or
idle cycles, etc. the CPU or DMAC and their results larger
are passed through the internal
bus. The external bus enters idle
state during internal bus idle cycles
or while a bus other than the
external bus is being accessed.
This condition is not effective for
divided access cycles, which are
generated by the BSC when the
access size is larger than the
external data bus width.
The number of internal bus
idle cycles may not become 0
depending on the Iφ:Bφ clock
ratio. Tables 7.21 and 7.22
show the relationship between
the clock ratio and the
minimum number of internal
bus idle cycles.
[7]
Write data wait During write access, a write cycle is 0 or 1
cycles
executed on the external bus only
after the write data becomes ready.
This write data wait period
generates idle cycles before the
write cycle. Note that when the
previous cycle is a write cycle and
the internal bus idle cycles are
shorter than the previous write
cycle, write data can be prepared in
parallel with the previous write cycle
and therefore, no idle cycle is
generated (write buffer effect).
For write → write or write →
read access cycles,
successive access cycles
without idle cycles are
frequently available due to the
write buffer effect described in
the left column. If successive
access cycles without idle
cycles are not allowed, specify
the minimum number of idle
cycles between access cycles
through CSnBCR.
[8]
Idle cycles
between
different
memory types
One idle cycle is always
generated after a read cycle
with SDRAM or PCMCIA
interface.
To ensure the minimum pulse width 0 to 2.5 The number of idle cycles
on the signal-multiplexed pins, idle
depends on the target memory
cycles may be inserted before
types. See table 7.23.
access after memory types are
switched. For some memory types,
idle cycles are inserted even when
memory types are not switched.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 285 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
In the above conditions, a total of four conditions, that is, condition [1] or [2] (either one is
effective), condition [3] or [4] (either one is effective), a set of conditions [5] to [7] (these are
generated successively, and therefore the sum of them should be taken as one set of idle cycles),
and condition [8] are generated at the same time. The maximum number of idle cycles among
these four conditions become the number of idle cycles on the external bus. To ensure the
minimum idle cycles, be sure to make register settings for condition [1] or [2].
CKIO
External bus idle cycles
Previous access
Next access
CSn
Idle cycle after access
Idle cycle before access
[1] DMAIW[2:0] setting in CMNCR
[2] IWW[2:0] setting in CSnBCR
IWRWD[2:0] setting in CSnBCR
IWRWS[2:0] setting in CSnBCR
IWRRD[2:0] setting in CSnBCR
IWRRS[2:0] setting in CSnBCR
[3] WTRP[1:0] setting in CSnWCR
TRWL[1:0] setting in CSnWCR
WTRC[1:0] setting in CSnWCR
Either one of them
is effective
Condition [1] or [2]
Either one of them
is effective
Condition [3] or [4]
[4] WM setting in CSnWCR
[5] Read
data
transfer
[6] Internal bus idle cycles, etc.
[7] Write
data
wait
Set of conditions
[5] to [7]
[8] Idle cycles
between
Condition [8]
different
memory types
Note: A total of four conditions (condition [1] or [2], condition [3] or [4], a set of conditions [5] to [7],
and condition [8]) generate idle cycle at the same time. Accordingly, the maximum number of
cycles among these four conditions become the number of idle cycles.
Figure 7.41 Idle Cycle Conditions
Page 286 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 7 Bus State Controller (BSC)
Table 7.21 Minimum Number of Idle Cycles on Internal Bus (CPU Operation)
Clock Ratio (Iφ:Bφ)
CPU Operation
8:1
6:1
4:1
3:1
2:1
1:1
Write → write
1
1
2
2
2
3
Write → read
0
0
0
0
0
1
Read → write
1
1
2
2
2
3
Read → read
0
0
0
0
0
1
Table 7.22 Minimum Number of Idle Cycles on Internal Bus (DMAC Operation)
Transfer Mode
DMAC Operation
Dual Address
Single Address
Write → write
0
2
Write → read
0 or 2
0
Read → write
0
0
Read → read
0
2
Notes: 1. The write → write and read → read columns in dual address transfer indicate the cycles
in the divided access cycles.
2. For the write → read cycles in dual address transfer, 0 means different channels are
activated successively and 2 means when the same channel is activated successively.
3. The write → read and read → write columns in single address transfer indicate the case
when different channels are activated successively. The "write" means transfer from a
device with DACK to external memory and the "read" means transfer from external
memory to a device with DACK.
Table 7.23 Number of Idle Cycles Inserted between Access Cycles to Different Memory
Types
Next Cycle
Previous Cycle
SRAM
Byte SRAM (BAS = 0)
Byte SRAM (BAS = 1)
SDRAM
PCMCIA
SRAM
0
0
1
1
0
Byte SRAM (BAS = 0)
0
0
1
1
0
Byte SRAM (BAS = 1)
1
1
0
0
1
SDRAM
1
1
0
0
1
PCMCIA
0
0
1
1
0
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 287 of 1278
SH7670 Group
Section 7 Bus State Controller (BSC)
Figure 7.42 shows sample estimation of idle cycles between access cycles. In the actual operation,
the idle cycles may become shorter than the estimated value due to the write buffer effect or may
become longer due to internal bus idle cycles caused by stalling in the pipeline due to CPU
instruction execution or CPU register conflicts. Please consider these errors when estimating the
idle cycles.
Sample estimation of the number of idle clock cycles (states) between cycles of bus access
We consider CPU access for the transfer of data from the CS5 to the CS6 space.
For this transfer, the sequence read from CS5 →read from CS5 →write to CS6→write to CS6 ... is repeated.
• Condition
0 is specified as the number of idle cycles between CS5BCR and CS6BCR.
WM bit in CS5WCR and CS6WCR = 1 (external WAIT_ pin disabled)
HW[1:0] = 00 (no delay of CS negation)
Iφ:Bφ = 4:1
No other processing proceeds during the transfer.
CS5 and CS6 are connected to SRAM for access in 32-bit units by a 32-bit-wide bus.
The items that decide the number of idle cycles are estimated for the different transitions on between bus cycles.
R indicates reading and W indicates writing in the table below.
R→R
R→W
W→W
W→R
(1)/(2)
Item
0
0
0
0
Since CSnBCR is set to 0
Note
(3)/(4)
0
0
0
0
When the WM bit is set to 1
(5)
1
1
0
0
Generated after the read cycle
(6)
0
2
2
0
See the description for Iφ:Bφ = 4:1 in table 7.21.
(7)
0
1
0
0
The effect of the write buffer is that idle cycles are not
generated the second time.
(5)+(6)+(7)
1
4
2
0
(8)
0
0
0
0
Due to SRAM→SRAM
Estimated number
of idle cycles
1
4
2
0
Maximum value among (1)/(2), (3)/(4), (5)+(6)+(7), and (8)
Actual number
of idle cycles
1
4
2
1
The mismatch in the case of W→R is because the estimate
of the number of idle cycles for item (6) was zero. Since a
loop-decision instruction is actually executed here,
an idle cycle is generated internally.
Figure 7.42 Comparison between Estimated Idle Cycles and Actual Value
Page 288 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
7.5.9
(1)
Section 7 Bus State Controller (BSC)
Others
Reset
The bus state controller (BSC) can be initialized completely only at power-on reset. At power-on
reset, all signals are negated and data output buffers are turned off regardless of the bus cycle state
after the internal reset is synchronized with the internal clock. All control registers are initialized.
In standby, sleep, and manual reset, control registers of the bus state controller are not initialized.
At manual reset, only the current bus cycle being executed is completed. Since the RTCNT
continues counting up during manual reset signal assertion, a refresh request occurs to initiate the
refresh cycle.
(2)
Access from the Side of the LSI Internal Bus Master
There are three types of LSI internal buses: a CPU bus, internal bus, and peripheral bus. The CPU
and cache memory are connected to the CPU bus. Internal bus masters other than the CPU and bus
state controller are connected to the internal bus. Low-speed peripheral modules are connected to
the peripheral bus. Internal memories other than the cache memory are connected bidirectionally
to the CPU bus and internal bus. Access from the CPU bus to the internal bus is enabled but
access from the internal bus to the cache bus is disabled. This gives rise to the following problems.
On-chip bus masters such as DMAC other than the CPU can access internal memory other than
the cache memory but cannot access the cache memory. If an on-chip bus master other than the
CPU writes data to an external memory other than the cache, the contents of the external memory
may differ from that of the cache memory. To prevent this problem, if the external memory whose
contents is cached is written by an on-chip bus master other than the CPU, the corresponding
cache memory should be purged by software.
In a cache-enabled space, if the CPU initiates read access, the cache is searched. If the cache stores
data, the CPU latches the data and completes the read access. If the cache does not store data, the
CPU performs four contiguous longword read cycles to perform cache fill operations via the
internal bus. If a cache miss occurs in byte or word operand access or at a branch to an odd word
boundary (4n + 2), the CPU performs four contiguous longword access cycles to perform a cache
fill operation on the external interface. For a cache-disabled space, the CPU performs access
according to the actual access addresses. For an instruction fetch to an even word boundary (4n),
the CPU performs longword access. For an instruction fetch to an odd word boundary (4n + 2), the
CPU performs word access.
For a read cycle of an on-chip peripheral module, the cycle is initiated through the internal bus and
peripheral bus. The read data is sent to the CPU via the peripheral bus, internal bus, and CPU bus.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 289 of 1278
Section 7 Bus State Controller (BSC)
SH7670 Group
In a write cycle for the cache-enabled space, the write cycle operation differs according to the
cache write methods.
In write-back mode, the cache is first searched. If data is detected at the address corresponding to
the cache, the data is then re-written to the cache. In the actual memory, data will not be re-written
until data in the corresponding address is re-written. If data is not detected at the address
corresponding to the cache, the cache is modified. In this case, data to be modified is first saved to
the internal buffer, 16-byte data including the data corresponding to the address is then read, and
data in the corresponding access of the cache is finally modified. Following these operations, a
write-back cycle for the saved 16-byte data is executed.
In write-through mode, the cache is first searched. If data is detected at the address corresponding
to the cache, the data is re-written to the cache simultaneously with the actual write via the internal
bus. If data is not detected at the address corresponding to the cache, the cache is not modified but
an actual write is performed via the internal bus.
Since the bus state controller (BSC) incorporates a one-stage write buffer, the BSC can execute an
access via the internal bus before the previous external bus cycle is completed in a write cycle. If
the on-chip module is read or written after the external low-speed memory is written, the on-chip
module can be accessed before the completion of the external low-speed memory write cycle.
In read cycles, the CPU is placed in the wait state until read operation has been completed. To
continue the process after the data write to the device has been completed, perform a dummy read
to the same address to check for completion of the write before the next process to be executed.
The write buffer of the BSC functions in the same way for an access by a bus master other than
the CPU such as the DMAC. Accordingly, to perform dual address DMA transfers, the next read
cycle is initiated before the previous write cycle is completed. Note, however, that if both the
DMA source and destination addresses exist in external memory space, the next write cycle will
not be initiated until the previous write cycle is completed.
Changing the registers in the BSC while the write buffer is operating may disrupt correct write
access. Therefore, do not change the registers in the BSC immediately after a write access. If this
change becomes necessary, do it after executing a dummy read of the write data.
In this LSI, the priority level applicable when there is a request for bus mastership for the internal
bus from any of the internal bus masters excluding the CPU (that is, A-DMAC (including FDMAC), E-DMAC, and DMAC) can be set in the register.
When changing the priority level, rewrite the register after making sure that none of the A-DMAC
(including F-DMAC), E-DMAC, and DMAC is started.
Page 290 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(3)
Section 7 Bus State Controller (BSC)
On-Chip Peripheral Module Access
To access an on-chip module register, two or more peripheral module clock (Pφ) cycles are
required. Care must be taken in system design.
When the CPU writes data to the internal peripheral registers, the CPU performs the succeeding
instructions without waiting for the completion of writing to registers.
For example, a case is described here in which the system is transferring to the software standby
mode for power savings. To make this transition, the SLEEP instruction must be performed after
setting the STBY bit in the STBCR register to 1. However a dummy read of the STBCR register is
required before executing the SLEEP instruction. If a dummy read is omitted, the CPU executes
the SLEEP instruction before the STBY bit is set to 1, thus the system enters sleep mode not
software standby mode. A dummy read of the STBCR register is indispensable to complete
writing to the STBY bit.
To reflect the change by internal peripheral registers while performing the succeeding instructions,
execute a dummy read of registers to which write instruction is given and then perform the
succeeding instructions.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 291 of 1278
Section 7 Bus State Controller (BSC)
Page 292 of 1278
SH7670 Group
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Section 8 Direct Memory Access Controller (DMAC)
The DMAC can be used in place of the CPU to perform high-speed transfers between external
devices that have DACK (transfer request acknowledge signal), external memory, on-chip
memory, memory-mapped external devices, and on-chip peripheral modules.
8.1
Features
• Number of channels: Eight channels (channels 0 to 7) selectable
Two channels (channels 0 and 1) can receive external requests.
• 4-Gbyte physical address space
• Data transfer unit is selectable: Byte, word (two bytes), longword (four bytes), and 16 bytes
(longword × 4)
• Maximum transfer count: 16,777,216 transfers (24 bits)
• Address mode: Dual address mode and single address mode are supported.
• Transfer requests
⎯ External request
⎯ On-chip peripheral module request
⎯ Auto request
The following modules can issue on-chip peripheral module requests.
⎯ Six SCIF sources, two IIC3 sources, two CMT sources, two SSI sources, and two SDHI
sources
• Selectable bus modes
⎯ Cycle steal mode (normal mode and intermittent mode)
⎯ Burst mode
• Selectable channel priority levels: The channel priority levels are selectable between fixed
mode and round-robin mode.
• Interrupt request: An interrupt request can be sent to the CPU on completion of half- or fulldata transfer. Through the HE and HIE bits in CHCR, an interrupt is specified to be issued to
the CPU when half of the initially specified DMA transfer is completed.
• External request detection: There are following four types of DREQ input detection.
⎯ Low level detection
⎯ High level detection
⎯ Rising edge detection
⎯ Falling edge detection
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 293 of 1278
Section 8 Direct Memory Access Controller (DMAC)
SH7670 Group
• Transfer request acknowledge and transfer end signals: Active levels for DACK and TEND
can be set independently.
• Support of reload functions in DMA transfer information registers: DMA transfer using the
same information as the current transfer can be repeated automatically without specifying the
information again. Modifying the reload registers during DMA transfer enables next DMA
transfer to be done using different transfer information.
The reload function can be enabled or disabled in each channel and in each reload register.
Page 294 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Figure 8.1 shows the block diagram of the DMAC.
RDMATCR_n
On-chip
memory
Iteration
control
On-chip
peripheral module
Register
control
DMATCR_n
RSAR_n
Internal bus
Peripheral bus
SAR_n
Start-up
control
RDAR_n
DAR_n
DMA transfer request signal
CHCR_n
DMA transfer acknowledge signal
HEIn
DEIn
Interrupt controller
Request
priority
control
DMAOR
DMARS0
to DMARS3
External ROM
Bus
interface
External RAM
DMAC module
External device
(memory mapped)
External device
(with acknowledge)
Bus state
controller
DREQ0 to DREQ3
DACK0 to DACK3,
TEND0, TEND1
[Legend]
RDMATCR: DMA reload transfer count register
DMATCR: DMA transfer count register
RSAR:
DMA reload source address register
SAR:
DMA source address register
RDAR:
DMA reload destination address register
DAR:
DMA destination address register
DMA channel control register
CHCR:
DMA operation register
DMAOR:
DMARS0 to DMARS3: DMA extension resource selectors 0 to 3
DMA transfer half-end interrupt request to the CPU
HEIn:
DMA transfer end interrupt request to the CPU
DEIn:
n = 0 to 7
Figure 8.1 Block Diagram of DMAC
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 295 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
8.2
Input/Output Pins
The external pins for DMAC are described below. Table 8.1 lists the configuration of the pins that
are connected to external bus. DMAC has pins for two channels (channels 0 and 1) for external
bus use.
Table 8.1
Pin Configuration
Channel Name
Abbreviation I/O
Function
DMA transfer request DREQ0
I
DMA transfer request input from an
external device to channel 0
DMA transfer request DACK0
acknowledge
O
DMA transfer request acknowledge
output from channel 0 to an external
device
DMA transfer request DREQ1
I
DMA transfer request input from an
external device to channel 1
DMA transfer request DACK1
acknowledge
O
DMA transfer request acknowledge
output from channel 1 to an external
device
0
DMA transfer end
TEND0
O
DMA transfer end output for channel 0
1
DMA transfer end
TEND1
O
DMA transfer end output for channel 1
0
1
Page 296 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.3
Section 8 Direct Memory Access Controller (DMAC)
Register Descriptions
The DMAC has the registers listed in table 8.2. There are four control registers and three reload
registers for each channel, and one common control register is used by all channels. In addition,
there is one extension resource selector per two channels. Each channel number is expressed in the
register names, as in SAR_0 for SAR in channel 0.
Table 8.2
Register Configuration
Channel
Register Name
Abbreviation R/W
Initial Value
Address
Access
Size
0
DMA source address
register_0
SAR_0
R/W
H'00000000
H'FFFE1000
16, 32
DMA destination
address register_0
DAR_0
R/W
H'00000000
H'FFFE1004
16, 32
DMA transfer count
register_0
DMATCR_0
R/W
H'00000000
H'FFFE1008
16, 32
DMA channel control
register_0
CHCR_0
R/W*1 H'00000000
H'FFFE100C
8, 16, 32
DMA reload source
address register_0
RSAR_0
R/W
H'00000000
H'FFFE1100
16, 32
DMA reload destination RDAR_0
address register_0
R/W
H'00000000
H'FFFE1104
16, 32
DMA reload transfer
count register_0
RDMATCR_0 R/W
H'00000000
H'FFFE1108
16, 32
DMA source address
register_1
SAR_1
R/W
H'00000000
H'FFFE1010
16, 32
DMA destination
address register_1
DAR_1
R/W
H'00000000
H'FFFE1014
16, 32
DMA transfer count
register_1
DMATCR_1
R/W
H'00000000
H'FFFE1018
16, 32
DMA channel control
register_1
CHCR_1
R/W*1 H'00000000
H'FFFE101C
8, 16, 32
DMA reload source
address register_1
RSAR_1
R/W
H'00000000
H'FFFE1110
16, 32
DMA reload destination RDAR_1
address register_1
R/W
H'00000000
H'FFFE1114
16, 32
RDMATCR_1 R/W
H'00000000
H'FFFE1118
16, 32
1
DMA reload transfer
count register_1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 297 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Channel
Register Name
Abbreviation R/W
Initial Value
Address
Access
Size
2
DMA source address
register_2
SAR_2
R/W
H'00000000
H'FFFE1020
16, 32
DMA destination
address register_2
DAR_2
R/W
H'00000000
H'FFFE1024
16, 32
DMA transfer count
register_2
DMATCR_2
R/W
H'00000000
H'FFFE1028
16, 32
DMA channel control
register_2
CHCR_2
R/W*1 H'00000000
H'FFFE102C
8, 16, 32
DMA reload source
address register_2
RSAR_2
R/W
H'00000000
H'FFFE1120
16, 32
DMA reload destination RDAR_2
address register_2
R/W
H'00000000
H'FFFE1124
16, 32
DMA reload transfer
count register_2
RDMATCR_2 R/W
H'00000000
H'FFFE1128
16, 32
DMA source address
register_3
SAR_3
R/W
H'00000000
H'FFFE1030
16, 32
DMA destination
address register_3
DAR_3
R/W
H'00000000
H'FFFE1034
16, 32
DMA transfer count
register_3
DMATCR_3
R/W
H'00000000
H'FFFE1038
16, 32
DMA channel control
register_3
CHCR_3
R/W*1 H'00000000
H'FFFE103C
8, 16, 32
DMA reload source
address register_3
RSAR_3
R/W
H'00000000
H'FFFE1130
16, 32
DMA reload destination RDAR_3
address register_3
R/W
H'00000000
H'FFFE1134
16, 32
RDMATCR_3 R/W
H'00000000
H'FFFE1138
16, 32
3
DMA reload transfer
count register_3
Page 298 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Channel
Register Name
Abbreviation R/W
Initial Value
Address
Access
Size
4
DMA source address
register_4
SAR_4
R/W
H'00000000
H'FFFE1040
16, 32
DMA destination
address register_4
DAR_4
R/W
H'00000000
H'FFFE1044
16, 32
DMA transfer count
register_4
DMATCR_4
R/W
H'00000000
H'FFFE1048
16, 32
DMA channel control
register_4
CHCR_4
R/W*1 H'00000000
H'FFFE104C
8, 16, 32
DMA reload source
address register_4
RSAR_4
R/W
H'00000000
H'FFFE1140
16, 32
DMA reload destination RDAR_4
address register_4
R/W
H'00000000
H'FFFE1144
16, 32
DMA reload transfer
count register_4
RDMATCR_4 R/W
H'00000000
H'FFFE1148
16, 32
DMA source address
register_5
SAR_5
R/W
H'00000000
H'FFFE1050
16, 32
DMA destination
address register_5
DAR_5
R/W
H'00000000
H'FFFE1054
16, 32
DMA transfer count
register_5
DMATCR_5
R/W
H'00000000
H'FFFE1058
16, 32
DMA channel control
register_5
CHCR_5
R/W*1 H'00000000
H'FFFE105C
8, 16, 32
DMA reload source
address register_5
RSAR_5
R/W
H'00000000
H'FFFE1150
16, 32
DMA reload destination RDAR_5
address register_5
R/W
H'00000000
H'FFFE1154
16, 32
RDMATCR_5 R/W
H'00000000
H'FFFE1158
16, 32
5
DMA reload transfer
count register_5
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 299 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Channel
Register Name
Abbreviation R/W
Initial Value
Address
Access
Size
6
DMA source address
register_6
SAR_6
R/W
H'00000000
H'FFFE1060
16, 32
DMA destination
address register_6
DAR_6
R/W
H'00000000
H'FFFE1064
16, 32
DMA transfer count
register_6
DMATCR_6
R/W
H'00000000
H'FFFE1068
16, 32
DMA channel control
register_6
CHCR_6
R/W*1 H'00000000
H'FFFE106C
8, 16, 32
DMA reload source
address register_6
RSAR_6
R/W
H'00000000
H'FFFE1160
16, 32
DMA reload destination RDAR_6
address register_6
R/W
H'00000000
H'FFFE1164
16, 32
DMA reload transfer
count register_6
RDMATCR_6 R/W
H'00000000
H'FFFE1168
16, 32
DMA source address
register_7
SAR_7
R/W
H'00000000
H'FFFE1070
16, 32
DMA destination
address register_7
DAR_7
R/W
H'00000000
H'FFFE1074
16, 32
DMA transfer count
register_7
DMATCR_7
R/W
H'00000000
H'FFFE1078
16, 32
DMA channel control
register_7
CHCR_7
R/W*1 H'00000000
H'FFFE107C
8, 16, 32
DMA reload source
address register_7
RSAR_7
R/W
H'00000000
H'FFFE1170
16, 32
DMA reload destination RDAR_7
address register_7
R/W
H'00000000
H'FFFE1174
16, 32
RDMATCR_7 R/W
H'00000000
H'FFFE1178
16, 32
7
DMA reload transfer
count register_7
Page 300 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Address
Access
Size
R/W*2 H'0000
H'FFFE1200
8, 16
DMARS0
R/W
H'0000
H'FFFE1300
16
DMA extension
resource selector 1
DMARS1
R/W
H'0000
H'FFFE1304
16
4 and 5
DMA extension
resource selector 2
DMARS2
R/W
H'0000
H'FFFE1308
16
6 and 7
DMA extension
resource selector 3
DMARS3
R/W
H'0000
H'FFFE130C
16
Channel
Register Name
Abbreviation R/W
Common
DMA operation register DMAOR
0 and 1
DMA extension
resource selector 0
2 and 3
Initial Value
Notes: 1. For the HE and TE bits in CHCRn, only 0 can be written to clear the flags after 1 is
read.
2. For the AE and NMIF bits in DMAOR, only 0 can be written to clear the flags after 1 is
read.
8.3.1
DMA Source Address Registers (SAR)
The DMA source address registers (SAR) are 32-bit readable/writable registers that specify the
source address of a DMA transfer. During a DMA transfer, these registers indicate the next source
address. When the data of an external device with DACK is transferred in single address mode,
SAR is ignored.
To transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2byte, 4-byte, or 16-byte address boundary respectively.
Bit:
Initial value:
R/W:
Bit:
Initial value:
R/W:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 301 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
8.3.2
DMA Destination Address Registers (DAR)
The DMA destination address registers (DAR) are 32-bit readable/writable registers that specify
the destination address of a DMA transfer. During a DMA transfer, these registers indicate the
next destination address. When the data of an external device with DACK is transferred in single
address mode, DAR is ignored.
To transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2byte, 4-byte, or 16-byte address boundary respectively.
Bit:
Initial value:
R/W:
Bit:
Initial value:
R/W:
8.3.3
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
DMA Transfer Count Registers (DMATCR)
The DMA transfer count registers (DMATCR) are 32-bit readable/writable registers that specify
the number of DMA transfers. The transfer count is 1 when the setting is H'00000001, 16,777,215
when H'00FFFFFF is set, and 16,777,216 (the maximum) when H'00000000 is set. During a DMA
transfer, these registers indicate the remaining transfer count.
The upper eight bits of DMATCR are always read as 0, and the write value should always be 0. To
transfer data in 16 bytes, one 16-byte transfer (128 bits) counts one.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
Page 302 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.3.4
Section 8 Direct Memory Access Controller (DMAC)
DMA Channel Control Registers (CHCR)
The DMA channel control registers (CHCR) are 32-bit readable/writable registers that control the
DMA transfer mode.
The DO, AM, AL, DL, and DS bits which specify the DREQ and DACK external pin functions
can be read and written to in channels 0 and 1, but they are reserved in channels 2 to 7. The TL bit
which specifies the TEND external pin function can be read and written to in channels 0 and 1, but
it is reserved in channels 2 to 7.
Bit:
Initial value:
R/W:
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TC
⎯
⎯
RLD
⎯
⎯
⎯
⎯
DO
TL
⎯
⎯
HE
HIE
AM
AL
0
R/W
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R
0
R
0
R/W
0
R/W
15
14
13
12
11
10
9
8
4
DM[1:0]
Initial value:
R/W:
0
R/W
0
R/W
SM[1:0]
0
R/W
0
R/W
RS[3:0]
0
R/W
0
R/W
0
R/W
0
R/W
7
6
5
DL
DS
TB
0
R/W
0
R/W
0
R/W
0
0
R/(W)* R/W
3
TS[1:0]
0
R/W
0
R/W
2
1
0
IE
TE
DE
0
0
0
R/W R/(W)* R/W
Note: * Only 0 can be written to clear the flag after 1 is read.
Bit
Bit Name
Initial
Value
R/W
Descriptions
31
TC
0
R/W
Transfer Count Mode
Specifies whether to transmit data once or for the count
specified in DMATCR by one transfer request. This
function is valid only at a request of the peripheral
module. Note that when this bit is set to 0, the TB bit
must not be set to 1 (burst mode). When the SCIF,
IIC3, or SSI is selected for the transfer request source,
this bit (TC) must not be set to 1.
0: Transmits data once by one transfer request.
1: Transmits data for the count specified in DMATCR
by one transfer request.
30
⎯
0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 303 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
29
RLDSAR
0
R/W
SAR Reload Function Enable or Disable
Sets whether to enable or disable the reload function
for SAR or DMATCR.
0: Disables the reload function for SAR or DMATCR.
1: Enables the reload function for SAR or DMATCR.
28
RLDDAR
0
R/W
DAR Reload Function Enable or Disable
Sets whether to enable or disable the reload function
for DAR or DMATCR.
0: Disables the reload function for DAR or DMATCR.
1: Enables the reload function for DAR or DMATCR.
27 to 24
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
23
DO
0
R/W
DMA Overrun
Selects whether DREQ is detected by overrun 0 or by
overrun 1. This bit is valid only in CHCR_0 and
CHCR_1. This bit is reserved in CHCR_2 to CHCR_7;
it is always read as 0 and the write value should always
be 0.
0: Detects DREQ by overrun 0.
1: Detects DREQ by overrun 1.
22
TL
0
R/W
Transfer End Level
Specifies the TEND signal output is high active or low
active. This bit is valid only in CHCR_0 and CHCR_1.
This bit is reserved in CHCR_2 to CHCR_7; it is always
read as 0 and the write value should always be 0.
0: Low-active output from TEND
1: High-active output from TEND
Page 304 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
21
⎯
0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
20
TEMASK
0
R/W
TE Set Mask
Indicates that DMA transfer is not terminated when the
TE bit is set to 1. By setting this bit together with the
SAR reload function or the DAR reload function, DMA
transfer can be executed until the transfer request is
canceled. Upon detection of the rising or falling edge of
an auto request or external request, this bit is ignored
and the DMA transfer is terminated when the TE bit is
set. Note that this function is enabled if either of the
RLDSAR bit or the RLDDAR bit is set to 1.
0: Terminates DMA if the TE bit is set.
1: Continues DMA even if the TE bit is set.
19
HE
0
R/(W)* Half-End Flag
This bit is set to 1 when the transfer count reaches half
of the DMATCR value that was specified before
transfer starts.
If DMA transfer ends because of an NMI interrupt, a
DMA address error, or clearing of the DE bit or the
DME bit in DMAOR before the transfer count reaches
half of the initial DMATCR value, the HE bit is not set to
1. If DMA transfer ends due to an NMI interrupt, a DMA
address error, or clearing of the DE bit or the DME bit
in DMAOR after the HE bit is set to 1, the bit remains
set to 1.
To clear the HE bit, write 0 to it after HE = 1 is read.
0: DMATCR > (DMATCR set before transfer starts)/2
during DMA transfer or after DMA transfer is
terminated
[Clearing condition]
•
Writing 0 after reading HE = 1.
1: DMATCR ≤ (DMATCR set before transfer starts)/2
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 305 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
18
HIE
0
R/W
Half-End Interrupt Enable
Specifies whether to issue an interrupt request to the
CPU when the transfer count reaches half of the
DMATCR value that was specified before transfer
starts.
When the HIE bit is set to 1, the DMAC requests an
interrupt to the CPU when the HE bit becomes 1.
0: Disables an interrupt to be issued when DMATCR
= (DMATCR set before transfer starts)/2.
1: Enables an interrupt to be issued when DMATCR
= (DMATCR set before transfer starts)/2.
17
AM
0
R/W
Acknowledge Mode
Specifies whether DACK is output in data read cycle or
in data write cycle in dual address mode.
In single address mode, DACK is always output
regardless of the specification by this bit.
This bit is valid only in CHCR_0 and CHCR_1. This bit
is reserved in CHCR_2 to CHCR_7; it is always read
as 0 and the write value should always be 0.
0: DACK output in read cycle (dual address mode)
1: DACK output in write cycle (dual address mode)
16
AL
0
R/W
Acknowledge Level
Specifies the DACK (acknowledge) signal output is
high active or low active.
This bit is valid only in CHCR_0 and CHCR_1. This bit
is reserved in CHCR_2 to CHCR_7; it is always read
as 0 and the write value should always be 0.
0: Low-active output from DACK
1: High-active output from DACK
Page 306 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
15, 14
DM[1:0]
00
R/W
Destination Address Mode
These bits select whether the DMA destination address
is incremented, decremented, or left fixed. (In single
address mode, DM1 and DM0 bits are ignored when
data is transferred to an external device with DACK.)
00: Fixed destination address
01: Destination address is incremented (+1 in 8-bit
transfer, +2 in 16-bit transfer, +4 in 32-bit transfer,
+16 in 16-byte transfer)
10: Destination address is decremented (–1 in 8-bit
transfer, –2 in 16-bit transfer, –4 in 32-bit transfer,
setting prohibited in 16-byte transfer)
11: Setting prohibited
13, 12
SM[1:0]
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
00
R/W
Source Address Mode
These bits select whether the DMA source address is
incremented, decremented, or left fixed. (In single
address mode, SM1 and SM0 bits are ignored when
data is transferred from an external device with DACK.)
00: Fixed source address
01: Source address is incremented (+1 in byte-unit
transfer, +2 in word-unit transfer, +4 in longwordunit transfer, +16 in 16-byte-unit transfer)
10: Source address is decremented (–1 in byte-unit
transfer, –2 in word-unit transfer, –4 in longwordunit transfer, setting prohibited in 16-byte-unit
transfer)
11: Setting prohibited
Page 307 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
11 to 8
RS[3:0]
0000
R/W
Resource Select
These bits specify which transfer requests will be sent
to the DMAC. The changing of transfer request source
should be done in the state when DMA enable bit (DE)
is set to 0.
0000: External request, dual address mode
0001: Setting prohibited
0010: External request/single address mode
External address space → External device with
DACK
0011: External request/single address mode
External device with DACK → External address
space
0100: Auto request
0101: Setting prohibited
0110: Setting prohibited
0111: Setting prohibited
1000: DMA extension resource selector
1001: Setting prohibited
1010: Setting prohibited
1011: Setting prohibited
1100: Setting prohibited
1101: Setting prohibited
1110: Setting prohibited
1111: Setting prohibited
Note: External request specification is valid only in
CHCR_0 to CHCR_3. If a request source is
selected in channels CHCR_4 to CHCR_7, no
operation will be performed.
Page 308 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
7
DL
0
R/W
DREQ Level
6
DS
0
R/W
DREQ Edge Select
These bits specify the sampling method of the DREQ
pin input and the sampling level.
These bits are valid only in CHCR_0 and CHCR_1.
These bits are reserved in CHCR_2 to CHCR_7; they
are always read as 0 and the write value should always
be 0.
If the transfer request source is specified as an on-chip
peripheral module or if an auto-request is specified, the
specification by these bits is ignored.
00: DREQ detected in low level
01: DREQ detected at falling edge
10: DREQ detected in high level
11: DREQ detected at rising edge
5
TB
0
R/W
Transfer Bus Mode
Specifies the bus mode when DMA transfers data.
Note that the burst mode must not be selected when
TC = 0.
0: Cycle steal mode
1: Burst mode
4, 3
TS[1:0]
00
R/W
Transfer Size
These bits specify the size of data to be transferred.
Select the size of data to be transferred when the
source or destination is an on-chip peripheral module
register of which transfer size is specified.
00: Byte unit
01: Word unit (two bytes)
10: Longword unit (four bytes)
11: 16-byte (four longword) unit
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 309 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
2
IE
0
R/W
Interrupt Enable
Specifies whether or not an interrupt request is
generated to the CPU at the end of the DMA transfer.
Setting this bit to 1 generates an interrupt request
(DEI) to the CPU when TE bit is set to 1.
0: Disables an interrupt request.
1: Enables an interrupt request.
1
TE
0
R/(W)* Transfer End Flag
This bit is set to 1 when DMATCR becomes 0 and
DMA transfer ends.
The TE bit is not set to 1 in the following cases.
•
DMA transfer ends due to an NMI interrupt or DMA
address error before DMATCR becomes 0.
•
DMA transfer is ended by clearing the DE bit and
DME bit in DMA operation register (DMAOR).
To clear the TE bit, write 0 after reading TE = 1.
If the TEMASK bit is 0 and the TE bit is set, transfer is
not enabled even if the DE bit is set to 1.
0: During the DMA transfer or DMA transfer has been
terminated
[Clearing condition]
•
Writing 0 after reading TE = 1
1: DMA transfer ends by the specified count
(DMATCR = 0)
Page 310 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Descriptions
0
DE
0
R/W
DMA Enable
Enables or disables the DMA transfer. In auto request
mode, DMA transfer starts by setting the DE bit and
DME bit in DMAOR to 1. In this case, all of the bits
TE, NMIF in DMAOR, and AE must be 0. In an
external request or peripheral module request, DMA
transfer starts if DMA transfer request is generated by
the devices or peripheral modules after setting the bits
DE and DME to 1. If the TEMASK bit is 1, the NMIF
and AE bits must be 0 upon detection of the low or
high level of an external request and at a request of
the peripheral module. If the TEMASK bit is 0, the TE
bit must also be 0. As with auto request mode, all of
the TE, NMIF, and AE bits must be 0 upon detection
of the rising or falling edge of an external request.
Clearing the DE bit to 0 can terminate the DMA
transfer.
0: DMA transfer disabled
1: DMA transfer enabled
Note:
*
Only 0 can be written to clear the flag after 1 is read.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 311 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
8.3.5
DMA Reload Source Address Registers (RSAR)
The DMA reload source address registers (RSAR) are 32-bit readable/writable registers.
When the SAR reload function is enabled, the RSAR value is written to the source address register
(SAR) at the end of the current DMA transfer. In this case, a new value for the next DMA transfer
can be preset in RSAR during the current DMA transfer. When the SAR reload function is
disabled, RSAR is ignored.
To transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2byte, 4-byte, or 16-byte address boundary respectively.
Bit:
Initial value:
R/W:
Bit:
Initial value:
R/W:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Page 312 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.3.6
Section 8 Direct Memory Access Controller (DMAC)
DMA Reload Destination Address Registers (RDAR)
The DMA reload destination address registers (RDAR) are 32-bit readable/writable registers.
When the DAR reload function is enabled, the RDAR value is written to the destination address
register (SAR) at the end of the current DMA transfer. In this case, a new value for the next DMA
transfer can be preset in RDAR during the current DMA transfer. When the DAR reload function
is disabled, RDAR is ignored.
To transfer data in word (2-byte), longword (4-byte), or 16-byte unit, specify the address with 2byte, 4-byte, or 16-byte address boundary respectively.
Bit:
Initial value:
R/W:
Bit:
Initial value:
R/W:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 313 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
8.3.7
DMA Reload Transfer Count Registers (RDMATCR)
The DMA reload transfer count registers (RDMATCR) are 32-bit readable/writable registers.
When the SAR or DAR reload function is enabled, the RDMATCR value is written to the transfer
count register (DMATCR) at the end of the current DMA transfer. In this case, a new value for the
next DMA transfer can be preset in RDMATCR during the current DMA transfer. When the SAR
or DAR reload function is disabled, RDMATCR is ignored.
The upper eight bits of RDMATCR are always read as 0, and the write value should always be 0.
As in DMATCR, the transfer count is 1 when the setting is H'00000001, 16,777,215 when
H'00FFFFFF is set, and 16,777,216 (the maximum) when H'00000000 is set. To transfer data in
16 bytes, one 16-byte transfer (128 bits) counts one.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
Page 314 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.3.8
Section 8 Direct Memory Access Controller (DMAC)
DMA Operation Register (DMAOR)
The DMA operation register (DMAOR) is a 16-bit readable/writable register that specifies the
priority level of channels at the DMA transfer. This register also shows the DMA transfer status.
Bit:
Initial value:
R/W:
15
14
⎯
⎯
0
R
0
R
13
12
CMS[1:0]
0
R/W
0
R/W
11
10
⎯
⎯
0
R
0
R
9
8
PR[1:0]
0
R/W
0
R/W
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
AE
NMIF
DME
0
R
0
R
0
R
0
R
0
R
0
0
0
R/(W)* R/(W)* R/W
Note: * Only 0 can be written to clear the flag after 1 is read.
Bit
Bit Name
Initial
Value
R/W
Description
15, 14
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
13, 12
CMS[1:0]
00
R/W
Cycle Steal Mode Select
These bits select either normal mode or intermittent
mode in cycle steal mode.
It is necessary that the bus modes of all channels be
set to cycle steal mode to make the intermittent mode
valid.
00: Normal mode
01: Setting prohibited
10: Intermittent mode 16
Executes one DMA transfer for every 16 cycles of
Bφ clock.
11: Intermittent mode 64
Executes one DMA transfer for every 64 cycles of
Bφ clock.
11, 10
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 315 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
9, 8
PR[1:0]
00
R/W
Priority Mode
These bits select the priority level between channels
when there are transfer requests for multiple channels
simultaneously.
00: Fixed mode 1: CH0 > CH1 > CH2 > CH3 > CH4 >
CH5 > CH6 > CH7
01: Fixed mode 2: CH0 > CH4 > CH1 > CH5 > CH2 >
CH6 > CH3 > CH7
10: Setting prohibited
11: Round-robin mode (only supported in CH0 to CH3)
7 to 3
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
2
AE
0
R/(W)* Address Error Flag
Indicates whether an address error has occurred by the
DMAC. When this bit is set, even if the DE bit in CHCR
and the DME bit in DMAOR are set to 1, DMA transfer
is not enabled. This bit can only be cleared by writing 0
after reading 1.
0: No DMAC address error
1: DMAC address error occurred
[Clearing condition]
•
1
NMIF
0
Writing 0 after reading AE = 1
R/(W)* NMI Flag
Indicates that an NMI interrupt occurred. When this bit
is set, even if the DE bit in CHCR and the DME bit in
DMAOR are set to 1, DMA transfer is not enabled. This
bit can only be cleared by writing 0 after reading 1.
When the NMI is input, the DMA transfer in progress
can be done in one transfer unit. Even if the NMI
interrupt is input while the DMAC is not in operation,
the NMIF bit is set to 1.
0: No NMI interrupt
1: NMI interrupt occurred
[Clearing condition]
•
Page 316 of 1278
Writing 0 after reading NMIF = 1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
0
DME
0
R/W
DMA Master Enable
Enables or disables DMA transfer on all channels. If
the DME bit and DE bit in CHCR are set to 1, DMA
transfer is enabled.
However, transfer is enabled only when the TE bit in
CHCR of the transfer corresponding channel, the NMIF
bit in DMAOR, and the AE bit are all cleared to 0.
Clearing the DME bit to 0 can terminate the DMA
transfer on all channels.
0: DMA transfer is disabled on all channels
1: DMA transfer is enabled on all channels
Note:
*
Only 0 can be written to clear the flag after 1 is read.
If the priority mode bits are modified after a DMA transfer, the channel priority is initialized. If
fixed mode 2 is specified, the channel priority is specified as CH0 > CH4 > CH1 > CH5 > CH2 >
CH6 > CH3 > CH7. If fixed mode 1 is specified, the channel priority is specified as CH0 > CH1 >
CH2 > CH3 > CH4 > CH5 > CH6 > CH7. If the round-robin mode is specified, the transfer end
channel is reset.
Table 8.3 shows the priority change in each mode (modes 0 to 2) specified by the priority mode
bits. In each priority mode, the channel priority to accept the next transfer request may change in
up to three ways according to the transfer end channel.
For example, when the transfer end channel is channel 1, the priority of the channel to accept the
next transfer request is specified as CH2 > CH3 > CH0 >CH1 > CH4 > CH5 > CH6 > CH7. When
the transfer end channel is any one of the channels 4 to 7, round-robin will not be applied and the
priority level is not changed at the end of transfer in the channels 4 to 7.
The DMAC internal operation for an address error is as follows:
• No address error: Read (source to DMAC) → Write (DMAC to destination)
• Address error in source address: Nop → Nop
• Address error in destination address: Read → Nop
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 317 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Table 8.3
Combinations of Priority Mode Bits
Transfer
Mode
CH No.
Mode 0
Priority Level at the End of Transfer
Priority Mode
End
Bits
PR[1]
High
Low
PR[0]
0
1
2
3
4
5
6
7
Any channel 0
0
CH0
CH1
CH2
CH3
CH4
CH5
CH6
CH7
Any channel 0
1
CH0
CH4
CH1
CH5
CH2
CH6
CH3
CH7
CH0
1
1
CH1
CH2
CH3
CH0
CH4
CH5
CH6
CH7
CH1
1
1
CH2
CH3
CH0
CH1
CH4
CH5
CH6
CH7
CH2
1
1
CH3
CH0
CH1
CH2
CH4
CH5
CH6
CH7
CH3
1
1
CH0
CH1
CH2
CH3
CH4
CH5
CH6
CH7
CH4
1
1
CH0
CH1
CH2
CH3
CH4
CH5
CH6
CH7
CH5
1
1
CH0
CH1
CH2
CH3
CH4
CH5
CH6
CH7
CH6
1
1
CH0
CH1
CH2
CH3
CH4
CH5
CH6
CH7
CH7
1
1
CH0
CH1
CH2
CH3
CH4
CH5
CH6
CH7
(fixed mode 1)
Mode 1
(fixed mode 2)
Mode 2
(round-robin mode)
Page 318 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.3.9
Section 8 Direct Memory Access Controller (DMAC)
DMA Extension Resource Selectors 0 to 3 (DMARS0 to DMARS3)
The DMA extension resource selectors (DMARS) are 16-bit readable/writable registers that
specify the DMA transfer sources from peripheral modules in each channel. DMARS0 is for
channels 0 and 1, DMARS1 is for channels 2 and 3, DMARS2 is for channels 4 and 5, and
DMARS3 is for channels 6 and 7. Table 8.4 shows the specifiable combinations.
This register can specify transfer requests from six SCIF sources, two IIC3 sources, two CMT
sources, two USB sources, two SSI sources, and two SDHI sources.
• DMARS0
Bit:
15
14
13
12
11
10
CH1 MID[5:0]
Initial value:
R/W:
0
R/W
0
R/W
9
8
7
6
CH1 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
13
12
11
10
5
4
3
2
1
CH0 MID[5:0]
0
R/W
0
R/W
0
R/W
0
R/W
9
8
7
6
0
CH0 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
5
4
3
2
0
R/W
0
R/W
1
0
• DMARS1
Bit:
15
14
CH3 MID[5:0]
Initial value:
R/W:
0
R/W
0
R/W
CH3 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
13
12
11
10
CH2 MID[5:0]
0
R/W
0
R/W
0
R/W
0
R/W
9
8
7
6
CH2 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
5
4
3
2
0
R/W
0
R/W
1
0
• DMARS2
Bit:
15
14
CH5 MID[5:0]
Initial value:
R/W:
0
R/W
0
R/W
CH5 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
13
12
11
10
CH4 MID[5:0]
0
R/W
0
R/W
0
R/W
0
R/W
9
8
7
6
CH4 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
5
4
3
2
0
R/W
0
R/W
1
0
• DMARS3
Bit:
15
14
CH7 MID[5:0]
Initial value:
R/W:
0
R/W
0
R/W
0
R/W
0
R/W
CH7 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
CH6 MID[5:0]
0
R/W
0
R/W
0
R/W
0
R/W
CH6 RID[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
Transfer requests from the various modules specify MID and RID as shown in table 8.4.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 319 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Table 8.4
DMARS Settings
Peripheral Module
Setting Value for One
Channel ({MID, RID})
MID
RID
Function
USB_0
H'03
B'000000
B'11
⎯
USB_1
H'07
B'000001
B'11
⎯
SDHI
H'11
B'000100
B'01
Transmit
H'12
B'000100
B'10
Receive
SSI_0
H'23
B'001000
B'11
⎯
SSI_1
H'27
B'001001
B'11
⎯
IIC3_0
H'61
B'011000
H'62
SCIF_0
H'81
B'100000
H'82
SCIF_1
H'85
B'100001
H'86
SCIF_2
H'89
B'100010
H'8A
B'01
Transmit
B'10
Receive
B'01
Transmit
B'10
Receive
B'01
Transmit
B'10
Receive
B'01
Transmit
B'10
Receive
CMT_0
H'FB
B'111110
B'11
⎯
CMT_1
H'FF
B'111111
B'11
⎯
When MID or RID other than the values listed in table 8.4 is set, the operation of this LSI is not
guaranteed. The transfer request from DMARS is valid only when the resource select bits
(RS[3:0]) in CHCR0 to CHCR7 have been set to B'1000. Otherwise, even if DMARS has been set,
the transfer request source is not accepted.
Page 320 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.4
Section 8 Direct Memory Access Controller (DMAC)
Operation
When there is a DMA transfer request, the DMAC starts the transfer according to the
predetermined channel priority order; when the transfer end conditions are satisfied, it ends the
transfer. Transfers can be requested in three modes: auto request, external request, and on-chip
peripheral module request. In bus mode, the burst mode or the cycle steal mode can be selected.
8.4.1
Transfer Flow
After the DMA source address registers (SAR), DMA destination address registers (DAR), DMA
transfer count registers (DMATCR), DMA channel control registers (CHCR), DMA operation
register (DMAOR), three reload registers (RSAR, RDAR, and RDMATCR), and DMA extension
resource selector (DMARS) are set for the target transfer conditions, the DMAC transfers data
according to the following procedure:
1. Checks to see if transfer is enabled (DE = 1, DME = 1, TEMASK = 0 and TE = 0 [or
TEMASK = 1], AE = 0, NMIF = 0)
2. When a transfer request comes and transfer is enabled, the DMAC transfers one transfer unit of
data (depending on the TS[1:0] settings). For an auto request, the transfer begins automatically
when the DE bit and DME bit are set to 1. The DMATCR value will be decremented by 1 for
each transfer. The actual transfer flows vary by address mode and bus mode.
3. When half of the specified transfer count is exceeded (when DMATCR reaches half of the
initial value), an HEI interrupt is sent to the CPU if the HIE bit in CHCR is set to 1.
4. When TEMASK = 0, if transfer has been completed for the specified count (that is, DMATCR
reaches 0), the transfer ends normally. If the IE bit in CHCR is set to 1 at this time, a DEI
interrupt is sent to the CPU. When TEMASK = 1, if DMATCR reaches 0, TE is set to 1. The
specified RSAR, RDAR, and RDMATC values are reloaded into RSAR, RDAR, and
RDMATC, and the transfer operation continues until there are no more transfer requests.
5. When an address error in the DMAC or an NMI interrupt is generated, the transfer is
terminated. Transfers are also terminated when the DE bit in CHCR or the DME bit in
DMAOR is cleared to 0.
Figure 8.2 is a flowchart of this procedure.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 321 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Start
Initial settings
(SAR, DAR, DMATCR, CHCR,
DMAOR, DMARS)
DE, DME = 1 and
NMIF, AE, TE = 0?
No
Yes
Transfer request
occurs?*1
No
*2
Yes
*3
Bus mode,
transfer request mode,
DREQ detection system
Transfer (one transfer unit);
DMATCR – 1 → DMATCR,
SAR and DAR updated
No
DMATCR = 0?
Yes
No
DMATCR=1/2 ?
Yes
TE = 1
HE=1
DEI interrupt request
(when IE = 1)
HEI interrupt request
(when HE = 1)
When reload function is enabled,
RSAR → SAR, RDAR → DAR,
and RDMATCR → DMATCR
When the TC bit in CHCR is 0, or
for a request from an on-chip peripheral
module, the transfer acknowledge
signal is sent to the module.
For a request from an
on-chip peripheral module,
the transfer acknowledge signal
is sent to the module.
NMIF = 1
or AE = 1 or DE = 0
or DME = 0?
Yes
NMIF = 1
or AE = 1 or DE = 0
or DME = 0?
No
Upon detection
of the level of an external
request or at a request of an on-chip
peripheral module, is the
TEMASK bit set to 1?
No
Yes
Yes
No
Transfer end
Normal end
Transfer terminated
Notes: 1. In auto-request mode, transfer begins when the NMIF, AE, and TE bits are cleared to 0 and the
DE and DME bits are set to 1.
2. DREQ level detection in burst mode (external request) or cycle steal mode.
3. DREQ edge detection in burst mode (external request), or auto request mode in burst mode.
Figure 8.2 DMA Transfer Flowchart
Page 322 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.4.2
Section 8 Direct Memory Access Controller (DMAC)
DMA Transfer Requests
DMA transfer requests are basically generated in either the data transfer source or destination, but
they can also be generated in external devices and on-chip peripheral modules that are neither the
transfer source nor destination.
Transfers can be requested in three modes: auto request, external request, and on-chip peripheral
module request. The request mode is selected by the RS[3:0] bits in CHCR_0 to CHCR_7 and
DMARS0 to DMARS3.
(1)
Auto-Request Mode
When there is no transfer request signal from an external source, as in a memory-to-memory
transfer or a transfer between memory and an on-chip peripheral module unable to request a
transfer, the auto-request mode allows the DMAC to automatically generate a transfer request
signal internally. When the DE bits in CHCR_0 to CHCR_7 and the DME bit in DMAOR are set
to 1, the transfer begins so long as the TE bits in CHCR_0 to CHCR_7, and the AE and NMIF bits
in DMAOR are 0.
(2)
External Request Mode
In this mode a transfer is performed at the request signals (DREQ0 and DREQ1) of an external
device. Choose one of the modes shown in table 8.5 according to the application system. When the
DMA transfer is enabled (for level detection, DE=1, DME=1, TEMASK = 0 and TE = 0 [or
TEMASK = 1], AE=0, NMIF=0); for edge detection, DE=1, DME=1, TE=0, AE=0, NMIF=0),
DMA transfer is performed upon a request at the DREQ input.
Table 8.5
Selecting External Request Modes with the RS Bits
RS[3] RS[2] RS[1] RS[0] Address Mode
Transfer Source
Transfer
Destination
0
0
0
0
Dual address mode
Any
Any
0
0
1
0
Single address mode External memory,
memory-mapped
external device
1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
External device with
DACK
External device with
DACK
External memory,
memory-mapped
external device
Page 323 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Choose to detect DREQ by either the edge or level of the signal input with the DL and DS bits in
CHCR_0 and CHCR_1 as shown in table 8.6. The source of the transfer request does not have to
be the data transfer source or destination. Upon detection of a rising or falling edge, one transfer
request in burst mode causes the transfer to continue until DMATCR = 0 is reached. In cycle steal
mode, one transfer request results in a single transfer.
Table 8.6
Selecting External Request Detection with DL and DS Bits
CHCR
DL bit
DS bit
Detection of External Request
0
0
Low level detection
1
Falling edge detection
0
High level detection
1
Rising edge detection
1
When DREQ is accepted, the DREQ pin enters the request accept disabled state (non-sensitive
period). After issuing acknowledge DACK signal for the accepted DREQ, the DREQ pin again
enters the request accept enabled state.
When DREQ is used by level detection, there are following two cases by the timing to detect the
next DREQ after outputting DACK.
Overrun 0: Transfer is terminated after the same number of transfer has been performed as
requests.
Overrun 1: Transfer is terminated after transfers have been performed for (the number of requests
plus 1) times.
The DO bit in CHCR selects this overrun 0 or overrun 1.
Table 8.7
Selecting External Request Detection with DO Bit
CHCR
DO bit
External Request
0
Overrun 0
1
Overrun 1
Page 324 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(3)
Section 8 Direct Memory Access Controller (DMAC)
On-Chip Peripheral Module Request
In this mode, the transfer is performed in response to the DMA transfer request signal from an onchip peripheral module.
Table 8.8 shows the list of DMAC transfer request signals sent from on-chip peripheral modules
to DMAC.
When a transfer request signal is sent in on-chip peripheral module request mode while DMA
transfer is enabled (DE=1, DME=1, TEMASK = 0 and TE = 0 [or TEMASK = 1], AE=0,
NMIF=0), DMA transfer is performed.
For on-chip peripheral module requests, there are cases in which the transfer source and
destination are fixed; see table 8.8.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 325 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Table 8.8
CHCR
Selecting On-Chip Peripheral Module Request Modes with RS3 to RS0 Bits
DMARS
RS[3:0] MID
1000
DMA Transfer
Request
RID Source
000000 11
000001 11
000100 01
10
001000 11
001001 11
011000 01
10
100000 01
10
100001 01
DMA Transfer
Request Signal
Transfer
Source
Transfer
Destination Bus Mode
USB_DMA0
(receive FIFO full)
D0FIFO
Any
USB_DMA0
(transmit FIFO empty)
Any
D0FIFO
USB_DMA1
(receive FIFO full)
D1FIFO
Any
USB_DMA1
(transmit FIFO empty)
Any
D1FIFO
SDHI transmit
TXI (receive data empty)
Data register Any
SDHI receive
RXI (transmit data full)
Any
Data
register
SSI_0
DMA0 (transmit mode)
Any
SSITDR0
DMA0 (receive mode)
SSIRDR0
Any
DMA1 (transmit mode)
Any
SSITDR1
DMA1 (receive mode)
SSIRDR1
Any
IIC3_0 transmit
TXI0 (transmit data empty)
Any
ICDRT0
IIC3_0 receive
RXI0 (receive data full)
ICDRR0
Any
SCIF_0 transmit TXI0
(transmit FIFO data empty)
Any
SCFTDR_0
SCIF_0 receive
SCFRDR_0
Any
USB
USB
SSI_1
RXI0
(receive FIFO data full)
SCIF_1 transmit TXI1
Any
(transmit FIFO data empty)
SCFTDR_1
SCIF_1 receive
SCFRDR_1
Any
SCIF_2 transmit TXI2
(transmit FIFO data empty)
Any
SCFTDR_2
SCIF_2 receive
RXI2
(receive FIFO data full)
SCFRDR_2
Any
111110 11
CMT_0
CMI0 (compare match)
Any
Any
111111 11
CMT_1
CMI1 (compare match)
Any
Any
10
100010 01
10
Page 326 of 1278
RXI1
(receive FIFO data full)
Cycle steal
or burst
Cycle steal
Cycle steal
or burst
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.4.3
Section 8 Direct Memory Access Controller (DMAC)
Channel Priority
When the DMAC receives simultaneous transfer requests on two or more channels, it selects a
channel according to a predetermined priority order. Three modes (fixed mode 1, fixed mode 2,
and round-robin mode) are selected using the PR1 and PR0 bits in DMAOR.
(1)
Fixed Mode
In fixed modes, the priority levels among the channels remain fixed. There are two kinds of fixed
modes as follows:
Fixed mode 1: CH0 > CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7
Fixed mode 2: CH0 > CH4 > CH1 > CH5 > CH2 > CH6 > CH3 > CH7
These are selected by the PR1 and PR0 bits in the DMA operation register (DMAOR).
(2)
Round-Robin Mode
Each time one unit of word, byte, longword, or 16 bytes is transferred on one channel, the priority
order is rotated. The channel on which the transfer was just finished is rotated to the lowest of the
priority order among the four round-robin channels (channels 0 to 4). The priority of the channels
other than the round-robin channels (channels 0 to 4) does not change even in round-robin mode.
The round-robin mode operation is shown in figure 8.3. The priority in round-robin mode is CH0
> CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7 immediately after a reset.
When the round-robin mode has been specified, do not concurrently specify cycle steal mode and
burst mode as the bus modes of any two or more channels.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 327 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
(1) When channel 0 transfers
Initial priority order
CH0 > CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7
Priority order
after transfer
CH1 > CH2 > CH3 > CH0 > CH4 > CH5 > CH6 > CH7
Channel 0 is given the lowest priority
among the round-robin channels.
(2) When channel 1 transfers
Initial priority order
CH0 > CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7
Priority order
after transfer
CH2 > CH3 > CH0 > CH1 > CH4 > CH5 > CH6 > CH7
Channel 1 is given the lowest priority
among the round-robin channels. The
priority of channel 0, which was higher
than channel 1, is also shifted.
(3) When channel 2 transfers
Initial priority order
CH0 > CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7
Priority order
after transfer
CH3 > CH0 > CH1 > CH2 > CH4 > CH5 > CH6 > CH7
Post-transfer priority order
when there is an
immediate transfer
request to channel 5 only
Channel 2 is given the lowest priority
among the round-robin channels. The
priority of channels 0 and 1, which were
higher than channel 2, is also shifted. If
there is a transfer request only to
channel 5 immediately after that, the
priority does not change because
channel 5 is not a round-robin channel.
CH3 > CH0 > CH1 > CH2 > CH4 > CH5 > CH6 > CH7
(4) When channel 7 transfers
Initial priority order
CH0 > CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7
Priority order
after transfer
CH0 > CH1 > CH2 > CH3 > CH4 > CH5 > CH6 > CH7
Priority order does not change.
Figure 8.3 Round-Robin Mode
Page 328 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Figure 8.4 shows how the priority order changes when channel 0 and channel 3 transfers are
requested simultaneously and a channel 1 transfer is requested during the channel 0 transfer. The
DMAC operates as follows:
1. Transfer requests are generated simultaneously to channels 0 and 3.
2. Channel 0 has a higher priority, so the channel 0 transfer begins first (channel 3 waits for
transfer).
3. A channel 1 transfer request occurs during the channel 0 transfer (channels 1 and 3 are both
waiting)
4. When the channel 0 transfer ends, channel 0 is given the lowest priority among the round-robin
channels.
5. At this point, channel 1 has a higher priority than channel 3, so the channel 1 transfer begins
(channel 3 waits for transfer).
6. When the channel 1 transfer ends, channel 1 is given the lowest priority among the round-robin
channels.
7. The channel 3 transfer begins.
8. When the channel 3 transfer ends, channels 3 and 2 are lowered in priority so that channel 3 is
given the lowest priority among the round-robin channels.
Transfer request
Waiting channel(s)
DMAC operation
Channel priority
(1) Channels 0 and 3
(2) Channel 0 transfer start
(3) Channel 1
0>1>2>3>4>5>6>7
3
1, 3 (4) Channel 0 transfer ends
Priority order
changes
1>2>3>0>4>5>6>7
(5) Channel 1 transfer starts
3
(6) Channel 1 transfer ends
Priority order
changes
2>3>0>1>4>5>6>7
(7) Channel 3 transfer starts
None
(8) Channel 3 transfer ends
Priority order
changes
0>1>2>3>4>5>6>7
Figure 8.4 Changes in Channel Priority in Round-Robin Mode
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 329 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
8.4.4
DMA Transfer Types
DMA transfer has two types; single address mode transfer and dual address mode transfer. They
depend on the number of bus cycles of access to the transfer source and destination. A data
transfer timing depends on the bus mode, which is the cycle steal mode or burst mode. The
DMAC supports the transfers shown in table 8.9.
Table 8.9
Supported DMA Transfers
Transfer Destination
External Device
with DACK
External
Memory
Memory-Mapped
External Device
On-Chip
On-Chip
Peripheral Module Memory
External device
with DACK
Not available
Dual, single
Dual, single
Not available
Not available
External memory
Dual, single
Dual
Dual
Dual
Dual
Memory-mapped
external device
Dual, single
Dual
Dual
Dual
Dual
On-chip
peripheral module
Not available
Dual
Dual
Dual
Dual
On-chip memory
Not available
Dual
Dual
Dual
Dual
Transfer Source
Notes: 1. Dual: Dual address mode
2. Single: Single address mode
3. 16-byte transfer is available only for on-chip peripheral modules that support longword
access.
Page 330 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
(1)
Address Modes
(a)
Dual Address Mode
In dual address mode, both the transfer source and destination are accessed (selected) by an
address. The transfer source and destination can be located externally or internally.
DMA transfer requires two bus cycles because data is read from the transfer source in a data read
cycle and written to the transfer destination in a data write cycle. At this time, transfer data is
temporarily stored in the DMAC. In the transfer between external memories as shown in figure
8.5, data is read to the DMAC from one external memory in a data read cycle, and then that data is
written to the other external memory in a data write cycle.
DMAC
SAR
Data bus
Address bus
DAR
Memory
Transfer source
module
Transfer destination
module
Data buffer
The SAR value is an address, data is read from the transfer source module,
and the data is tempolarily stored in the DMAC.
First bus cycle
DMAC
Memory
Data bus
DAR
Address bus
SAR
Transfer source
module
Transfer destination
module
Data buffer
The DAR value is an address and the value stored in the data buffer in the
DMAC is written to the transfer destination module.
Second bus cycle
Figure 8.5 Data Flow of Dual Address Mode
Auto request, external request, and on-chip peripheral module request are available for the transfer
request. DACK can be output in read cycle or write cycle in dual address mode. The AM bit in the
channel control register (CHCR) can specify whether the DACK is output in read cycle or write
cycle.
Figure 8.6 shows an example of DMA transfer timing in dual address mode.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 331 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
CKIO
A25 to A0
Transfer source
address
Transfer destination
address
CSn
D31 to D0
RD
WEn
DACKn
(Active-low)
Data read cycle
Data write cycle
(1st cycle)
(2nd cycle)
Note: In transfer between external memories, with DACK output in the read cycle,
DACK output timing is the same as that of CSn.
Figure 8.6 Example of DMA Transfer Timing in Dual Mode
(Transfer Source: Normal Memory, Transfer Destination: Normal Memory)
Page 332 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(b)
Section 8 Direct Memory Access Controller (DMAC)
Single Address Mode
In single address mode, both the transfer source and destination are external devices, either of
them is accessed (selected) by the DACK signal, and the other device is accessed by an address. In
this mode, the DMAC performs one DMA transfer in one bus cycle, accessing one of the external
devices by outputting the DACK transfer request acknowledge signal to it, and at the same time
outputting an address to the other device involved in the transfer. For example, in the case of
transfer between external memory and an external device with DACK shown in figure 8.7, when
the external device outputs data to the data bus, that data is written to the external memory in the
same bus cycle.
External address bus
External data bus
This LSI
External
memory
DMAC
External device
with DACK
DACK
DREQ
Data flow (from memory to device)
Data flow (from device to memory)
Figure 8.7 Data Flow in Single Address Mode
Two kinds of transfer are possible in single address mode: (1) transfer between an external device
with DACK and a memory-mapped external device, and (2) transfer between an external device
with DACK and external memory. In both cases, only the external request signal (DREQ) is used
for transfer requests.
Figure 8.8 shows an example of DMA transfer timing in single address mode.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 333 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
CK
A25 to A0
Address output to external memory space
CSn
Select signal to external memory space
WEn
Write strobe signal to external memory space
Data output from external device with DACK
D31 to D0
DACKn
DACK signal (active-low) to external device with DACK
(a) External device with DACK → External memory space (normal memory)
CK
A25 to A0
Address output to external memory space
CSn
Select signal to external memory space
RD
Read strobe signal to external memory space
Data output from external memory space
D31 to D0
DACKn
DACK signal (active-low) to external device with DACK
(b) External memory space (normal memory) → External device with DACK
Figure 8.8 Example of DMA Transfer Timing in Single Address Mode
(2)
Bus Modes
There are two bus modes; cycle steal and burst. Select the mode by the TB bits in the channel
control registers (CHCR).
(a)
Cycle Steal Mode
• Normal mode
In normal mode of cycle steal, the bus mastership is given to another bus master after a onetransfer-unit (byte, word, longword, or 16-byte unit) DMA transfer. When another transfer
request occurs, the bus mastership is obtained from another bus master and a transfer is
performed for one transfer unit. When that transfer ends, the bus mastership is passed to
another bus master. This is repeated until the transfer end conditions are satisfied.
The cycle-steal normal mode can be used for any transfer section; transfer request source,
transfer source, and transfer destination.
Figure 8.9 shows an example of DMA transfer timing in cycle-steal normal mode. Transfer
conditions shown in the figure are;
⎯ Dual address mode
⎯ DREQ low level detection
Page 334 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
DREQ
Bus mastership returned to CPU once
Bus cycle
CPU
CPU
CPU
DMAC DMAC
CPU
Read/Write
DMAC DMAC CPU
Read/Write
Figure 8.9 DMA Transfer Example in Cycle-Steal Normal Mode
(Dual Address, DREQ Low Level Detection)
• Intermittent Mode 16 and Intermittent Mode 64
In intermittent mode of cycle steal, DMAC returns the bus mastership to other bus master
whenever a unit of transfer (byte, word, longword, or 16 bytes) is completed. If the next
transfer request occurs after that, DMAC obtains the bus mastership from other bus master
after waiting for 16 or 64 cycles of Bφ clock. DMAC then transfers data of one unit and returns
the bus mastership to other bus master. These operations are repeated until the transfer end
condition is satisfied. It is thus possible to make lower the ratio of bus occupation by DMA
transfer than the normal mode of cycle steal.
When DMAC obtains again the bus mastership, DMA transfer may be postponed in case of
entry updating due to cache miss.
The cycle-steal intermittent mode can be used for any transfer section; transfer request source,
transfer source, and transfer destination. The bus modes, however, must be cycle steal mode in
all channels.
Figure 8.10 shows an example of DMA transfer timing in cycle-steal intermittent mode.
Transfer conditions shown in the figure are;
⎯ Dual address mode
⎯ DREQ low level detection
DREQ
More than 16 or 64 Bφ clock cycles
(depends on the CPU's condition of using bus)
Bus cycle
CPU
CPU
CPU DMAC DMAC
Read/Write
CPU
CPU
DMAC DMAC
CPU
Read/Write
Figure 8.10 Example of DMA Transfer in Cycle-Steal Intermittent Mode
(Dual Address, DREQ Low Level Detection)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 335 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
(b)
Burst Mode
In burst mode, once the DMAC obtains the bus mastership, it does not release the bus mastership
and continues to perform transfer until the transfer end condition is satisfied. In external request
mode with low level detection of the DREQ pin, however, when the DREQ pin is driven high, the
bus mastership is passed to another bus master after the DMAC transfer request that has already
been accepted ends, even if the transfer end conditions have not been satisfied.
Figure 8.11 shows DMA transfer timing in burst mode.
DREQ
Bus cycle
CPU
CPU
CPU
DMAC DMAC DMAC DMAC
Read
Write
Read
CPU
CPU
Write
Figure 8.11 DMA Transfer Example in Burst Mode
(Dual Address, DREQ Low Level Detection)
(3)
Relationship between Request Modes and Bus Modes by DMA Transfer Category
Table 8.10 shows the relationship between request modes and bus modes by DMA transfer
category.
Page 336 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Table 8.10 Relationship of Request Modes and Bus Modes by DMA Transfer Category
Address
Mode
Transfer Category
Dual
Request
Mode
Bus
Mode
Transfer
Size (Bits)
Usable
Channels
External device with DACK and external memory
External
B/C
8/16/32/128
0 and 1
External device with DACK and memory-mapped
external device
External
B/C
8/16/32/128
0 and 1
External memory and external memory
All*
4
B/C
8/16/32/128
0 to 7*
External memory and memory-mapped external
device
All*
4
B/C
8/16/32/128
0 to 7*
Memory-mapped external device and memorymapped external device
All*
4
B/C
8/16/32/128
0 to 7*
External memory and on-chip peripheral module
All*
1
B/C*
Memory-mapped external device and
on-chip peripheral module
All*
1
B/C*
1
Single
3
3
5
8/16/32/128*
5
8/16/32/128*
B/C*
5
4
4
1
B/C*
8/16/32/128*
0 to 7*
On-chip peripheral module and on-chip peripheral All*
module
On-chip memory and on-chip memory
3
All*
2
0 to 7*
3
2
0 to 7*
8/16/32/128*
2
0 to 7*
B/C
8/16/32/128
0 to 7*
B/C
8/16/32/128
0 to 7*
3
3
3
3
On-chip memory and memory-mapped external
device
All*
On-chip memory and on-chip peripheral module
All*
On-chip memory and external memory
All*
4
B/C
8/16/32/128
0 to 7*
External device with DACK and external memory
External
B/C
8/16/32/128
0 and 1
External device with DACK and memory-mapped
external device
External
B/C
8/16/32/128
0 and 1
5
2
3
3
[Legend]
B: Burst
C: Cycle steal
Notes: 1. External requests, auto requests, and on-chip peripheral module requests are all
available.
However, in the case of internal module request, along with the exception of CMT as
the transfer request source, the requesting module must be designated as the transfer
source or the transfer destination.
2. Access size permitted for the on-chip peripheral module register functioning as the
transfer source or transfer destination.
3. If the transfer request is an external request, channels 0 to 3 are only available.
4. External requests, auto requests, and on-chip peripheral module requests are all
available. In the case of on-chip peripheral module requests, however, the CMT are
only available.
5. In the case of internal module request, only cycle steal except for the USB, SSI, and
CMT as the transfer request source.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 337 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
(4)
Bus Mode and Channel Priority
In priority fixed mode (CH0 > CH1), when channel 1 is transferring data in burst mode and a
request arrives for transfer on channel 0, which has higher-priority, the data transfer on channel 0
will begin immediately. In this case, if the transfer on channel 0 is also in burst mode, the transfer
on channel 1 will only resume on completion of the transfer on channel 0.
When channel 0 is in cycle steal mode, one transfer-unit of data on this channel, which has the
higher priority, is transferred. Data is then transferred continuously to channel 1 without releasing
the bus. The bus mastership will then switch between the two in this order: channel 0, channel 1,
channel 0, channel 1, etc. That is, the CPU cycle after the data transfer in cycle steal mode is
replaced with a burst-mode transfer cycle (priority execution of burst-mode cycle). An example of
this is shown in figure 8.12.
When multiple channels are in burst mode, data transfer on the channel that has the highest
priority is given precedence. When DMA transfer is being performed on multiple channels, the
bus mastership is not released to another bus-master device until all of the competing burst-mode
transfers have been completed.
CPU
CPU
DMA
CH1
DMA
CH1
DMAC CH1
Burst mode
DMA
CH0
DMA
CH1
DMA
CH0
CH0
CH1
CH0
DMAC CH0 and CH1
Cycle steal mode
DMA
CH1
DMA
CH1
DMAC CH1
Burst mode
CPU
CPU
Priority: CH0 > CH1
CH0: Cycle steal mode
CH1: Burst mode
Figure 8.12 Bus State when Multiple Channels are Operating
In round-robin mode, the priority changes as shown in figure 8.3. Note that channels in cycle steal
and burst modes must not be mixed.
Page 338 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.4.5
(1)
Section 8 Direct Memory Access Controller (DMAC)
Number of Bus Cycles and DREQ Pin Sampling Timing
Number of Bus Cycles
When the DMAC is the bus master, the number of bus cycles is controlled by the bus state
controller (BSC) in the same way as when the CPU is the bus master. For details, see section 7,
Bus State Controller (BSC).
(2)
DREQ Pin Sampling Timing
Figures 8.13 to 8.16 show the DREQ input sampling timings in each bus mode.
CKIO
Bus cycle
DREQ
(Rising)
CPU
CPU
1st acceptance
DMAC
CPU
2nd acceptance
Non sensitive period
DACK
(Active-high)
Acceptance start
Figure 8.13 Example of DREQ Input Detection in Cycle Steal Mode Edge Detection
CKIO
Bus cycle
DREQ
(Overrun 0 at
high level)
CPU
CPU
DMAC
1st acceptance
CPU
2nd acceptance
Non sensitive period
DACK
(Active-high)
Acceptance
start
CKIO
Bus cycle
DREQ
(Overrun 1 at
high level)
DACK
(Active-high)
CPU
CPU
1st acceptance
DMAC
CPU
2nd acceptance
Non sensitive period
Acceptance
start
Figure 8.14 Example of DREQ Input Detection in Cycle Steal Mode Level Detection
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 339 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
CKIO
Bus cycle
DREQ
(Rising)
CPU
CPU
DMAC
DMAC
Burst acceptance
Non sensitive period
DACK
(Active-high)
Figure 8.15 Example of DREQ Input Detection in Burst Mode Edge Detection
CKIO
Bus cycle
DREQ
(Overrun 0 at
high level)
CPU
CPU
DMAC
2nd
acceptance
1st acceptance
Non sensitive period
DACK
(Active-high)
Acceptance
start
CKIO
Bus cycle
DREQ
(Overrun 1 at
high level)
CPU
CPU
1st acceptance
DMAC
2nd acceptance
DMAC
3rd
acceptance
Non sensitive period
DACK
(Active-high)
Acceptance
start
Acceptance
start
Figure 8.16 Example of DREQ Input Detection in Burst Mode Level Detection
Page 340 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
Figure 8.17 shows the TEND output timing.
CKIO
End of DMA transfer
Bus cycle
DMAC
CPU
DMAC
CPU
CPU
DREQ
DACK
TEND
Figure 8.17 Example of DMA Transfer End Signal Timing
(Cycle Steal Mode Level Detection)
The unit of the DMA transfer is divided into multiple bus cycles when 16-byte transfer is
performed for an 8-bit, 16-bit, or 32-bit external device, when longword access is performed for an
8-bit or 16-bit external device, or when word access is performed for an 8-bit external device.
When a setting is made so that the DMA transfer size is divided into multiple bus cycles and the
CS signal is negated between bus cycles, note that DACK and TEND are divided like the CS
signal for data alignment as shown in figure 8.18. Figures 8.13 to 8.17 show cases in which
DACK and TEND are not divided at the time of DMA transfer.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 341 of 1278
SH7670 Group
Section 8 Direct Memory Access Controller (DMAC)
T1
T2
Taw
T1
T2
CKIO
Address
CS
RD
Data
WEn
DACKn
(Active low)
TEND
(Active low)
WAIT
Note: TEND is asserted for the last unit of DMA transfer. If a transfer unit
is divided into multiple bus cycles and the CS is negated between
the bus cycles, TEND is also divided.
Figure 8.18 BSC Normal Memory Access
(No Wait, Idle Cycle 1, Longword Access to 16-Bit Device)
Page 342 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
8.5
8.5.1
Section 8 Direct Memory Access Controller (DMAC)
Usage Notes
NMIF Bit (NMI Flag) in DMA Operation Register (DMAOR)
When the flag is read with the same timing as flag setting, the flag is read as 0 but internally the
LSI might enter the state where 1 has been read in some cases. Accordingly, if 0 is written to the
flag in this state, the flag is cleared to 0 in the same way as when 0 is written to the flag after 1 is
read.
When using this flag, take the following steps to read from and write to the flag to prevent
unexpected clearing of the flag.
Only when explicitly clearing the flag, write 0 to the flag after reading 1; in other cases, the write
value should always be 1.
When the flag is not used, the write value should always be 0 (write 0 after reading 1 only when
explicitly clearing the flag).
8.5.2
Half-End Flag Setting and Half-End Interrupt Generation
Note the following when the half-end flag in CHCR is referred to or the half-end interrupt is used
while the reload function is used.
The reload transfer count (the RDMATCR setting) should be the same value as the initial transfer
count (the DMATCR setting). If the initial DMATCR setting and the RDMATCR setting used for
the second or later transfers differ, the half-end flag or interrupt might be set or generated before
the transfer count reaches half of the specified value, or the half-end flag or interrupt might never
be set or generated.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 343 of 1278
Section 8 Direct Memory Access Controller (DMAC)
Page 344 of 1278
SH7670 Group
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
Section 9 Clock Pulse Generator (CPG)
This LSI has a clock pulse generator (CPG) that generates an internal clock (Iφ), a peripheral clock
(Pφ), and a bus clock (Bφ). The CPG consists of a crystal oscillator, PLL circuits, and divider
circuits.
9.1
Features
• Four clock operating modes
The mode can be selected from among the four clock operating modes (three clock operating
modes in the wide temperature specifications) based on the frequency range to be used and the
input clock type: the crystal resonator, the external clock, the crystal resonator for USB, or the
external clock for USB.
• Three clocks generated independently
An internal clock (Iφ) for the CPU and cache; a peripheral clock (Pφ) for the on-chip
peripheral modules; a bus clock (Bφ = CKIO) for the external bus interface
• Frequency change function
Internal and peripheral clock frequencies can be changed independently using the PLL (phase
locked loop) circuits and divider circuits within the CPG. Frequencies are changed by software
using frequency control register (FRQCR) settings.
• Power-down mode control
The clock can be stopped in sleep mode and software standby mode, and specific modules can
be stopped using the module standby function. For details on clock control in the power-down
modes, see section 11, Power-Down Modes.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 345 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
Figure 9.1 shows a block diagram of the clock pulse generator.
On-chip oscillator
Divider 1
×1
× 1/2
× 1/4
XTAL
PLL circuit
(× 8,12)
Divider 2
×1
× 1/2
× 1/3
× 1/4
× 1/6
× 1/8
× 1/12
Crystal
oscillator
Peripheral clock
(Pφ: 50 MHz max. (regular specifications)
33.3 MHz max. (wide temperature
specifications)
Bus clock
(Bφ = CKIO:
100 MHz max. (regular specifications)
66.6 MHz max. (wide temperature
specifications)
EXTAL
USB_X2
Internal clock
(Iφ: 200 MHz max. (regular specifications)
133.3 MHz max. (wide temperature
specifications)
Crystal
oscillator
USB_X1
CKIO
CPG control unit
MD_CLK1
MD_CLK0
Clock frequency
control circuit
Standby control circuit
FRQCR
Bus interface
[Legend]
Peripheral bus
FRQCR: Frequency control register
Figure 9.1 Block Diagram of Clock Pulse Generator
Page 346 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
The clock pulse generator blocks function as follows:
(1)
Crystal Oscillator
The crystal oscillator is an oscillation circuit in which the crystal resonator is connected to the
XTAL/EXTAL pin or USB_X1/USB_X2 pin. This can be used according to the clock operating
mode.
(2)
Divider 1
Divider 1 divides the frequency of one of the three clocks: the clock from the crystal resonator or
the EXTAL pin, the clock from the CKIO pin, and the clock from the crystal resonator or the
USB_X1 pin. The division ratio depends on the clock operating mode.
(3)
PLL Circuit
The PLL circuit multiplies the frequency of the output from divider 1 by 8 or 12. The
multiplication rate is set by the frequency control register. When this is done, the phase of the
rising edge of the internal clock is controlled so that it will agree with the phase of the rising edge
of the CKIO pin.
The input clock to be used depends on the clock operating mode. The clock operating mode is
specified using the MD_CK0 and MD_CK1 pins. For details on the clock operating mode, see
table 9.2.
(4)
Divider 2
Divider 2 divides the frequency of output of the PLL circuit to generate an internal clock, a bus
clock, and a peripheral clock. The internal clock can be 1 or 1/2 times the output frequency of the
PLL circuit, and it should not be lower than the clock frequency on the CKIO pin. The peripheral
clock can be 1/4, 1/6, 1/8, or 1/12 times the output frequency of the PLL circuit, and it should not
be higher than the half of the clock frequency on the CKIO pin. The bus clock is automatically
determined by hardware at the division ratio against the output frequency of the PLL circuit so
that it will be 4 times the clock source (when clock mode = 0), 2 times (when clock mode = 1 or
3), or 1 times (when clock mode = 2).
(5)
Clock Frequency Control Circuit
The clock frequency control circuit controls the clock frequency using the MD_CK0 and
MD_CK1 pins and the frequency control register (FRQCR).
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 347 of 1278
Section 9 Clock Pulse Generator (CPG)
(6)
SH7670 Group
Standby Control Circuit
The standby control circuit controls the states of the clock pulse generator and other modules
during clock switching, or sleep or software standby mode.
In addition, the standby control register is provided to control the power-down mode of other
modules. For details on the standby control register, see section 11, Power-Down Modes.
(7)
Frequency Control Register (FRQCR)
The frequency control register (FRQCR) has control bits assigned for the following functions:
clock output/non-output from the CKIO pin during software standby mode, the frequency
multiplication ratio of PLL circuit, and the frequency division ratio of the internal clock and the
peripheral clock (Pφ).
Page 348 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
9.2
Section 9 Clock Pulse Generator (CPG)
Input/Output Pins
Table 9.1 lists the clock pulse generator pins and their functions.
Table 9.1
Pin Name
Pin Configuration and Functions of the Clock Pulse Generator
Function
(Clock
Operating
Mode 2)
Function
(Clock
Operating
Mode 3)
Output Connected to
Leave this pin
the crystal
open.
resonator.
(Leave this pin
open when the
crystal
resonator is not
in use.)
Leave this pin
open.
Leave this pin
open.
Input
Connected to
the crystal
resonator or
used to input
external clock.
Used as an
external clock
input terminal.
Pull-up this pin. Pull-up this pin.
I/O
Clock output
pin.
Clock output
pin
Clock input pin
Symbol I/O
Function
(Clock
Operating
Mode 0)
Function
(Clock
Operating
Mode 1)
Mode
MD_
control pins CLK0
Input
Sets the clock operating mode.
MD_
CLK1
Input
Sets the clock operating mode.
Crystal
XTAL
input/output
pins (clock
input pins)
EXTAL
Clock
CKIO
input/output
pin
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Clock output
pin
Page 349 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
Pin Name
Function
(Clock
Operating
Mode 0)
Function
(Clock
Operating
Mode 1)
Function
(Clock
Operating
Mode 2)
Function
(Clock
Operating
Mode 3)
Connected to
the crystal
resonator to
input the clock
for USB only, or
used to input
external clock.
When USB is
not used, this
pin should be
pulled up.
Connected to
the crystal
resonator to
input the clock
for USB only, or
used to input
external clock.
When USB is
not used, this
pin should be
pulled up.
Connected to
the crystal
resonator to
input the clock
for USB only, or
used to input
external clock.
When USB is
not used, this
pin should be
pulled up.
Connected to
the crystal
resonator to
input the clock
for both USB
and the LSI, or
used to input
external clock.
USB_X2 Output Connected to
the crystal
resonator for
USB.
(Leave this pin
open when the
crystal
resonator is not
in use.)
Connected to
the crystal
resonator for
USB.
(Leave this pin
open when the
crystal
resonator is not
in use.)
Connected to
the crystal
resonator for
USB.
(Leave this pin
open when the
crystal
resonator is not
in use.)
Connected to
the crystal
resonator for
both USB and
the LSI.
(Leave this pin
open when the
crystal
resonator is not
in use.)
Symbol I/O
Crystal
USB_X1 Input
input/output
pins for
USB
(clock input
pins)
Page 350 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
9.3
Section 9 Clock Pulse Generator (CPG)
Clock Operating Modes
Table 9.2 shows the relationship between the combinations of the mode control pins (MD_CK1
and MD_CK0) and the clock operating modes. Table 9.3 shows the usable frequency ranges in the
clock operating modes.
Table 9.2
Clock Operating Modes
Pin Values
Clock I/O
Mode MD_CK1 MD_CK0 Source
PLL Circuit
Output Divider 2 On/Off
CKIO Frequency
0
0
0
EXTAL or crystal CKIO
resonator
1
ON (× 8, 12) (EXTAL or crystal
resonator) × 4
1
0
1
EXTAL
CKIO
1/2
ON (× 8, 12) (EXTAL) × 2
2
1
0
CKIO
⎯
1/4
ON (× 8, 12) (CKIO)
3
1
1
USB_X1 or
CKIO
crystal resonator
1/2
ON (× 8)
(USB_X1 or
crystal resonator)
×2
• Mode 0
In mode 0, clock is input from the EXTAL pin or the crystal resonator. The PLL circuit shapes
waveforms and the frequency is multiplied according to the frequency control register setting
before the clock is supplied to the LSI. The oscillating frequency for the crystal resonator and
EXTAL pin input clock ranges from 15 to 25 MHz (15 to 16.6 MHz in the wide temperature
specifications). The frequency range of CKIO is from 60 to 100 MHz (60 MHz to 66.6 MHz in
the wide temperature specifications). To reduce current supply, pull up the USB_X1 pin and
open the USB_X2 pin when USB is not used.
• Mode 1
In mode 1, clock is input from the EXTAL pin. The PLL circuit shapes waveform and the
frequency is multiplied according to the frequency control register setting before the clock is
supplied to the LSI. The oscillating frequency for the EXTAL pin input clock ranges from 30
to 50 MHz (30 to 33.3 MHz in the wide temperature specifications). The frequency range of
CKIO is from 60 to 100 MHz (60 to 66.6 MHz in the wide temperature specifications). To
reduce current supply, pull up the USB_X1 pin and open the USB_X2 pin when USB is not
used.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 351 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
• Mode 2
In mode 2, the CKIO pin functions as an input pin and draws an external clock signal. The
PLL circuit shapes waveform and the frequency is multiplied according to the frequency
control register setting before the clock is supplied to the LSI. The frequency range of CKIO is
from 60 to 100 MHz (60 to 66.6 MHz in the wide temperature specifications). To reduce
current supply, pull up the EXTAL pin and open the XTAL pin when the LSI is used in mode
2. When USB is not used, pull up the USB_X1 pin and open the USB_X2 pin.
• Mode 3
In mode 3, clock is input from the USB_X1 pin or the crystal oscillator. The external clock is
input through this pin and waveform is shaped in the PLL circuit. Then the frequency is
multiplied according to the frequency control register setting before the clock is supplied to the
LSI. The frequency of CKIO is the same as that of the input clock 96 MHz. To reduce current
supply, pull up the EXTAL pin and open the XTAL pin when the LSI is used in mode 3. When
the USB crystal resonator is not used, open the USB_X2 pin.
Note that this mode is supported only in the regular specifications; it is not supported in the
wide temperature specifications.
Table 9.3
Relationship between Clock Operating Mode and Frequency Range (1)
Regular Specifications
Restrictions: Iφ ≤ 200MHz, Bφ ≤ 100MHz, Pφ ≤ 50MHz, Iφ ≤ Bφ ≤ Pφ×2
PLL
Ratio of
Frequency Internal
Multiplier Clock
Clock
Selectable Frequency Range (MHz)
PLL
Frequencies
Output Clock
Internal Clock
Bus Clock
Peripheral
Mode
Setting*1 Divider 1
Circuit
(I:B:P)*2
Input Clock*3
(CKIO Pin)
(Iφ)
(Bφ)
Clock (Pφ)
0
H'x003
1/1
ON (× 8)
8:4:2
15.00 to 25.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 30.00 to 50.00
H'x004
1/1
ON (× 8)
8:4:4/3
15.00 to 25.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 20.00 to 33.33
H'x005
1/1
ON (× 8)
8:4:1
15.00 to 25.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 15.00 to 25.00
H'x006
1/1
ON (× 8)
8:4:2/3
15.00 to 25.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 10.00 to 16.67
H'x013
1/1
ON (× 8)
4:4:2
15.00 to 25.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 30.00 to 50.00
H'x014
1/1
ON (× 8)
4:4:4/3
15.00 to 25.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 20.00 to 33.33
H'x015
1/1
ON (× 8)
4:4:1
15.00 to 25.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 15.00 to 25.00
H'x016
1/1
ON (× 8)
4:4:2/3
15.00 to 25.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 10.00 to 16.67
H'x104
1/1
ON (× 12)
12:4:2
15.00 to 16.67
60.00 to 66.67
180.00 to 200.00 60.00 to 66.67
30.00 to 33.33
H'x106
1/1
ON (× 12)
12:4:1
15.00 to 16.67
60.00 to 66.67
180.00 to 200.00 60.00 to 66.67
15.00 to 16.67
Operating FRQCR
Page 352 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
PLL
Ratio of
Frequency Internal
Clock
Multiplier
Clock
Operating FRQCR
PLL
Frequencies
Internal Clock
Bus Clock
Peripheral
(CKIO Pin)
(Iφ)
(Bφ)
Clock (Pφ)
Mode
Setting* Divider 1
Circuit
(I:B:P)*2
1
H'x003
1/2
ON (× 8)
4:2:1
30.00 to 50.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 30.00 to 50.00
H'x004
1/2
ON (× 8)
4:2:4/3
30.00 to 50.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 20.00 to 33.33
H'x005
1/2
ON (× 8)
4:2:1/2
30.00 to 50.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 15.00 to 25.00
H'x006
1/2
ON (× 8)
4:1:1/3
30.00 to 50.00
60.00 to 100.00 120.00 to 200.00 60.00 to 100.00 10.00 to 16.67
H'x013
1/2
ON(× 8)
2:2:1
30.00 to 50.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 30.00 to 50.00
H'x014
1/2
ON(× 8)
2:2:2/3
30.00 to 50.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 20.00 to 33.33
H'x015
1/2
ON(× 8)
2:2:1/2
30.00 to 50.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 15.00 to 25.00
H'x016
1/2
ON(× 8)
2:2:1/3
30.00 to 50.00
60.00 to 100.00 60.00 to 100.00
60.00 to 100.00 10.00 to 16.67
H'x104
1/2
ON (× 12)
6:2:1
30.00 to 33.33
60.00 to 66.67
180.00 to 200.00 60.00 to 66.67
30.00 to 33.33
H'x106
1/2
ON (× 12)
6:2:1/2
30.00 to 33.33
60.00 to 66.67
180.00 to 200.00 60.00 to 66.67
15.00 to 16.67
H'x003
1/4
ON (× 8)
2:1:1/2
60.00 to 100.00 ⎯
120.00 to 200.00 60.00 to 100.00 30.00 to 50.00
H'x004
1/4
ON (× 8)
2:1:1/3
60.00 to 100.00 ⎯
120.00 to 200.00 60.00 to 100.00 20.00 to 33.33
H'x005
1/4
ON (× 8)
2:1:1/4
60.00 to 100.00 ⎯
120.00 to 200.00 60.00 to 100.00 15.00 to 25.00
H'x006
1/4
ON (× 8)
2:1:1/6
60.00 to 100.00 ⎯
120.00 to 200.00 60.00 to 100.00 10.00 to 16.67
H'x013
1/4
ON (× 8)
1:1:1/2
60.00 to 100.00 ⎯
60.00 to 100.00
60.00 to 100.00 30.00 to 50.00
H'x014
1/4
ON (× 8)
1:1:1/3
60.00 to 100.00 ⎯
60.00 to 100.00
60.00 to 100.00 20.00 to 33.33
H'x015
1/4
ON (× 8)
1:1:1/4
60.00 to 100.00 ⎯
60.00 to 100.00
60.00 to 100.00 15.00 to 25.00
H'x016
1/4
ON (× 8)
1:1:1/6
60.00 to 100.00 ⎯
60.00 to 100.00
60.00 to 100.00 10.00 to 16.67
H'x104
1/4
ON (× 12)
3:1:1/2
60.00 to 66.67
⎯
180.00 to 200.00 60.00 to 66.67
30.00 to 33.33
H'x106
1/4
ON (× 12)
3:1:1/4
60.00 to 66.67
⎯
180.00 to 200.00 60.00 to 66.67
15.00 to 16.67
H'x003
1/2
ON (× 8)
4:2:1
48.00 to 48.00
96.00 to 96.00
192.00 to 192.00 96.00 to 96.00
48.00 to 48.00
H'x004
1/2
ON (× 8)
4:2:2/3
48.00 to 48.00
96.00 to 96.00
192.00 to 192.00 96.00 to 96.00
32.00 to 32.00
H'x005
1/2
ON (× 8)
4:2:1/2
48.00 to 48.00
96.00 to 96.00
192.00 to 192.00 96.00 to 96.00
24.00 to 24.00
H'x006
1/2
ON (× 8)
4:2:1/3
48.00 to 48.00
96.00 to 96.00
192.00 to 192.00 96.00 to 96.00
16.00 to 16.00
H'x013
1/2
ON (× 8)
2:2:1
48.00 to 48.00
96.00 to 96.00
96.00 to 96.00
96.00 to 96.00
48.00 to 48.00
H'x014
1/2
ON (× 8)
2:2:2/3
48.00 to 48.00
96.00 to 96.00
96.00 to 96.00
96.00 to 96.00
32.00 to 32.00
H'x015
1/2
ON (× 8)
2:2:1/2
48.00 to 48.00
96.00 to 96.00
96.00 to 96.00
96.00 to 96.00
24.00 to 24.00
H'x016
1/2
ON (× 8)
2:2:1/3
48.00 to 48.00
96.00 to 96.00
96.00 to 96.00
96.00 to 96.00
16.00 to 16.00
2
3
1
Selectable Frequency Range (MHz)
Output Clock
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Input Clock*3
Page 353 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
Table 9.3
Relationship between Clock Operating Mode and Frequency Range (2)
wide temperature Specifications
Restrictions: Iφ ≤ 200MHz, Bφ ≤ 100MHz, Pφ ≤ 50MHz, Iφ ≤ Bφ ≤ Pφ×2
PLL
Frequency
Multiplier
Clock
Operating FRQCR
Internal
Clock
Output Clock
Internal Clock
Bus Clock
Peripheral
Setting*1 1
Circuit
(I:B:P)*2
Input Clock*3
(CKIO Pin)
(Iφ)
(Bφ)
Clock (Pφ)
0
H'x003
1/1
ON (× 8)
8/4/2
15.00 to 16.67
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
30.00 to 33.33
H'x004
1/1
ON (× 8)
8/4/4/3
15.00 to 16.67
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
20.00 to 22.22
H'x005
1/1
ON (× 8)
8/4/1
15.00 to 16.67
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
15.00 to 16.67
H'x006
1/1
ON (× 8)
8/4/2/3
15.00 to 16.67
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
10.00 to 11.11
H'x013
1/1
ON (× 8)
4/4/2
15.00 to 16.67
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
30.00 to 33.33
H'x014
1/1
ON (× 8)
4/4/4/3
15.00 to 16.67
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
20.00 to 22.22
H'x015
1/1
ON (× 8)
4/4/1
15.00 to 16.67
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
15.00 to 16.67
H'x016
1/1
ON (× 8)
4/4/2/3
15.00 to 16.67
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
10.00 to 11.11
H'x003
1/2
ON (× 8)
4/2/1
30.00 to 33.33
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
30.00 to 33.33
H'x004
1/2
ON (× 8)
4/2/2/3
30.00 to 33.33
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
20.00 to 22.22
H'x005
1/2
ON (× 8)
4/2/1/2
30.00 to 33.33
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
15.00 to 16.67
H'x006
1/2
ON (× 8)
4/2/1/3
30.00 to 33.33
60.00 to 66.67
120.00 to 133.33
60.00 to 66.67
10.00 to 11.11
H'x013
1/2
ON (× 8)
2/2/1
30.00 to 33.33
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
30.00 to 33.33
H'x014
1/2
ON (× 8)
2/2/2/3
30.00 to 33.33
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
20.00 to 22.22
H'x015
1/2
ON (× 8)
2/2/1/2
30.00 to 33.33
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
15.00 to 16.67
H'x016
1/2
ON (× 8)
2/2/1/3
30.00 to 33.33
60.00 to 66.67
60.00 to 66.67
60.00 to 66.67
10.00 to 11.11
H'x003
1/4
ON (× 8)
2/1/1/2
60.00 to 66.67
⎯
120.00 to 133.33
60.00 to 66.67
30.00 to 33.33
H'x004
1/4
ON (× 8)
2/1/1/3
60.00 to 66.67
⎯
120.00 to 133.33
60.00 to 66.67
20.00 to 22.22
H'x005
1/4
ON (× 8)
2/1/1/4
60.00 to 66.67
⎯
120.00 to 133.33
60.00 to 66.67
15.00 to 16.67
H'x006
1/4
ON (× 8)
2/1/1/6
60.00 to 66.67
⎯
120.00 to 133.33
60.00 to 66.67
10.00 to 11.11
H'x013
1/4
ON (× 8)
1/1/1/2
60.00 to 66.67
⎯
60.00 to 66.67
60.00 to 66.67
30.00 to 33.33
H'x014
1/4
ON (× 8)
1/1/1/3
60.00 to 66.67
⎯
60.00 to 66.67
60.00 to 66.67
20.00 to 22.22
H'x015
1/4
ON (× 8)
1/1/1/4
60.00 to 66.67
⎯
60.00 to 66.67
60.00 to 66.67
15.00 to 16.67
H'x016
1/4
ON (× 8)
1/1/1/6
60.00 to 66.67
⎯
60.00 to 66.67
60.00 to 66.67
10.00 to 11.11
2
PLL
Frequencies
Selectable Frequency Range (MHz)
Mode
1
Divider
Ratio of
Notes: 1. x in the FRQCR register setting depends on the set value in bits 12 and 13.
2. The ratio of clock frequencies, where the input clock frequency is assumed to be 1.
Page 354 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
3. In mode 0, the frequency of the EXTAL pin input clock or the crystal resonator
In mode 1, the frequency of the EXTAL pin input clock
In mode 2, the frequency of the CKIO pin input clock.
In mode 3, the frequency of the USB_X1 pin input clock or the crystal resonator
Cautions: 1.
The frequency of the internal clock is as follows:
In mode 0
the frequency on the EXTAL pin × the frequency-multiplier of the PLL
circuit × the divisor of the divider 1
In mode 1
(the frequency on the EXTAL pin × 1/2) × the frequency-multiplier of
the PLL circuit × the divisor of the divider 1
In mode 2
(the frequency on the CKIO pin × 1/4) × the frequency-multiplier of
the PLL circuit × the divisor of the divider 1
In mode 3
(the frequency on the USB_X1pin × 1/2) × the frequency-multiplier of
the PLL circuit × the divisor of the divider 1
The frequency of the internal clock should not be set lower than the frequency on the
CKIO pin.
2. The frequency of the peripheral clock is as follows:
In mode 0 the frequency on the EXTAL pin × the frequency-multiplier of the PLL
circuit × the divisor of the divider 1
In mode 1 (the frequency on the EXTAL pin × 1/2) × the frequency-multiplier of
the PLL circuit × the divisor of the divider 1
In mode 2 (the frequency on the CKIO pin × 1/4) × the frequency-multiplier of
the PLL circuit × the divisor of the divider 1
In mode 3 (the frequency on the USB_X1 pin × 1/2) × the frequency-multiplier of
the PLL circuit × the divisor of the divider 1
The frequency of the peripheral clock should be set to 50 MHz or less, and should
not be set higher than one half of the frequency on the CKIO pin.
3. The frequency multiplier of PLL circuit can be selected as ×8 or × 12. The divisor of
the divider can be selected as × 1, × 1/2, × 1/3, × 1/4, × 1/6, × 1/8, or × 1/12. The
settings are made in the frequency-control register (FRQCR).
4. The output frequency of the PLL circuit is as follows:
In mode 0 the frequency on the EXTAL pin × the frequency-multiplier of the PLL
circuit
In mode 1 (the frequency on the EXTAL pin × 1/2) × the frequency-multiplier of
the PLL circuit
In mode 2 (the frequency on the CKIO pin × 1/4) × the frequency-multiplier of
the PLL circuit
In mode 3 (the frequency on the USB_X1 pin × 1/2) × the frequency-multiplier of
the PLL circuit
Ensure that the output frequency of the PLL circuit should be 200 MHz or less.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 355 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
9.4
Register Descriptions
The clock pulse generator has the following registers.
Table 9.4
Register Configuration
Register Name
Abbreviation R/W
Initial Value Address
Frequency control register
FRQCR
H'0003
9.4.1
R/W
Access Size
H'FFFE0010 16
Frequency Control Register (FRQCR)
FRQCR is a 16-bit readable/writable register used to specify whether a clock is output from the
CKIO pin during normal operation mode, software standby mode and standby mode cancellation.
The register also specifies the frequency-multiplier of the PLL circuit and the frequency division
ratio for the internal clock and peripheral clock (Pφ). FRQCR is accessed by word.
FRQCR is initialized to H'0003 only by a power-on reset or in deep standby. FRQCR retains its
previous value in manual reset or software standby mode. The previous value is also retained
when an internal reset is triggered by an overflow of the WDT.
Bit:
Initial value:
R/W:
15
14
-
-
0
R
0
R
13
12
CKOEN[1:0]
0
R/W
0
R/W
11
10
-
-
0
R
0
R
9
8
7
6
5
4
3
STC[1:0]
-
-
-
IFC
-
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
15, 14
⎯
All 0
R
Reserved
-
0
R
2
1
0
PFC[2:0]
0
R/W
1
R/W
1
R/W
These bits are always read as 0. The write value
should always be 0.
Page 356 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
Initial
Value
Bit
Bit Name
13, 12
CKOEN[1:0] 00
R/W
Description
R/W
Clock Output Enable
Specifies the CKIO pin outputs clock signals, or is set
to a fixed level or high impedance (Hi-Z) during
normal operation mode, standby mode, or
cancellation of standby mode.
If these bits are set to 01, the CKIO pin is fixed at low
during standby mode or cancellation of standby
mode. Therefore, the malfunction of an external circuit
caused by an unstable CKIO clock during cancellation
of standby mode can be prevented. In clock operating
mode 2, the CKIO pin functions as an input
regardless of the value of these bits.
11, 10
⎯
All 0
R
In normal operation
In standby mode
00
Output
Output off (Hi-Z)
01
Output
Low-level output
10
Output
Output
(unstable clock output)
11
Output off (Hi-Z)
Output off (Hi-Z)
Reserved
These bits are always read as 0. The write value
should always be 0.
9, 8
STC[1:0]
00
R/W
Frequency Multiplication Ratio of PLL Circuit
00: × 8 time
01: × 12 times
10: Reserved (setting prohibited)
11: Reserved (setting prohibited)
7 to 5
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 357 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
Bit
Bit Name
Initial
Value
R/W
Description
4
IFC
0
R/W
Internal Clock Frequency Division Ratio
This bit specifies the frequency division ratio of the
internal clock with respect to the output frequency of
PLL circuit.
0: × 1 time
1: × 1/2 time
3
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
2 to 0
PFC[2:0]
011
R/W
Peripheral Clock Frequency Division Ratio
These bits specify the frequency division ratio of the
peripheral clock with respect to the output frequency
of PLL circuit.
000: Reserved (setting prohibited)
001: Reserved (setting prohibited)
010: Reserved (setting prohibited)
011: × 1/4 time
100: × 1/6 time
101: × 1/8 time
110: × 1/12 time
111: Reserved (setting prohibited)
Page 358 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
9.5
Section 9 Clock Pulse Generator (CPG)
Changing the Frequency
The frequency of the internal clock (Iφ) and peripheral clock (Pφ) can be changed either by
changing the multiplication rate of PLL circuit or by changing the division rates of divider. All of
these are controlled by software through the frequency control register (FRQCR). The methods are
described below.
9.5.1
Changing the Multiplication Rate
A PLL settling time is required when the multiplication rate of PLL circuit is changed. The onchip WDT counts the settling time.
1. In the initial state, the multiplication rate of PLL circuit is 8 time.
2. Set a value that will become the specified oscillation settling time in the WDT and stop the
WDT. The following must be set:
WTCSR.TME = 0: WDT stops
WTCSR.CKS[2:0]: Division ratio of WDT count clock
WTCNT counter: Initial counter value
(The WDT count is incremented using the clock after the setting.)
3. Set the desired value in the STC1 and STC0 bits. The division ratio can also be set in the IFC
and PFC2 to PFC0 bits.
4. This LSI pauses temporarily and the WDT starts incrementing. The internal and peripheral
clocks both stop and the WDT is supplied with the clock. The clock will continue to be output
at the CKIO pin. This state is the same as software standby mode. Whether or not registers are
initialized depends on the module. For details, see section 28.3, Register States in Each
Operating Mode.
5. Supply of the clock that has been set begins at WDT count overflow, and this LSI begins
operating again. The WDT stops after it overflows.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 359 of 1278
Section 9 Clock Pulse Generator (CPG)
9.5.2
SH7670 Group
Changing the Division Ratio
Counting by the WDT does not proceed if the frequency divisor is changed but the multiplier is
not.
1. In the initial state, IFC = B'0 and PFC[2:0] = B'011.
2. Set the desired value in the IFC and PFC2 to IFC0 bits. The values that can be set are limited
by the clock operating mode and the multiplication rate of PLL circuit. Note that if the wrong
value is set, this LSI will malfunction.
3. After the register bits (IFC and PFC2 to PFC0) have been set, the clock is supplied of the new
division ratio.
Note: When executing the SLEEP instruction after the frequency has been changed, be sure to
read the frequency control register (FRQCR) three times before executing the SLEEP
instruction.
Page 360 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
9.6
Notes on Board Design
9.6.1
Note on Inputting External Clock
Figure 9.2 is an example of connecting the external clock input. When putting the XTAL pin in
open state, make sure the parasitic capacitance is less than or equal to 10 pF. To stably input the
external clock with enough PLL stabilizing time at power on or releasing the standby, wait longer
than the oscillation stabilizing time.
EXTAL
External clock input
XTAL
Open state
Example of connection with XTAL pin open
Figure 9.2 Example of Connecting External Clock
9.6.2
Note on Using an External Crystal Resonator
Place the crystal resonator and capacitors CL1 and CL2 as close to the XTAL and EXTAL pins as
possible. In addition, to minimize induction and thus obtain oscillation at the correct frequency,
the capacitors to be attached to the resonator must be grounded to the same ground. Do not bring
wiring patterns close to these components.
Signal lines prohibited
CL1
EXTAL
CL2
XTAL
This LSI
Reference value
CL1 = 10 pF
CL2 = 10 pF
Note: The values for CL1 and CL2
should be determined after
consultation with the crystal
resonator manufacturer.
Figure 9.3 Note on Using a Crystal Resonator
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 361 of 1278
SH7670 Group
Section 9 Clock Pulse Generator (CPG)
9.6.3
Note on Resonator
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.
9.6.4
Note on Using a PLL Oscillation Circuit
In the PLLVcc and PLLVss connection pattern for the PLL, signal lines from the board power
supply pins must be as short as possible and pattern width must be as wide as possible to reduce
inductive interference.
In clock operating mode 2 or 3, the EXTAL pin is pulled up and the XTAL pin is left open.
Since the analog power supply pins of the PLL are sensitive to the noise, the system may
malfunction due to inductive interference at the other power supply pins. To prevent such
malfunction, the analog power supply pins and digital power supply pins Vcc and VccQ should
not supply the same resources on the board if at all possible.
Signal lines prohibited
Power supply
PLLVcc
Vcc
PLLVss
Vss
Figure 9.4 Note on Using a PLL Oscillation Circuit
Page 362 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 10 Watchdog Timer (WDT)
Section 10 Watchdog Timer (WDT)
This LSI includes the watchdog timer (WDT), which externally outputs an overflow signal
(WDTOVF) on overflow of the counter when the value of the counter has not been updated
because of a system malfunction. The WDT can simultaneously generate an internal reset signal
for the entire LSI.
The WDT is a single channel timer that counts up the clock oscillation settling period when the
system leaves software standby mode or the temporary standby periods that occur when the clock
frequency is changed. It can also be used as a general watchdog timer or interval timer.
10.1
Features
• Can be used to ensure the clock oscillation settling time
The WDT is used in leaving software standby mode or the temporary standby periods that
occur when the clock frequency is changed.
• Can switch between watchdog timer mode and interval timer mode.
• Outputs WDTOVF signal in watchdog timer mode
When the counter overflows in watchdog timer mode, the WDTOVF signal is output
externally. It is possible to select whether to reset the LSI internally when this happens. Either
the power-on reset or manual reset signal can be selected as the internal reset type.
• Interrupt generation in interval timer mode
An interval timer interrupt is generated when the counter overflows.
• Choice of eight counter input clocks
Eight clocks (Pφ × 1 to Pφ × 1/16384) that are obtained by dividing the peripheral clock can be
selected.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 363 of 1278
SH7670 Group
Section 10 Watchdog Timer (WDT)
Figure 10.1 shows a block diagram of the WDT.
WDT
Standby
cancellation
Standby
mode
Standby
control
Peripheral
clock
Divider
Interrupt
request
Interrupt
control
Clock selection
Clock selector
WDTOVF
Internal reset
request*
Reset
control
Overflow
WRCSR
WTCSR
Clock
WTCNT
Bus interface
[Legend]
WTCSR: Watchdog timer control/status register
WTCNT: Watchdog timer counter
WRCSR: Watchdog reset control/status register
Note: * The internal reset signal can be generated by making a register setting.
Figure 10.1 Block Diagram of WDT
10.2
Input/Output Pin
Table 10.1 shows the pin configuration of the WDT.
Table 10.1 Pin Configuration
Pin Name
Symbol
I/O
Function
Watchdog timer overflow
WDTOVF
Output
Outputs the counter overflow signal in
watchdog timer mode
Page 364 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
10.3
Section 10 Watchdog Timer (WDT)
Register Descriptions
The WDT has the following registers.
Table 10.2 Register Configuration
Register Name
Abbreviation R/W
Initial
Value
Address
Access
Size
Watchdog timer counter
WTCNT
R/W
H'00
H'FFFE0002
16*
Watchdog timer control/status
register
WTCSR
R/W
H'18
H'FFFE0000
16*
Watchdog reset control/status
register
WRCSR
R/W
H'1F
H'FFFE0004
16*
Note:
10.3.1
*
For the access size, see section 10.3.4, Notes on Register Access.
Watchdog Timer Counter (WTCNT)
WTCNT is an 8-bit readable/writable register that is incremented by cycles of the selected clock
signal. When an overflow occurs, it generates a watchdog timer overflow signal (WDTOVF) in
watchdog timer mode and an interrupt in interval timer mode. WTCNT is initialized to H'00 by a
power-on reset caused by the RES pin or in software standby mode.
Use word access to write to WTCNT, writing H'5A in the upper byte. Use byte access to read
from WTCNT.
Note: The method for writing to WTCNT differs from that for other registers to prevent
erroneous writes. See section 10.3.4, Notes on Register Access, for details.
Bit:
Initial value:
R/W:
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Page 365 of 1278
SH7670 Group
Section 10 Watchdog Timer (WDT)
10.3.2
Watchdog Timer Control/Status Register (WTCSR)
WTCSR is an 8-bit readable/writable register composed of bits to select the clock used for the
count, overflow flags, and timer enable bit.
WTCSR is initialized to H'18 by a power-on reset caused by the RES pin or in software standby
mode. When used to count the clock oscillation settling time for canceling software standby mode,
it retains its value after counter overflow.
Use word access to write to WTCSR, writing H'A5 in the upper byte. Use byte access to read from
WTCSR.
Note: The method for writing to WTCSR differs from that for other registers to prevent
erroneous writes. See section 10.3.4, Notes on Register Access, for details.
Bit:
7
6
5
4
3
IOVF
WT/IT
TME
-
-
0
R/W
0
R/W
1
R
1
R
Initial value:
0
R/W: R/(W)
2
1
0
CKS[2:0]
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
7
IOVF
0
R/(W)
Interval Timer Overflow
0
R/W
Indicates that WTCNT has overflowed in interval timer
mode. This flag is not set in watchdog timer mode.
0: No overflow
1: WTCNT overflow in interval timer mode
[Clearing condition]
•
6
WT/IT
0
R/W
When 0 is written to IOVF after reading IOVF
Timer Mode Select
Selects whether to use the WDT as a watchdog timer
or an interval timer.
0: Use as interval timer
1: Use as watchdog timer
Note: When the WTCNT overflows in watchdog timer
mode, the WDTOVF signal is output externally.
If this bit is modified when the WDT is running,
the counting-up may not be performed
correctly.
Page 366 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 10 Watchdog Timer (WDT)
Bit
Bit Name
Initial
Value
R/W
Description
5
TME
0
R/W
Timer Enable
Starts and stops timer operation. Clear this bit to 0
when using the WDT in software standby mode or
when changing the clock frequency.
0: Timer disabled
Count-up stops and WTCNT value is retained
1: Timer enabled
4, 3
⎯
All 1
R
Reserved
These bits are always read as 1. The write value
should always be 1.
2 to 0
CKS[2:0]
000
R/W
Clock Select
These bits select the clock to be used for the WTCNT
count from the eight types obtainable by dividing the
peripheral clock (Pφ). The overflow period that is
shown inside the parenthesis in the table is the value
when the peripheral clock (Pφ) is 25 MHz.
Bits 2 to 0
Clock Ratio
Overflow Cycle
000:
1 × Pφ
10.2 μs
001:
1/64 × Pφ
655.4 μs
010:
1/128 × Pφ
1.3 ms
011:
1/256 × Pφ
2.6 ms
100:
1/512 × Pφ
5.2 ms
101:
1/1024 × Pφ
10.5 ms
110:
1/4096 × Pφ
41.9 ms
111:
1/16384 × Pφ
167.8 ms
Note: If the CKS2 to CKS0 bits are modified when
the WDT is running, the counting-up may not
be performed correctly. Ensure that these bits
are modified only when the WDT is not
running.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 367 of 1278
SH7670 Group
Section 10 Watchdog Timer (WDT)
10.3.3
Watchdog Reset Control/Status Register (WRCSR)
WRCSR is an 8-bit readable/writable register that controls output of the internal reset signal
generated by watchdog timer counter (WTCNT) overflow.
WRCSR is initialized to H'1F by input of a reset signal from the RES pin, but is not initialized by
the internal reset signal generated by overflow of the WDT. WRCSR is initialized to H'1F in
software standby mode.
Note: The method for writing to WRCSR differs from that for other registers to prevent
erroneous writes. See section 10.3.4, Notes on Register Access, for details.
7
6
5
4
3
2
1
WOVF
RSTE
RSTS
-
-
-
-
-
Initial value:
0
R/W: R/(W)
0
R/W
0
R/W
1
R
1
R
1
R
1
R
1
R
Bit:
Bit
Bit Name
Initial
Value
R/W
Description
7
WOVF
0
R/(W)
Watchdog Timer Overflow
0
Indicates that the WTCNT has overflowed in
watchdog timer mode. This bit is not set in interval
timer mode.
0: No overflow
1: WTCNT has overflowed in watchdog timer mode
[Clearing condition]
•
6
RSTE
0
R/W
When 0 is written to WOVF after reading WOVF
Reset Enable
Selects whether to generate a signal to reset the LSI
internally if WTCNT overflows in watchdog timer
mode. In interval timer mode, this setting is ignored.
0: Not reset when WTCNT overflows*
1: Reset when WTCNT overflows
Note: *
Page 368 of 1278
LSI not reset internally, but WTCNT and
WTCSR reset within WDT.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 10 Watchdog Timer (WDT)
Bit
Bit Name
Initial
Value
R/W
Description
5
RSTS
0
R/W
Reset Select
Selects the type of reset when the WTCNT overflows
in watchdog timer mode. In interval timer mode, this
setting is ignored.
0: Power-on reset
1: Manual reset
4 to 0
⎯
All 1
R
Reserved
These bits are always read as 1. The write value
should always be 1.
10.3.4
Notes on Register Access
The watchdog timer counter (WTCNT), watchdog timer control/status register (WTCSR), and
watchdog reset control/status register (WRCSR) are more difficult to write to than other registers.
The procedures for reading or writing to these registers are given below.
(1)
Writing to WTCNT and WTCSR
These registers must be written by a word transfer instruction. They cannot be written by a byte or
longword transfer instruction.
When writing to WTCNT, set the upper byte to H'5A and transfer the lower byte as the write data,
as shown in figure 10.2. When writing to WTCSR, set the upper byte to H'A5 and transfer the
lower byte as the write data. This transfer procedure writes the lower byte data to WTCNT or
WTCSR.
WTCNT write
15
WTCSR write
8
15
Address: H'FFFE0000
0
7
H'5A
Address: H'FFFE0002
Write data
8
7
H'A5
0
Write data
Figure 10.2 Writing to WTCNT and WTCSR
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 369 of 1278
SH7670 Group
Section 10 Watchdog Timer (WDT)
(2)
Writing to WRCSR
WRCSR must be written by a word access to address H'FFFE0004. It cannot be written by byte
transfer or longword transfer instructions.
Procedures for writing 0 to WOVF (bit 7) and for writing to RSTE (bit 6) are different, as shown
in figure 10.3.
To write 0 to the WOVF bit, the write data must be H'A5 in the upper byte and H'00 in the lower
byte. This clears the WOVF bit to 0. The RSTE bit is not affected. To write to the RSTE bit, the
upper byte must be H'5A and the lower byte must be the write data. The value of bit 6 of the lower
byte is transferred to the RSTE bit, respectively. The WOVF bit is not affected.
Writing 0 to the WOVF bit
15
Address: H'FFFE0004
15
0
7
H'A5
Address: H'FFFE0004
Writing to the RSTE and RSTS bits
8
H'00
8
7
H'5A
0
Write data
Figure 10.3 Writing to WRCSR
(3)
Reading from WTCNT, WTCSR, and WRCSR
WTCNT, WTCSR, and WRCSR are read in a method similar to other registers. WTCSR is
allocated to address H'FFFE0000, WTCNT to address H'FFFE0002, and WRCSR to address
H'FFFE0004. Byte transfer instructions must be used for reading from these registers.
Page 370 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
10.4
WDT Usage
10.4.1
Canceling Software Standby Mode
Section 10 Watchdog Timer (WDT)
The WDT can be used to cancel software standby mode with an interrupt such as an NMI
interrupt. The procedure is described below. (The WDT does not operate when resets are used for
canceling, so keep the RES pin low until clock oscillation settles.)
1. Before making a transition to software standby mode, always clear the TME bit in WTCSR
to 0. When the TME bit is 1, an erroneous reset or interval timer interrupt may be generated
when the count overflows.
2. Set the type of count clock used in the CKS[2:0] bits in WTCSR and the initial value of the
counter in WTCNT. These values should ensure that the time till count overflow is longer than
the clock oscillation settling time.
3. After setting the STBY bit of the standby control register (STBCR: see section 11, PowerDown Modes) to 1, the execution of a SLEEP instruction puts the system in software standby
mode and clock operation then stops.
4. The WDT starts counting by detecting the edge change of the NMI signal.
5. When the WDT count overflows, the CPG starts supplying the clock and this LSI resumes
operation. The WOVF flag in WRCSR is not set when this happens.
10.4.2
Changing the Frequency
To change the frequency used by the PLL, use the WDT. When changing the frequency only by
switching the divider, do not use the WDT.
1. Before changing the frequency, always clear the TME bit in WTCSR to 0. When the TME bit
is 1, an erroneous reset or interval timer interrupt may be generated when the count overflows.
2. Set the type of count clock used in the CKS[2:0] bits in WTCSR and the initial value of the
counter in WTCNT. These values should ensure that the time till count overflow is longer than
the clock oscillation settling time. However, the WDT counts up using the clock after the
setting.
3. When the frequency control register (FRQCR) is written to, this LSI stops temporarily. The
WDT starts counting.
4. When the WDT count overflows, the CPG resumes supplying the clock and this LSI resumes
operation. The WOVF flag in WRCSR is not set when this happens.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 371 of 1278
Section 10 Watchdog Timer (WDT)
SH7670 Group
5. The counter stops at the value of H'00.
6. Before changing WTCNT after execution of the frequency change instruction, always confirm
that the value of WTCNT is H'00 by reading from WTCNT.
10.4.3
Using Watchdog Timer Mode
1. Set the WT/IT bit in WTCSR to 1 to set the type of count clock in the CKS2 to CKS0 bits,
whether this LSI is to be reset internally or not in the RSTE bit in WRCSR, and the initial
value of the counter in WTCNT.
2. Set the TME bit in WTCSR to 1 to start the count in watchdog timer mode.
3. While operating in watchdog timer mode, rewrite the counter periodically to H'00 to prevent
the counter from overflowing.
4. When the counter overflows, the WDT sets the WOVF flag in WRCSR to 1, and the
WDTOVF signal is output externally (figure 10.4). The WDTOVF signal can be used to reset
the system. The WDTOVF signal is output for 64 × Pφ clock cycles.
5. If the RSTE bit in WRCSR is set to 1, a signal to reset the inside of this LSI can be generated
simultaneously with the WDTOVF signal. The internal reset signal is output for 128 × Pφ
clock cycles.
6. When a WDT overflow reset is generated simultaneously with a reset input on the RES pin,
the RES pin reset takes priority, and the WOVF bit in WRCSR is cleared to 0.
Page 372 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 10 Watchdog Timer (WDT)
WTCNT
value
Overflow
H'FF
H'00
Time
H'00 written
in WTCNT
WT/IT = 1
TME = 1
WOVF = 1
WT/IT = 1
TME = 1
WDTOVF and internal reset generated
H'00 written
in WTCNT
WDTOVF
signal
64 × Pφ clock cycles
Internal
reset signal*
128 × Pφ clock cycles
[Legend]
WT/IT: Timer mode select bit
TME:
Timer enable bit
Note: * Internal reset signal occurs only when the RSTE bit is set to 1.
Figure 10.4 Operation in Watchdog Timer Mode
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 373 of 1278
SH7670 Group
Section 10 Watchdog Timer (WDT)
10.4.4
Using Interval Timer Mode
When operating in interval timer mode, interval timer interrupts are generated at every overflow of
the counter. This enables interrupts to be generated at set periods.
1. Clear the WT/IT bit in WTCSR to 0, set the type of count clock in the CKS[2:0] bits in
WTCSR, and set the initial value of the counter in WTCNT.
2. Set the TME bit in WTCSR to 1 to start the count in interval timer mode.
3. When the counter overflows, the WDT sets the IOVF bit in WTCSR to 1 and an interval timer
interrupt request is sent to the INTC. The counter then resumes counting.
WTCNT value
Overflow
Overflow
Overflow
Overflow
H'FF
H'00
Time
WT/IT = 0
TME = 1
ITI
ITI
ITI
ITI
[Legend]
ITI: Interval timer interrupt request generation
Figure 10.5 Operation in Interval Timer Mode
Page 374 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
10.5
Section 10 Watchdog Timer (WDT)
Usage Notes
Pay attention to the following points when using the WDT in either the interval timer or watchdog
timer mode.
10.5.1
Timer Variation
After timer operation has started, the period from the power-on reset point to the first count up
timing of WTCNT varies depending on the time period that is set by the TME bit of WTCSR. The
shortest such time period is thus one cycle of the peripheral clock, Pφ, while the longest is the
result of frequency division according to the value in the CKS[2:0] bits. The timing of subsequent
incrementation is in accord with the selected frequency division ratio. Accordingly, this time
difference is referred to as timer variation.
This also applies to the timing of the first incrementation after WTCNT has been written to during
timer operation.
10.5.2
Prohibition against Setting H'FF to WTCNT
When the value in WTCNT reaches H'FF, the WDT assumes that an overflow has occurred.
Accordingly, when H'FF is set in WTCNT, an interval timer interrupt or WDT reset will occur
immediately, regardless of the current clock selection by the CKS[2:0] bits.
10.5.3
System Reset by WDTOVF Signal
If the WDTOVF signal is input to the RES pin of this LSI, this LSI cannot be initialized correctly.
Avoid input of the WDTOVF signal to the RES pin of this LSI through glue logic circuits. To
reset the entire system with the WDTOVF signal, use the circuit shown in figure 10.6.
Reset input
(Low active)
Reset signal to
entire system
(Low active)
RES
WDTOVF
Figure 10.6 Example of System Reset Circuit Using WDTOVF Signal
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 375 of 1278
Section 10 Watchdog Timer (WDT)
10.5.4
SH7670 Group
Manual Reset in Watchdog Timer Mode
When a manual reset occurs in watchdog timer mode, the bus cycle is continued. If a manual reset
occurs while the bus is released or during DMAC burst transfer, manual reset exception handling
will be pended until the CPU acquires the bus mastership.
However, if the duration from generation of the manual reset to the bus cycle end is equal to or
longer than the duration of the internal manual reset activated, the occurrence of the internal
manual reset source is ignored instead of being pended, and the manual reset exception handling is
not executed.
Page 376 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 11 Power-Down Modes
Section 11 Power-Down Modes
In power-down modes, operation of some of the internal peripheral modules and of the CPU stops.
This leads to reduced power consumption. These modes are canceled by a reset or interrupt.
11.1
Features
11.1.1
Power-Down Modes
This LSI has the following power-down modes and function:
1. Sleep mode
2. Software standby mode
3. Module standby function
Table 11.1 shows the transition conditions for entering the modes from the program execution
state, as well as the CPU and peripheral module states in each mode and the procedures for
canceling each mode.
Table 11.1 States of Power-Down Modes
State*
On-Chip
Power-Down
CPU
On-Chip
Peripheral
External
Canceling
Mode
Transition Conditions
CPG
CPU
Register Memory
Modules
Memory
Procedure
Sleep mode
Execute SLEEP
Runs
Halts
Held
Runs
Auto-
•
Interrupt
•
Reset
•
DMA address
Runs
instruction with STBY bit
refreshing
cleared to 0 in STBCR
error
Software
Execute SLEEP
standby mode
instruction with STBY bit
(contents are
set to 1 in STBCR
held)
Module standby Set the MSTP bits in
function
Halts
Runs
Halts
Runs
Held
Held
Halts
*
Selfrefreshing
Specified
Specified
Auto-
STBCR2, STBCR3, and
module halts
module halts
refreshing
STBCR4 to 1
(contents are
held)
Note:
Halts
•
NMI interrupt
•
IRQ interrupt
•
Reset
•
Clear MSTP bit
to 0
•
Reset
The pin state is retained or set to high impedance. For details, see appendix A, Pin
States.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 377 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2
Register Descriptions
The following registers are used in power-down modes.
Table 11.2 Register Configuration
Register Name
Abbreviation
R/W
Initial
Value
Address
Access
Size
Standby control register
STBCR
R/W
H'00
H'FFFE0014
8
Standby control register 2
STBCR2
R/W
H'00
H'FFFE0018
8
Standby control register 3
STBCR3
R/W
H'00
H'FFFE0408
8
Standby control register 4
STBCR4
R/W
H'00
H'FFFE040C
8
System control register 1
SYSCR1
R/W
H'FF
H'FFFE0402
8
System control register 2
SYSCR2
R/W
H'FF
H'FFFE0404
8
System control register 3
SYSCR3
R/W
H'00
H'FFFE0418
8
Page 378 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
11.2.1
Section 11 Power-Down Modes
Standby Control Register (STBCR)
STBCR is an 8-bit readable/writable register that specifies the state of the power-down mode. This
register is initialized to H'00 by a power-on reset but retains its previous value by a manual reset
or in software standby mode. Only byte access is valid.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
Initial value:
R/W:
7
6
5
4
3
2
1
0
STBY
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
Description
7
STBY
0
R/W
Software Standby
Specifies transition to software standby mode.
0: Executing SLEEP instruction puts chip into sleep
mode.
1: Executing SLEEP instruction puts chip into
software standby mode.
6 to 0
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 379 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2.2
Standby Control Register 2 (STBCR2)
STBCR2 is an 8-bit readable/writable register that controls the operation of modules in powerdown modes. STBCR2 is initialized to H'00 by a power-on reset but retains its previous value by a
manual reset or in software standby mode. Only byte access is valid.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
7
6
MSTP
10
Initial Value: 0
R/W: R/W
4
3
2
1
0
MSTP MSTP
9
8
5
MSTP
7
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R
0
R
0
R
0
R
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
7
MSTP10
0
R/W
Module Stop 10
When the MSTP10 bit is set to 1, the supply of the
clock to the H-UDI is halted.
0: H-UDI runs.
1: Clock supply to H-UDI halted.
6
MSTP9
0
R/W
Module Stop 9
When the MSTP9 bit is set to 1, the supply of the
clock to the UBC is halted.
0: UBC runs.
1: Clock supply to UBC halted.
5
MSTP8
0
R/W
Module Stop 8
When the MSTP8 bit is set to 1, the supply of the
clock to the DMAC is halted.
0: DMAC runs.
1: Clock supply to DMAC halted.
Page 380 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 11 Power-Down Modes
Bit
Bit Name
Initial
Value
R/W
Description
4
MSTP7
0
R/W
Module Stop 7
When the MSTP7 bit is set to 1, the clock supply to
the FPU is halted. After the MSTP7 bit is set to 1, the
value of 0 cannot be written for clearing. In other
words, once the MSTP7 bit is set to 1 and the clock
supply to the FPU is temporarily halted, then the clock
supply to the FPU cannot be restarted by clearing the
MSTP7 bit to 0.
If the clock supply to the FPU is halted and then
restarted, a power-on reset must be performed for
this LSI.
0: FPUC runs.
1: Clock supply to FPU halted.
3 to 0
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 381 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2.3
Standby Control Register 3 (STBCR3)
STBCR3 is an 8-bit readable/writable register that controls the operation of modules in powerdown modes. STBCR3 is initialized to H'00 by a power-on reset but retains its previous value by a
manual reset or in software standby mode. Only byte access is valid.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
7
6
5
4
3
2
HIZ
MSTP
36
MSTP
35
MSTP
34
MSTP
33
MSTP
32
MSTP MSTP
31
30
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial Value: 0
R/W: R/W
Bit
Bit Name
Initial
Value
R/W
Description
7
HIZ
0
R/W
Port High Impedance
1
0
0
R/W
Selects whether the state of a specified pin is
retained or the pin is placed in the high-impedance
state in software standby mode. See appendix A, Pin
States to determine the pin to which this control is
applied.
Do not set this bit when the TME bit of WTSCR of the
WDT is 1. When setting the output pin to the highimpedance state, set the HIZ bit with the TME bit
being 0.
0: The pin state is held in software standby mode.
1: The pin state is set to the high-impedance state in
software standby mode.
6
MSTP36
0
R/W
Module Stop 36
When the MSTP36 bit is set to 1, the supply of the
clock to the STIF1 is halted.
0: STIF1 runs.
1: Clock supply to STIF1 halted.
5
MSTP35
0
R/W
Module Stop 35
When the MSTP35 bit is set to 1, the supply of the
clock to the STIF0 is halted.
0: STIF0 runs.
1: Clock supply to STIF0 halted.
Page 382 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 11 Power-Down Modes
Bit
Bit Name
Initial
Value
R/W
Description
4
MSTP34
0
R/W
Module Stop 34
When the MSTP34 bit is set to 1, the supply of the
clock to the CMT is halted.
0: CMT runs.
1: Clock supply to CMT halted.
3
MSTP33
0
R/W
Module Stop 33
When the MSTP33 bit is set to 1, the supply of the
clock to the IIC3 is halted.
0: IIC3 runs.
1: Clock supply to IIC3 halted.
2
MSTP32
0
R/W
Module Stop 32
When the MSTP32 bit is set to 1, the supply of the
clock to the SCIF2 is halted.
0: SCIF2 runs.
1: Clock supply to SCIF2 halted.
1
MSTP31
0
R/W
Module Stop 31
When the MSTP31 bit is set to 1, the supply of the
clock to the SCIF1 is halted.
0: SCIF1 runs.
1: Clock supply to SCIF1 halted.
0
MSTP30
0
R/W
Module Stop 30
When the MSTP30 bit is set to 1, the supply of the
clock to the SCIF0 is halted.
0: SCIF0 runs.
1: Clock supply to SCIF0 halted.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 383 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2.4
Standby Control Register 4 (STBCR4)
STBCR4 is an 8-bit readable/writable register that controls the operation of modules in powerdown modes. STBCR4 is initialized to H'00 by a power-on reset but retains its previous value by a
manual reset or in software standby mode. Only byte access is valid.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
Initial Value:
R/W:
7
6
5
4
3
2
⎯
MSTP
46
MSTP
45
MSTP
44
MSTP
43
MSTP
42
MSTP MSTP
41
40
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
7
⎯
0
R
Reserved
1
0
0
R/W
This bit is always read as 0. The write value should
always be 0.
6
MSTP46
0
R/W
Module Stop 46
When the MSTP46 bit is set to 1, the supply of the
clock to the SSI1 is halted.
0: SSI1 runs.
1: Clock supply to SSI1 halted.
5
MSTP45
0
R/W
Module Stop 45
When the MSTP45 bit is set to 1, the supply of the
clock to the SSI0 is halted.
0: SSI0 runs.
1: Clock supply to SSI0 halted.
4
MSTP44
0
R/W
Module Stop 44
When the MSTP44 bit is set to 1, the supply of the
clock to the HIF is halted.
0: HIF runs.
1: Clock supply to HIF halted.
Page 384 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 11 Power-Down Modes
Bit
Bit Name
Initial
Value
R/W
Description
3
MSTP43
0
R/W
Module Stop 43
When the MSTP43 bit is set to 1, the supply of the
clock to the A-DMAC is halted.
0: A-DMAC runs.
1: Clock supply to A-DMAC halted.
2
MSTP42
0
R/W
Module Stop 42
When the MSTP42 bit is set to 1, the supply of the
clock to the SDHI is halted.
0: SDHI runs.
1: Clock supply to SDHI halted.
1
MSTP41
0
R/W
Module Stop 41
When the MSTP41 bit is set to 1, the supply of the
clock to the USB is halted.
0: USB runs.
1: Clock supply to USB halted.
0
MSTP40
0
R/W
Module Stop 40
When the MSTP40 bit is set to 1, the supply of the
clock to the EtherC is halted.
0: EtherC runs.
1: Clock supply to EtherC halted.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 385 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2.5
System Control Register 1 (SYSCR1)
SYSCR1 is an 8-bit readable/writable register that enables or disables access to the on-chip RAM
(high-speed). SYSCR1 is valid only in byte access.
When an RAME bit is set to 1, the corresponding on-chip RAM (high-speed) area is enabled.
When an RAME bit is cleared to 0, the corresponding on-chip RAM (high-speed) area cannot be
accessed. In this case, an undefined value is returned when reading data or fetching an instruction
from the on-chip RAM (high-speed), and writing to the on-chip RAM (high-speed) is ignored. The
initial value of an RAME bit is 1.
Note that when clearing the RAME bit to 0 to disable the on-chip RAM (high-speed), be sure to
execute an instruction to read from or write to the same arbitrary address in each page before
setting the RAME bit. If such an instruction is not executed, the data last written may not be
written to the on-chip RAM (high-speed). Furthermore, an instruction to access the on-chip RAM
(high-speed) should not be located immediately after the instruction to write to SYSCR1. If an onchip RAM (high-speed) access instruction is set, normal access is not guaranteed.
If this bit is set to 1 to enable the on-chip RAM (high-speed), the SYSCR1 read instruction must
be placed immediately after the SYSCR1 write instruction. If the on-chip RAM (high-speed)
access instruction is placed immediately after the SYSCR1 write instruction, then normal access
will not be guaranteed.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
R/W:
7
6
5
4
⎯
⎯
⎯
⎯
1
R
1
R
1
R
1
R
3
2
1
0
RAME3 RAME2 RAME1 RAME0
1
R/W
Bit
Bit Name
Initial
Value
R/W
Description
7 to 4
⎯
All 1
R
Reserved
1
R/W
1
R/W
1
R/W
These bits are always read as 1. The write value
should always be 1.
3
RAME3
1
R/W
RAM Enable 3 (corresponding RAM addresses: Page
3 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) disabled
1: On-chip RAM (high-speed) enabled
Page 386 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 11 Power-Down Modes
Bit
Bit Name
Initial
Value
R/W
Description
2
RAME2
1
R/W
RAM Enable 2 (corresponding RAM addresses: Page
2 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) disabled
1: On-chip RAM (high-speed) enabled
1
RAME1
1
R/W
RAM Enable 1 (corresponding RAM addresses: Page
1 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) disabled
1: On-chip RAM (high-speed) enabled
0
RAME0
1
R/W
RAM Enable 0 (corresponding RAM addresses: Page
0 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) disabled
1: On-chip RAM (high-speed) enabled
Note:
*
For specific address for each page, see section 27, On-Chip RAM.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 387 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2.6
System Control Register 2 (SYSCR2)
SYSCR2 is an 8-bit readable/writable register that enables or disables write to the on-chip RAM
(high-speed). SYSCR2 is valid only in byte access.
When the RAMWE bit is set to 1, writing to the on-chip RAM (high-speed) is enabled. When an
RAMWE bit is cleared to 0, the corresponding on-chip RAM (high-speed) area cannot be written
to. In this case, writing to the on-chip RAM (high-speed) is ignored. The initial value of an
RAMWE bit is 1.
Note that when clearing the RAMWE bit to 0 to disable the on-chip RAM, be sure to execute an
instruction to read from or write to the same arbitrary address in each page before setting the
RAMWE bit. If such an instruction is not executed, the data last written may not be written to the
on-chip RAM (high-speed). Furthermore, an instruction to access the on-chip RAM (high-speed)
should not be located immediately after the instruction to write to SYSCR2. If an on-chip RAM
(high-speed) access instruction is set, normal access is not guaranteed.
If this bit is set to 1 to enable writing to the on-chip RAM (high-speed), the SYSCR2 read
instruction must be placed immediately after the SYSCR2 write instruction. If the on-chip RAM
(high-speed) access instruction is placed immediately after the SYSCR2 write instruction, then
normal access will not be guaranteed.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
Initial value:
R/W:
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
RAM
WE3
RAM
WE2
RAM
WE1
RAM
WE0
1
R
1
R
1
R
1
R
1
R/W
1
R/W
1
R/W
1
R/W
Bit
Bit Name
Initial
Value
R/W
Description
7 to 4
⎯
All 1
R
Reserved
These bits are always read as 1. The write value
should always be 1.
3
RAMWE3
1
R/W
RAM Write Enable 3 (corresponding RAM addresses:
Page 3 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) write disabled
1: On-chip RAM (high-speed) write enabled
Page 388 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 11 Power-Down Modes
Bit
Bit Name
Initial
Value
R/W
Description
2
RAMWE2
1
R/W
RAM Write Enable 2 (corresponding RAM addresses:
Page 2 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) write disabled
1: On-chip RAM (high-speed) write enabled
1
RAMWE1
1
R/W
RAM Write Enable 1 (corresponding RAM addresses:
Page 1 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) write disabled
1: On-chip RAM (high-speed) write enabled
0
RAMWE0
1
R/W
RAM Write Enable 0 (corresponding RAM addresses:
Page 0 in on-chip RAM (high-speed)*)
0: On-chip RAM (high-speed) write disabled
1: On-chip RAM (high-speed) write enabled
Note:
*
For specific address for each page, see section 27, On-Chip RAM.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 389 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.2.7
System Control Register 3 (SYSCR3)
SYSCR3 is an 8-bit readable/writable register that controls the software reset for SSI0 and SSI1.
SYSCR3 is valid only in byte access.
Note: See section 11.4, Usage Notes, when writing data to this register.
Bit:
Initial value:
R/W:
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
SSI1
SRST
SSI0
SRST
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
7 to 2
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
1
SSI1SRST
0
R/W
SSI1 Software Reset
Controls the SSI1 reset by software.
0: Cancels the SSI1 reset.
1: Places the SSI1 in reset state.
0
SSI0SRST
0
R/W
SSI0 Software Reset
Controls the SSI0 reset by software.
0: Cancels the SSI0 reset
1: Places the SSI0 in reset state.
Page 390 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
11.3
Operation
11.3.1
(1)
Section 11 Power-Down Modes
Sleep Mode
Transition to Sleep Mode
Executing the SLEEP instruction when the STBY bit in STBCR is 0 causes a transition from the
program execution state to sleep mode. Although the CPU halts immediately after executing the
SLEEP instruction, the contents of its internal registers remain unchanged. The on-chip modules
continue to run in sleep mode. Clock pulses continue to be output on the CKIO pin in clock mode
0, 1, or 3.
(2)
Canceling Sleep Mode
Sleep mode is canceled by an interrupt (NMI, IRQ, and on-chip peripheral module), DMA address
error, or reset (power-on reset).
• Canceling with an interrupt
When an NMI, IRQ, or on-chip peripheral module interrupt occurs, sleep mode is canceled and
interrupt exception handling is executed. When the priority level of the generated interrupt is
equal to or lower than the interrupt mask level that is set in the status register (SR) of the CPU,
or the interrupt by the on-chip peripheral module is disabled on the module side, the interrupt
request is not accepted and sleep mode is not canceled.
• Canceling with a DMA address error
When a DMA address error occurs, sleep mode is canceled and DMA address error exception
handling is executed.
• Canceling with a reset
Sleep mode is canceled by a power-on reset.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 391 of 1278
Section 11 Power-Down Modes
11.3.2
(1)
SH7670 Group
Software Standby Mode
Transition to Software Standby Mode
The LSI switches from a program execution state to software standby mode by executing the
SLEEP instruction when the STBY bit in STBCR is 1. In software standby mode, not only the
CPU but also the clock and on-chip peripheral modules halt. The clock output from the CKIO pin
also halts in clock mode 0, 1, or 3.
The contents of the CPU remain unchanged. Some registers of on-chip peripheral modules are,
however, initialized. Regarding the states of on-chip peripheral module registers in software
standby mode, see section 28.3, Register States in Each Operating Mode.
The CPU takes one cycle to finish writing to STBCR, and then executes processing for the next
instruction. However, it takes one or more cycles to actually write. Therefore, execute a SLEEP
instruction after reading STBCR to have the values written to STBCR by the CPU to be definitely
reflected in the SLEEP instruction.
The procedure for switching to software standby mode is as follows:
1. Clear the TME bit in the WDT's timer control register (WTCSR) to 0 to stop the WDT.
2. Set the WDT's timer counter (WTCNT) to 0 and the CKS[2:0] bits in WTCSR to appropriate
values to secure the specified oscillation settling time.
3. After setting the STBY bit in STBCR to 1, read STBCR. Then, execute a SLEEP instruction.
Page 392 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(2)
Section 11 Power-Down Modes
Canceling Software Standby Mode
Software standby mode is canceled by interrupts (NMI or IRQ) or a reset (power-on reset). The
CKIO pin starts outputting the clock in clock mode 0, 1, or 3.
• Canceling with an interrupt
When the falling edge or rising edge of the NMI pin (selected by the NMI edge select bit
(NMIE) in interrupt control register 0 (ICR0) of the interrupt controller (INTC)) or the falling
edge or rising edge of an IRQ pin (IRQ7 to IRQ0) (selected by the IRQn sense select bits
(IRQn1S and IRQn0S) in interrupt control register 1 (ICR1) of the interrupt controller (INTC))
is detected, clock oscillation is started. This clock pulse is supplied only to the oscillation
settling counter (WDT) used to count the oscillation settling time.
After the elapse of the time set in the clock select bits (CKS[2:0]) in the watchdog timer
control/status register (WTCSR) of the WDT before the transition to software standby mode,
the WDT overflow occurs. Since this overflow indicates that the clock has been stabilized, the
clock pulse will be supplied to the entire chip after this overflow. Software standby mode is
thus cleared and NMI interrupt exception handling (IRQ interrupt exception handling in the
case of IRQ) starts. However, if the priority level of IRQ interrupt is lower than the interrupt
mask level set in the status register (SR) of the CPU, the interrupt request is not accepted and
thus the software standby mode is not released.
When canceling software standby mode by the NMI interrupt or IRQ interrupt, set the
CKS[2:0] bits so that the WDT overflow period will be equal to or longer than the oscillation
settling time.
The clock output phase of the CKIO pin may be unstable immediately after detecting an
interrupt and until software standby mode is canceled. When software standby mode is
canceled by the falling edge of the NMI pin, the NMI pin should be high when the CPU enters
software standby mode (when the clock pulse stops) and should be low when the CPU returns
from software standby mode (when the clock is initiated after the oscillation settling). When
software standby mode is canceled by the rising edge of the NMI pin, the NMI pin should be
low when the CPU enters software standby mode (when the clock pulse stops) and should be
high when the CPU returns from software standby mode (when the clock is initiated after the
oscillation settling) (This is the same with the IRQ pin.)
• Canceling with a reset
When the RES pin is driven low, software standby mode is released and this LSI enters the
power-on reset state. And if the RES pin is driven high after that, the power-on reset exception
handling starts.
Keep the RES pin low until the clock oscillation settles.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 393 of 1278
SH7670 Group
Section 11 Power-Down Modes
11.3.3
Software Standby Mode Application Example
This example describes a transition to software standby mode on the falling edge of the NMI
signal, and cancellation on the rising edge of the NMI signal. The timing is shown in figure 11.1.
When the NMI pin is changed from high to low level while the NMI edge select bit (NMIE) in
ICR is set to 0 (falling edge detection), the NMI interrupt is accepted. When the NMIE bit is set to
1 (rising edge detection) by the NMI exception service routine, the STBY bit in STBCR is set to 1,
and a SLEEP instruction is executed, software standby mode is entered. Thereafter, software
standby mode is canceled when the NMI pin is changed from low to high level.
Oscillator
CK
NMI pin
NMIE bit
STBY bit
LSI state
Program
execution
NMI
exception
handling
Exception
service routine
Software
standby mode
Oscillation
settling time
NMI exception
handling
Figure 11.1 NMI Timing in Software Standby Mode (Application Example)
Page 394 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
11.3.4
(1)
Section 11 Power-Down Modes
Module Standby Function
Transition to Module Standby Function
Setting the standby control register MSTP bits to 1 halts the supply of clocks to the corresponding
on-chip peripheral modules. This function can be used to reduce the power consumption in normal
mode and sleep mode. Disable a module before placing it in the module standby mode. In
addition, do not access the module's registers while it is in the module standby state.
The register states are the same as those in software standby mode. For details, see section 28.3,
Register States in Each Operating Mode.
However, the states of the CMT registers are exceptional. In the CMT, all registers are initialized
in software standby mode, but retain their previous values in module standby mode.
(2)
Canceling Module Standby Function
The module standby function can be canceled by clearing the MSTP bits to 0, or by a power-on
reset. When taking a module out of the module standby state by clearing the corresponding MSTP
bit to 0, read the MSTP bit to confirm that it has been cleared to 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 395 of 1278
Section 11 Power-Down Modes
11.4
SH7670 Group
Usage Notes
When writing data to registers related to power-down modes, note the following suggestion.
In a case where the CPU writes data to the registers related to power-down modes, if the CPU
once starts executing the write instruction, the CPU keeps on executing the succeeding
instructions without waiting for the completion of writing data to the registers. If reflecting a
change of writing data to registers becomes necessary while the CPU is performing the succeeding
instructions, execute a dummy read for the same register between the write instruction to the
register and the succeeding instructions.
Page 396 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Section 12 Ethernet Controller (EtherC)
This LSI has an on-chip Ethernet controller (EtherC) conforming to the Ethernet or the IEEE802.3
MAC (Media Access Control) layer standard. Connecting a physical-layer LSI (PHY-LSI)
complying with this standard enables the Ethernet controller (EtherC) to perform transmission and
reception of Ethernet/IEEE802.3 frames. This LSI has one MAC layer interface.
The Ethernet controller is connected to the direct memory access controller for Ethernet controller
(E-DMAC) inside this LSI, and carries out high-speed data transfer to and from the memory.
Figure 12.1 shows a configuration of the EtherC.
12.1
•
•
•
•
•
•
Features
Transmission and reception of Ethernet/IEEE802.3 frames
Supports 10/100 Mbps receive/transfer
Supports full-duplex and half-duplex modes
Conforms to IEEE802.3u standard MII (Media Independent Interface)
Magic Packet detection and Wake-On-LAN (WOL) signal output
Conforms to IEEE802.3x flow control
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 397 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
E-DMAC
EtherC
E-DMAC interface
MAC
Transmit
controller
Receive
controller
Command status
interface
MII
PHY
Figure 12.1 Configuration of EtherC
Page 398 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.2
Section 12 Ethernet Controller (EtherC)
Input/Output Pins
Table 12.1 lists the pin configuration of the EtherC.
Table 12.1 Pin Configuration
Port
Abbreviation I/O
0
TX-CLK*
Input
Function
Transmit Clock
Timing reference signal for the TX-EN, MII_TXD3 to MII_TXD0,
TX-ER signals
0
RX-CLK*
Input
Receive Clock
Timing reference signal for the RX-DV, MII_RXD3 to MII_RXD0,
RX-ER signals
0
TX-EN*
Output
Transmit Enable
Indicates that transmit data is ready on pins MII_TXD3 to
MII_TXD0.
0
0
MII_TXD3 to
MII_TXD0*
Output
TX-ER*
Output
Transmit Data
4-bit transmit data
Transmit Error
Notifies the PHY-LSI of error during transmission
0
RX-DV*
Input
Receive Data Valid
Indicates that valid receive data is on pins MII_RXD3 to
MII_RXD0.
0
0
MII_RXD3 to
MII_RXD0*
Input
RX-ER*
Input
Receive Data
4-bit receive data
Receive Error
Identifies error state occurred during data reception.
0
CRS
Input
Carrier Detection
Carrier detection signal
0
COL
Input
Collision Detection
Collision detection signal
0
MDC
Output
0
MDIO
Input/
Output
Management Data Clock
Reference clock signal for information transfer via MDIO
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Management Data I/O
Bidirectional signal for exchange of management information
between this LSI and PHY
Page 399 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Port
Abbreviation I/O
Function
0
LNKSTA
Link Status
Input
Inputs link status from PHY
0
EXOUT
Output
General-Purpose External Output
Signal indicating value of register-bit (ECMR0-ELB)
0
WOL
Output
Wake-On-LAN
Signal indicating reception of Magic Packet
Note:
*
MII signal conforming to IEEE802.3u
Page 400 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.3
Section 12 Ethernet Controller (EtherC)
Register Description
The EtherC has the following registers. For details on addresses and access sizes of registers, see
section 28, List of Registers.
MAC Layer Interface Control Registers:
• EtherC mode register (ECMR)
• EtherC status register (ECSR)
• EtherC interrupt permission register (ECSIPR)
• PHY interface register (PIR)
• MAC address high register (MAHR)
• MAC address low register (MALR)
• Receive frame length register (RFLR)
• PHY status register (PSR)
• Transmit retry over counter register (TROCR)
• Delayed collision detect counter register (CDCR)
• Lost carrier counter register (LCCR)
• Carrier not detect counter register (CNDCR)
• CRC error frame counter register (CEFCR)
• Frame receive error counter register (FRECR)
• Too-short frame receive counter register (TSFRCR)
• Too-long frame receive counter register (TLFRCR)
• Residual-bit frame counter register (RFCR)
• Multicast address frame counter register (MAFCR)
• IPG register (IPGR)
• Automatic PAUSE frame set register (APR)
• Manual PAUSE frame set register (MPR)
• PAUSE frame retransfer count set register (TPAUSER)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 401 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.1
EtherC Mode Register (ECMR)
ECMR is a 32-bit readable/writable register and specifies the operating mode of the Ethernet
controller. The settings in this register are normally made in the initialization process following a
reset.
The operating mode setting must not be changed while the transmitting and receiving functions
are enabled. To switch the operating mode, return the EtherC and E-DMAC to their initial states
by means of the SWR bit in EDMR before making settings again.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
ZPF
PFR
RXF
TXF
Initial value:
R/W:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
R
R
R
R
R
R
R
R
R
R
R
R
R/W
R/W
R/W
R/W
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
PRCEF
-
-
MPDE
-
-
RE
TE
-
ILB
ELB
DM
PRM
Initial value:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
R/W:
R
R
R
R/W
R
R
R/W
R
R
R/W
R/W
R
R/W
R/W
R/W
R/W
Bit
Initial
Bit Name Value
R/W
Description
31 to 20
⎯
R
Reserved
All 0
These bits are always read as 0. The write value
should always be 0.
19
ZPF
0
R/W
0 time parameter PAUSE Frame Use Enable
0: Disables PAUSE frame control in which the TIME
parameter is 0.
The next frame is transmitted after the time
indicated by the Timer value has elapsed. When the
EtherC receives a PAUSE frame with the time
indicated by the Timer value set to 0, the PAUSE
frame is discarded.
1: Enables PAUSE frame control in which the TIME
parameter is 0.
A PAUSE frame with the Timer value set to 0 is
transmitted when the number of data in the receive
FIFO is less than the FCFTR value before the time
indicated by the Timer value has not elapsed. When
the EtherC receives a PAUSE frame with the time
indicated by the Timer value set to 0, the transmit
wait state is canceled.
Page 402 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Bit
Initial
Bit Name Value
R/W
Description
18
PFR
R/W
PAUSE Frame Receive Mode
0
0: PAUSE frame is not transferred to the E-DMAC
1: PAUSE frame is transferred to the E-DMAC
17
RXF
0
R/W
Receive Flow Control Operating Mode
0: PAUSE frame detection function is disabled
1: Receive flow control function is enabled
16
TXF
0
R/W
Transmit Flow Control Operating mode
0: Transmit flow control function is disabled
1: Transmit flow control function is enabled
15 to 13
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
12
PRCEF
0
R/W
Permit Receive CRC Error Frame
0: A frame with a CRC error is received as a frame
with an error.
1: A frame with a CRC error is received as a frame
without an error.
For a frame with an error, a CRC error is reflected in
the ECSR of the E-DMAC and the status of the receive
descriptor. For a frame without an error, the frame is
received as normal frame.
11, 10
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
9
MPDE
0
R/W
Magic Packet Detection Enable
Enables or disables Magic Packet detection by
hardware to allow activation from the Ethernet.
0: Magic Packet detection is not enabled
1: Magic Packet detection is enabled
8, 7
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 403 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Bit
Initial
Bit Name Value
R/W
Description
6
RE
R/W
Reception Enable
0
If a frame is being received when this bit is switched
from receive function enabled (RE = 1) to disabled (RE
= 0), the receive function will be enabled until reception
of the corresponding frame is completed.
0: Receive function is disabled
1: Receive function is enabled
5
TE
0
R/W
Transmission Enable
If a frame is being transmitted when this bit is switched
from transmit function enabled (TE = 1) to disabled (TE
= 0), the transmit function will be enabled until
transmission of the corresponding frame is completed.
0: Transmit function is disabled
1: Transmit function is enabled
4
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
3
ILB
0
R/W
Internal Loop Back Mode
Specifies loopback mode in the EtherC.
0: Normal data transmission/reception is performed.
1: When DM = 1, data loopback is performed inside
the MAC in the EtherC.
2
ELB
0
R/W
External Loop Back Mode
This bit value is output directly to this LSI’s generalpurpose external output pin (EXOUT). This bit is used
for loopback mode directives, etc., in the LSI, using the
EXOUT pin. In order for LSI loopback to be
implemented using this function, the LSI must have a
pin corresponding to the EXOUT pin.
0: Low-level output from the EXOUT pin
1: High-level output from the EXOUT pin
1
DM
0
R/W
Duplex Mode
Specifies the EtherC transfer method.
0: Half-duplex transfer is specified
1: Full-duplex transfer is specified
Page 404 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Bit
Initial
Bit Name Value
R/W
Description
0
PRM
R/W
Promiscuous Mode
0
Setting this bit enables all Ethernet frames to be
received. All Ethernet frames means all receivable
frames, irrespective of differences or enabled/disabled
status (destination address, broadcast address,
multicast bit, etc.).
0: EtherC performs normal operation
1: EtherC performs promiscuous mode operation
12.3.2
EtherC Status Register (ECSR)
ECSR is a 32-bit readable/writable register and indicates the status in the EtherC. This status can
be notified to the CPU by interrupts. When 1 is written to the PSRTO, LCHNG, MPD, and ICD,
the corresponding flags can be cleared. Writing 0 does not affect the flag. For bits that generate
interrupt, the interrupt can be enabled or disabled according to the corresponding bit in ECSIPR.
The interrupts generated due to this status register are indicated in the ECI bit in EESR.
Initial value:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
-
-
-
PSRTO
-
LCHNG
MPD
ICD
Initial value:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
R/W:
R
R
R
R
R
R
R
R
R
R
R
R/W
R
R/W
R/W
R/W
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 405 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Bit
Bit Name
31 to 5 ⎯
Initial
Value
R/W
Description
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
4
PSRTO
0
R/W
PAUSE Frame Retransfer Retry Over
Indicates that during the retransfer of PAUSE frames
when the flow control is enabled, the number of retries
has exceeded the upper limit set in the automatic
PAUSE frame retransfer count set register
(TPAUSER).
0: Number of PAUSE frame retransfers has not
exceeded the upper limit
1: Number of PAUSE frame retransfers has exceeded
the upper limit
3
⎯
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
2
LCHNG
0
R/W
Link Signal Change
Indicates that the LNKSTA signal input from the PHY
has changed from high to low or low to high.
To check the current Link state, refer to the LMON bit
in the PHY status register (PSR).
0: Changes in the LNKSTA signal are not detected
1: Changes in the LNKSTA signal are detected (high
to low or low to high)
1
MPD
0
R/W
Magic Packet Detection
Indicates that a Magic Packet has been detected on
the line.
0: Magic Packet has not been detected
1: Magic Packet has been detected
0
ICD
0
R/W
Illegal Carrier Detection
Indicates that the PHY has detected an illegal carrier
on the line. If a change in the signal input from the
PHY occurs before the software recognition period,
the correct information may not be obtained. Refer to
the timing specification for the PHY used.
0: LSI has not detected an illegal carrier on the line
1: LSI has detected an illegal carrier on the line
Page 406 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.3.3
Section 12 Ethernet Controller (EtherC)
EtherC Interrupt Permission Register (ECSIPR)
ECSIPR is a 32-bit readable/writable register that enables or disables the interrupt sources
indicated by ECSR. Each bit can disable or enable interrupts corresponding to the bits in ECSR.
Bit:
31
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Initial value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
-
-
-
-
-
-
-
-
-
-
4
PSRTO
IP
3
-
2
LCHNG
IP
1
MPD
IP
0
ICD
IP
30
29
28
27
26
25
24
23
22
21
20
19
-
18
17
16
Initial value:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
R/W:
R
R
R
R
R
R
R
R
R
R
R
R/W
R
R/W
R/W
R/W
Bit
Bit Name
31 to 5 ⎯
Initial
Value
R/W
All 0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
4
PSRTOIP
0
R/W
PAUSE Frame Retransfer Retry Over Interrupt Enable
0: Interrupt notification by the PSRTO bit is disabled
1: Interrupt notification by the PSRTO bit is enabled
3
—
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
2
LCHNGIP
0
R/W
LINK Signal Changed Interrupt Enable
0: Interrupt notification by the LCHNG bit is disabled
1: Interrupt notification by the LCHNG bit is enabled
1
MPDIP
0
R/W
Magic Packet Detection Interrupt Enable
0: Interrupt notification by the MPD bit is disabled
1: Interrupt notification by the MPD bit is enabled
0
ICDIP
0
R/W
Illegal Carrier Detection Interrupt Enable
0: Interrupt notification by the ICD bit is disabled
1: Interrupt notification by the ICD bit is enabled
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 407 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.4
PHY Interface Register (PIR)
PIR is a 32-bit readable/writable register that provides a means of accessing the PHY registers via
the MII.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
Initial value:
R/W:
Initial value:
R/W:
Bit
16
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
-
-
-
-
MDI
MDO
MMD
MDC
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Undefined
0
R/W
0
R/W
0
R/W
Bit Name
31 to 4 ⎯
Initial
Value
R/W Description
All 0
R
R
Reserved
These bits are always read as 0. The write value should
always be 0.
3
MDI
Undefined R
MII Management Data-In
Indicates the level of the MDIO pin.
2
MDO
0
R/W MII Management Data-Out
Outputs the value set to this bit from the MDIO pin,
when the MMD bit is 1.
1
MMD
0
R/W MII Management Mode
Specifies the data read/write direction with respect to
the MII.
0: Read direction is indicated
1: Write direction is indicated
0
MDC
0
R/W MII Management Data Clock
Outputs the value set to this bit from the MDC pin and
supplies the MII with the management data clock. For
the method of accessing the MII registers, see section
12.4.4, Accessing MII Registers.
Page 408 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.3.5
Section 12 Ethernet Controller (EtherC)
MAC Address High Register (MAHR)
MAHR is a 32 -bit readable/writable register that specifies the upper 32 bits of the 48-bit MAC
address. The settings in this register are normally made in the initialization process after a reset.
The MAC address setting must not be changed while the transmitting and receiving functions are
enabled. To switch the MAC address setting, return the EtherC and E-DMAC to their initial states
by means of the SWR bit in EDMR before making settings again.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
MA[47:32]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
MA[31:16]
Initial value: 0
R/W: R/W
Bit
0
R/W
0
R/W
Bit Name
31 to 0 MA[47:16]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
MAC Address Bits
These bits are used to set the upper 32 bits of the MAC
address.
If the MAC address is 01-23-45-67-89-AB
(hexadecimal), the value set in this register is
H'01234567.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 409 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.6
MAC Address Low Register (MALR)
MALR is a 32-bit readable/writable register that specifies the lower 16 bits of the 48-bit MAC
address. The settings in this register are normally made in the initialization process after a reset.
The MAC address setting must not be changed while the transmitting and receiving functions are
enabled. To switch the MAC address setting, return the EtherC and E-DMAC to their initial states
by means of the SWR bit in EDMR before making settings again.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
MA[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 16 ⎯
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
All 0
R
0
R/W
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
15 to 0 MA[15:0]
All 0
R/W
MAC Address Bits 15 to 0
These bits are used to set the lower 16 bits of the
MAC address.
If the MAC address is 01-23-45-67-89-AB
(hexadecimal), the value set in this register is
H'000089AB.
Page 410 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.3.7
Section 12 Ethernet Controller (EtherC)
Receive Frame Length Register (RFLR)
RFLR is a 32-bit readable/writable register and it specifies the maximum frame length (in bytes)
that can be received by this LSI. The settings in this register must not be changed while the
receiving function is enabled.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
bit: 15
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
Initial value:
R/W:
Bit
14
13
12
-
-
-
-
0
R
0
R
0
R
0
R
Bit Name
31 to 12 ⎯
16
RFL[11:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R
Reserved
0
R/W
0
R/W
These bits are always read as 0. The write value
should always be 0.
11 to 0 RFL[11:0]
All 0
R/W
Receive Frame Length 11 to 0
The frame length described here refers to all fields
from the destination address up to and including the
CRC data. Frame contents from the destination
address up to and including the data are actually
transferred to memory. CRC data is not included in
the transfer.
When data that exceeds the specified value is
received, the part of the data that exceeds the
specified value is discarded.
H'000 to H'5EE: 1,518 bytes
H'5EF: 1,519 bytes
H'5F0: 1,520 bytes
:
:
H'7FF: 2,047 bytes
H'800 to H'FFF: 2,048 bytes
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 411 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.8
PHY Status Register (PSR)
PSR is a read-only register that can read interface signals from the PHY.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
Initial value:
R/W:
Initial value:
R/W:
Bit
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
LMON
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
undefined
Bit Name
31 to 1 ⎯
Initial
Value
R/W
All 0
R
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
0
LMON
0
R
LNKSTA Pin Status
The Link status can be read by connecting the Link
signal output from the PHY to the LNKSTA pin. For
the polarity, refer to the PHY specifications to be
connected.
Page 412 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.3.9
Section 12 Ethernet Controller (EtherC)
Transmit Retry Over Counter Register (TROCR)
TROCR is a 32-bit counter that indicates the number of frames that were unable to be transmitted
in 16 transmission attempts including the retransfer. When 16 transmission attempts have failed,
TROCR is incremented by 1. When the value in this register reaches H'FFFFFFFF, the count is
halted. The counter value is cleared to 0 by a write to this register with any value.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TROC[31:16]
Initial value: 0
R/W: R/W
Bit:
15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
TROC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 0 TROC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Transmit Retry Over Count
These bits indicate the number of frames that were
unable to be transmitted in 16 transmission attempts
including the retransfer.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 413 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.10 Delayed Collision Detect Counter Register (CDCR)
CDCR is a 32-bit counter that indicates the number of delayed collisions on all lines from a start
of transmission. When the value in this register reaches H'FFFFFFFF, count-up is halted. The
counter value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
COSDC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
COSDC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
0
R/W
0
R/W
Initial
Value
31 to 0 COSDC[31:0] All 0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
R/W
Description
R/W
Delayed Collision Detect Count
These bits indicate the number of delayed collisions
on all lines from a start of transmission.
Page 414 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.11 Lost Carrier Counter Register (LCCR)
LCCR is a 32-bit counter that indicates the number of times the carrier was lost during data
transmission. When the value in this register reaches H'FFFFFFFF, the count is halted. The
counter value is cleared to 0 by writing to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
LCC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
LCC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
0
R/W
Bit Name
31 to 0 LCC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Lost Carrier Count
These bits indicate the number of times the carrier
was lost during data transmission.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 415 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.12 Carrier Not Detect Counter Register (CNDCR)
CNDCR is a 32-bit counter that indicates the number of times the carrier could not be detected
while the preamble was being sent. When the value in this register reaches H'FFFFFFFF, the count
is halted. The counter value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
CNDC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
CNDC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 0 CNDC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Carrier Not Detect Count
These bits indicate the number of times the carrier
was not detected.
Page 416 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.13 CRC Error Frame Counter Register (CEFCR)
CEFCR is a 32-bit counter that indicates the number of times a frame with a CRC error was
received. When the value in this register reaches H'FFFFFFFF, the count is halted. The counter
value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
CEFC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
CEFC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
0
R/W
Bit Name
31 to 0 CEFC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
CRC Error Frame Count
These bits indicate the count of CRC error frames
received.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 417 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.14 Frame Receive Error Counter Register (FRECR)
FRECR is a 32-bit counter that indicates the number of frames input from the PHY for which a
receive error was indicated by the RX-ER pin. FRECR is incremented each time the RX-ER pin
becomes active. When the value in this register reaches H'FFFFFFFF, the count is halted. The
counter value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
FREC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
FREC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 0 FREC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Frame Receive Error Count
These bits indicate the count of errors during frame
reception.
Page 418 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.15 Too-Short Frame Receive Counter Register (TSFRCR)
TSFRCR is a 32-bit counter that indicates the number of frames of fewer than 64 bytes that have
been received. When the value in this register reaches H'FFFFFFFF, the count is halted. The
counter value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TSFC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
TSFC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 0 TSFC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Too-Short Frame Receive Count
These bits indicate the count of frames received with
a length of less than 64 bytes.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 419 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.16 Too-Long Frame Receive Counter Register (TLFRCR)
TLFRCR is a 32-bit counter that indicates the number of frames received with a length exceeding
the value specified by the receive frame length register (RFLR). When the value in this register
reaches H'FFFFFFFF, the count is halted. TLFRCR is not incremented when a frame containing
residual bits is received. In this case, the reception of the frame is indicated in the residual-bit
frame counter register (RFCR). The counter value is cleared to 0 by a write to this register with
any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TLFC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
TLFC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 0 TLFC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Too-Long Frame Receive Count
These bits indicate the count of frames received with
a length exceeding the value in RFLR.
Page 420 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.17 Residual-Bit Frame Counter Register (RFCR)
RFCR is a 32-bit counter that indicates the number of frames received containing residual bits
(less than an 8-bit unit). When the value in this register reaches H'FFFFFFFF, the count is halted.
The counter value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RFC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
RFC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
0
R/W
Bit Name
31 to 0 RFC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Residual-Bit Frame Count
These bits indicate the count of frames received
containing residual bits.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 421 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.18 Multicast Address Frame Counter Register (MAFCR)
MAFCR is a 32-bit counter that indicates the number of frames received with a specified multicast
address. When the value in this register reaches H'FFFFFFFF, the count is halted. The counter
value is cleared to 0 by a write to this register with any value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
MAFC[31:16]
Initial value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
MAFC[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 0 MAFC[31:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R/W
Multicast Address Frame Count
These bits indicate the count of multicast frames
received.
Page 422 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.19 IPG Register (IPGR)
IPGR sets the IPG (Inter Packet Gap). This register must not be changed while the transmitting
and receiving functions of the EtherC mode register (ECMR) are enabled. (For details, refer to
section 12.4.6, Operation by IPG Setting.)
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
4
3
2
1
0
0
R/W
0
R/W
Initial value:
R/W:
Initial value:
R/W:
Bit
14
13
12
11
10
9
8
7
6
5
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit Name
31 to 5 ⎯
Initial
Value
R/W
All 0
R
IPG[4:0]
1
R/W
0
R/W
1
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
4 to 0
IPG[4:0]
H'13
R/W
Inter Packet Gap
Sets the IPG value every 4-bit time.
H'00: 20-bit time
H'01: 24-bit time
:
:
H'13: 96-bit time (Initial value)
:
:
H'1F: 144-bit time
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 423 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.20 Automatic PAUSE Frame Set Register (APR)
APR sets the TIME parameter value of the automatic PAUSE frame. When transmitting the
automatic PAUSE frame, the value set in this register is used as the TIME parameter of the
PAUSE frame.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
16
AP[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
Bit Name
31 to 16 ⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
15 to 0 AP[15:0]
All 0
R/W
Automatic PAUSE
Sets the TIME parameter value of the automatic
PAUSE frame. At this time, 1 bit means 512-bit time.
Page 424 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.21 Manual PAUSE Frame Set Register (MPR)
MPR sets the TIME parameter value of the manual PAUSE frame. When transmitting the manual
PAUSE frame, the value set to this register is used as the TIME parameter of the PAUSE frame.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
MP[15:0]
Initial value: 0
R/W: R/W
Bit
0
R/W
0
R/W
Bit Name
31 to 16 ⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial
Value
R/W
Description
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
15 to 0 MP[15:0]
All 0
R/W
Manual PAUSE
Sets the TIME parameter value of the manual PAUSE
frame. At this time, 1 bit means 512-bit time. Read
values are undefined.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 425 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.3.22 PAUSE Frame Retransfer Count Set Register (TPAUSER)
TPAUSER sets the upper limit of the number of times of the PAUSE frame retransfer. TPAUSER
must not be changed while the transmitting function is enabled.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial value:
R/W:
TPAUSE[15:0]
Initial value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
31 to 16
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
15 to 0
TPAUSE[15:0] All 0
R/W
Upper Limit of the Number of Times of PAUSE Frame
Retransfer
H'0000: Unlimited number of times of retransfer
H'0001: Retransfer once
:
:
H'FFFF: Number of times of retransfer is 65535
Page 426 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.4
Section 12 Ethernet Controller (EtherC)
Operation
The overview of the Ethernet controller (EtherC) are shown below. The EtherC transmits and
receives PAUSE frames conforming to the Ethernet/IEEE802.3 frames.
12.4.1
Transmission
The EtherC transmitter assembles the transmit data on the frame and outputs to MII when there is
a transmit request from the E-DMAC. The data transmitted via the MII is transmitted to the lines
by PHY-LSI. Figure 12.2 shows the state transition of the EtherC transmitter.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 427 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
FDPX
TE set
Start of transmission
(preamble transmission)
Idle
Transmission
halted
HDPX
Carrier
detection
TE reset
Carrier
non-detection
Carrier
detection
HDPX
Retransfer
initiation
FDPX
Collision
Reset
Carrier
detection
Retransfer
processing*1
Carrier
non-detection
Collision
Failure of 15
retransfer attempts
or collision
after 512-bit time
SFD
transmission
Error
Collision*2
Error detection
Error
notification
Error
Data
transmission
Collision*2
Error
[Legend]
FDPX: Full Duplex
CRC
Normal transmission
HDPX: Half Duplex
transmission
SFD: Start Frame Delimiter
Notes: 1. Transmission retry processing includes both jam transmission that depends on collision
detection and the adjustment of transmission intervals based on the back-off algorithm.
2. Transmission is retried only when data of 512 bits or less (including the preamble and
SFD) is transmitted. When a collision is detected during the transmission of data greater
than 512 bits, only jam is transmitted and transmission based on the back-off algorithm
is not retried.
Figure 12.2 EtherC Transmitter State Transitions
1. When the transmit enable (TE) bit is set, the transmitter enters the transmit idle state.
2. When a transmit request is issued by the transmit E-DMAC, the EtherC sends the preamble
after a transmission delay equivalent to the frame interval time. If full-duplex transfer is
selected, which does not require carrier detection, the preamble is sent as soon as a transmit
request is issued by the E-DMAC.
Page 428 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
3. The transmitter sends the SFD, data, and CRC sequentially. At the end of transmission, the
transmit E-DMAC generates a transmission complete interrupt (TC). If a collision or the
carrier-not-detected state occurs during data transmission, these are reported as interrupt
sources.
4. After waiting for the frame interval time, the transmitter enters the idle state, and if there is
more transmit data, continues transmitting.
12.4.2
Reception
The EtherC receiver separates the frame data (MII into preamble, SFD, DA (destination address),
SA (Source address), type/length, Data, and CRC data) and outputs DA, SA, type/length, Data to
the E-DMAC. Figure 12.3 shows the state transitions of the EtherC receiver.
Illegal carrier
detection
RX-DV negation
Idle
Preamble
detection
RE set
Reception
halted
Start of frame
reception
Wait for SFD
reception
SFD
reception
RE reset
Promiscuous and other
station destination address
Destination address
reception
Reset
Error
notification*
Error
detection
Receive error
detection
Receive error
detection
Normal reception
Own destination address
or broadcast
or multicast
or promiscuous
Data
reception
End of
reception
CRC
reception
[Legend]
SFD: Start frame delimiter
Note: * The error frame also transmits data to the buffer.
Figure 12.3 EtherC Receiver State Transmissions
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 429 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
1. When the receive enable (RE) bit is set, the receiver enters the receive idle state.
2. When an SFD (start frame delimiter) is detected after a receive packet preamble, the receiver
starts receive processing. Discards a frame with an invalid pattern.
3. In normal mode, if the destination address matches the receiver’s own address, or if broadcast
or multicast transmission or promiscuous mode is specified, the receiver starts data reception.
4. Following data reception from the MII, the receiver carries out a CRC check. The result is
indicated as a status bit in the descriptor after the frame data has been written to memory.
Reports an error status in the case of an abnormality.
5. After one frame has been received, if the receive enable bit is set (RE = 1) in the EtherC mode
register, the receiver prepares to receive the next frame.
12.4.3
MII Frame Timing
Each MII Frame timing is shown in figure 12.4.
TX-CLK
TX-EN
TXD3 to TXD0
Preamble
SFD
Data
CRC
TX-ER
CRS
COL
Figure 12.4 (1) MII Frame Transmit Timing (Normal Transmission)
TX-CLK
TX-EN
MII_TXD3 to
MII_TXD0
Preamble
JAM
TX-ER
CRS
COL
Figure 12.4 (2) MII Frame Transmit Timing (Collision)
Page 430 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
TX-CLK
TX-EN
MII_TXD3 to
MII_TXD0
Preamble
SFD
Data
TX-ER
CRS
COL
Figure 12.4 (3) MII Frame Transmit Timing (Transmit Error)
RX-CLK
RX-DV
MII_RXD3 to
MII_RXD0
Preamble
SFD
Data
CRC
RX-ER
Figure 12.4 (4) MII Frame Receive Timing (Normal Reception)
RX-CLK
RX-DV
MII_RXD3 to
MII_RXD0
Preamble
SFD
Data
XXXX
RX-ER
Figure 12.4 (5) MII Frame Receive Timing (Reception Error (1))
RX-CLK
RX-DV
MII_RXD3 to
MII_RXD0
XXXX
1110
XXXX
RX-ER
Figure 12.4 (6) MII Fame Receive Timing (Reception Error (2))
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 431 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.4.4
Accessing MII Registers
MII registers in the PHY are accessed via this LSI’s PHY interface register (PIR). Connection is
made as a serial interface in accordance with the MII frame format specified in IEEE802.3u.
MII Management Frame Format: The format of an MII management frame is shown in figure
12.5. To access an MII register, a management frame is implemented by the program in
accordance with the procedures shown in MII Register Access Procedure.
Access Type
Item
MII Management Frame
PRE
ST
OP
PHYAD
REGAD
TA
DATA
Number of bits
32
2
2
5
5
2
16
Read
1..1
01
10
00001
RRRRR
Z0
D..D
Write
1..1
01
01
00001
RRRRR
10
D..D
IDLE
X
[Legend]
PRE:
ST:
OP:
PHYAD:
32 consecutive 1s
Write of 01 indicating start of frame
Write of code indicating access type
Write of 0001 if the PHY address is 1 (sequential write starting with the MSB).
This bit changes depending on the PHY address.
REGAD: Write of 0001 if the register address is 1 (sequential write starting with the MSB).
This bit changes depending on the PHY register address.
TA:
Time for switching data transmission source on MII interface
(a) Write: 10 written
(b) Read: Bus release (notation: Z0) performed
DATA: 16-bit data. Sequential write or read from MSB
(a) Write: 16-bit data write
(b) Read: 16-bit data read
IDLE:
Wait time until next MII management format input
(a) Write: Independent bus release (notation: X) performed
(b) Read: Bus already released in TA; control unnecessary
Figure 12.5 MII Management Frame Format
Page 432 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
MII Register Access Procedure: The program accesses MII registers via the PHY interface
register (PIR). Access is implemented by a combination of 1-bit-unit data write, 1-bit-unit data
read, bus release, and independent bus release. Figure 12.6 shows the MII register access timing.
The timing will differ depending on the PHY type.
(1) Write to PHY interface
register
MMD = 1
MDO = write data
MDC = 0
MDC
MDO
(2) Write to PHY interface
register
(1) (2)
(3)
1-bit data write timing
relationship
MMD = 1
MDO = write data
MDC = 1
(3) Write to PHY interface
register
MMD = 1
MDO = write data
MDC = 0
Figure 12.6 (1) 1-Bit Data Write Flowchart
(1)
Write to PHY interface
register
MMD = 0
MDC = 0
MDC
MDO
(2)
Write to PHY interface
register
(1) (2)
MMD = 0
MDC = 1
(3)
(3)
Bus release timing
relationship
Write to PHY interface
register
MMD = 0
MDC = 0
Figure 12.6 (2) Bus Release Flowchart (TA in Read in Figure 12.5)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 433 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
(1) Write to PHY interface
register
MDC
MMD = 0
MDC = 1
MDI
(2) Read from PHY
interface register read
(1)
MMD = 0
MMC = 1
(2)
(3)
1-bit data read timing
relationship
MDI is read data
(3) Write to PHY interface
register
MMD = 0
MDC = 0
Figure 12.6 (3) 1-Bit Data Read Flowchart
(1) Write to PHY interface
register
MMD = 0
MDC = 0
MDC
MDO
(1)
Independent bus release
timing relationship
Figure 12.6 (4) Independent Bus Release Flowchart (IDLE in Write in Figure 12.5)
Page 434 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
12.4.5
Section 12 Ethernet Controller (EtherC)
Magic Packet Detection
The EtherC has a Magic Packet detection function. This function provides a Wake-On-LAN
(WOL) facility that activates various peripheral devices connected to a LAN from the host device
or other source. This makes it possible to construct a system in which a peripheral device receives
a Magic Packet sent from the host device or other source, and activates itself. When the Magic
Packet is detected, data is stored in the FIFO of the E-DMAC by the broadcast packet that has
received data previously and the EtherC is notified of the receiving status. To return to normal
operation from the interrupt processing, initialize the EtherC and E-DMAC by using the SWR bit
in the E-DMAC mode register (EDMR).
With a Magic Packet, reception is performed regardless of the destination address. As a result, this
function is valid, and the WOL pin enabled, only in the case of a match with the destination
address specified by the format in the Magic Packet. Further information on Magic Packets can be
found in the technical documentation published by AMD Corporation.
The procedure for using the WOL function with this LSI is as follows.
1. Disable interrupt source output by means of the various interrupt enable/mask registers.
2. Set the Magic Packet detection enable bit (MPDE) in the EtherC mode register (ECMR).
3. Set the Magic Packet detection interrupt enable bit (MPDIP) in the EtherC interrupt enable
register (ECSIPR) and clear the other bits in ECSIPR. Set the EtherC status register interrupt
permission bit (ECIIP) of the EtherC/E-DMAC status interrupt permission register (EESIPR)
in the Ethernet controller direct memory access controller (E-DMAC) and clear the other bits
in EESIPR.
4. If necessary, set the CPU operating mode to sleep mode or set supporting functions to module
standby mode.
5. When a Magic Packet is detected, an interrupt is sent to the CPU. The WOL pin notifies
peripheral LSIs that the Magic Packet has been detected.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 435 of 1278
SH7670 Group
Section 12 Ethernet Controller (EtherC)
12.4.6
Operation by IPG Setting
The EtherC has a function to change the non-transmission period IPG (Inter Packet Gap) between
transmit frames. By changing the set values of the IPG setting register (IPGR), the transmission
efficiency can be raised and lowered from the standard value. IPG settings are prescribed in
IEEE802.3 standards. When changing settings, adequately check that the respective devices can
operate smoothly on the same network.
Case A
(short IPG)
[1]
Packet
Case B
(long IPG)
[1]
[2]
[3]
[4]
[5]
......
IPG*
[2]
[3]
[4]
......
Note: * IPG may be longer than the set value, depending on the state of the circuit and the system bus.
Figure 12.7 Changing IPG and Transmission Efficiency
12.4.7
Flow Control
The EtherC supports flow control functions conforming to IEEE802.3x in full-duplex operations.
Flow control can be applied to both receive and transmit operations. The methods for transmitting
PAUSE frames when controlling flow are as follows:
Automatic PAUSE Frame Transmission: For receive frames, PAUSE frames are automatically
transmitted when the number of data in the receive FIFO (included in E-DMAC) reaches the value
set in the flow control FIFO threshold register (FCFTR) of the E-DMAC. The TIME parameter
included in the PAUSE frame at this time is set by the automatic PAUSE frame setting register
(APR). The automatic PAUSE frame transmission is repeated until the number of data in the
receive FIFO becomes less than the FCFTR setting as the receive data is read from the FIFO.
The upper limit of the number of retransfers of the PAUSE frame can also be set by the automatic
PAUSE frame retransfer count set register (TPAUSER). In this case, PAUSE frame transmission
is repeated until the number of data becomes FCFTR value set or below, or the number of
transmits reaches the value set by TPAUSER. The automatic PAUSE frame transmission is
enabled when the TXF bit in the EtherC mode register (ECMR) is 1.
Page 436 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 12 Ethernet Controller (EtherC)
Manual PAUSE Frame Transmission: PAUSE frames are transmitted by directives from the
software. When writing the Timer value to the manual PAUSE frame set register (MPR), manual
PAUSE frame transmission is started. With this method, PAUSE frame transmission is carried out
only once.
PAUSE Frame Reception: The next frame is not transmitted until the time indicated by the
Timer value elapses after receiving a PAUSE frame. However, the transmission of the current
frame is continued. A received PAUSE frame is valid only when the RXF bit in the EtherC mode
register (ECMR) is set to 1.
12.5
Connection to PHY-LSI
Figure 12.8 shows the example of connection to a DP83846AVHG by National Semiconductor
Corporation.
This LSI
MII (Media Independent Interface)
DP83846AVHG
TX-ER
MII_TXD3
MII_TXD2
MII_TXD1
MII_TXD0
TX-EN
TX-CLK
MDC
MDIO
MII_RXD3
MII_RXD2
MII_RXD1
MII_RXD0
RX-CLK
CRS
COL
RX-DV
RX-ER
TX_ER
TXD3
TXD2
TXD1
TXD0
TX_EN
TX_CLK
MDC
MDIO
RXD3
RXD2
RXD1
RXD0
RX_CLK
CRS
COL
RX_DV
RX_ER
Figure 12.8 Example of Connection to DP83846AVHG
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 437 of 1278
Section 12 Ethernet Controller (EtherC)
12.6
SH7670 Group
Usage Notes
• Conditions for Setting LCHNG Bit
Even if the level of the signal input to the LNKSTA pin is not changed, the LCHNG bit in
ECSR may be set. It may happen when the pin function is changed from port to LNKSTA by
PCCRH2 of the PFC or when a software reset caused by the SWR bit in EDMR is cleared
while the LNKSTA pin is being driven high.
This is because the LNKSTA signal is internally fixed low when the pin functions as a port or
during the software reset state regardless of the external pin level.
Clear the LCHNG bit before setting the LCHNGIP bit in ECSIPR not to request a LINK signal
changed interrupt accidentally.
Page 438 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Section 13 Ethernet Controller Direct Memory Access
Controller (E-DMAC)
This LSI includes a direct memory access controller (E-DMAC) directly connected to the Ethernet
controller (EtherC). A large proportion of buffer management is controlled by the E-DMAC itself
using descriptors. This lightens the load on the CPU and enables efficient control of data transfer.
Figure 13.1 shows the configuration of the E-DMAC, and the descriptors and transmit/receive
buffers in memory.
13.1
Features
The E-DMAC has the following features:
•
•
•
•
The load on the CPU is reduced by means of a descriptor management system
Transmit/receive frame status information is indicated in descriptors
Achieves efficient system bus utilization through the use of block transfer (16-byte units)
Supports single-frame/multi-buffer operation
This LSI
Internal bus
Transmit
buffer
E-DMAC
Transmit
descriptor
Receive
buffer
Receive
descriptor
External bus
interface
Internal
bus
interface
Descriptor
information
Transmit
DMAC
Descriptor
information
Receive
DMAC
Transmit
FIFO
EtherC
Receive
FIFO
External memory
Figure 13.1 Configuration of E-DMAC, and Descriptors and Buffers
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 439 of 1278
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2
SH7670 Group
Register Descriptions
The E-DMAC has the following registers. For addresses and access sizes of these registers, see
section 28, List of Registers.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
E-DMAC mode register (EDMR)
E-DMAC transmit request register (EDTRR)
E-DMAC receive request register (EDRRR)
Transmit descriptor list address register (TDLAR)
Receive descriptor list address register (RDLAR)
EtherC/E-DMAC status register (EESR)
EtherC/E-DMAC status interrupt permission register (EESIPR)
Transmit/receive status copy enable register (TRSCER)
Receive missed-frame counter register (RMFCR)
Transmit FIFO threshold register (TFTR)
FIFO depth register (FDR)
Receiving method control register (RMCR)
E-DMAC operation control register (EDOCR)
Receive buffer write address register (RBWAR)
Receive descriptor fetch address register (RDFAR)
Transmit buffer read address register (TBRAR)
Transmit descriptor fetch address register (TDFAR)
Flow control FIFO threshold register (FCFTR)
Receive data padding setting register (RPADIR)
Transmit interrupt register (TRIMD)
Checksum mode register (CSMR)
Checksum skipped bytes monitor register (CSSBM)
Checksum monitor register (CSSMR)
Page 440 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.2.1
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
E-DMAC Mode Register (EDMR)
EDMR is a 32-bit readable/writable register that specifies the operating mode of the E-DMAC.
The settings in this register are normally made in the initialization process following a reset. If the
EtherC and E-DMAC are initialized by means of this register during data transmission, abnormal
data may be sent onto the line. Operating mode settings must not be changed while the transmit
and receive functions are enabled. To change the operating mode, the EtherC and E-DMAC
modules are got into at their initial state by means of the software reset bit (SWR) in this register,
then make new settings. It takes 64 cycles of the internal bus clock Bφ to initialize the EtherC and
E-DMAC. Therefore, registers of the EtherC and E-DMAC should be accessed after 64 cycles of
the internal bus clock Bφ has elapsed.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
DE
DL1
DL0
⎯
⎯
⎯
SWR
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R
0
R
0
R
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31 to 7
⎯
All 0
R
Reserved
Initial Value:
R/W:
These bits are always read as 0. The write value
should always be 0.
6
DE
0
R/W
E-DMAC Data Endian Convert
Selects whether or not the endian format is converted
on data transfer by the E-DMAC. However, the endian
format of the descriptors and E-DMAC register values
are not converted regardless of this bit setting.
0: Endian format not converted (big endian)
1: Endian format converted (little endian)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 441 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
5
DL1
0
R/W
Descriptor Length
4
DL0
0
R/W
These bits specify the descriptor length.
00: 16 bytes
01: 32 bytes
10: 64 bytes
11: Reserved (setting prohibited)
3 to 1
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
0
SWR
0
R/W
Software Reset
Writing 1 in this bit initializes registers of the E-DMAC
other than TDLAR, RDLAR, and RMFCR and registers
of the EtherC. While a software reset is being
executed (64 cycles of the internal bus clock Bφ),
accesses to the all Ethernet-related registers are
prohibited.
Software reset period (example):
When Bφ = 100 MHz: 0.64 μs
When Bφ = 75 MHz: 0.85 μs
This bit is always read as 0.
0: Writing 0 is ignored (E-DMAC operation is not
affected)
1: Writing 1 resets the EtherC and E-DMAC and then
automatically cleared
Page 442 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.2.2
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
E-DMAC Transmit Request Register (EDTRR)
The EDTRR is a 32-bit readable/writable register that issues transmit directives to the E-DMAC.
When transmission of one frame is completed, the next descriptor is read. If the transmit
descriptor active bit in this descriptor has the "active" setting, transmission is continued. If the
transmit descriptor active bit has the "inactive" setting, the TR bit is cleared and operation of the
transmit DMAC is halted.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
TR
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Bit
Bit Name
Initial
value
R/W
31 to 1
⎯
All 0
R
Initial Value:
R/W:
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
0
TR
0
R/W
Transmit Request
0: Transmission-halted state. Writing 0 does not stop
transmission. Termination of transmission is
controlled by the active bit in the transmit descriptor
1: Start of transmission. The relevant descriptor is
read and a frame is sent with the transmit active bit
set to 1
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 443 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.3
E-DMAC Receive Request Register (EDRRR)
EDRRR is a 32-bit readable/writable register that issues receive directives to the E-DMAC. When
the receive request bit is set, the E-DMAC reads the relevant receive descriptor. If the receive
descriptor active bit in the descriptor has the "active" setting, the E-DMAC prepares for a receive
request from the EtherC. When one receive buffer of data has been received, the E-DMAC reads
the next descriptor and prepares to receive the next frame. If the receive descriptor active bit in the
descriptor has the "inactive" setting, the RR bit is cleared and operation of the receive DMAC is
halted.
Bit:
Initial Value:
R/W:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
RR
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31 to 1
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
0
RR
0
R/W
Receive Request
0: The receive function is disabled*
1: A receive descriptor is read and the E-DMAC is
ready to receive
Note:
*
If the receive function is disabled during frame reception, write-back is not performed
successfully to the receive descriptor. Following pointers to read a receive descriptor
become abnormal and the E-DMAC cannot operate successfully. In this case, to make
the E-DMAC reception enabled again, execute a software reset by the SWR bit in
EDMR. To make the E-DMAC reception disabled without executing a software reset,
set the RE bit in ECMR. Next, after the E_DMAC has completed the reception and
write-back to the receive descriptor has been confirmed, disable the receive function of
this register.
Page 444 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.2.4
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Transmit Descriptor List Address Register (TDLAR)
TDLAR is a 32-bit readable/writable register that specifies the start address of the transmit
descriptor list. Descriptors have a boundary configuration in accordance with the descriptor length
indicated by the DL bit in EDMR. This register must not be written to during transmission.
Modifications to this register should only be made while transmission is disabled by the TR bit
(= 0) in the E-DMAC transmit request register (EDTRR).
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TDLA[31:16]
Initial Value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
TDLA[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31 to 0
TDLA[31:0]
All 0
R/W
Transmit Descriptor Start Address
The lower bits are set as follows according to the
specified descriptor length.
16-byte boundary: TDLA3 to TDLA0 = 0000
32-byte boundary: TDLA4 to TDLA0 = 00000
64-byte boundary: TDLA5 to TDLA0 = 000000
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 445 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.5
Receive Descriptor List Address Register (RDLAR)
RDLAR is a 32-bit readable/writable register that specifies the start address of the receive
descriptor list. Descriptors have a boundary configuration in accordance with the descriptor length
indicated by the DL bit in EDMR. This register must not be written to during reception.
Modifications to this register should only be made while reception is disabled by the RR bit (= 0)
in the E-DMAC Receive Request Register (EDRRR).
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RDLA[31:16]
Initial Value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
RDLA[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31 to 0
RDLA[31:0]
All 0
R/W
Receive Descriptor Start Address
The lower bits are set as follows according to the
specified descriptor length.
16-byte boundary: RDLA3 to RDLA0 = 0000
32-byte boundary: RDLA4 to RDLA0 = 00000
64-byte boundary: RDLA5 to RDLA0 = 000000
Page 446 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.2.6
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
EtherC/E-DMAC Status Register (EESR)
EESR is a 32-bit readable/writable register that shows communications status information on the
E-DMAC in combination with the EtherC. The information in this register is reported in the form
of interrupts. Individual bits are cleared by writing 1 (however, bit 22 (ECI) is a read-only bit and
not to be cleared by writing 1) and are not affected by writing 0. Each interrupt source can also be
masked by means of the corresponding bit in the EtherC/E-DMAC status interrupt permission
register (EESIPR).
The interrupts generated by this register are EINT0. For interrupt priority, see section 6.5,
Interrupt Exception Handling Vector Table and Priority.
Bit: 31
30
29
28
27
26
23
22
21
20
19
18
17
16
⎯
TWB
⎯
⎯
⎯
TABT
RABT RFCOF
ADE
ECI
TC
TDE
TFUF
FR
RDE
RFOF
0
R
0
R/W
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
CND
DLC
CD
TRO
RMAF
⎯
⎯
RRF
RTLF
RTSF
PRE
CERF
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31
⎯
0
R
Reserved
Initial Value:
R/W:
25
24
0
R/W
This bit is always read as 0. The write value should
always be 0.
30
TWB
0
R/W
Write-Back Complete
Indicates that write-back from the E-DMAC to the
corresponding descriptor has completed. This
operation is enabled when the TIS bit in TRIMD is set
to 1.
0: Write-back has not completed, or no transmission
directive
1: Write-back has completed
29 to 27
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 447 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
26
TABT
0
R/W
Transmit Abort Detection
Indicates that frame transmission by the EtherC has
been aborted because of an error during transmission.
0: Frame transmission has not been aborted or no
transmit directive
1: Frame transmit has been aborted
25
RABT
0
R/W
Receive Abort Detection
Indicates that frame reception by the EtherC has been
aborted because of an error during reception.
0: Frame reception has not been aborted or no receive
directive
1: Frame receive has been aborted
24
RFCOF
0
R/W
Receive Frame Counter Overflow
Indicates that the receive FIFO frame counter has
overflowed.
0: Receive frame counter has not overflowed
1: Receive frame counter overflows
23
ADE
0
R/W
Address Error
Indicates that the memory address that the E-DMAC
tried to transfer is found illegal.
0: Illegal memory address not detected (normal
operation)
1: Illegal memory address detected
Note: When an address error is detected, the E-DMAC
halts transmitting/receiving. To resume the
operation, set the E-DMAC again after software
reset by means of the SWR bit in EDMR.
22
ECI
0
R
EtherC Status Register Interrupt Source
This bit is a read-only bit. When the source of an
ECSR interrupt in the EtherC is cleared, this bit is also
cleared.
0: EtherC status interrupt source has not been
detected
1: EtherC status interrupt source has been detected
Page 448 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
21
TC
0
R/W
Frame Transmit Complete
Indicates that all the data specified by the transmit
descriptor has been transmitted to the EtherC. The
transfer status is written back to the relevant
descriptor. When 1-frame transmission is completed
for 1-frame/1-buffer processing, or when the last data
in the frame is transmitted and the transmission
descriptor valid bit (TACT) in the next descriptor is not
set for multiple-frame buffer processing, transmission
is completed and this bit is set to 1. After frame
transmission, the E-DMAC writes the transmission
status back to the descriptor.
0: Transfer not complete, or no transfer directive
1: Transfer complete
20
TDE
0
R/W
Transmit Descriptor Empty
Indicates that the transmission descriptor valid bit
(TACT) in the descriptor is not set when the E-DMAC
reads the transmission descriptor when the previous
descriptor is not the last one of the frame for multiplebuffer frame processing. As a result, an incomplete
frame may be transmitted.
0: Transmit descriptor active bit TACT = 1 detected
1: Transmit descriptor active bit TACT = 0 detected
When transmission descriptor empty (TDE = 1)
occurs, execute a software reset and initiate
transmission. In this case, the address that is stored in
the transmit descriptor list address register (TDLAR) is
transmitted first.
19
TFUF
0
R/W
Transmit FIFO Underflow
Indicates that underflow has occurred in the transmit
FIFO during frame transmission. Incomplete data is
sent onto the line.
0: Underflow has not occurred
1: Underflow has occurred
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 449 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
18
FR
0
R/W
Frame Reception
Indicates that a frame has been received and the
receive descriptor has been updated. This bit is set to
1 each time a frame is received.
0: Frame not received
1: Frame received
17
RDE
0
R/W
Receive Descriptor Empty
When receive descriptor empty (RDE = 1) occurs,
receiving can be restarted by setting RACT = 1 in the
receive descriptor and initiating receiving.
0: Receive descriptor active bit RACT = 1 not detected
1: Receive descriptor active bit RACT = 0 detected
16
RFOF
0
R/W
Receive FIFO Overflow
Indicates that the receive FIFO has overflowed during
frame reception.
0: Overflow has not occurred
1: Overflow has occurred
15 to 12
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
11
CND
0
R/W
Carrier Not Detect
Indicates the carrier detection status.
0: A carrier is detected when transmission starts
1: A carrier is not detected when transmission starts
10
DLC
0
R/W
Detect Loss of Carrier
Indicates that loss of the carrier has been detected
during frame transmission.
0: Loss of carrier not detected
1: Loss of carrier detected
9
CD
0
R/W
Delayed Collision Detect
Indicates that a delayed collision has been detected
during frame transmission.
0: Delayed collision not detected
1: Delayed collision detected
Page 450 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
8
TRO
0
R/W
Transmit Retry Over
Indicates that a retry-over condition has occurred
during frame transmission. Total 16 transmission
retries including 15 retries based on the back-off
algorithm are failed after the EtherC transmission
starts.
0: Transmit retry-over condition not detected
1: Transmit retry-over condition detected
7
RMAF
0
R/W
Receive Multicast Address Frame
0: Multicast address frame has not been received
1: Multicast address frame has been received
6, 5
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
4
RRF
0
R/W
Receive Residual-Bit Frame
0: Residual-bit frame has not been received
1: Residual-bit frame has been received
3
RTLF
0
R/W
Receive Too-Long Frame
Indicates that the frame more than the number of
receive frame length upper limit set by RFLR of the
EtherC has been received.
0: Too-long frame has not been received
1: Too-long frame has been received
2
RTSF
0
R/W
Receive Too-Short Frame
Indicates that a frame of fewer than 64 bytes has been
received.
0: Too-short frame has not been received
1: Too-short frame has been received
1
PRE
0
R/W
PHY Receive Error
0: PHY receive error not detected
1: PHY receive error detected
0
CERF
0
R/W
CRC Error on Received Frame
0: CRC error not detected
1: CRC error detected
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 451 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.7
EtherC/E-DMAC Status Interrupt Permission Register (EESIPR)
EESIPR is a 32-bit readable/writable register that enables interrupts corresponding to individual
bits in the EtherC/E-DMAC status register (EESR). An interrupt is enabled by writing 1 to the
corresponding bit. In the initial state, interrupts are not enabled.
Bit: 31
30
29
28
27
⎯
TWBIP
⎯
⎯
⎯
0
R
0
R/W
0
R
0
R
0
R
0
R/W
Bit: 15
14
13
12
11
10
⎯
⎯
⎯
⎯
Initial Value:
R/W:
0
R
0
R
0
R
0
R
Bit
Bit Name
Initial
value
R/W
Description
31
⎯
0
R
Reserved
Initial Value:
R/W:
26
25
24
23
TABTIP RABTIP RFCOF ADEIP
IP
CNDIP DLCIP
0
R/W
0
R/W
0
R/W
9
CDIP
0
R/W
0
R/W
0
R/W
8
7
TROIP RMAFIP
0
R/W
0
R/W
22
21
ECIIP
TCIP
0
R
0
R/W
6
5
⎯
⎯
0
R
0
R
20
19
18
TDEIP TFUFIP FRIP
17
16
RDEIP RFOFIP
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
4
3
2
1
0
RRFIP RTLFIP RTSFIP PREIP CERFIP
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
This bit is always read as 0. The write value should
always be 0.
30
TWBIP
0
R/W
Write-Back Complete Interrupt Permission
0: Write-back complete interrupt is disabled
1: Write-back complete interrupt is enabled
29 to 27
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
26
TABTIP
0
R/W
Transmit Abort Detection Interrupt Permission
0: Transmit abort detection interrupt is disabled
1: Transmit abort detection interrupt is enabled
25
RABTIP
0
R/W
Receive Abort Detection Interrupt Permission
0: Receive abort detection interrupt is disabled
1: Receive abort detection interrupt is enabled
24
RFCOFIP
0
R/W
Receive Frame Counter Overflow Interrupt Permission
0: Receive frame counter overflow interrupt is disabled
1: Receive frame counter overflow interrupt is enabled
Page 452 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
23
ADEIP
0
R/W
Address Error Interrupt Permission
0: Address error interrupt is disabled
1: Address error interrupt is enabled
22
ECIIP
0
R/W
EtherC Status Register Interrupt Permission
0: EtherC status interrupt is disabled
1: EtherC status interrupt is enabled
21
TCIP
0
R/W
Frame Transmit Complete Interrupt Permission
0: Frame transmit complete interrupt is disabled
1: Frame transmit complete interrupt is enabled
20
TDEIP
0
R/W
Transmit Descriptor Empty Interrupt Permission
0: Transmit descriptor empty interrupt is disabled
1: Transmit descriptor empty interrupt is enabled
19
TFUFIP
0
R/W
Transmit FIFO Underflow Interrupt Permission
0: Underflow interrupt is disabled
1: Underflow interrupt is enabled
18
FRIP
0
R/W
Frame Received Interrupt Permission
0: Frame received interrupt is disabled
1: Frame received interrupt is enabled
17
RDEIP
0
R/W
Receive Descriptor Empty Interrupt Permission
0: Receive descriptor empty interrupt is disabled
1: Receive descriptor empty interrupt is enabled
16
RFOFIP
0
R/W
Receive FIFO Overflow Interrupt Permission
0: Receive FIFO overflow interrupt is disabled
1: Receive FIFO overflow interrupt is enabled
15 to 12
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
11
CNDIP
0
R/W
Carrier Not Detect Interrupt Permission
0: Carrier not detect interrupt is disabled
1: Carrier not detect interrupt is enabled
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 453 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
10
DLCIP
0
R/W
Detect Loss of Carrier Interrupt Permission
0: Detect loss of carrier interrupt is disabled
1: Detect loss of carrier interrupt is enabled
9
CDIP
0
R/W
Delayed Collision Detect Interrupt Permission
0: Delayed collision detect interrupt is disabled
1: Delayed collision detect interrupt is enabled
8
TROIP
0
R/W
Transmit Retry Over Interrupt Permission
0: Transmit retry over interrupt is disabled
1: Transmit retry over interrupt is enabled
7
RMAFIP
0
R/W
Receive Multicast Address Frame Interrupt Permission
0: Receive multicast address frame interrupt is disabled
1: Receive multicast address frame interrupt is enabled
6, 5
⎯
All 0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
4
RRFIP
0
R/W
Receive Residual-Bit Frame Interrupt Permission
0: Receive residual-bit frame interrupt is disabled
1: Receive residual-bit frame interrupt is enabled
3
RTLFIP
0
R/W
Receive Too-Long Frame Interrupt Permission
0: Receive too-long frame interrupt is disabled
1: Receive too-long frame interrupt is enabled
2
RTSFIP
0
R/W
Receive Too-Short Frame Interrupt Permission
0: Receive too-short frame interrupt is disabled
1: Receive too-short frame interrupt is enabled
1
PREIP
0
R/W
PHY-LSI Receive Error Interrupt Permission
0: PHY-LSI receive error interrupt is disabled
1: PHY-LSI receive error interrupt is enabled
0
CERFIP
0
R/W
CRC Error on Received Frame
0: CRC error on received frame interrupt is disabled
1: CRC error on received frame interrupt is enabled
Page 454 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.2.8
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Transmit/Receive Status Copy Enable Register (TRSCER)
TRSCER specifies whether or not transmit and receive status information reported by bits in the
EtherC/E-DMAC status register is to be indicated in bits TFS26 to TFS0 and RFS26 to RFS0 in
the corresponding descriptor. Bits in this register correspond to bits 11 to 0 in the EtherC/EDMAC status register (EESR). When a bit is cleared to 0, the transmit status (bits 11 to 8 in
EESR) is indicated in bits TFS3 to TFS0 in the transmit descriptor, and the receive status (bits 7 to
0 in EESR) is indicated in bits RFS7 to RFS0 of the receive descriptor. When a bit is set to 1, the
occurrence of the corresponding interrupt is not indicated in the descriptor. After this LSI is reset,
all bits are cleared to 0.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
4
3
2
1
0
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
Initial Value:
R/W:
Initial Value:
R/W:
CNDCE DLCCE CDCE TROCE RMAF
CE
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
31 to 12
⎯
All 0
R
0
R/W
0
R/W
0
R/W
6
5
⎯
⎯
0
R
0
R
RRFCE RTLF
CE
0
R/W
0
R/W
RTSF PRECE CERF
CE
CE
0
R/W
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value should
always be 0.
11
CNDCE
0
R/W
CND Bit Copy Directive
0: Indicates the CND bit state in bit TFS3 in the transmit
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit TFS3 of the transmit descriptor
10
DLCCE
0
R/W
DLC Bit Copy Directive
0: Indicates the DLC bit state in bit TFS2 of the transmit
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit TFS2 of the transmit descriptor
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 455 of 1278
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
9
CDCE
0
R/W
CD Bit Copy Directive
SH7670 Group
0: Indicates the CD bit state in bit TFS1 of the transmit
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit TFS1 of the transmit descriptor
8
TROCE
0
R/W
TRO Bit Copy Directive
0: Indicates the TRO bit state in bit TFS0 of the receive
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit TFS0 of the receive descriptor
7
RMAFCE
0
R/W
RMAF Bit Copy Directive
0: Indicates the RMAF bit state in bit RFS7 of the
receive descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit RFS7 of the receive descriptor
6, 5
⎯
All 0
R
Reserved
These bits are always read as 0. The write value should
always be 0.
4
RRFCE
0
R/W
RRF Bit Copy Directive
0: Indicates the RRF bit state in bit RFS4 of the receive
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit RFS4 of the receive descriptor
3
RTLFCE
0
R/W
RTLF Bit Copy Directive
0: Indicates the RTLF bit state in bit RFS3 of the receive
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit RFS3 of the receive descriptor
2
RTSFCE
0
R/W
RTSF Bit Copy Directive
0: Indicates the RTSF bit state in bit RFS2 of the
receive descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit RFS2 of the receive descriptor
Page 456 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
1
PRECE
0
R/W
PRE Bit Copy Directive
0: Indicates the PRF bit state in bit RFS1 of the receive
descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit RFS1 of the receive descriptor
0
CERFCE
0
R/W
CERF Bit Copy Directive
0: Indicates the CERF bit state in bit RFS0 of the
receive descriptor
1: Occurrence of the corresponding interrupt is not
indicated in bit RFS0 of the receive descriptor
13.2.9
Receive Missed-Frame Counter Register (RMFCR)
RMFCR is a 16-bit counter that indicates the number of frames missed (discarded, and not
transferred to the receive buffer) during reception. When the receive FIFO overflows, the receive
frames in the FIFO are discarded. The number of frames discarded at this time is counted. When
the value in this register reaches H'FFFF, counting-up is halted. When this register is read, the
counter value is cleared to 0. Write operations to this register have no effect.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Initial Value:
R/W:
MFC[15:0]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
Bit
Bit Name
Initial
value
R/W
31 to 16
⎯
All 0
R
0
R
0
R
0
R
0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
15 to 0
MFC[15:0]
All 0
R
Missed-Frame Counter
Indicate the number of frames that are discarded and
not transferred to the receive buffer during reception.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 457 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.10 Transmit FIFO Threshold Register (TFTR)
TFTR is a 32-bit readable/writable register that specifies the transmit FIFO threshold at which the
first transmission is started. The actual threshold is 4 times the set value. The EtherC starts
transmission when the amount of data in the transmit FIFO exceeds the number of bytes specified
by this register, when the transmit FIFO is full, or when 1-frame write is executed. When setting
this register, do so in the transmission-halt state.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Initial Value:
R/W:
Initial Value:
R/W:
Bit
TFT[10:0]
0
R/W
Bit Name Initial value R/W
31 to 11 ⎯
All 0
R
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
10 to 0
TFT[10:0] All 0
R/W
Transmit FIFO threshold
When setting a transmit FIFO, the FIFO must be set to
a smaller value than the specified value of the FIFO
capacity by FDR.
H'00: Store and forward modes
H'01 to H'0C: Setting prohibited
H'0D: 52 bytes
H'0E: 56 bytes
:
:
H'1F: 124 bytes
H'20: 128 bytes
:
:
H'3F: 252 bytes
H'40: 256 bytes
:
:
H'7F: 508 bytes
H'80: 512 bytes
H'81 to H'200: Setting prohibited
Note: When starting transmission before one frame of data write has completed, take care the
generation of the underflow.
Page 458 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.11 FIFO Depth Register (FDR)
FDR is a 32-bit readable/writable register that specifies the depth of the transmit and receive
FIFOs.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
TFD2
TFD1
TFD0
⎯
⎯
⎯
⎯
⎯
RFD2
RFD1
RFD0
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
1
R/W
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
1
R/W
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
31 to 11
⎯
All 0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
10
TFD2
0
R/W
Transmit FIFO Depth
9
TFD1
0
R/W
8
TFD0
1
R/W
These bits specify the depth of the transmit FIFO.
After the start of the transmission and reception, the
setting cannot be changed.
000: 256 bytes
001: 512 bytes
Other than above: Setting prohibited
7 to 3
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
2
RFD2
0
R/W
Receive FIFO Depth
1
RFD1
0
R/W
0
RFD0
1
R/W
These bits specify the depth of the receive FIFO. After
the start of the transmission and reception, the setting
cannot be changed.
000: 256 bytes
001: 512 bytes
Other than above: Setting prohibited
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 459 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.12 Receiving Method Control Register (RMCR)
RMCR is a 32-bit readable/writable register that specifies the control method for the RR bit in
EDRRR when a frame is received. This register must be set during the receiving-halt state.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
RNC
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
31 to 1
⎯
All 0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
0
RNC
0
R/W
Receive Enable Control
0: When reception of one frame is completed, the EDMAC writes the receive status into the descriptor
and clears the RR bit in EDRRR
1: When reception of one frame is completed, the EDMAC writes the receive status into the descriptor,
reads the next descriptor, and prepares to receive
the next frame
Page 460 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.13 E-DMAC Operation Control Register (EDOCR)
EDOCR is a 32-bit readable/writable register that specifies the control methods used in E-DMAC
operation.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
FEC
AEC
EDH
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
0
R/W
0
R
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
Description
31 to 4
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
3
FEC
0
R/W
FIFO Error Control
Specifies E-DMAC operation when transmit FIFO
underflow or receive FIFO overflow occurs.
0: E-DMAC operation continues when underflow or
overflow occurs
1: E-DMAC operation halts when underflow or
overflow occurs
2
AEC
0
R/W
Address Error Control
Indicates detection of an illegal memory address in an
attempted E-DMAC transfer.
0: Illegal memory address not detected (normal
operation)
1: E-DMAC stops its operation due to illegal memory
address detection
Note: To resume the operation, set the E-DMAC again
after software reset by means of the SWR bit in
EDMR.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 461 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
1
EDH
0
R/W
E-DMAC Halted
0: The E-DMAC is operating normally
1: The E-DMAC has been halted by NMI pin assertion.
E-DMAC operation is restarted by writing 0
⎯
0
0
R
Reserved
This bit is always read as 0. The write value should
always be 0.
13.2.14 Receiving-Buffer Write Address Register (RBWAR)
RBWAR stores the address of data to be written in the receiving buffer when the E-DMAC writes
data to the receiving buffer. Which addresses in the receiving buffer are processed by the EDMAC can be recognized by monitoring addresses displayed in this register. The address that the
E-DMAC is actually processing may be different from the value read from this register.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RBWA[31:16]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
8
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
RBWA[15:0]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
Initial
value
Bit
Bit Name
31 to 0
RBWA[31:0] All 0
0
R
0
R
0
R
0
R
0
R
R/W
Description
R
Receiving-Buffer Write Address
These bits can only be read. Writing is prohibited.
Page 462 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.15 Receiving-Descriptor Fetch Address Register (RDFAR)
RDFAR stores the descriptor start address that is required when the E-DMAC fetches descriptor
information from the receiving descriptor. Which receiving descriptor information is used for
processing by the E-DMAC can be recognized by monitoring addresses displayed in this register.
The address from which the E-DMAC is actually fetching a descriptor may be different from the
value read from this register.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RDFA[31:16]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
8
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
RDFA[15:0]
Initial Value:
R/W:
Bit
0
R
0
R
0
R
Bit Name
0
R
0
R
0
R
Initial value R/W
31 to 0 RDFA[31:0] All 0
R
0
R
0
R
0
R
Description
Receiving-Descriptor Fetch Address
These bits can only be read. Writing is prohibited.
13.2.16 Transmission-Buffer Read Address Register (TBRAR)
TBRAR stores the address of the transmission buffer when the E-DMAC reads data from the
transmission buffer. Which addresses in the transmission buffer are processed by the E-DMAC
can be recognized by monitoring addresses displayed in this register. The address from which the
E-DMAC is actually reading in the buffer may be different from the value read from this register.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TBRA[31:16]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
8
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
TBRA[15:0]
Initial Value:
R/W:
Bit
0
R
Bit Name
0
R
0
R
0
R
0
R
Initial value R/W
31 to 0 TBRA[31:0] All 0
R
0
R
0
R
0
R
0
R
Description
Transmission-Buffer Read Address
These bits can only be read. Writing is prohibited.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 463 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.17 Transmission-Descriptor Fetch Address Register (TDFAR)
TDFAR stores the descriptor start address that is required when the E-DMAC fetches descriptor
information from the transmission descriptor. Which transmission descriptor information is used
for processing by the E-DMAC can be recognized by monitoring addresses displayed in this
register. The address from which the E-DMAC is actually fetching a descriptor may be different
from the value read from this register.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
TDFA[31:16]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
8
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
TDFA[15:0]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit
Bit Name
Initial
value
R/W
Description
31 to 0
TDFA[31:0]
All 0
R
Transmission-Descriptor Fetch Address
These bits can only be read. Writing is prohibited.
13.2.18 Flow Control FIFO Threshold Register (FCFTR)
FCFTR is a 32-bit readable/writable register that sets the flow control of the EtherC (setting the
threshold on automatic PAUSE transmission). The threshold can be specified by the depth of the
receive FIFO data (RFD2 to RFD0) and the number of receive frames (RFF2 to RFF0). The
condition to start the flow control is decided by taking OR operation on the two thresholds.
Therefore, the flow control by the two thresholds is independently started.
When flow control is performed according to the RFD bits setting, if the setting is the same as the
depth of the receive FIFO specified by the FIFO depth register (FDR), flow control is started when
the remaining FIFO is (FIFO data − 64) bytes. For instance, when RFD in FDR = 1 and RFD in
FCFTR = 1, flow control is started when (512 − 64) bytes of data is stored in the receive FIFO.
The value set in the RFD bits in this register should be equal to or less than those in FDR.
Page 464 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
1
R/W
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
Description
31 to 19
⎯
All 0
R
Reserved
18
17
16
RFF[2:0]
1
R/W
1
R/W
1
0
RFD[2:0]
0
R/W
0
R/W
0
R/W
These bits are always read as 0. The write value
should always be 0.
18 to 16
RFF[2:0]
111
R/W
Receive Frame Number Flow Control Threshold
000: When one receive frame has been stored in the
receive FIFO
001: When two receive frames have been stored in the
receive FIFO
:
:
110: When seven receive frames have been stored in
the receive FIFO
111: When eight receive frames have been stored in
the receive FIFO
15 to 3
⎯
All 0
⎯
Reserved
These bits are always read as 0. The write value
should always be 0.
2 to 0
RFD[2:0]
000
R/W
Receive Byte Flow Control Threshold
000: When (256 − 64) bytes of data is stored in the
receive FIFO
001: When (512 − 64) bytes of data is stored in the
receive FIFO
Other than above: Setting prohibited
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 465 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.19
Receive Data Padding Setting Register (RPADIR)
RPADIR is a 32-bit readable/writable register that performs the padding of receive data. Before
setting this register again, reset the software with the SWR bit in the E-DMAC mode register
(EDMR).
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R/W
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
31 to 18
⎯
All 0
⎯
17
16
PADS1 PADS0
PADR[5:0]
0
R/W
0
R/W
0
R/W
0
R/W
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
17
PADS1
0
R/W
Padding size
16
PADS0
0
R/W
00: No padding
01: Padding of one byte
10: Padding of two bytes
11: Padding of three bytes
15 to 6
⎯
All 0
⎯
Reserved
These bits are always read as 0. The write value
should always be 0.
5 to 0
PADR[5:0]
000000
R/W
Padding Range
H'00: Data equivalent to the padding size is inserted in
the first byte.
H'01: Data equivalent to the padding size is inserted in
the second byte.
:
:
H'3E: Data equivalent to the padding size is inserted in
the 63rd byte.
H'3F: Data equivalent to the padding size is inserted in
the 64th byte.
Page 466 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.20 Transmit Interrupt Register (TRIMD)
TRIMD is a 32-bit readable/writable register that specifies whether or not to notify write-back
completion for each frame using the TWB bit in EESR and an interrupt on transmit operations.
Bit:
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
TIS
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
Description
31 to 1
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
0
TIS
0
R/W
Transmit Interrupt Setting
0: Write-back completion for each frame is not notified
1: Write-backed completion for each frame using the
TWB bit in EESR is notified
13.2.21 Checksum Mode Register (CSMR)
CSMR is a 32-bit readable/writable register that specifies the checksum operating mode. Set this
register when reception is stopped.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
1
R/W
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
1
R/W
0
R/W
CSEBL CSMD
Initial Value: 1
R/W: R/W
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SB[5:0]
0
R/W
1
R/W
1
R/W
0
R/W
Page 467 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
31
CSEBL
1
R/W
Operation Setting for Checksum Calculation Function
0: The result of checksum calculation is not written
back to the receive descriptor.
1: The result of checksum calculation is written back
to the receive descriptor.
30
CSMD
1
R/W
Setting for Checksum Calculation Mode
0: Checksums are calculated on all the remaining
data after skipping the number of bytes specified in
SB5 to SB0 from the beginning of the MAC layer
packet.
1: Packet checksums for the upper layer such as TCP
or UDP are calculated along with the analysis of
the MAC/IP layer packet.
⎯
29 to 6
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
SB[5:0]*
5 to 0
011010
R/W
Bytes Skipped in Checksum Calculation
These bits specify the number of bytes to be skipped
from the beginning of a receive MAC packet.
H'00: Byte 0 (checksum calculation starts from the
beginning of a receive MAC packet)
H'02: Byte 2
:
:
H'1A: Byte 26
:
:
H'3E: Byte 62
Note
*
Setting is possible only when CSEBL = 1 and CSMD = 0. Otherwise, 6'h00 should be
set.
Page 468 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.22 Checksum Skipped Bytes Monitor Register (CSSBM )
CSSBM is a 32-bit read-only register that stores the number of skipped bytes during the
processing of received packets in the E-DMAC. The number of skipped bytes can be recognized
by monitoring the value displayed by this register. Note that the number of items of data received
by the E-DMAC may be different from the number of skipped bytes.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
Initial
value
R/W
31 to 6
⎯
All 0
R
SBM[5:0]
0
R
0
R
0
R
0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
5 to 0
SBM[5:0]
000000
R/W
Number of Skipped Bytes
These bits can only be read. Writing is prohibited.
These bits are initialized to 0 at the beginning of a
receive packet.
Note
*
The value is valid only when CSEBL = 1 and CSMD = 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 469 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.2.23 Checksum Monitor Register (CSSMR)
CSSMR is a 32-bit read-only register that stores the value of a checksum during the processing of
received packets in E-DMAC. The checksum value can be recognized by monitoring the value
displayed by this register. Note that the value of the data received by E-DMAC may be different
from the checksum value.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Initial Value:
R/W:
CS[15:0]
Initial Value:
R/W:
0
R
0
R
0
R
0
R
0
R
Bit
Bit Name
Initial
value
R/W
31 to 16
⎯
All 0
R
0
R
0
R
0
R
0
R
Description
Reserved
These bits are always read as 0. The write value
should always be 0.
15 to 0
CS[15:0]
0
R
Checksum Value
These bits can only be read. Writing is prohibited.
These bits are initialized to 0 at the beginning of a
receive packet.
Note
*
The value is valid only when CSEBL = 1 and CSMD = 0.
Page 470 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.3
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Operation
The E-DMAC is connected to the EtherC, and performs efficient transfer of transmit/receive data
between the EtherC and memory (buffers) without the intervention of the CPU. The E-DMAC
itself reads control information, including buffer pointers called descriptors, relating to the buffers.
The E-DMAC reads transmit data from the transmit buffer and writes receive data to the receive
buffer in accordance with this control information. By setting up a number of consecutive
descriptors (a descriptor list), it is possible to execute transmission and reception continuously.
13.3.1
Descriptor List and Data Buffers
Before starting transmission/reception, the communication program creates transmit and receive
descriptor lists in memory. The start addresses of these lists are then set in the transmit and receive
descriptor list start address registers.
The descriptor start address must be aligned so that it matches the address boundary according to
the descriptor length set by the E-DMAC mode register (EDMR). The transmit buffer start address
can be aligned with a byte, a word, and a longword boundary.
(1)
Transmit Descriptor
Figure 13.2 shows the relationship between a transmit descriptor and the transmit buffer.
According to the specification in this descriptor, the relationship between the transmit frame and
transmit buffer can be defined as one frame/one buffer or one frame/multi-buffer.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 471 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Transmit descriptor
TD0
31 30 29 28 27 26
T T T T T
A D F F F
C L P P E
T E 1 0
31
TD1
Transmit buffer
0
TFS26 to TFS0
Valid transmit data
16
TDL
31
TD2
0
TBA
Padding (4 bytes)
Figure 13.2 Relationship between Transmit Descriptor and Transmit Buffer
Page 472 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(a)
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Transmit Descriptor 0 (TD0)
TD0 indicates the transmit frame status. The CPU and E-DMAC use TD0 to report the frame
transmission status.
Bit: 31
30
29
28
27
TACT
TDLE
TFP1
TFP0
TFE
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
8
7
Bit: 15
26
25
24
23
22
21
20
19
18
17
16
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
TFS[26:16]
TFS[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31
TACT
0
R/W
Transmit Descriptor Active
Indicates that this descriptor is active. The CPU sets
this bit after transmit data has been transferred to the
transmit buffer. The E-DMAC resets this bit on
completion of a frame transfer or when transmission is
suspended.
0: The transmit descriptor is invalid.
Indicates that valid data has not been written to this
bit by the CPU, or this bit has been reset by a writeback operation on termination of E-DMAC frame
transfer processing (completion or suspension of
transmission)
If this state is recognized in an E-DMAC descriptor
read, the E-DMAC terminates transmit processing
and transmit operations cannot be continued (a
restart is necessary)
1: The transmit descriptor is valid.
Indicates that valid data has been written to the
transmit buffer by the CPU and frame transfer
processing has not yet been executed, or that
frame transfer is in progress
When this state is recognized in an E-DMAC
descriptor read, the E-DMAC continues with the
transmit operation
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 473 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
30
TDLE
0
R/W
Transmit Descriptor List End
After completion of the corresponding buffer transfer,
the E-DMAC references the first descriptor. This
specification is used to set a ring configuration for the
transmit descriptors.
0: This is not the last transmit descriptor list
1: This is the last transmit descriptor list
29
TFP1
0
R/W
Transmit Frame Position 1, 0
28
TFP0
0
R/W
These two bits specify the relationship between the
transmit buffer and transmit frame. In the preceding
and following descriptors, a logically positive
relationship must be maintained between the settings
of this bit and the TDLE bit.
00: Frame transmission for transmit buffer indicated by
this descriptor continues (frame is not concluded)
01: Transmit buffer indicated by this descriptor
contains end of frame (frame is concluded)
10: Transmit buffer indicated by this descriptor is start
of frame (frame is not concluded)
11: Contents of transmit buffer indicated by this
descriptor are equivalent to one frame (one
frame/one buffer)
27
TFE
0
R/W
Transmit Frame Error
Indicates that one or other bit of the transmit frame
status indicated by bits 26 to 0 is set. Whether or not
the transmit frame status information is copied into this
bit is specified by the transmit/receive status copy
enable register.
0: No error during transmission
1: An error occurred during transmission
Page 474 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Bit
Bit Name
26 to 0
TFS26 to
TFS0
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Initial
value
R/W
Description
All 0
R/W
Transmit Frame Status
TFS26 to TFS4: Reserved (The write value should
always be 0.)
TFS8: Detect Transmit Buffer Underflow (corresponds
to TDE bit in EESR)
TFS3: Carrier Not Detect (corresponds to CND bit in
EESR)
TFS2: Detect Loss of Carrier (corresponds to DLC bit
in EESR)
TFS1: Delayed Collision Detect (corresponds to CD
bit in EESR)
TFS0: Transmit Retry Over (corresponds to TRO bit in
EESR)
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 475 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
(b)
Transmit Descriptor 1 (TD1)
TD1 specifies the transmit buffer length (maximum 64 Kbytes).
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
TDL[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Initial Value:
R/W:
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31 to 16
TDL[15:0]
All 0
R/W
Transmit Buffer Data Length
These bits specify the valid transfer byte length in the
corresponding transmit buffer.
When the one frame/multi-buffer system is specified
(TD0 and TFP = 10 or 00), the transfer byte length
specified in the descriptors at the start and midway
can be set in byte units.
15 to 0
⎯
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
(c)
Transmit Descriptor 2 (TD2)
TD2 specifies the 32-bit transmit buffer start address. The transmit buffer start address setting can
be aligned with a byte, a word, or a longword boundary.
Page 476 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(2)
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Receive Descriptor
Figure 13.3 shows the relationship between a receive descriptor and the receive buffer. In frame
reception, the E-DMAC performs data rewriting up to a receive buffer 16-byte boundary,
regardless of the receive frame length. Finally, the actual receive frame length is reported in the
lower 16 bits of RD1 in the descriptor. Data transfer to the receive buffer is performed
automatically by the E-DMAC to give a one frame/one buffer or one frame/multi-buffer
configuration according to the size of one received frame.
Receive descriptor
Receive buffer
RD0
RD1
RACT
RDLE
RFP1
RFP0
RFE
RCSE
31 30 29 28 27 26 25
1615
RFS9 to
RFS0
RD2
RCS15 to RCS0
15
RBL
31
31
0
16
0
Valid receive data
RDL
0
RBA
Padding (4 bytes)
Figure 13.3 Relationship between Receive Descriptor and Receive Buffer
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 477 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
(a)
Receive Descriptor 0 (RD0)
RD0 indicates the receive frame status. The CPU and E-DMAC use RD0 to report the frame
receive status.
Bit: 31
30
29
RACT
RDLE
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
14
13
Bit: 15
28
27
26
RFE
RCSE
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
12
11
10
9
8
7
RFP[1:0]
25
24
23
22
21
20
19
18
17
16
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
RFS[9:0]
RCS[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31
RACT
0
R/W
Receive Descriptor Active
Indicates that this descriptor is active. The E-DMAC
resets this bit after receive data has been transferred
to the receive buffer. On completion of receive frame
processing, the CPU sets this bit to prepare for
reception.
0: The receive descriptor is invalid.
Indicates that the receive buffer is not ready
(access disabled by E-DMAC), or this bit has been
reset by a write-back operation on termination of EDMAC frame transfer processing (completion or
suspension of reception).
If this state is recognized in an E-DMAC descriptor
read, the E-DMAC terminates receive processing
and receive operations cannot be continued.
Reception can be restarted by setting RACT to 1
and executing receive initiation.
1: The receive descriptor is valid
Indicates that the receive buffer is ready (access
enabled) and processing for frame transfer from the
FIFO has not been executed, or that frame transfer
is in progress.
When this state is recognized in an E-DMAC
descriptor read, the E-DMAC continues with the
receive operation.
Page 478 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
30
RDLE
0
R/W
Receive Descriptor List Last
After completion of the corresponding buffer transfer,
the E-DMAC references the first receive descriptor.
This specification is used to set a ring configuration for
the receive descriptors.
0: This is not the last receive descriptor list
1: This is the last receive descriptor list
29, 28
RFP[1:0]
00
R/W
Receive Frame Position
These two bits specify the relationship between the
receive buffer and receive frame.
00: Frame reception for receive buffer indicated by this
descriptor continues (frame is not concluded)
01: Receive buffer indicated by this descriptor
contains end of frame (frame is concluded)
10: Receive buffer indicated by this descriptor is start
of frame (frame is not concluded)
11: Contents of receive buffer indicated by this
descriptor are equivalent to one frame (one
frame/one buffer)
27
RFE
0
R/W
Receive Frame Error
Indicates that one or other bit of the receive frame
status indicated by bits 25 to 16 is set. Whether or not
the receive frame status information is copied into this
bit is specified by the transmit/receive status copy
enable register.
0: No error during reception
1: A certain kind of error occurred during reception
26
RCSE
0
R/W
Determination of Receive Packet Checksum Value
When CSEBL = 1 and CSMD = 1, the setting shown in
table 13.1 occurs depending on the received packet
and data.
The information in this bit will be invalid if operation is
based on any setting other than the above.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 479 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Bit
Bit Name
Initial
value
R/W
Description
25 to 16
RFS[9:0]
All 0
R/W
Receive Frame Status
These bits indicate the error status during frame
reception.
RFS9: Receive FIFO overflow (corresponds to RFOF
bit in EESR)
RFS8: Reserved (The write value should always
be 0.)
RFS7: Multicast address frame received (corresponds
to RMAF bit in EESR)
RFS6: CAM entry unregistered frame received
(corresponds to the RUAF bit in EESR)
RSF5: Reserved (The write value should always
be 0.)
RFS4: Receive residual-bit frame error (corresponds
to RRF bit in EESR)
RFS3: Receive too-long frame error (corresponds to
RTLF bit in EESR)
RFS2: Receive too-short frame error (corresponds to
RTSF bit in EESR)
RFS1: PHY-LSI receive error (corresponds to PRE bit
in EESR)
RFS0: CRC error on received frame (corresponds to
CERF bit in EESR)
15 to 0
RCS[15:0]
Page 480 of 1278
All 0
R/W
Receive Packet Checksum Value
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Table 13.1 Types of Receive Packets and the RCSE State of Receive Data
Frame Type
When Data Is Normal
When Data Is Abnormal
IP version
Option and extension
header
RCS[15:0]
RCSE
RCS[15:0]
RCSE
IPv4
None
16'hFFFF
0
Undefined
1
16'h0000
Fragment
Undefined
Undefined Undefined
Undefined
Option
16'hFFFF
0
Undefined
1
0
Undefined
1
0
Undefined
1
0
Undefined
1
0
Undefined
1
0
Undefined
1
16'h0000
IPv6
None
16'hFFFF
16'h0000
Hop-by-hop
16'hFFFF
16'h0000
Routing
16'hFFFF
16'h0000
End-point option
16'hFFFF
16'h0000
AH
16'hFFFF
16'h0000
Fragment
Undefined
Undefined Undefined
Undefined
ESP
16'h0000
1
16'h0000
1
MobileIPv6
16'h0000
1
16'h0000
1
Others
16'h0000
1
16'h0000
1
16'h0000
0
16'h0000
0
Other than
IPv4 and IPv6
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 481 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
(b)
Receive Descriptor 1 (RD1)
RD1 specifies the receive buffer length (maximum 64 Kbytes).
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
RBL[15:0]
Initial Value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
RDL[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
value
R/W
Description
31 to 16
RBL[15:0]
All 0
R/W
Receive Buffer Length
These bits specify the maximum reception byte length
in the corresponding receive buffer.
The transfer byte length must align with a 16-byte
boundary (bits 19 to 16 cleared to 0). The maximum
receive frame length with one frame per buffer is
1,514 bytes, excluding the CRC data. Therefore, for
the receive buffer length specification, a value of 1,520
bytes (H'05F0) that takes account of a 16-byte
boundary is set as the maximum receive frame length.
15 to 0
RDL[15:0]
All 0
R/W
Receive Data Length
These bits specify the data length of a receive frame
stored in the receive buffer.
The receive data transferred to the receive buffer does
not include the 4-byte CRC data at the end of the
frame. The receive frame length is reported as the
number of words (valid data bytes) not including this
CRC data.
(c)
Receive Descriptor 2 (RD2)
RD2 specifies the 32-bit receive buffer start address. The receive buffer start address must be
aligned with a longword boundary. However, when SDRAM is connected, it must be aligned with
a 16-byte boundary.
Page 482 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.3.2
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Transmission
When the transmit function is enabled and the transmit request bit (TR) is set in the E-DMAC
transmit request register (EDTRR), the E-DMAC reads the descriptor used last time from the
transmit descriptor list (in the initial state, the descriptor indicated by the transmission descriptor
start address register (TDLAR)). If the setting of the TACT bit in the read descriptor is active, the
E-DMAC reads transmit frame data sequentially from the transmit buffer start address specified
by TD2, and transfers it to the EtherC. The EtherC creates a transmit frame and starts transmission
to the MII. After DMA transfer of data equivalent to the buffer length specified in the descriptor,
the following processing is carried out according to the TFP value.
1. TFP = 00 or 01 (frame continuation):
Descriptor write-back is performed after DMA transfer.
2. TFP = 01 or 11 (frame end):
Descriptor write-back is performed after completion of frame transmission.
The E-DMAC continues reading descriptors and transmitting frames as long as the setting of the
TACT bit in the read descriptors is "active." When a descriptor with an "inactive" TACT bit is
read, the E-DMAC resets the transmit request bit (TR) in the transmit register and ends transmit
processing (EDTRR).
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 483 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Transmission flowchart
This LSI + memory
E-DMAC
Transmit FIFO
EtherC
Ethernet
EtherC/E-DMAC
initialization
Descriptor and
transmit
buffer setting
Transmit directive
Descriptor read
Transmit data transfer
Descriptor write-back
Descriptor read
Transmit data transfer
Frame transmission
Descriptor write-back
Transmission
completed
Figure 13.4 Sample Transmission Flowchart
Page 484 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.3.3
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Reception
When the receive function is enabled and the CPU sets the receive request bit (RR) in the EDMAC receive request register (EDRRR), the E-DMAC reads the descriptor following the
previously used one from the receive descriptor list (the descriptor indicated by the receive
descriptor list's starting address register (RDLA) is used at the initial state), and then enters the
receive-standby state. If the setting of the RACT bit is "active" and an own-address frame is
received, the E-DMAC transfers the frame to the receive buffer specified by RD2. If the data
length of the received frame is greater than the buffer length given by RD1, the E-DMAC
performs write-back to the descriptor when the buffer is full (RFP = 10 or 00), then reads the next
descriptor. The E-DMAC then continues to transfer data to the receive buffer specified by the new
RD2. When frame reception is completed, or if frame reception is suspended because of a certain
kind of error, the E-DMAC performs write-back to the relevant descriptor (RFP = 11 or 01), and
then ends the receive processing. The E-DMAC then reads the next descriptor and enters the
receive-standby state again.
To receive frames continuously, the receive enable control bit (RNC) must be set to 1 in the
receive control register (RCR). After initialization, this bit is cleared to 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 485 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Reception flowchart
This LSI + memory
E-DMAC
Receive FIFO
EtherC
Ethernet
EtherC/E-DMAC
initialization
Descriptor and
receive
buffer setting
Start of reception
Descriptor read
Frame reception
Receive data transfer
Descriptor write-back
Descriptor read
Receive data transfer
Descriptor write-back
Descriptor read (receive
ready for the next frame)
Reception
completed
Figure 13.5 Sample Reception Flowchart
Page 486 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.3.4
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Multi-Buffer Frame Transmit/Receive Processing
Multi-Buffer Frame Transmit Processing
If an error occurs during multi-buffer frame transmission, the processing shown in figure 13.6 is
carried out by the E-DMAC.
Where the transmit descriptor is shown as inactive (TACT bit = 0) in the figure, buffer data has
already been transmitted normally, and where the transmit descriptor is shown as active (TACT bit
= 1), buffer data has not been transmitted. If a frame transmit error occurs in the first descriptor
part where the transmit descriptor is active (TACT bit = 1), transmission is halted, and the TACT
bit cleared to 0, immediately. The next descriptor is then read, and the position within the transmit
frame is determined on the basis of bits TFP1 and TFP0 (continuing [B'00] or end [B'01]). In the
case of a continuing descriptor, the TACT bit is cleared to 0, only, and the next descriptor is read
immediately. If the descriptor is the final descriptor, not only is the TACT bit cleared to 0, but
write-back is also performed to the TFE and TFS bits at the same time. Data in the buffer is not
transmitted between the occurrence of an error and write-back to the final descriptor. If error
interrupts are enabled in the EtherC/E-DMAC status interrupt permission register (EESIPR), an
interrupt is generated immediately after the final descriptor write-back.
Descriptors
T
A
C
T
Inactivates TACT (change 1 to 0)
E-DMAC
Descriptor read
Inactivates TACT
Descriptor read
Inactivates TACT
Descriptor read
Inactivates TACT
Descriptor read
Inactivates TACT and writes TFE, TFS
T
D
L
E
T
F
P
1
T
F
P
0
0 0
1 0
0 0
0 0
0 0
0 0
1 0
0 0
1 0
0 0
1 0
0 0
1 0
0 0
1 0
0 1
1 1
1 0
Transmit error
occurrence
Untransmitted
data is not
transmitted
after error
occurrence
Descriptor is
only processed.
One frame
Buffer
Transmitted data
Untransmitted data
Figure 13.6 E-DMAC Operation after Transmit Error
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 487 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Multi-Buffer Frame Receive Processing
If an error occurs during multi-buffer frame reception, the processing shown in figure 13.7 is
carried out by the E-DMAC.
Where the receive descriptor is shown as inactive (RACT bit = 0) in the figure, buffer data has
already been received normally, and where the receive descriptor is shown as active (RACT bit =
1), this indicates a buffer for which reception has not yet been performed. If a frame receive error
occurs in the first descriptor part where the RACT bit = 1 in the figure, reception is halted
immediately and a status write-back to the descriptor is performed.
If error interrupts are enabled in the EtherC/E-DMAC status interrupt permission register
(EESIPR), an interrupt is generated immediately after the write-back. If there is a new frame
receive request, reception is continued from the buffer after that in which the error occurred.
Descriptors
R
A
C
T
R
D
L
E
R
F
P
1
R
F
P
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
Start of frame
Inactivates RACT and writes RFE, RFS
E-DMAC
Receive error
occurrence
Descriptor read
Write-back
.........
New frame reception
continues from buffer
Buffer
Received data
Unreceived data
Figure 13.7 E-DMAC Operation after Receive Error
Page 488 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
13.3.5
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Padding Receive Data
The E-DMAC can pad one to three bytes anywhere in the receive data to increase the efficiency of
processing of receive data. For example, by padding two bytes after the 14-byte MAC header of
an Ethernet frame with this function, the subsequent data can be placed at the beginning of the
four-byte boundary.
[No padding]
Receive buffer area
16-byte
boundary
MAC header (14 bytes)
16-byte
boundary
MAC header (14 bytes)
16-byte
boundary
MAC header (14 bytes)
Padding for separation
in the 16-byte boundary
4 bytes
[Padding]
Padding of two bytes after the 14th byte
Receive buffer area
16-byte
boundary
MAC header (14 bytes)
Padding two bytes after
the MAC header
16-byte
boundary
MAC header (14 bytes)
16-byte
boundary
MAC header (14 bytes)
Padding for separation
in the 16-byte boundary
4 bytes
Figure 13.8 Padding Receive Data
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 489 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
13.3.6
Checksum Calculation Function
Checksum calculation for receive packets is accelerated in the following two modes:
• Checksum calculation mode of MAC/IP packet analysis type
• All-data checksum calculation mode of skipped bytes designation type
(1)
Checksum Calculation Mode of MAC/IP Packet Analysis Type (CSEBL = 1 and CSMD
= 1)
Any receive packet included in the table below will be the target of calculation. Note that even
when a receive packet is included in the table, checksum calculation is not done if the MAC
packet payload contains padding data that has been inserted because the IP packet is small.
IPver
Item
IPv4
No option
Option provided
Fragment*
IPv6
1
No extension header
Length of the extension header of a hop-by-hop option
Length of the extension header of routing
Length of the extension header of a fragment*1
Length of the extension header of an end-point option
Length of the extension header of AH
Length of the extension header of ESP*2
Length of the extension header of MobileIPv6*2
Notes: *1. This is the target of calculation, but both RCS15 to RCS0 and RCSE will be undefined
even if the data is normal.
*2. No calculation is performed on RCS15 to RCS0, and RCSE is set to 1.
Page 490 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
The following shows the areas as the target of calculation of an IPv4 packet. The shaded portions
are the target of calculation.
No. 31
16
15 11 8 7
0
0
1
2
3
IPv4/IPv6/others (Decision)
4
Packet length
IHL*
5
Transmit IP address
6
7
Transmit IP address
8
Receive IP address
9
Receive IP address
An option, if any, is deleted from the target of calculation.
10
Data
Note: * This is changed to the octet basis and undergoes a subtraction
during checksum calculation. During calculation,
{8'h00, protocol No.[7:0]} is used.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 491 of 1278
SH7670 Group
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
The following shows the areas as the target of calculation of an IPv6 packet. The shaded portions
are the target of calculation.
No. 31
16
15
0
0
1
2
3
IPv4/IPv6/others (Decision)
4
5
Payload length
Next header*1
Transmit IP address
6
Transmit IP address
7
Transmit IP address
8
9
Transmit IP address
Transmit IP address
Receive IP address
10
Receive IP address
11
Receive IP address
12
13
Receive IP address
Receive IP address
Next header*1 Header length*2
The content of an extension header is not the target
of checksum calculation.
Data
Note: 1. Calculation applies only to TCP/UDP. Calculation requires an
expansion to {8'h00, next header[7:0]}.
2. This is changed to the octet basis and undergoes a subtraction
during checksum calculation.
Page 492 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
(2)
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
All-Data Checksum Calculation Mode of Skipped Bytes Designation Type (CSEBL = 1
and CSMD = 0)
The data equivalent to the number of bytes specified by SB5 to SB0 is skipped from the beginning
of a packet, and checksums are calculated on all of the subsequent valid data. (Example: 14-byte
skip)
No. 31
16
15
0
0
1
SB[5:0]OE
2
3
4
5
6
7
Data to be calculated
8
9
10
11
13.3.7
Usage Notes
The checksum calculation function is not affected by the padding function specified through the
receive data padding setting register (RPADIR). Checksums are calculated when the receive data
is transferred from the EtherC to the E-DMAC, whereas the receive data is padded when it is
transferred from the E-DMAC to the receive buffer in memory.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 493 of 1278
Section 13 Ethernet Controller Direct Memory Access Controller (E-DMAC)
Page 494 of 1278
SH7670 Group
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Section 14 DMAC That Works with Encryption/Decryption
and Forward Error Correction Core (A-DMAC)
14.1
Overview
The A-DMAC is a high-level descriptor-mode DMAC having error correction function. This
DMAC provides data transfer with memory via an internal shared bus (I-BUS) and data transfer
with an external MPEG device via STIF.
14.1.1
Features
The functions and features of this A-DMAC are as follows:
(1)
Channels for checksum processing
• Number of channels: 2
• Transfer direction: Memory← →memory, memory← →STIF
• Descriptor structure: Structure that enables checksum operation, etc., to be continuously
performed
• Error check: Checksum calculation function
(2)
FEC channels
• Number of channels: 1
• Descriptor structure: Structure that enables processing of any number of data items with a
small number of buffers
• Error correction (FEC): XOR calculation function
(3)
Other features
• Supported endian: Big endian/little endian
• Number of STIFs connected: Two channels
• Channel arbitration: Round robin scheduling that provides highly efficient use of encryption
modules and buses
• Channel operation: Parallel processing
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 495 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
14.1.2
SH7670 Group
Overall Configuration of the A-DMAC
The A-DMAC is configured as shown in figure 14.1. Table 14.1 gives an overview of A-DMAC
submodules.
The A-DMAC is connected to the I-BUS via the I-BUS interface, to the STIF0 via the STIF0
interface, and to the STIF1 via the STIF1 interface. The I-BUS is a shared bus in this LSI
operating on the B clock. The STIF is an I/O port for MPEG-2 TS/PS format data. The STIF0 is
fixed at CH0 and the STIF1 fixed at CH1.
The A-DMAC has two channels for checksum operation that operate on descriptors. Aside from
these channels, the A-DMAC has an FEC channel dedicated for FEC operation. This FEC channel
performs XOR operation of FEC operation.
These modules operate in parallel. For example, when the bus for channel 0 for checksum
processing is accessed, channel 1 for checksum processing can perform checksum operation.
The arbiter is a module that arbitrates the requests sent from each checksum processing channel
and each initiator of the FEC channel. The arbiter arbitrates requests from an initiator in round
robin scheduling. If you want to execute CH0 and CH1 simultaneously and raise the priority of
CH0 or CH1, the arbiter controls the priorities in descriptor ring units (example: When the
descriptor of CH0 or CH1, whichever has a lower priority, runs dry, the arbiter piles up the next
descriptor after a certain idling) or controls the priorities by suspending channel processing of
lower priority.
Page 496 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
A-DMAC
CPU control
CPU control data
ADMA interrupt
INTC
I-BUS
interface
Channel 0 for checksum
ad_irqc0_n
BUS I/F control
Function
· DMA automatic
processing
· Checksum operation
· Processing data
management,
Data selector
Channel0 control
BUS I/F data
Function
· DMA automatic
processing
· Checksum operation
· Processing data
management,
Data selector
ad_irqfec_n
FEC channel
Function
· DMA autmatic
processing
· XOR operation
I-BUS control
I-BUS data
I-BUS
Channel0 data
Arbiter
STIF0 I/F control
STIF0 I/F data
Channel 1 for checksum
ad_irqc1_n
Function
· Bus protocol
conversion
Function
· Arbitration
Channel1 control
Channel1 data
STIF1 I/F control
STIF1 I/F data
STIF0
interface
Function
· STIF0 protocol
conversion
STIF1
interface
Function
· STIF1 protocol
conversion
STIF0control
STIF0 data
STIF0
STIF1 control
STIF1 data
STIF1
FEC
channel control
FEC
channel data
x_rst
x_bck
x_bckstp_p
x_modstp_p
Figure 14.1 Block Diagram of A-DMAC
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 497 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
SH7670 Group
Table 14.1 A-DMAC Submodules
Submodule Name
Function
Channel for checksum
processing
•
DMA automatic processing based on descriptors
•
Checksum operation
•
Continuous execution of checksum
•
DMA automatic processing based on descriptors
•
XOR operation for any number of data items
•
Arbitrates requests from the channel for checksum processing
and FEC channel.
•
Channel arbitration mode is round robin scheduling.
•
Conversion between I-BUS protocol and A-DMAC protocol
•
Distribution of register R/W requests from the CPU to each
module
•
Conversion between STIF protocol and A-DMAC protocol
•
STIF0 is fixed at channel 0 for encryption/authentication.
•
STIF1 is fixed at channel 1 for encryption/authentication.
FEC channel
Arbiter
I-BUS interface
STIF interface
Page 498 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
14.1.3
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Restrictions on the A-DMAC
The following restrictions apply to the A-DMAC:
• The A-DMAC supports only register access in 32-bit units.
• If the channel processor, or FEC processor is running, write to registers related to the
appropriate processor is inhibited. However, you can write data to the following two registers
by verifying them after the write even if the appropriate processor is running. Write data
repeatedly till verify succeeds.
⎯ Channel [i] processing control register (C[i]C) (However, do not rewrite the C[i]C_R bit of
the running channel processor.)
⎯ Channel [i] processing interrupt request register (C[i]I)
• Descriptors of data size 0 are inhibited.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 499 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
14.2
SH7670 Group
Register Descriptions
The A-DMAC has the following registers. For details on the addresses of these registers and the
register status in each processing state, see section 28, List of Registers.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Channel [i] processing control register (C[i]C) (i = 0, 1)
Channel [i] processing mode register (C[i]M) (i = 0, 1)
Channel [i] processing interrupt request register (C[i]I) (i = 0, 1)
Channel [i] processing descriptor start address register (C[i]DSA) (i = 0, 1)
Channel [i] processing descriptor current address register (C[i]DCA) (i = 0, 1)
Channel [i] processing descriptor 0 register (C[i]D0) [control] (i = 0, 1)
Channel [i] processing descriptor 1 register (C[i]D1) [source address] (i = 0, 1)
Channel [i] processing descriptor 2 register (C[i]D2) [destination address] (i = 0, 1)
Channel [i] processing descriptor 3 register (C[i]D3) [data length] (i = 0, 1)
Channel [i] processing descriptor 4 register (C[i]D4) [checksum value write address] (i = 0, 1)
FEC DMAC processing control register (FECC)
FEC DMAC processing interrupt request register (FECI)
FEC DMAC processing descriptor start address register (FECDSA)
FEC DMAC processing descriptor current address register (FECDCA)
FEC DMAC processing descriptor 0 register (FECD00) [control]
FEC DMAC processing descriptor 1 register (FECD01D0A) [destination address]
FEC DMAC processing descriptor 2 register (FECD02S0A) [source 0 address]
FEC DMAC processing descriptor 3 register (FECD03S1A) [source 1 address]
Page 500 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
14.2.1
Channel [i] Processing Control Register (C[i]C) (i = 0, 1)
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
C[i]C_R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
C[i]C_
DWF
⎯
⎯
⎯
C[i]C_
VLD
⎯
⎯
⎯
C[i]C_
EIE
⎯
⎯
⎯
C[i]C_E
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R/W
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit Name
31 to 17 —
Initial
Value
R/W
Description
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
16
C[i]C_R
0
R/W
Reset
Writing 1 to this bit when the channel [i] processor is
halted causes the channel [i] calculation sequence
to be reset. This bit is automatically and immediately
set to 0. Setting both this bit and the C[i]C_E bit to 1
causes channel [i] processing to be newly started.
15 to 13 —
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
12
C[i]C_DWF
0
R
WAIT State Flag after Descriptor Processing End
0: Non-WAIT state
1: WAIT state
There are two methods for understanding the
processing state of the DMAC channel [i] descriptor.
In one, when the DMAC channel [i] descriptor is set,
C[i]DWE is set to 1 and then C[i]DIE is set to 1 to
accept the "1 descriptor processing end" interrupt
request. In the other, the processing state is
observed till this bit is set to 1.
11 to 9
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 501 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
8
C[i]C_VLD
0
R/W
Variable-Length Descriptor Control Flag
SH7670 Group
0: Fixed-length descriptor (32 bytes)
1: Variable-length descriptor (16/32 bytes)
The A-DMAC channel uses the 32-byte fixed length
structure or 16/32-byte variable-length structure. If
this bit is set to 0 to define the descriptor as the
fixed-length, the descriptor is always read as 32
bytes. If this bit is set to 1 to define the descriptor as
the variable-length, the first 16 bytes are read, and if
r_cid4/r_cid5/r_cid6/r_cid7 information is required,
the remaining 16 bytes are read according to the
contents of r_cidm/r_cihm.
7 to 5
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
4
C[i]C_EIE
0
R/W
"Processing End" Interrupt Request Enable
When processing ends, specifies whether to enable
or disable the "processing end" interrupt request.
0: Disables the "processing end" interrupt request.
1: Enables the "processing end" interrupt request.
A-DMAC channel [i] processing end means fetching
of depleted descriptors (invalid descriptors
(descriptors where C[i]F0 is set to 0)).
3 to 1
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Page 502 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
0
C[i]C_E
0
R/W
Execution Request
Setting this bit to 1 causes channel [i] processing to
be started. Setting this bit to 0 causes channel [i]
processing to be suspended. When 0 is written to
this bit, 0 is read immediately but the channel [i]
processor does not stop immediately. That is, the
processor stops after it writes back to the descriptor
being processed. To understand the channel
operating state, set the C[i]C_EIE bit to 1 to accept
the "operation end" interrupt request or poll the
"operation end" interrupt request flag. To start new
processing, the channel [i] of the STIF must be
initialized.
0: Channel [i] processing is halted.
1: Channel [i] processing is in progress.
Determine if channel [i] processing is suspended
when the processor writes back to the descriptor.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 503 of 1278
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
14.2.2
Channel [i] Processing Mode Register (C[i]M) (i = 0, 1)
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
C[i]M_
LIE
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
Initial
Value
R/W
Description
31 to 5
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
4
C[i]M_LIE
0
R/W
"Last Data Descriptor End Processing" Interrupt
Request Enable
When last data (C[i]F2=1) descriptor end processing
ends, specifies whether to enable or disable the
interrupt request.
0: Disables the "last data descriptor processing
end" interrupt request.
1: Enables the "last data descriptor processing end"
interrupt request.
3 to 0
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
Page 504 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
14.2.3
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Channel [i] Processing Interrupt Request Register (C[i]I) (i = 0, 1)
ad_irqc[i]_n is asserted as negation of logical OR of all bits in this register.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
C[i]I_
DI
⎯
⎯
⎯
C[i]I_
LI
⎯
⎯
⎯
⎯
⎯
⎯
⎯
C[i]I_
EI
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R/W
0
R
0
R
0
R
0
R
0
R
0
R
0
R
0
R/W
Initial Value:
R/W:
Initial Value:
R/W:
Bit
Bit Name
31 to 13 —
Initial
Value
R/W
Description
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
12
C[i]I_DI
0
R/W
"1 Descriptor Processing End" Interrupt Request
(interrupt request to notify you that the processor
ended descriptor processing and wrote back the
descriptor)
This bit is cleared to 0 by writing 1 to it. When 0 is
written to this bit, the current state is retained.
0: The "1 descriptor processing end" interrupt is not
requested.
1: The "1 descriptor processing end" interrupt is
requested.
11 to 9
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 505 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
SH7670 Group
Bit
Bit Name
Initial
Value
R/W
Description
8
C[i]I_LI
0
R/W
"Continuous Data Last Descriptor Processing End"
Interrupt Request (interrupt request to notify you that
processing described in the descriptor where C[i]F2
is set to 1 ended)
This bit is cleared to 0 by writing 1 to it. When 0 is
written to this bit, the current state is retained.
0: The "last descriptor processing end" interrupt is
not requested.
1: The "last descriptor processing end" interrupt is
requested.
7 to 1
—
All 0
R
Reserved
These bits are always read as 0. The write value
should always be 0.
0
C[i]I_EI
0
R/W
"Processing End" Interrupt Request
This bit indicates whether the "processing end"
interrupt is requested.
This bit is cleared to 0 by writing 1 to it. When 0 is
written to this bit, the current state is retained.
0: The "processing end" interrupt is not requested.
1: The "processing end" interrupt is requested.
"Processing end" means fetching of depleted
descriptors (invalid descriptors (descriptors where
C[i]F0 is set to 0)).
Page 506 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
14.2.4
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Channel [i] Processing Descriptor Start Address Register (C[i]DSA) (i = 0, 1)
Do not write any value to this register when C[i]C_E is set to 1.
Bit: 31
30
29
28
27
26
25
24
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
8
23
22
21
20
19
18
17
16
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
7
6
5
4
3
2
1
0
C[i]DSA[31:16]
Initial Value: 0
R/W: R/W
Bit: 15
C[i]DSA[15:4]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
C[i]DSA[3:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
Description
31 to 4
C[i]DSA[31:4]
All 0
R/W
Descriptor Ring Start Address
3 to 0
C[i]DSA[3:0]
All 0
R
Specify a descriptor ring start address. Set a 16-byte
boundary address value.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 507 of 1278
0
R
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
14.2.5
Channel [i] Processing Descriptor Current Address Register (C[i]DCA) (i = 0, 1)
Do not write any value to this register when C[i]C_E is set to 1.
Bit: 31
30
29
28
27
26
25
24
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
8
23
22
21
20
19
18
17
16
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
7
6
5
4
3
2
1
0
C[i]DCA[31:16]
Initial Value: 0
R/W: R/W
Bit: 15
C[i]DCA[15:4]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
C[i]DCA[3:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R
0
R
0
R
Bit
Bit Name
Initial
Value
R/W
Description
31 to 4
C[i]DCA[31:4]
All 0
R/W
Descriptor Current Address
3 to 0
C[i]DCA[3:0]
All 0
R
Specify the start address of descriptor processing.
Set a 16-byte boundary address value. When
descriptor processing is in progress, these bits
indicate the address of descriptor currently being
processed. After descriptor write-back, these bits
indicate the address of the next descriptor.
Page 508 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
0
R
SH7670 Group
14.2.6
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Channel [i] Processing Descriptor 0 Register (C[i]D0) [Control] (i = 0, 1)
Do not write any value to this register when C[i]C_E is set to 1.
Bit: 31
30
29
28
27
C[i]CRDO[3:0]
Initial Value: 0
R/W: R/W
25
24
23
0
R/W
0
R/W
C[i]CHDO[3:0]
21
20
C[i]SO[3:0]
0
R/W
0
R/W
18
17
16
C[i]DA
C[i]SA
C[i]CSM[1:0]
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit: 15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
C[i]F2
C[i]F1
C[i]F0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
31 to 28 C[i]CRDO[3:0]
0
R/W
19
0
R/W
Bit Name
0
R/W
22
0
R/W
Initial Value: 0
R/W: R/W
Bit
26
Initial
Value
R/W
Description
All 0
R/W
Transfer Data Destination Data Sequence
0
R/W
Specify a swap method for writing transfer data after
encryption processing from the A-DMAC to memory
such as the STIF and SDRAM or after checksum
operation. Specify a swap method for writing the
checksum operation result obtained from body data
in the C[i]CHDO3 to C[i]CHDO0 bits, not these bits.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 509 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
31 to 28 C[i]CRDO[3:0]
Initial
Value
R/W
Description
All 0
R/W
•
SH7670 Group
When the destination is not the STIF (C[i]DA bit
= 0)
C[i]CRDO3: Data swap in two-byte units
(longword swap in word units)
0: As-is
1: Swap
C[i]CRDO2: Data swap in one-byte units (word
swap in byte units)
0: As-is
1: Swap
C[i]CRDO1: Inversion of bit 1 at address when
one or two bytes are accessed
0: As-is
1: Inversion
C[i]CRDO0: Inversion of bit 0 at address when
one byte is accessed
0: As-is
1: Inversion
C[i]CRDO1 and C[i]CRDO0 function for endian
adjustment. Note that if an endian different from
the endian of this LSI is used, up to three
different addresses are accessed from the
address where the start and end addresses are
specified when an area is allocated.
•
When the destination is the STIF (C[i]DA bit = 1)
C[i]CRDO3: Data swap in two-byte units
(longword swap in word units)
0: As-is
1: Swap
C[i]CRDO2: Data swap in one-byte units (word
swap in byte units)
0: As-is
1: Swap
C[i]CRDO1: Data swap in one-bit units (byte
swap in one-bit units)
0: As-is
1: Swap
C[i]CRDO0: Set this bit to 0 as reserved.
Page 510 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Bit
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit Name
27 to 24 C[i]CHDO[3:0]
Initial
Value
R/W
Description
All 0
R/W
Checksum Operation Result Destination Data
Sequence
Specify a swap method for writing the checksum
operation result from the A-DMAC to memory such
as SDRAM. Specify a swap method for writing body
data after checksum operation in the C[i]CRDO3 to
C[i]CRDO0 bits.
C[i]CHDO3: Data swap in two-byte units (longword
swap in word units)
0: As-is
1: Swap
C[i]CHDO2: Data swap in one-byte units (word swap
in byte units)
0: As-is
1: Swap
C[i]CHDO1: Inversion of bit 1 at address when one
or two bytes are accessed
0: As-is
1: Inversion
C[i]CHDO0: Inversion of bit 0 at address when one
byte is accessed
0: As-is
1: Inversion
C[i]CHDO1 and C[i]CHDO0 function for endian
adjustment. Note that if an endian different from the
endian of this LSI is used, up to three different
addresses are accessed from the address where the
start and end addresses are specified when an area
is allocated.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 511 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
SH7670 Group
Initial
Value R/W Description
23 to 20 C[i]SO[3:0] All 0
R/W Source Data Sequence
Specify a swap method for reading data from memory such as the
STIF and SDRAM to the A-DMAC.
•
When the source is not the STIF (C[i]SA bit = 0)
•
C[i]SO3: Data swap in two-byte units (longword swap in word
units)
0: As-is
1: Swap
C[i]SO2: Data swap in one-byte units (word swap in byte units)
0: As-is
1: Swap
C[i]SO1: Inversion of bit 1 at address when one or two bytes
are accessed
0: As-is
1: Inversion
C[i]SO0: Inversion of bit 0 at address when one byte is
accessed
0: As-is
1: Inversion
C[i]SO1 and C[i]SO0 function for endian adjustment. Note that
if an endian different from the endian of this LSI is used, up to
three different addresses are accessed from the address
where the start and end addresses are specified when an area
is allocated.
When the source is the STIF (C[i]SA bit = 1)
C[i]SO3: Data swap in two-byte units (longword swap in word
units)
0: As-is
1: Swap
C[i]SO2: Data swap in one-byte units (word swap in byte units)
0: As-is
1: Swap
C[i]SO1: Data swap in one-bit units (byte swap in one-bit units)
0: As-is
1: Swap
C[i]SO0: Set this bit to 0 as reserved.
This bit is referenced in AES encryption/decryption,
DES/3DES encryption/decryption, SHA hash generation,
HMAC keyed hash generation, target data read for checksum
operation, and data copy from memory to the STIF and from
the STIF to memory. However, this bit is not referenced in key
copy and initial vector copy.
Page 512 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
19
C[i]DA
0
R/W
Destination Attribute
Specifies whether the data read source uses the
channel [i] (the destination address is not used) of the
STIF or the destination address (memory such as
SDRAM).
0: Uses the destination address (memory such as
SDRAM).
1: Uses the channel [i] of the STIF
18
C[i]SA
0
R/W
Source Attribute
Specifies whether the data read source uses the
channel [i] (the source address is not used) of the STIF
or the source address (memory such as SDRAM).
0: Uses the source address (memory such as SDRAM).
1: Uses the channel [i] of the STIF
17, 16
C[i]CSM[1:0] 00
R/W
Checksum Mode
00: Checksum (not initialized, not written back)
Not beginning of data
Not end of data
01: Checksum (not initialized, written back)
Not beginning of data
End of data
10: Checksum (initialized, not written back)
Beginning of data
Not end of data
11: Checksum (initialized, written back)
Beginning of data
End of data
15 to 3
—
All 0
R/W
Reserved
These bits are always read as 0. The write value should
always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 513 of 1278
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
2
C[i]F2
0
R/W
Descriptor Execution Flag 2
SH7670 Group
When splitting continuous data into several descriptors
for execution, set this bit to 1 in the descriptor that
processes the last data part (because the pointer in the
A-DMAC must be initialized to process the next
descriptor).
Use this flag when splitting and executing descriptors
because the encryption/decryption part, authentication
part, and checksum operation part in data such as
IPsec/TLS differ.
0: Non-last descriptor that processes continuous data
1: Last descriptor that processes continuous data
1
C[i]F1
0
R/W
Descriptor Execution Flag 1
When this bit is 1, the A-DMAC regards this descriptor
as the last descriptor in the descriptor ring area. When
processing of this descriptor ends, the A-DMAC returns
to the beginning (descriptor start address) of the
descriptor ring area.
0: Non-last descriptor ring
1: Last descriptor ring
0
C[i]F0
0
R/W
Descriptor Execution Flag 0
When this bit is 0, the A-DMAC ends processing
because this descriptor is invalid. When this bit is 1, this
descriptor is valid. When this bit is 1 (valid descriptor),
the A-DMAC sets this bit to 0 and writes back to the
original address after processing of this descriptor ends.
0: Invalid descriptor
1: Valid descriptor
Page 514 of 1278
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
14.2.7
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Channel [i] Processing Descriptor 1 Register (C[i]D1) [Source Address] (i = 0, 1)
Do not write any value to this register when C[i]C_E is set to 1.
Bit: 31
30
29
28
27
26
25
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
24
23
22
21
20
19
18
17
16
C[i]D1[31:16]
Initial Value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
C[i]D1[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
31 to 0
C[i]D1[31:0]
All 0
R/W
Source Address
Specify a source address. This register is used when
source access involves memory reference. It is not
used in the STIF.
When copying a key or initial vector from the source,
set 0000 in the lower four bits (16-byte boundary).
When splitting continuous data into several
descriptors for execution, specify the same source
address in all the descriptors.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 515 of 1278
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
14.2.8
Channel [i] Processing Descriptor 2 Register (C[i]D2)
[Destination Address] (i = 0, 1)
Do not write any value to this register when C[i]C_E is set to 1.
Bit: 31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
C[i]D2[31:16]
Initial Value: 0
R/W: R/W
Bit: 15
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
C[i]D2[15:0]
Initial Value: 0
R/W: R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
Bit
Bit Name
Initial
Value
R/W
Description
31 to 0
C[i]D2[31:0]
All 0
R/W
Transfer Data Destination Address
Specify a destination address to which to write back
the transfer data.
When splitting continuous data into several
descriptors for execution, specify the same source
address in all the descriptors.
14.2.9
Channel [i] Processing Descriptor 3 Register (C[i]D3) [Data Length] (i = 0, 1)
Do not write any value to this register when C[i]C_E is set to 1.
Bit: 31
30
⎯
⎯
Initial Value: 0
R/W: R/W
Bit: 15
29
28
27
26
25
24
23
22
21
20
19
18
17
16
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
⎯
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
C[i]DWE C[i]DIE
C[i]D3[15:0]
Initial Value: 0
R/W: R/W
Page 516 of 1278
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
0
R/W
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
31, 30
—
All 0
R/W
Reserved
These bits are always read as 0. The write value
should always be 0.
29
C[i]DWE
0
R/W
"1 Descriptor Processing End" Interrupt Release
Wait Enable
If this bit is 1 and the "1 descriptor processing"
interrupt is requested, the A-DMAC waits for the
interrupt release before it moves to next descriptor
processing.
0: Does not observe the "1 descriptor processing
end" interrupt.
1: Enables "1 descriptor processing end" interrupt
release wait.
28
C[i]DIE
0
R/W
"1 Descriptor Processing End" Interrupt Request
Enable
Specifies whether to enable or disable the "1
descriptor processing end" interrupt when
processing of this descriptor ends. Processing does
not end even if the "1 descriptor processing end"
interrupt request is enabled.
0: Disables the "1 descriptor processing end"
interrupt request.
1: Enables the "1 descriptor processing end"
interrupt request.
27 to 16
—
All 0
R/W
Reserved
These bits are always read as 0. The write value
should always be 0.
R01UH0234EJ0300 Rev. 3.00
Jun 21, 2011
Page 517 of 1278
SH7670 Group
Section 14 DMAC That Works with Encryption/Decryption and Forward Error Correction Core (A-DMAC)
Bit
Bit Name
Initial
Value
R/W
Description
15 to 0
C[i]D3[15:0]
All 0
R/W
Target Data Size (Byte Length)
The target data size range that can be specified in
these bits is as follows:
0 < C[I]D3[15:0]