The revision list can be viewed directly by
clicking the title page.
The revision list summarizes the locations of
revisions and additions. Details should always
be checked by referring to the relevant text.
SH7641
32
Hardware Manual
Renesas 32-Bit RISC Microcomputer
SuperH™ RISC engine Family / SH7641 Series
SH7641 HD6417641
Rev.4.00
Revision Date: Sep. 14, 2005
Rev. 4.00 Sep. 14, 2005 Page ii of l
Keep safety first in your circuit designs!
1. Renesas Technology Corp. puts the maximum effort into making semiconductor products better and
more reliable, but there is always the possibility that trouble may occur with them. Trouble with
semiconductors may lead to personal injury, fire or property damage.
Remember to give due consideration to safety when making your circuit designs, with appropriate
measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or
(iii) prevention against any malfunction or mishap.
Notes regarding these materials
1. These materials are intended as a reference to assist our customers in the selection of the Renesas
Technology Corp. product best suited to the customer's application; they do not convey any license
under any intellectual property rights, or any other rights, belonging to Renesas Technology Corp. or
a third party.
2. Renesas Technology Corp. assumes no responsibility for any damage, or infringement of any thirdparty's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or
circuit application examples contained in these materials.
3. All information contained in these materials, including product data, diagrams, charts, programs and
algorithms represents information on products at the time of publication of these materials, and are
subject to change by Renesas Technology Corp. without notice due to product improvements or
other reasons. It is therefore recommended that customers contact Renesas Technology Corp. or
an authorized Renesas Technology Corp. product distributor for the latest product information
before purchasing a product listed herein.
The information described here may contain technical inaccuracies or typographical errors.
Renesas Technology Corp. assumes no responsibility for any damage, liability, or other loss rising
from these inaccuracies or errors.
Please also pay attention to information published by Renesas Technology Corp. by various means,
including the Renesas Technology Corp. Semiconductor home page (http://www.renesas.com).
4. When using any or all of the information contained in these materials, including product data,
diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total
system before making a final decision on the applicability of the information and products. Renesas
Technology Corp. assumes no responsibility for any damage, liability or other loss resulting from the
information contained herein.
5. Renesas Technology Corp. semiconductors are not designed or manufactured for use in a device or
system that is used under circumstances in which human life is potentially at stake. Please contact
Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor when
considering the use of a product contained herein for any specific purposes, such as apparatus or
systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use.
6. The prior written approval of Renesas Technology Corp. is necessary to reprint or reproduce in
whole or in part these materials.
7. If these products or technologies are subject to the Japanese export control restrictions, they must
be exported under a license from the Japanese government and cannot be imported into a country
other than the approved destination.
Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the
country of destination is prohibited.
8. Please contact Renesas Technology Corp. for further details on these materials or the products
contained therein.
Rev. 4.00 Sep. 14, 2005 Page iii of l
General Precautions on Handling of Product
1. Treatment of NC Pins
Note: Do not connect anything to the NC pins.
The NC (not connected) pins are either not connected to any of the internal circuitry or are
used as test pins or to reduce noise. If something is connected to the NC pins, the
operation of the LSI is not guaranteed.
2. Treatment of Unused Input Pins
Note: Fix all unused input pins to high or low level.
Generally, the input pins of CMOS products are hi g h-impedance input pins. If unused pins
are in their open states, intermediate levels are induced by noise in the vicinity, a passthrough current flows internally, and a malfun ction may occur.
3. Processing before Initialization
Note: When power is first supplied, the product's state is undefined.
The states of internal circuits are undefined until full power is supplied throughout the
chip and a low level is input on the reset pin. During the period where the states are
undefined, the register settings and the output state of each pin are also undefined. Design
your system so that it does not malfunction because of processing while it is in this
undefined state. For those products which have a reset function, reset the LSI immediately
after the power supply has been turned on.
4. Prohibition of Access to Undefined or Rese rved Addresses
Note: Access to undefined or reserved addresses is prohibited.
The undefined or reserved addresses may be used to expand functions, or test registers
may have been be allocated to these addresses. Do not access these registers; the system's
operation is not guaranteed if they are accessed.
5. Treatment of Power Supply (0 V) Pins
Note: There should be no voltage difference between the system ground pins (0 V power
supply), VssQ, Vss, Vss, Vss (PLL1), and Vss (PLL2).
If voltage difference is created between the system ground pi ns, malfunctions may occur or
excessive current flows during standby due to through current. Voltage difference should not
be created between the system ground pins, VssQ, Vss, Vss (PLL1), and Vss (PLL2).
Rev. 4.00 Sep. 14, 2005 Page iv of l
Important Notice on the Quality Assurance for this LSI
Although the wafer process and assembly process of this LSI are entrusted to the external silicon
foundries, the quality of this LSI is guaranteed for the customers under the quality assurance
system of our company.
However, if it is clear that our company is responsible for a defective product, we will only offer,
after the agreement of both parties, to exchange it with a new product from stock.
The following shows the robustness (reference values) of the LSI against static-electricity-induced
breakdown.
Robustness (Reference Values) of the LSI against Static-electricity-induced Breakdown
Machine Model Method ± 200 V or more
Human Body Model Method ± 1500 V or more
Charged Device Model Method ± 1000 V or more
For the details on the quality assurance of this LSI, contact your nearest Renesas Technology sales
representative.
Rev. 4.00 Sep. 14, 2005 Page v of l
Configuration of This Manual
This manual comprises the following items:
1. General Precautions on Handling of Product
2. Configuration of This Manual
3. Preface
4. Contents
5. Overview
6. Description of Functional Modules
• CPU and System-Control Modules
• On-Chip Peripheral Modules
The configuration of the functional description of each module differs according to the
module. However, the generic style includes the following items:
When designing an application system that includes this LSI, take notes into account. Each section
includes notes in relation to the descriptions given, and usage notes are given, as required, as the
final part of each section.
7. List of Registers
8. Electrical Characteristics
9. Appendix
10. Main Revisions and Additions in this Edition (only for revised versions)
The list of revisions is a summary of points that have been revised or added to earlier versions.
This does not include all of the revised contents. For details, see the actual locations in this
manual.
11. Index
Rev. 4.00 Sep. 14, 2005 Page vi of l
Rev. 4.00 Sep. 14, 2005 Page vii of l
Preface
The SH7641 RISC (Reduced Instruction Set Comput er ) mi croc omputer includes a Renesas
Technology original RISC CPU as its core, and the peripheral functions required to configure a
system.
Target Users: This manual was written for users who will be using this LSI in the design of
application systems. Users of this manual are expected to understand the
fundamentals of electrical circuits, logical circuits, and microcomputers.
Objective: This manual was written to explain the hardware functions and electrical
characteristics of this LSI to the above users.
Refer to the SH-3/SH-3E/SH3-DSP Software Manual for a detailed description of
the instruction set.
Notes on reading this manual:
• Product names
The following products are covered in this manual.
Product Classifications and Abbreviations
Basic Classification Product Code
SH7641 HD6417641
• In order to understand the overall functions of the chip
Read the manual according to the contents. This manual can be roughl y categorized into parts
on the CPU, system control functions, peripheral functions and electrical characteristics.
• In order to understand the details of the CPU's functions
Read the SH-3/SH-3E/SH3-DSP Software Manual.
This product does not support the MMU functions. For example, the LDTLB instruction code
is executed as the NOP instruction.
Rev. 4.00 Sep. 14, 2005 Page viii of l
Rules: Register name: The following notation is used for cases when the same or a
similar function, e.g. serial communication, is implemented
on more than one chann el:
XXX_N (XXX is the register name and N is the channel
number)
Bit order: The MSB (most significant bit) is on the left and the LSB
(least significant bit) is on the right.
Number notation: Binary is B'xxxx, hexadecimal is H'xxxx , decimal is xxxx.
Signal notation: An overbar is added to a low-active signal: xxxx
Related Manuals: The latest versions of all related manuals are available from our web site.
Please ensure you have the latest versions of all documents you require.
http://www.renesas.com/eng/
SH7641manuals:
Document Title Document No.
SuperH RISC engine SH7641Hardware Manual This manual
ADC Analog to digital converter
ALU Arithmetic logic unit
bpp bits per pixel
bps bits per second
BSC Bus state controller
CODEC Coder-decoder
CPG Clock pulse generator
CPU Central processing unit
CRC Cyclic redund anc y check
DMAC Direct memory access controller
DSP Digital signal processor
ESD Electrostatic discharge
ECC Error checking and correction
etu Elementary time unit
FIFO First-in first-out
Hi-Z High impedance
H-UDI User debugging interface
INTC Interrupt controller
LSB Least significant bit
MSB Most significant bit
PC Program counter
PFC Pin function controller
PLL Phase locked loop
RAM Random access memory
RISC Reduced instruction set computer
ROM Read only memory
SCIF Serial communication interface with FIFO
SOF Start of frame
TAP Test access port
T.B.D To be determined
UBC User break controller
List of Multiplexed Pins........................................................................................819
Port A Data Register (PADR) Read/Write Operations .........................................845
Absolute Maximum Ratings .................................................................................907
Rev. 4.00 Sep. 14, 2005 Page xlix of l
Appendix
Table A.1
Pin States in Reset State, Power Down Mode, and Bus-Released States
When Other Function is Selected.......................................................................... 967
Table A.2Pin States in Reset State, Power Down Mode, and Bus-Released States
When I/O Port is Selected..................................................................................... 971
Rev. 4.00 Sep. 14, 2005 Page l of l
Section 1 Overview
Section 1 Overview
This LSI is a single-chip RISC microprocessor that integrates a Renesas Technology original 32 bit SuperH RISC engine architecture CPU with a digital signal processing (DSP) extension as its
core, with 16-kbyte of cache memory, 16-kbyte o f an on -chip X/Y memory, and peripheral
functions required for system configuration such as an interrupt controller. This LSI comes in 256pin package.
High-speed data transfers can be formed by an on-chip direct memory access controller (DMAC),
and an external memory access support function enables direct connection to different kinds of
memory. This LSI also supports powerful peripheral functions such as USB function and serial
communication interface with FIFO.
1.1 Features
The features of this LSI are listed in table 1.1.
Table 1.1 Features
Items Specification
CPU
• Renesas Technology original SuperH architecture
• Compatible with SH-1, SH-2 and SH-3 at object code level
• 32-bit internal data bus
• Support of an abundant register-set
Sixteen 32-bit general registers (eight 32-bit bank registers)
Eight 32-bit control registers
Four 32-bit system registers
• RISC-type instruction set
Instruction length: 16-bit fixed length for improved code efficiency
Load/store architecture
Delayed branch instructions
Instruction set based on C language
• Instruction execution time: one instruction/cycle for basic instructions
• Logical address space: 4Gbytes
• Five-stage pipeline
Rev. 4.00 Sep. 14, 2005 Page 1 of 982
REJ09B0023-0400
Section 1 Overview
Items Specification
DSP
• Mixture of 16-bit and 32-bit instructions
• 32-/40-bit internal data paths
• Multiplier, ALU, barrel shifter and DSP register
• Large DSP data registers
Six 32-bit data registers
Two 40-bit data registers
• Extended Harvard Architecture for DSP data bus
Two data buses
One instruction bus
• Max. four parallel operations: ALU, multiply, and two load or store
• Two addressing units to generate addresses for two memory access
• DSP data addressing modes: increment, indexing (with or without
modulo addressing)
• Zero-overhead repeat loop control
• Conditional execution instructions
Clock pulse
generator (CPG)
• Clock mode: Input clock can be selected from external input (EXTAL
or CKIO) or crystal oscillator
• Three types of clocks generated:
CPU clock: maximum 100 MHz
Bus clock: maximum 50 MHz
Peripheral clock: maximum 33 MHz
• Power-down modes:
Sleep mode
Standby mode
Module standby mode
• Three types of clock modes (selectable PLL2 × 2 / × 4, clock / crystal
oscillator)
Watchdog timer
• On-chip one-channel watchdog timer
• Select from operation in watchdog-timer or interval-timer mode.
• Interrupt generation is supported for the interval-timer mode.
Rev. 4.00 Sep. 14, 2005 Page 2 of 828
REJ09B0023-0400
Items Specification
Cache memory
• 16-kbyte cache, mixed instruction/data
• 256 entries, 4-way set associative, 16-byte block length
• Total memory: 16-kbyte (XRAM: 8-kbyte, YRAM: 8-kbyte)
Interrupt controller
(INTC)
• Nine external interrupt pins (NMI, IRQ7 to IRQ0)
• On-chip peripheral interrupts: Priority level set for each module
• Supports soft vector mode
User break controller
(UBC)
• Addresses, data values, type of access, and data size can all be set
as break conditions
• Supports a sequential break function
• Two break channels
Section 1 Overview
Rev. 4.00 Sep. 14, 2005 Page 3 of 982
REJ09B0023-0400
Section 1 Overview
Items Specification
Bus state controller
(BSC)
• Physical address space divided into eight areas, four areas (area 0,
areas 2 to 4), each a maximum of 64 Mbytes and other four areas
(areas 5A, 5B, areas 6A, 6B), each a maximum of 32 Mbytes
• The following features settable for each area independently
Bus size (8, 16, or 32 bits), but different support size by each areas
Number of wait cycles (wait read/write settable independently area
exists)
Idle wait cycles (same area/another area)
Specifying the memory to be connected to each area enables
direct connection to SRAM, SDRAM, Burst ROM, address/data
MPX mode supporting area exists
Outputs chip select signal (CS0, CS2 to CS4, CS5A/B, CS6A/B)
for corresponding area (selectable for programming CS
assert/negate timing)
• SDRAM refresh function
Supports auto-refresh and self-refresh mode
• SDRAM burst access function
• Area 2/3 enables connection to different SDRAM (size/latency)
Direct memory access
controller (DMAC)
• Number of channels: four channels (two channels can accept external
requests)
• Two types of bus modes
Cycle steal mode and burst mode
• Interrupt can be requested to the CPU at completion of data transfer
• Supports intermittent mode (16/64 cycles)
User debugging
interface (H-UDI)
• E10A emulator support
• JTAG-standard pin assignment
• Realtime branch trace
Rev. 4.00 Sep. 14, 2005 Page 4 of 828
REJ09B0023-0400
Items Specification
Advanced user
debugger (AUD)
• Six output pins
• Trace of branch source/destination address
• Window data trace function
• Full trace function
All trace data can be output by stalling the CPU even when the
trace data is not output in time
• Real-time trace function
Function to output trace data that can be output at the range not to
stall the CPU
Multi-function timer
pulse unit (MTU)
• Maximum 16-pulse input/output
• Selection of 8 counter input clocks for each channel
• The following operations can be set for each channel:
Waveform output at compare match
Input capture function
Counter clear operation
A maximum 12-phase PWM output is possible in combination with
synchronous operation
• Buffer operation settable for channels 0,3,and 4
• Phase counting mode settable independently for each of channels 1
and 2
• Cascade connection operation
• Fast access via internal 16-bit bus
• 23 interrupt sources
• Automatic transfer of register data
• A/D converter conversion start trigger can be generated
• Module standby mode can be set
Section 1 Overview
Rev. 4.00 Sep. 14, 2005 Page 5 of 982
REJ09B0023-0400
Section 1 Overview
Items Specification
Compare match timer
(CMT)
• 16-bit counter × 2 channels
• Selection of four clocks
• Interrupt request or DMA transfer request can be generated by
compare-match
Serial communication
interface with FIFO
(SCIF)
• 3 channels
• Asynchronous mode or clock synchronous mode can be selected
• Separate 16-stage FIFO registers for transmission and reception
• Dedicated Modem control function (Asynchronous mode)
I/O ports
USB function module
• Input or output can be selected for each bits
• Conforming to the USB standard
• Corresponds mode of USB internal transceiver or external transceiver
• Supports control (endpoint 0), balk transmission (endpoint 1, 2),
interrupt (endpoint 3)
• Supports USB standard command and transaction class or vendor
command in firmware
• FIFO buffer for end point (128-byte/endpoint)
• Module input clock: 48MHz. Either self-powered or bus-powered mode
can be selected.
I2C bus interface (IIC2)
• One channel
• Conforms to the Phillips I
2
• Master/slave mode supported
• Continuous transmission/reception supported
2
• Either the I
C bus format or clock synchronous serial format is
selectable.
A/D converter
• 10 bits±8 LSB, 8 channels
• Input range: 0 to AVcc (max. 3.6V)
U memory
• Three independent read/write ports
8-/16-/32-bit access from the CPU
8-/16-/32-bit access from the DSP
8-/16-bit access from the DMAC
• Total memory: 64-kbyte
C bus interface specification.
Rev. 4.00 Sep. 14, 2005 Page 6 of 828
REJ09B0023-0400
1.2 Block Diagram
The block diagram of this LSI is shown in figure1.1.
SH3
CPU
Section 1 Overview
USB
X/Y
Memory
U Memory
CACHE
[Legend]
ADC:
AUD:
BSC:
CACHE:
CMT:
CPG/WDT:
CPU:
DMAC:
Y-BUS
X-BUS
L-BUS
I-BUS
BSC
External Bus
Interface
A/D converter
Advanced user debugger
Bus state controller
Cache memory
Compare match timer
Clock Pulse generator/Watch dog Timer
Central processing unit
Direct memory access controller
DSP
UBC
AUD
INTC
CPG/
WDT
DMAC
I/O port
DSP:
H-UDI:
INTC:
SCIF:
UBC:
MTU:
USB :
IIC2:
CMT
MTU
SCIF
Peripheral-BUS
Digital signal processor
User debugging interface
Interrupt controller
Serial communication interface
User break controller
Multi-Function Timer Pulse unit
USB function module
2
C bus interface
I
ADC
H-UDI
IIC2
Figure 1.1 Block Diagram
Rev. 4.00 Sep. 14, 2005 Page 7 of 982
REJ09B0023-0400
Section 1 Overview
1.3 Pin Assignments
The pin assignments of this LSI is shown in figure 1.2.
2 3 4 5 6 7 8 9 1011121314151617181920
1
A
B
C
D
E
F
G
H
J
K
L
M
N
P
R
T
U
V
W
Y
1 2 3 4 5 6 7 8 9 10111213141516171819
SH7641
BGA-256
(Top view)
A
B
C
D
E
F
G
H
J
K
L
M
N
P
R
T
U
V
W
Y
20
Figure 1.2 Pin Assignments (BGA-256)
Rev. 4.00 Sep. 14, 2005 Page 8 of 828
REJ09B0023-0400
Section 1 Overview
1.4 Pin functions
Table 1.2 summarizes the pin functions.
Table 1.2 Pin functions
No.
(BGA256) Pin Name Description
B2 D7 Data bus
C2 D6 Data bus
D2 D5 Data bus
B1 D4 Data bus
E2 D3 Data bus
E3 D2 Data bus
C1 VssQ Ground for I/O circuits (0V)
D3 D1 Data bus
D1 VccQ Power supply for I/O circuits (3.3V)
E4 D0 Data bus
F2 CS3/PTA[3] Chip select 3/Port A
F3 Vss Ground (0V)
E1 CS2/PTA[2] Chip select 2/Port A
F4 Vcc Power supply (1.8V)
G2 UCLK/PTB[0] USB external input clock/Port B
G3 VBUS/PTB[1] USB power detection/Port B
F1 SUSPND/PTB[2] USB suspend/Port B
G4 XVDATA/PTB[3] Receive data input from USB differential receiver/Port B
H2 TXENL/PTB[4] USB output enable/Port B
H3 VccQ Power supply for I/O circuits (3.3V)*
G1 DP D+
H1 DM DH4 VssQ Power supply for US I/O circuits (0V)*
J3 TXDMNS/PTB[5] D- Transmit output for USB transceiver/Port B
J2 TXDPLS/PTB[6] D+ Transmit output for USB transceiver/Port B
Y1 SCK0/PTH[0] Serial clock 0/Port H
W2 CTS0/PTH[1] Transmit clear 0/Port H
W3 TxD0/PTH[2] Transmit data 0/Port H
W4 RxD0/PTH[3] Receive data 0/Port H
Y2 RTS0/PTH[4] Transmit request 0/Port H
W5 SCK1/PTH[5] Serial clock 1/Port H
V5 CTS1/PTH[6] Transmit clear 1/Port H
Y3 TxD1/PTH[7] Transmit data 1/Port H
V4 RxD1/PTH[8] Receive data 1/Port H
Y4 RTS1/PTH[9] Transmit request 1/Port H
U5 SCK2/PTH[10] Serial clock 2/Port H
W6 CTS2/PTH[11] Transmit clear 2/Port H
V6 Vss Ground (0V)
Y5 TxD2/PTH[12] Transmit data 2/Port H
U6 Vcc Power supply (1.8V)
W7 RxD2/PTH[13] Receive data 2/Port H
V7 VccQ Power supply for I/O circuits (3.3V)
Y6 RTS2/PTH[14] Transmit request 2/Port H
U7 VssQ Ground for I/O circuits (0V)
W8 TIOC4D/PTE[0] Timer input output 4D/Port E
V8 TIOC4C/PTE[1] Timer input output 4C/Port E
Y7 TIOC4B/PTE[2] Timer input output 4B/Port E
U8 TIOC4A/PTE[3] Timer input output 4A/Port E
Y8 TIOC3D/PTE[4] Timer input output 3D/Port E
V9 TIOC3B/PTE[6] Timer input output 3B/Port E
Section 1 Overview
Rev. 4.00 Sep. 14, 2005 Page 11 of 982
REJ09B0023-0400
Section 1 Overview
No.
(BGA256) Pin Name Description
W9 TIOC3C/PTE[5] Timer input output 3C/Port E
U9 TIOC3A/PTE[7] Timer input output 3A/Port E
Y9 TIOC2B/PTE[8] Timer input output 2B/Port E
V10 Vss Ground (0V)
W10 TIOC2A/PTE[9] Timer input output 2A/Port E
U10 Vcc Power supply (1.8V)
Y10 TIOC1B/PTE[10] Timer input output 1B/Port E
Y11 TIOC1A/PTE[11] Timer input output 1A/Port E
U11 TIOC0D/PTE[12] Timer input output 0D/Port E
Y12 TIOC0C/PTE[13] Timer input output 0C/Port E
V11 TIOC0B/PTE[14] Timer input output 0B/Port E
W11 TIOC0A/PTE[15] Timer input output 0A/Port E
U12 VssQ Ground for I/O circuits (0V)
Y13 TCLKD/PTF[8] Timer Clock Input D/Port F
V12 VccQ Power supply for I/O circuits (3.3V)
W12 TCLKC/PTF[9] Timer Clock Input C/Port F
U13 TCLKB/PTF[10] Timer Clock Input B/Port F
Y14 TCLKA/PTF[11] Timer Clock Input A/Port F
V13 POE0/PTF[12] Port output enable input 0/Port F
W13 POE1/PTF[13] Port output enable input 1/Port F
U14 POE2/PTF[14] Port output enable input 2/Port F
Y15 POE3/PTF[15] Port output enable input 3/Port F
V14 PTF[0] Port F
Y16 PTF[1] Port F
U15 PTF[2] Port F
W14 PTF[3] Port F
V15 PTF[4] Port F
Y17 PTF[5] Port F
U16 Vcc Power supply (1.8V)
W15 PTF[6] Port F
U17 Vss Ground (0V)
Rev. 4.00 Sep. 14, 2005 Page 12 of 828
REJ09B0023-0400
No.
(BGA256) Pin Name Description
Y18 VssQ Ground for I/O circuits (0V)
W17 PTF[7] Port F
Y19 VccQ Power supply for I/O circuits (3.3V)
V18 PTG[8] Port G
W16 SCL/PTG[9] Serial clock/Port G*
V16 SDA/PTG[10] Serial data/Port G*
U20 AVcc (AD) Power supply for A/D (3.3V)
T17 AN[7]/PTG[7] A/D converter input/Port G*
2
R19 VccQ*1 Power supply for I/O circuits (3.3V)*
R18 Vss Ground (0V)
T20 DREQ0/PTC[9] DMA request/Port C
R17 Vcc Power supply (1.8V)
P19 DREQ1/PTC[10] DMA request/Port C
P18 STATUS0/PTC[14] Processor status/Port C
R20 STATUS1/PTC[15] Processor status/Port C
P17 BREQ/PTC[6] Bus request/Port C
N19 BACK/PTC[7] Bus acknowledge/Port C
N18 VccQ*1 Power supply for I/O circuits (3.3V)*
P20 VccQ*1 Power supply for I/O circuits (3.3V)*
N17 ASEBRKAK/PTC[13] ASE brake acknowledge/Port C
J17 MD2 Clock mode set
H20 VccQ*1 Power supply for I/O circuits (3.3V)*
J18 MD0 Clock mode set
J19 CS6B/PTC[4] Chip select 6B/Port C
H17 VssQ Ground for I/O circuits (0V)
G20 CS6A/PTC[3] Chip select 6A/Port C
H18 VccQ Power supply for I/O circuits (3.3V)
H19 CS5B/PTC[2] Chip select 5B/Port C
G17 CS5A/PTC[1] Chip select 5A/Port C
F20 CS4/PTC[0] Chip select 4/Port C
G18 WAIT Hardware wait request
E20 CS0 Chip select 0
F17 BS Bus cycle start
G19 TEND/PTC[8] DMA transfer end/Port C
F18 FRAME/PTC[5] FRAME output/Port C
D20 RD Read strobe
E17 Vcc Power supply (1.8V)
1
Rev. 4.00 Sep. 14, 2005 Page 14 of 828
REJ09B0023-0400
No.
(BGA256) Pin Name Description
F19 DACK0/PTC[11] DMA request acknowledge/Port C
D17 Vss Ground (0V)
C20 VssQ Ground for I/O circuits (0V)
D19 DACK1/PTC[12] DMA request acknowledge/Port C
B20 VccQ Power supply for I/O circuits (3.3V)
C18 D31/PTD[15] Data bus/Port D
E19 D30/PTD[14] Data bus/Port D
E18 D29/PTD[13] Data bus/Port D
D18 D28/PTD[12] Data bus/Port D
C19 D27/PTD[11] Data bus/Port D
A20 D26/PTD[10] Data bus/Port D
B19 D25/PTD[9] Data bus/Port D
B18 D24/PTD[8] Data bus/Port D
B17 D23/PTD[7] Data bus/Port D
A19 D22/PTD[6] Data bus/Port D
B16 D21/PTD[5] Data bus/Port D
C16 D20/PTD[4] Data bus/Port D
A18 VssQ Ground for I/O circuits (0V)
C17 D19/PTD[3] Data bus/Port D
A17 VccQ Power supply for I/O circuits (3.3V)
D16 D18/PTD[2] Data bus/Port D
B15 D17/PTD[1] Data bus/Port D
C15 Vss Ground (0V)
A16 D16/PTD[0] Data bus/Port D
D15 Vcc Power supply (1.8V)
B14 CKIO2 System clock output
C14 VccQ Power supply for I/O circuits (3.3V)
A15 CKIO System clock for I/O circuits
D14 VssQ Ground for I/O circuits (0V)
B13 RD/WR Read/Write
C13 VccQ Power supply for I/O circuits (3.3V)
Section 1 Overview
Rev. 4.00 Sep. 14, 2005 Page 15 of 982
REJ09B0023-0400
Section 1 Overview
No.
(BGA256) Pin Name Description
A14 WE0/DQMLL D7 to D0 Select signal/DQM (SDRAM)
D13 VssQ Ground for I/O circuits (0V)
A13 WE1/DQMLU D15 to D8 Select signal/DQM (SDRAM)
C12 CASU/PTA[5] CAS for Upper-32M-byte address/Port A
B12 WE3/DQMUU/AH D31 to D24 Select signal/DQM (SDRAM)/
Address hold (MPX)
D12 RASU/PTA[7] RAS for Upper-32M-byte address/Port A
A12 WE2/DQMUL D23 to D16 Select signal/DQM (SDRAM)
C11 Vss Ground (0V)
B11 CKE/PTA[1] CK enable/Port A
D11 Vcc Power supply (1.8V)
A11 CASL/PTA[4] CAS for Lower-32M-byte address/Port A
A10 RASL/PTA[6] RAS for Lower-32M-byte address/Port A
D10 A17 Address bus
A9 A16 Address bus
C10 A15 Address bus
B10 A14 Address bus
D9 A13 Address bus
A8 A12 Address bus
C9 A11 Address bus
B9 A10 Address bus
D8 VssQ Ground for I/O circuits (0V)
A7 A9 Address bus
C8 VccQ Power supply for I/O circuits (3.3V)
B8 A8 Address bus
D7 A7 Address bus
A6 A6 Address bus
C7 A5 Address bus
A5 A4 Address bus
D6 A3 Address bus
B7 A2 Address bus
Rev. 4.00 Sep. 14, 2005 Page 16 of 828
REJ09B0023-0400
Section 1 Overview
No.
(BGA256) Pin Name Description
C6 A1 Address bus
A4 A0/PTA[0] Address bus/Port A
D5 Vcc Power supply (1.8V)
B6 D15 Data bus
D4 Vss Ground (0V)
A3 VssQ Ground for I/O circuits (0V)
B4 D14 Data bus
A2 VccQ Power supply for I/O circuits (3.3V)
C3 D13 Data bus
B5 D12 Data bus
C5 D11 Data bus
C4 D10 Data bus
B3 D9 Data bus
A1 D8 Data bus
Notes: Treatment of unused pins: All the I/O buffers except PTG10, PTG9, and PTG 7 to PTG 0
(IIC2 and analog pins) have weak keepers. Weak-keeper circuits are provided on
input/output pins, and fix the pin inputs to high or low level when the pins are not driven
externally. Unused pins that are provided weak-keeper circuits need not to be fixed their
input levels. Fix unused pins that are not provided weak-keeper circuits to high or low level.
1. These pins are not real power supply for LSI, but each pin should be supplied each
specified voltage for correct action.
2. Weak-keeper circuits are not provided on the I/O buffer pins. Accordingly, pull the pins
up or down when they are not in use. Furthermore, do not apply intermediate voltages
to these pins when you are using them as port input pins.
3. H3 and H4 are a pair of power-supply pins located in the nearest position to the USB
module in this LSI.
Insert a bypass capacitor to the pair of pins to improve the electrical characteristic for
the USB input/output.
Rev. 4.00 Sep. 14, 2005 Page 17 of 982
REJ09B0023-0400
Section 1 Overview
Table 1.3 lists the pin functions.
Table 1.3 Pin Functions
Classification Symbol I/O Name Function
Power supply
Clock
Vcc I Power supply Power supply for the internal LSI.
Connect all Vcc pins to the system.
There will be no operation if any pins
are open.
Vss I Ground Ground pin. Connect all Vss pins to
the system power supply (0V). There
will be no operation if any pins are
open.
VccQ I Power supply Power supply for I/O pins. Connect
all VccQ pins to the system power
supply. There will be no operation if
any pins are open.
VssQ I Ground Ground pin. Connect all VssQ pins to
the system power supply (0V). There
will be no operation if any pins are
open.
Vcc (PLL1) I PLL1 power
supply
Power supply for the on-chip PLL1
oscillator
Vss (PLL1) I PLL1 ground Ground pin for the on-chip PLL1
oscillator
Vcc (PLL2) I PLL2 power
supply
Power supply for the on-chip PLL2
oscillator
Vcc (PLL2) I PLL2 ground Ground pin for the on-chip PLL2
oscillator
EXTAL I External clock Connected to a crystal resonator.
An external clock signal may also be
input to the EXTAL pin. For
examples of the connection of crystal
resonator or an external clock signal,
see section 4, Clock Pulse
Generator (CPG).
XTAL O Crystal Connected to a crystal resonator.
For examples of the connection of
crystal resonator or an external clock
signal, see section 4, Clock Pulse
Generator (CPG).
Rev. 4.00 Sep. 14, 2005 Page 18 of 828
REJ09B0023-0400
Section 1 Overview
Classification Symbol I/O Name Function
Clock
CKIO O System clock Supplies the system clock to external
devices.
CKIO2 O System clock Supplies the system clock to external
devices.
Operating mode
control
MD3, MD2,
MD0
I Mode set Sets the operating mode. Do not
change values on these pins during
operation.
MD2, MD0 set the clock mode, MD3
set the bus-width mode of area 0.
System control
RESETPI Power-on reset When low, this LSI enters the power-
on reset state.
RESETMI Manual reset When low, this LSI enters the
manual reset state.
STATUS1,
STATUS0
BREQ I Bus-mastership
O Status output Indicate that this LSI is in software
standby, reset, or sleep mode.
Low when an external device
request
requests the release of the bus
mastership.
BACK O Bus-mastership
request
acknowledge
Indicates that the bus mastership
has been released to an external
device. Reception of the BACK
signal informs the device which has
output the BREQ signal that it has
acquired the bus.
Interrupts
NMI I Non-maskable
interrupt
IRQ7 to IRQ0 I Interrupt requests
7 to 0
Non-maskable interrupt request pin.
Fix to high level when not in use.
Maskable interrupt request pin.
Selectable as level input or edge
input. The rising edge, falling edge,
and both edges are selectable as
edges.
Address bus A25 to A0 O Address bus Outputs addresses.
Data bus D31 to D0 I/O Data bus 32-bit bidirectional bus.
Bus control
CS0,
CS2 to CS4,
CS5A, CS5B,
O Chip select 0,
2 to 4, 5A, 5B,
6A, 6B
Chip-select signal for external
memory or devices.
CS6A, CS6B
RD O Read Indicates reading of data from
external devices.
Rev. 4.00 Sep. 14, 2005 Page 19 of 982
REJ09B0023-0400
Section 1 Overview
Classification Symbol I/O Name Function
Bus control RD/WR O Read/write Read/write signal
BS O Bus start Bus-cycle start
WE3/DQMUU/
AH
O Byte specification Indicates that bits 31 to 24 of the
data in the external memory or
device are being written.
Selects D31 to D24 when SDRAM is
connected.
Address hold signal for address/data
multiplexed I/O.
WE2/DQMUL O Byte specification Indicates that bits 23 to 16 of the
data in the external memory or
device are being written.
Selects D23 to D16 when SDRAM is
connected.
WE1/DQMLU O Byte specification Indicates that bits 15 to 8 of the data
in the external memory or device are
being written.
Selects D15 to D8 when SDRAM is
connected.
WE0/DQMLL O Byte specification Indicates that bits 7 to 0 of the data
in the external memory or device are
being written.
Selects D7 to D0 when SDRAM is
connected.
RASU, RASLO RAS Connected to the RAS pin when the
SDRAM is connected.
CASU, CASLO CAS Connected to the CAS pin when the
SDRAM is connected.
CKE O CK enable Connected to the CKE pin when the
SDRAM is connected.
FRAMEO FRAME signal Connects the FRAME signal for the
burst MPX-IO interface.
WAITI Wait When active, inserts a wait cycle into
the bus cycles during access to the
external space.
Rev. 4.00 Sep. 14, 2005 Page 20 of 828
REJ09B0023-0400
Classification Symbol I/O Name Function
Direct memory
access controller
(DMAC)
DREQ0,
DREQ1
DACK0,
DACK1
I DMA-transfer
request
O DMA-transfer
request receive
Input pin for external requests for
DMA transfer.
Output pin for request receive, in
response to external requests for
DMA transfer.
User debugging
interface
(H-UDI)
TEND0 O DMA-transfer end
output
TCK I Test clock Test-clock input pin.
TMS I Test mode select Inputs the test-mode select signal.
Output pin for DMA transfer end
signal
TDI I Test data input Serial input pin for instructions and
data.
TDO O Test data
output
Serial output pin for instructions and
data.
TRSTI Test reset Initialization-signal input pin.
Advanced user
debugger
(AUD)
AUDATA3 to
AUDATA0
AUDCK O AUD clock Sync-clock output pin in AUD-trace
O AUD data Data output pins in AUD-trace mode.
mode.
AUDSYNCO AUD sync
signal
Data start-position acknowledgesignal output pin in AIUD-trace
mode.
E10A interface
ASEBRKAK O Break mode
acknowledge
Indicates that the E10A emulator has
entered its break mode.
For the connection with the E10A,
see the SH7641 E10A Emulator
User's Manual (tentative title).
ASEMD0I ASE mode Sets the ASE mode.
SCL I/O Serial clock pin Serial clock input/output pin I2C bus interface 2
SDA I/O Serial data pin Serial data input/output pin
Section 1 Overview
Rev. 4.00 Sep. 14, 2005 Page 21 of 982
REJ09B0023-0400
Section 1 Overview
Classification Symbol I/O Name Function
Multi function timerpulse unit (MTU)
TCLKA
TCLKB
I Clock input External clock input pins
TCLKC
TCLKD
TIOC0A
TIOC0B
TIOC0C
I/O Input capture/
output compare
match
The TGRA_0 to TGRD_0 input
capture input/output compare
output/PWM output pins.
TIOC0D
TIOC1A
TIOC1B
TIOC2A
TIOC2B
TIOC3A
TIOC3B
TIOC3C
I/O Input capture/
output compare
match
I/O Input capture/
output compare
match
I/O Input capture/
output compare
match
The TGRA_1 to TGRB_1 input
capture input/output compare
output/PWM output pins.
The TGRA_2 to TGRB_2 input
capture input/output compare
output/PWM output pins.
The TGRA_3 to TGRD_3 input
capture input/output compare
output/PWM output pins.
TIOC3D
TIOC4A
TIOC4B
TIOC4C
I/O Input capture/
output compare
The TGRA_4 to TGRB_4 input
capture input/output compare
output/PWM output pins
TIOC4D
Port output enable
(POE)
POE3 to
POE0
I Port output
enable
Request signal input to set the high
current pins to the high impedance
status
Serial
communication
interface with FIFO
(SCIF)
SCK0
SCK1
SCK2
RxD0
I/O Serial clock Clock input/output pins
I Received data Data input pins
RxD1
RxD2
TxD0
O Transmitted data Data output pins
TxD1
TxD2
RTS0
I/O Request to send Request to send
RTS1
RTS2
CTS0
I/O Clear to send Clear to send
CTS1
CTS2
Rev. 4.00 Sep. 14, 2005 Page 22 of 828
REJ09B0023-0400
Section 1 Overview
Classification Symbol I/O Name Function
USB function
module
XVDATA I Data input Input pin for receive data from USB
differential receiver
DPLS I D+ input Input pin for D+ signal from USB
receiver
DMNS I D- input Input pin for D- signal from USB
receiver
TXDPLS O D+ output D+ transmit output pin to USB
transceiver
TXDMNS O D- output D- transmit output pin to USB
transceiver
TXENL O Output enable Output enable pin to USB
transceiver
VBUS I USB power
USB cable connection monitor pin
supply monitor
SUSPND O Suspend USB transceiver suspend state
output pin
UCLK I USB clock USB clock input pin (48 MHz input)
DP I/O D+ input/output Input/output pin for D+ signal to/from
transceiver
DM I/O D- input/output Input/output pin for D- signal to/from
transceiver
A/D converter AN7 to AN0 I Analog input pins Analog input pins
AVcc I Analog power
supply for the
Power supply pin for the A/D
converter
A/D converter
AVss I Analog ground
for the A/D
The ground pin for the A/D
converter.
converter
Rev. 4.00 Sep. 14, 2005 Page 23 of 982
REJ09B0023-0400
Section 1 Overview
Classification Symbol I/O Name Function
I/O ports
PTA14 to
PTA0
PTB8 to
PTB0
PTC15 to
PTC0
PTD15 to
PTD0
PTE15 to
PTE0
PTF15 to
PTF0
PTG13 to
PTG8
PTG7 to
I/O General purpose
port
I/O General purpose
port
I/O General purpose
port
I/O General purpose
port
I/O General purpose
port
I/O General purpose
port
General purpose
I/O
port
I
15 bits general purpose input/output
pins
9 bits general purpose input/output
pins
16 bits general purpose input/output
pins.
16 bits general purpose input/output
pins
16 bits general purpose input/output
pins
16 bits general purpose input/output
pins
14 bits general purpose input/output
and input pins
PTG0
PTH14 to
PTG0
PTJ12 to
PTG0
I/O General purpose
port
I/O General purpose
port
15 bits general purpose input/output
pins
13 bits general purpose input/output
pins
Rev. 4.00 Sep. 14, 2005 Page 24 of 828
REJ09B0023-0400
Section 2 CPU
Section 2 CPU
2.1 Registers
This LSI has the same registers as the SH-3. In addition, this LSI also supports the same DSPrelated registers as in the SH-DSP. The basic software-accessible registers are divided into four
distinct groups:
• General registers
• Control registers
• System registers
• DSP registers
With the exception of some DSP registers, all of these registers are 32-bit width. The general
registers are accessible, with R0 to R7 banked to provide access to a separate set of R0 to R7
registers (i.e. R0 to R7_BANK0, and R0 to R7_BANK1)
register bank (RB) bit in the status register (SR) defines which set of banked registers (R0 to
R7_BANK0 or R0 to R7_BANK1) are accessed as general registers, and which are accessed only
by LDC/STC instructions.
depending on the value of the RB bit. The
The control registers can be accessed by LDC/STC instructions. Control registers are:
• SR: Status register
• SSR: Saved status register
• SPC: Saved program counter
• GBR: Global base register
• VBR: Vector base register
• RS: Repeat start register (DSP mode only)
• RE: Repeat end register (DSP mode only)
• MOD: Modulo register (DSP mode only)
Rev. 4.00 Sep. 14, 2005 Page 25 of 982
REJ09B0023-0400
Section 2 CPU
The system registers are accessed by the LDS/STS instructions (the PC is software-accessible, but
is included here because its contents are saved in, and restored from, SPC in exception handling).
The system registers are:
• MACH: Multiply and accumulate high register
• MACL: Multiply and accumulate low register
• PR: Procedure register
• PC: Program counter
This section explains the usage of these registers in different modes.
Figures 2.1 and 2.2 show the register configuration in each processing mode.
The DSP mode is switched by means of the DSP bit in the status register.
Notes: 1. The R0 register is used as an index register in indexed register indirect addressing mode
and indexed GBR indirect addressing mode.
2. Bank register
Accessed as a general register when the RB bit is set to 1 in the SR register.
Accessed only by LDC/STC instructions when the RB bit is cleared to 0.
3. Bank register
Accessed as a general register when the RB bit is cleared to 0 in the SR register.
Accessed only by LDC/STC instructions when the RB bit is set to 1.
Figure 2.1 Register Configuration in Each Processing Mode (1)
Rev. 4.00 Sep. 14, 2005 Page 27 of 982
REJ09B0023-0400
Section 2 CPU
39
32 31
A0G
A1G
(c) DSP mode register configuration (DSP = 1)
A0
A1
M0
M1
X0
X1
Y0
Y1
DSR
MS
ME
MOD
0
Figure 2.2 Register Configuration in Each Processing Mode (2)
Register values after a reset are shown in table 2.1.
Table 2.1 Initial Register Values
Type Registers Initial Value*
General registers R0 to R15 Undefined
Control registers SR RB bit = 1, BL bit = 1, I3 to I0 = 1111 (H'F),
The reserved bits other than bit 30 are all 0;
bit 30 is 1, others undefined
GBR, SSR, SPC Undefined
VBR H'00000000
RS, RE Undefined
MOD Undefined
System registers MACH, MACL, PR Undefined
PC H'A0000000
DSP registers A0, A0G, A1, A1G, M0, M1,
X0, X1, Y0, Y1
DSR H'00000000
Note: * Initialized by a power-on or manual reset.
Undefined
Rev. 4.00 Sep. 14, 2005 Page 28 of 982
REJ09B0023-0400
Section 2 CPU
2.1.1 General Registers
There are sixteen 32-bit general registers (Rn), designated R0 to R15. The general registers are
used for data processing and address calculation.
With SuperH microcomputer type instructions, R0 is used as an index register. With a number of
instructions, R0 is the only register that can be used.
With DSP type instructions, eight of the sixteen general registers are used for addressing of X and
Y data memory and data memory (single data) that uses the L-bus.
To access X memory, R4 and R5 are used as the X address register [Ax] and R8 is used as the X
index register [Ix]. To access Y memory, R6 and R7 are used as the Y address register [Ay] and
R9 is used as the Y index register [Iy]. To access single data that uses the L-bus, R2, R3, R4, and
R5 are used as the single data address register [As] and R8 is used as the single data index register
[Is].
Figure 2.3 shows the general registers, which are identical to those of the SH3, when DSP
extension is disabled.
31
2
R0*1,*
2
R1*
2
R2*
2
R3*
2
R4*
2
R5*
2
R6*
2
R7*
R8
R9
R10
R11
R12
R13
R14
R15
0
General Registers (when not in DSP mode)
Notes: 1. R0 functions as an index register in the indexed
register-indirect addressing mode and indexed
GBR-indirect addressing mode. In some
instructions, only R0 can be used as the source
register or destination register.
2. R0 to R7 are banked registers. SR.RB specifies
BANK.
SR.RB = 0; BANK0 is used
SR.RB = 1; BANK1 is used
Figure 2.3 General Registers (Not in DSP Mode)
Rev. 4.00 Sep. 14, 2005 Page 29 of 982
REJ09B0023-0400
Section 2 CPU
On the other hand, registers R2 to R9 are also used for DSP data address calculation when DSP
extension is enabled (see figure 2.4). Other symbols that represent the purpose of the registers in
DSP type instructions is shown in [ ].
31
R0
R1
R2 [As]
R3 [As]
R4 [As, Ax]
R5 [As, Ax]
R6 [Ay]
R7 [Ay]
R8 [Ix, Is]
R9 [Iy]
R10
R11
R12
R13
R14
R15
0
General Registers (DSP mode enabled)
X or Y data transfer operation
R4, 5 [Ax]: Address register set for X data memory.
R8 [x]: Index register for address register set Ax.
R6, 7 [Ay]: Address register set for Y data memory.
R9 [Iy]: Index register for address register set Ay.
Single data transfer operation
R2 to 5 [As]: Address register set for memory.
R8 [Is]: Index register for address register set As.
Figure 2.4 General Registers (DSP Mode)
DSP type instructions can access X and Y data memory simultaneously. To specify addresses for
X and Y data memory, two address pointer sets are provided. These are:
R8[Ix], R4,5[Ax] for X memory access, and R9[Iy], R6,7[Ay] for Y memory access.
The symbols R2 to R9 are used by the assembler, but users can use other register names (aliases)
that indicate the purpose of the register in the DSP instruction. The coding in assembler is as
follows.
Ix: .REG (R8)
The name Ix is the alias for R8. Other aliases are as follows.
Ax0: .REG (R4)
Ax1: .REG (R5)
Ix: .REG (R8)
Ay0: .REG (R6)
Rev. 4.00 Sep. 14, 2005 Page 30 of 982
REJ09B0023-0400
Section 2 CPU
Ay1: .REG (R7)
Iy: .REG (R9)
As0: .REG (R4) ; This is optional, if another alias is required for single data transfer.
As1: .REG (R5) ; This is optional, if another alias is required for single data transfer.
As2: .REG (R2)
As3: .REG (R3)
Is: .REG (R8) ; This is optional, if another alias is required for single data transfer.
2.1.2 Control Registers
This LSI has 8 control registers: SR, SSR, SPC, GBR, VBR, RS, RE, and MOD (figure 2.5). SSR,
SPC, GBR and VBR are the same as the SH-3 registers. The DSP mode is activated only when
SR.DSP = 1.
Repeat start register RS, repeat end register RE, and repeat counter RC (12-bit part of SR) and
repeat control bits RF0 and RF1 are new registers and control bits which are used for repeat
control. Modulo register MOD and modulo control bits DMX and DMY in SR are also new
register and control bits.
In SR, there are six additional control bits: RC11 to RC0, RF0, RF1, DMX, DMY and DSP. DMX
and DMY are used for modulo addressing control. If DMX is 1, the modulo addressing mode is
effective for the X memory address pointer, Ax (R4 or R5). If DMY is 1, the modulo addressing
mode is effective for the Y memory address pointer, Ay (R6 or R7). However, both X and Y
address pointers cannot be operated in modulo addressing mode even though both DMX and
DMY bits are set. The case where DMX = DMY = 1 is reserved for future expansion. If both
DMX and DMY are set simultaneously, the hardware will provisionally treat only the Y address
pointer as the modulo addressing mode pointer. Modulo addressing is available for X and Y data
transfer operations (MOVX and MOVY), but not for a sing le d a ta transfer operation (MOVS).
RF1 and RF0 hold information on the number of repeat steps, and are set when a SETRC
instruction is executed. When RF1 and RF0 = 00, the current repeat module consists of one
instruction step. RF1 and RF0 = 01 means two instruction steps, RF1 and RF0 = 11 means three
instruction steps, and RF1 and RF0 = 10 means the current repeat module consists of four or more
instructions.
Although RC11 to RC0 and RF1 and RF0 can be changed by a store/load to SR, use of the
dedicated manipulation instruction SETRC is recommended.
SR also has a 12-bit repeat counter, RC, which is used for efficient loop control. The repeat start
register (RS) and repeat end register (RE) are also provided for loop control. They hold the start
Rev. 4.00 Sep. 14, 2005 Page 31 of 982
REJ09B0023-0400
Section 2 CPU
and end addresses of a loop (the contents of the RS and RE registers are slightly different from the
actual loop start and end addresses).
The modulo register, MOD, is provided to implement modulo addressing for circular data
buffering. MOD holds the modulo start address (MS) and modulo end address (ME).
In order to access RS, RE and MOD, load/store (control register) instructions for these registers
are provided. An example for RS is as follows:
LDC Rm,RS; Rm -> RS
LDC.L @Rm+,RS; (Rm) -> RS, Rm+4 -> Rm
STC RS,Rn; RS -> Rn
STC.L RS,@-Rn; Rn-4 -> Rn, RS -> (Rn)
Address set instructions for RS and RE are also provided.
LDRS @(disp,PC); disp × 2 + PC -> RS
LDRE @(disp,PC); disp × 2 + PC -> RE
Rev. 4.00 Sep. 14, 2005 Page 32 of 982
REJ09B0023-0400
Section 2 CPU
31
0 1RC0-0
RB bit: Register bank bit; used to define the general registers.
RB = 1: R0_BANK1 to R7_BANK1 are used as general registers.
R0_BANK0 to R7_BANK0 accessed by LDC/STC instructions.
RB = 0: R0_BANK0 to R7_BANK0 are used as general registers.
R0_BANK1 to R7_BANK1 accessed by LDC/STC instructions.
BL bit: Block bit; used to mask exception.
BL = 1: Interrupts are masked (not accepted)
BL = 0: Interrupts are accepted
RC [11:0]: 12-bit repeat counter
DSP bit: DSP operation mode
DSP = 1: DSP instructions (LDS Rm, DSR/A0/X0/X1/Y0/Y1,
LDS.L @Rm+, DSR/A0/X0/X1/Y0/Y1, STS DSR/A0/X0/X1/Y0/Y1, Rn,
STS.L DSR/A0/X0/X1/Y0/Y1, @–Rn, LDC Rm, RS/RE/MOD,
LDC.L @Rm+, RS/RE/MOD, STC RS/RE/MOD,Rn, STC.L RS/RE/MOD, @–Rn,
LDRS, LDRE, SETRC, MOVS, MOVX, MOVY, Pxxx) are enabled.
DSP = 0: All DSP instructions are treated as illegal instructions; only SH3 instructions are
suppor ted.
DMY bit: Modulo addressing enable for Y side
DMX bit: Modulo addressing enable for X side
Q, M bit: Used by DIV0U/S and DIV1 instructions.
I [3:0]: 4-bit field indicating the interrupt request mask level.
RF [1:0]: Used for repeat control
S bit: Used by the MAC instructions and DSP data.
T bit: The MOVT, CMP/cond, TAS, TST, BT, BF, SETT, CLRT and DT instructions use the T bit to indicate true
Reserved bits: A fixed value (either 0 or 1) is read from each of the bits. When writing, write the values shown in the
28 2716 15 13 12 11 10 9 8 7 6 5 4 3 2 10
DSP
DMY DMX M Q I3 I2 I1 I0
(logic one) or false (logic zero). The ADDV/C, SUBV/C, DIV0U/S, DIV1, NEGC, SHAR/L, SHLR/L,
ROTR/L and ROTCR/L instructions also use the T bit to indicate a carry, borrow, overflow, or underflow.
above register. Operation is not guaranteed if a value other than that given above is written to the
reserved bits.
RF1 RF0
STRB BL
SR (Status register)
Figure 2.5 Control Registers (1)
Rev. 4.00 Sep. 14, 2005 Page 33 of 982
REJ09B0023-0400
Section 2 CPU
310
SSR
310
SPC
310
GBR
310
VBR
310
RS
310
RE
3116 150
MOD
ME: Modulo end address, MS: Modulo start address
Saved status register (SSR)
Stores current SR value at time of exception to indicate processor status when returning to instruction stream from
exception handler.
Saved program counter (SPC)
Stores current PC value at time of exception to indicate return address on completion of exception handling.
Global base register (GBR)
Stores base address of GBR-indirect addressing mode. The GBR-indirect addressing mode is used for data transfer
and logical operations on the on-chip peripheral module register area.
Vector base register (VBR)
Stores base address of exception vector area.
Repeat start register (RS)
Used in DSP mode only. Indicates start address of repeat loop.
Repeat end register (RE)
Used in DSP mode only. Indicates address of repeat loop end.
Modulo register (MOD)
Used in DSP mode only.
MD[31:16]: ME: Modulo end address, MD[15:0]: Modulo start address.
In X/Y operand address generation, the CPU compares the address with ME, and if it is the same, loads MS in either
the X or Y operand address register (depending on bits DMX and DMY in the SR register).
MEMS
Saved status register (SSR)
Saved program counter (SPC)
Global base register
Vector base register
Repeat start register
Repeat end register
Modulo register
Figure 2.5 Control Registers (2)
Rev. 4.00 Sep. 14, 2005 Page 34 of 982
REJ09B0023-0400
2.1.3 System Registers
This LSI has four system registers, MACL, MACH, PR and PC (figure 2.6).
Section 2 CPU
31
MACH
MACL
31
PR
31
PC
0
Multiply and accumulate high and low registers
(MACH and MACL)
Store the results of multiplicationand accumulation
operations.
0
Procedure register (PR)
Stores the subroutine procedure return address.
Program counter (PC)
0
Indicates the start address of the current instruction.
Figure 2.6 System Registers
The DSR, A0, X0, X1, Y0 and Y1 registers are also treated as system registers. Therefore,
instructions for data transfer between general registers and system registers are supported for these
registers.
2.1.4 DSP Registers
This LSI has eight data registers and one control register as DSP registers (figure 2.7). The data
registers are 32-bit width with the exception of registers A0 and A1. Registers A0 and A1 include
8 guard bits (fields A0G and A1G), giving them a total width of 40 bits.
Three kinds of operation access the DSP data registers. The first is DSP data processing. When a
DSP fixed-point data operation uses A0 or A1 as the source register, it uses the guard bits (bits 39
to 32). When it uses A0 or A1 as the destination register, guard bits 39 to 32 are valid. When a
DSP fixed-point data operation uses a DSP register other than A0 or A1 as the source register, it
sign-extends the source value to bits 39 to 32. When it uses one of these registers as the
destination register, bits 39 to 32 of the result are discarded.
The second kind of operation is an X or Y data transfer operation, "MOVX.W" or "MOVY.W".
This operation accesses the X and Y memories through the 16-bit X and Y data buses (figure 2.8).
The register to be loaded or stored by this operation always comprises the upper 16 bits (bits 31 to
16). X0 or X1 can be the destination of an X memory load and Y0 or Y1 can be the desti nati on o f
a Y memory load, but no other register can be the destination register in this operation.
Rev. 4.00 Sep. 14, 2005 Page 35 of 982
REJ09B0023-0400
Section 2 CPU
When data is read into the upper 16 bits of a register (bits 31 to 16), the lower 16 bits of the
register (bits 15 to 0) are automatically cleared. A0 and A1 can be stored in the X or Y memory by
this operation, but no other registers can be stored.
The third kind of operation is a single-data transfer instruction, "MOVS.W" or "MOVS.L". These
instructions access any memory location through the LDB (figure 2.8). All DSP registers connect
to the LDB and can be the source or destination register of the data transfer. These instructions
have word and longword access modes. In word mode, registers to be loaded or stored by this
instruction comprise the upper 16 bits (bits 31 to 16) for DSP registers except A0G and A1G.
When data is loaded into a register other than A0G and A1G in word mode, the lower half of the
register is cleared. When A0 or A1 is used, the data is sign-extended to bits 39 to 32 and the lower
half is cleared. When A0G or A1G is the destination register in word mode, data is loaded into an
8-bit register, but A0 or A1 is not cleared. In longword mode, when the destination register is A0
or A1, it is sign-extended to bits 39 to 32.
Tables 2.2 and 2.3 show the data type of registers used in DSP instructions. Some instructions
cannot use some registers shown in the tables because of instruction code limitations. For
example, PMULS can use A1 as the source register, but cannot use A0. These tables ignore details
of register selectability.
Rev. 4.00 Sep. 14, 2005 Page 36 of 982
REJ09B0023-0400
Section 2 CPU
Table 2.2 Destination Register in DSP Instructions
Note: * The data is sign-extended and input to the ALU.
40-bit data
Sign* 32-bit data X0, X1
Rev. 4.00 Sep. 14, 2005 Page 38 of 982
REJ09B0023-0400
Section 2 CPU
313239
A0A0G
A1G
(a) DSP Data Registers
(b) DSP Status Register (DSR)
Reset status
DSR: All zeros
Others: Undefined
A1
M0
M1
X0
X1
Y0
Y1
831
Figure 2.7 DSP Registers
16 bits
16 bits
8 bits32 bits
MOVS.W,
MOVS.L
A0G
A1G
DSR
MOVX.W
32039
07
MOVY.W
3116
0
01234567
DCCS [2:0]VNZGT
LDB
XDB
YDB
MOVS.W,
MOVS.L
A0
A1
M0
M1
X0
X1
Y0
Y1
Figure 2.8 Connections of DSP Registers and Buses
Rev. 4.00 Sep. 14, 2005 Page 39 of 982
REJ09B0023-0400
Section 2 CPU
The DSP unit has one control register, the DSP status register (DSR). DSR holds the status of DSP
data operation results (zero, negative, and so on) and has a DC bit which is similar to the T bit in
the CPU. The DC bit indicates one of the status flags. A DSP data processing instruction controls
its execution based on the DC bit. This control affects only the operations in the DSP unit; it
controls the update of DSP registers only. It cannot control operations in the CPU, such as address
register updating and load/store operations. Control bits CS2 to CS0 specify the condition to be
reflected in the DC bit.
Unconditional DSP type data operations, except PMULS, MOVX, MOVY and MOVS, update the
condition flags and DC bit, but no CPU instructions, including MAC instructions, update th e DC
bit. Conditional DSP type instructions do NOT update DSR either.
Rev. 4.00 Sep. 14, 2005 Page 40 of 982
REJ09B0023-0400
Section 2 CPU
Table 2.4 DSR Register Bits
Bits Name (Abbreviation) Function
31 to 8 Reserved bits 0: Always read as 0; always use 0 as the write value
7 Signed Greater Than bit (GT) Indicates that the operation result is positive (except 0),
or that operand 1 is greater than operand 2
1: Operation result is positive, or operand 1 is greater
than operand 2
6 Zero bit (Z) Indicates that the operation result is zero (0), or that
operand 1 is equal to operand 2
1: Operation result is zero (0), or operands are equal
5 Negative bit (N) Indicates that the operation result is negative, or that
operand 1 is smaller than operand 2
1: Operation result is negative, or operand 1 is smaller
than operand 2
4 Overflow bit (V) Indicates that the operation result has overflowed
1: Operation result has overflowed
3 to 1 Condition Select bits (CS) Designate the mode for selecting the operation result
status to be set in the DC bit
Do not set these bits to 110 or 111
000: Carry/borrow mode
001: Negative value mode
010: Zero mode
011: Overflow mode
100: Signed greater mode
101: Signed greater than or equal to mode
0 DSP Condition bit (DC) Sets the status of the operation result in the mode
designated by the CS bits
0: Designated mode status has not occurred (false)
1: Designated mode status has occurred
Note: After execution of a PADDC/PSUBC instruction, the DC bit sets the status of the operation
result in carry/borrow mode regardless of the CS bits.
Rev. 4.00 Sep. 14, 2005 Page 41 of 982
REJ09B0023-0400
Section 2 CPU
DSR is assigned as a system register and the following load/store instructions are provided:
STS DSR,Rn;
STS.L DSR,@-Rn;
LDS Rn,DSR;
LDS.L @Rn+,DSR;
When DSR is read by an STS instruction, the upper bits (bits 31 to 8) are all 0.
2.2 Data Formats
2.2.1 Register Data Format (Non-DSP Type)
Register operands are always longwo rds (32 bits) (figure 2.9). When the memory operand is only
a byte (8 bits) or a word (16 bits), it is sign-extended into a longword when loaded into a register.
310
Longword
Figure 2.9 Longword Operand
2.2.2 DSP-Type Data Formats
This LSI has several different data formats that depend on the instruction. This section explains
the data formats for DSP type instructions.
Figure 2.10 shows three DSP-type data formats with different binary point positions. A CPU-type
data format with the binary point to the right of bit 0 is also shown for reference.
The DSP-type fixed point data format has the bina ry point between bit 31 and bit 30. The DSPtype integer format has the binary point between bit 16 and bit 15. The DSP-type logical format
does not have a binary point. The valid data le ngt h s of t he dat a for mat s d e pen d o n the in struct i o n
and the DSP register.
Rev. 4.00 Sep. 14, 2005 Page 42 of 982
REJ09B0023-0400
Section 2 CPU
DSP type fixed point
With guard bits
Without guard bits
Multiplier input
DSP type integer
With guard bits
Without guard bits
Shift amount for
arithmetic shift (PSHA)
Shift amount for
logical shift (PSHL)
DSP type logical
39
31 300
S
31 300
S
39
31 3016 15
S
39
32 310
S
310
S
31220
31210
393116 150
16 15
15
16
15
16
S
16
15
S
–28 to +28 – 2
–1 to +1 – 2
0
–1 to +1 – 2
–223 to +2
–215 to +2
–32 to +32
–16 to +16
–31
–31
–15
23
– 1
15
– 1
CPU type integer
Longword
S: Sign bit
: Binary point: Does not affect the operations
310
S
–231 to +2
31
– 1
Figure 2.10 Data Formats
The shift amount for the arithmetic shift (PSHA) instruction has a 7-bit field that can represent
values from –64 to +63, but –32 to +32 are valid numbers for the instruction. Also the shift
amount for a logical shift operation has a 6-bit field, but –16 to +16 are valid numbers for the
instruction.
Rev. 4.00 Sep. 14, 2005 Page 43 of 982
REJ09B0023-0400
Section 2 CPU
2.2.3 Memory Data Formats
Memory data formats are classified into byte, word, and longword. Byte data can be accessed
from any address, but an address error will occur if word data starting from an address other than
2n or longword data starting from an address other than 4n is accessed. In such cases, the data
accessed cannot be guaranteed (figure 2.11).
Address A + 1Address A + 3
Address AAddress A + 2
31015
Address A
Address A + 4
Address A + 8
237
Byte 0Byte 1Byte 2Byte 3
Word 1Word 0
Longword
Big-endian mode
Figure 2.11 Byte, Word, and Longword Alignment
2.3 Features of CPU Core Instructions
The CPU core instructions are RISC-type instructions with the following features:
Fixed 16-Bit Length: All instructions have a fixed length of 16 bits. This improves program code
efficiency.
One Instruction per State: Pipelining is used, and basic instructions can be executed in one state.
Data Size: The basic data size for operations is longword. Byte, word, or longword can be
selected as the memory access size. Memory byte or word data is sign-extended and operated on
as longword data. Immediate data is sign-extended to longword size for arithmetic operations or
zero-extended to longword size for logical operations.
Rev. 4.00 Sep. 14, 2005 Page 44 of 982
REJ09B0023-0400
Section 2 CPU
Table 2.5 Word Data Sign Extension
This LSI's CPU Description Example of Other CPU
MOV.W @(disp,PC),R1
ADD R1,R0
........
.DATA.W H'1234
Note: Immediate data is referenced by @(disp,PC).
Sign-extended to 32 bits, R1
becomes H'00001234, and is then
operated on by the ADD instruction.
ADD.W #H'1234,R0
Load/Store Architecture: Basic operations are executed between registers. In operations
involving memory, data is first loaded into a register (load/store architecture). However, bit
manipulation instructions such as AND are executed directly on memory.
Delayed Branching: Unconditional branch instructions, etc., are executed as delayed branches.
With a delayed branch instruction, the branch is made after execution of the instruction (called the
slot instruction) immediately following the delayed branch instruction. This minimizes disruption
of the pipeline when a branch is made.
With a delayed branch, the actual branch operation occurs after exe cution of the slot instruction.
However, instruction execution for register updating, etc., excluding the branch operation, is
performed in delayed branch instruction → delay slot instruction order. 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.6 Delayed Branch Instructions
This LSI's CPU Description Example of Other CPU
BRA TRGET
ADD R1,R0
ADD is executed before branch to
TRGET.
ADD.W R1,R0
BRA TRGET
Multiply/Multiply-and-Accumulate Operations: A 16 × 16 → 32 multiply operat i o n i s
executed in 1 to 2 states, and a 16 × 16 + 64 → 64 multiply-and-accumulate operation in 2 states.
A 32 × 32 → 64 multiply operation and a 32 × 32 + 64 → 64 multiply-and-accumulate operation
are each executed in 2 to 3 states.
T Bit: The result of a comparison is indicated by the T bit in the status register (SR), and a
conditional branch is performed according to whether the result is True or False. Processing speed
has been improved by keeping the number of instructions that modify the T bit to a minimum.
Rev. 4.00 Sep. 14, 2005 Page 45 of 982
REJ09B0023-0400
Section 2 CPU
Table 2.7 T Bit
This LSI's CPU Description Example of Other CPU
CMP/GE R1,R0
BT TRGET0
BF TRGET1
ADD #–1,R0
CMP/EQ #0,R0
BT TRGET
If R0 ≥ R1, the T bit is set.
A branch is made to TRGET0
if R0 ≥ R1, or to TRGET1 if R0 < R1.
The T bit is not set by ADD.
If R0 = 0, the T bit is set.
A branch is made if R0 = 0.
CMP.W R1,R0
BGE TRGET0
BLT TRGET1
SUB.W #1,R0
BEQ TRGET
Immediate Data: Byte immediate data is placed inside the instruction code. Word and longword
immediate data is not placed inside the instruction code, but in a table in memory. The table in
memory is referenced with an immediate data transfer instruction (MOV) using PC-relative
addressing mode with displacement.
Table 2.8 Immediate Data Referencing
Type This LSI's CPU Example of Other CPU
8-bit immediate MOV #H'12,R0 MOV.B #H'12,R0
16-bit immediate MOV.W @(disp,PC),R0
........
.DATA.W H'1234
32-bit immediate MOV.L @(disp,PC),R0
........
.DATA.L H'12345678
Note: Immediate data is referenced by @(disp,PC).
MOV.W #H'1234,R0
MOV.L #H'12345678,R0
Absolute Addresses: When data is referenced by an absolute address, the absolute address value
is placed in a table in memory beforehand. Using the method whereby immediate data is loaded
when an instruction is executed, this value is transferred to a register and the data is referenced
using register indirect addressing mode.
Rev. 4.00 Sep. 14, 2005 Page 46 of 982
REJ09B0023-0400
Section 2 CPU
Table 2.9 Absolute Address Referencing
Type This LSI's CPU Example of Other CPU
Absolute address MOV.L @(disp,PC),R1
MOV.B @R1,R0
........
.DATA.L H'12345678
MOV.B @H'12345678,R0
16-Bit/32-Bit Displacement: When data is referenced with a 16- or 32-bit displacement, the
displacement value is placed in a table in memory beforehand. Using the method whereby
immediate data is loaded when an instruction is executed, this value is transferred to a register and
the data is referenced using indexed register indirect addressing mode.
Table 2.10 Displacement Referencing
Type This LSI's CPU Example of Other CPU
16-bit displacement MOV.W @(disp,PC),R0
MOV.W @(R0,R1),R2
........
.DATA.W H'1234
MOV.W @(H'1234,R1),R2
Rev. 4.00 Sep. 14, 2005 Page 47 of 982
REJ09B0023-0400
Section 2 CPU
2.4 Instruction Formats
2.4.1 CPU Instruction Addressing Modes
The following table shows addressing modes and effective address calculation methods for
instructions executed by the CPU core.
Table 2.11 Addressing Modes and Effective Addresses for CPU Instructions
Addressing
Mode
Instruction
Format
Effective Address Calculation Method Calculation Formula
Register direct Rn Effective address is register Rn.
(Operand is register Rn contents.)
Register indirect @Rn Effective address is register Rn contents.
Rn
Register
indirect with
post-increment
Rn
@Rn+ Effective address is register Rn contents.
A constant is added to Rn after instruction
execution: 1 for a byte operand, 2 for a word
operand, 4 for a longword operand.
Rn
Register
indirect with
pre-decrement
Rn
Rn + 1/2/4
1/2/4
+
@–Rn Effective address is register Rn contents. It is
decremented by a constant beforehand: 1 for
a byte operand, 2 for a word operand, 4 for
a longword operand.
Rn
Rn – 1/2/4
1/2/4
–
Rn – 1/2/4
Rn
Rn
After instruction execution
Byte: Rn + 1 → Rn
Word: Rn + 2 → Rn
Longword: Rn + 4 → Rn
Byte: Rn – 1 → Rn
Word: Rn – 2 → Rn
Longword: Rn – 4 → Rn
(Instruction executed with Rn
after calculation)
Rev. 4.00 Sep. 14, 2005 Page 48 of 982
REJ09B0023-0400
Section 2 CPU
Addressing
Mode
Register
indirect with
displacement
Indexed
register indirect
GBR
indirect with
displacement
Indexed GBR
indirect
Instruction
Format
Effective Address Calculation Method Calculation Formula
@(disp:4, Rn) Effective address is register Rn contents with
4-bit displacement disp added. After disp is
zero-extended, it is multiplied by 1 (byte),
2 (word), or 4 (longword), according to the
operand size.
Rn
disp
(zero-extended)
1/2/4
+
×
Rn
+ disp × 1/2/4
@(R0, Rn) Effective address is sum of register Rn and
R0 contents.
Rn
+
R0
Rn + R0
@(disp:8, GBR) Effective address is register GBR contents
with 8-bit displacement disp added.
After disp is zero-extended, it is multiplied by
1 (byte), 2 (word), or 4 (longword), according
to the operand size.
GBR
disp
(zero-extended)
1/2/4
+
×
GBR
+ disp × 1/2/4
@(R0, GBR) Effective address is sum of register GBR and
R0 contents.
GBR
+
R0
GBR + R0
Byte: Rn + disp
Word: Rn + disp × 2
Longword: Rn + disp × 4
Rn + R0
Byte: GBR + disp
Word: GBR + disp × 2
Longword: GBR + disp × 4
GBR + R0
Rev. 4.00 Sep. 14, 2005 Page 49 of 982
REJ09B0023-0400
Section 2 CPU
Addressing
Mode
PC-relative with
displacement
Instruction
Format
Effective Address Calculation Method Calculation Formula
@(disp:8, PC) Effective address is PC with 8-bit
displacement disp added. After disp is zeroextended, it is multiplied by 2 (word) or 4
(longword),
according to the operand size. With a
longword operand, the lower 2 bits of PC are
masked.
PC
H'FFFFFFFC
disp
(zero-extended)
2/4
*
&
PC + disp × 2
+
PC&H'FFFFFFFC
×
* : With longword operand
+ disp × 4
or
PC-relative disp:8 Effective address is PC with 8-bit
displacement disp added after being signextended and multiplied by 2.
PC
+
disp
(sign-extended)
2
×
PC + disp × 2
disp:12 Effective address is PC with 12-bit
displacement disp added after being signextended and multiplied by 2
PC
+
disp
(sign-extended)
2
×
PC + disp × 2
Rn Effective address is sum of PC and Rn.
PC
+
Rn
PC + Rn
Word: PC + disp × 2
Longword:
PC&H'FFFFFFFC
+ disp × 4
PC + disp × 2
PC + disp × 2
PC + Rn
Rev. 4.00 Sep. 14, 2005 Page 50 of 982
REJ09B0023-0400
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.