Regarding the change of names mentioned in the document, such as Mitsubishi
Electric and Mitsubishi XX, to Renesas Technology Corp.
The semiconductor operations of Hitachi and Mitsubishi Electric were transferred to Renesas
Technology Corporation on April 1st 2003. These operations include microcomputer, logic, analog
and discrete devices, and memory chips other than DRAMs (flash memory, SRAMs etc.)
Accordingly, although Mitsubishi Electric, Mitsubishi Electric Corporation, Mitsubishi
Semiconductors, and other Mitsubishi brand names are mentioned in the document, these names
have in fact all been changed to Renesas Technology Corp. Thank you for your understanding.
Except for our corporate trademark, logo and corporate statement, no changes whatsoever have been
made to the contents of the document, and these changes do not constitute any alteration to the
contents of the document itself.
Note : Mitsubishi Electric will continue the business operations of high frequency & optical devices
and power devices.
Renesas Technology Corp.
Customer Support Dept.
April 1, 2003
Page 2
Mitsubishi 32-Bit RISC Single-Chip Microcomputers
32180
M32R Family M32R/ECU Series
32180
Group
User's Manual
http://www.infomicom.maec.co.jp/
The latest version of this manual is published at the Mitsubishi microcomputer home
page shown above. Please make sure you are using the latest version of the manual.
Rev. 1.0
Jan. 24, 2003
Page 3
Keep safety first in your circuit designs!
•
Mitsubishi Electric Corporation 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
•
These materials are intended as a reference to assist our customers in the selection of the
Mitsubishi semiconductor 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
Mitsubishi Electric Corporation or a third party .
•
Mitsubishi Electric Corporation assumes no responsibility for any damage, or infringement of
any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials.
•
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 Mitsubishi Electric Corporation without notice due to
product improvements or other reasons. It is therefore recommended that customers contact
Mitsubishi Electric Corporation or an authorized Mitsubishi Semiconductor product distributor for the latest product information before purchasing a product listed herein.
The information described here may contain technical inaccuracies or typographical errors.
Mitsubishi Electric Corporation assumes no responsibility for any damage, liability, or other
loss rising from these inaccuracies or errors.
Please also pay attention to information published by Mitsubishi Electric Corporation by
various means, including the Mitsubishi Semiconductor home page (http://
www.mitsubishichips.com).
•
When using any or all of the information contained in these materials, including product data,
diagrams, charts, programs, and algorithms, please be sure to ev aluate all inf ormation as a
total system before making a final decision on the applicability of the information and products. Mitsubishi Electric Corporation assumes no responsibility for any damage, liability or
other loss resulting from the information contained herein.
•
Mitsubishi Electric Corporation 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 Mitsubishi Electric Corporation or an authorized Mitsubishi Semiconductor 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.
•
The prior written approval of Mitsubishi Electric Corporation is necessary to reprint or reproduce in whole or in part these materials.
•
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 ree xport contrary to the export control laws and regulations of Japan and/or
the country of destination is prohibited.
•
Please contact Mitsubishi Electric Corporation or an authorized Mitsubishi Semiconductor
product distributor for further details on these materials or the products contained therein.
Page 4
Revision History
32180 Group User’s Manual
Rev. Date of Issue
PageChanges Made
1.0 Jan. 24, 2 0 03–First edition issued
Contents of Revision
(1/1)
Page 5
0000000000000
Before Use
• Guide to Understanding the Register Table
(1) Bit number: Indicates a register’s bit number.
(2) Register border: The registers enclosed with thick border lines must be accessed in halfwords or words.
(3) Status after reset: The initial state of each register after reset is indicated in hexadecimal or binary.
(4) Status after reset: The initial state of each register after reset is indicated bitwise.
0: This bit is “0” after reset.
1: This bit is “1” after reset.
?: This bit is undefined after reset.
(5) The shaded bits mean that they have no functions assigned.
(6) Read conditions:
R: This bit can be accessed for read.
?: The value read from this bit is undefined. (Reading this bit has no effect.)
0: The value read from this bit is always “0”.
1: The value read from this bit is always “1”.
(7) Write conditions:
W: This bit can be accessed for write.
N: This bit is write protected.
0: To write to this bit, always write “0”.
1: To write to this bit, always write “1”.
–: Writing to this bit has no effect. (It does not matter whether this bit is set to “0” or “1” by writing in software.)
Note: Care must be taken when writing to this bit. See Note in each register table.
XXXRegister(XXX)<Address: H’XXXX XXXX>
b01234567891011121314b15
AAABBBCCC
000
bBit nameFunctionR W
0AAA0 :
• • • • • • • • • bit1 : • • • • • • • • • bit
1BBB0 :
• • • • • • • • • bit1 : • • • • • • • • • bit
2CCC0 :
• • • • • • • • • bit1 : • • • • • • • • • bit
3–15No function assigned. Fix to “0”.00
Note 1: Only writing “0” is effective. Writing “1” has no effect, in which case the bit retains the value it had before the write.
• Notation of active-low pins (signals)
(1)
(5)
(3)
<After reset: H’0000>
• • • • • • • • • bitR W
• • • • • • • • • bitR W
• • • • • • • • • bitR (Note 1)
(2)
(4)
(6) (7)
The symbol “#” suffixed to the pin (or signal) names means that the pins (or signals) are active-low.
Page 6
Table of contents
CHAPTER 1 OVERVIEW
1.1 Outline of the 32180 Group ---------------------------------------------------------------------------------------------1-2
1.1.1M32R Family CPU Core with Built-in FPU (M32R-FPU) ---------------------------------------------1-2
Appendix 3.1 Example Processing of Unused Pins ---------------------------------------------------------- Appendix 3-2
APPENDIX 4 SUMMARY OF PRECAUTIONS
(10)
Page 16
Appendix 4.1 Precautions about the CPU -------------------------------------------------------------------------- Appendix 4-2
Appendix 4.1.1 Precautions Regarding Data Transfer------------------------------------------------ Appendix 4-2
Appendix 4.2 Precautions about the Address Space ------------------------------------------------------------------ Appendix 4-3
Appendix 4.2.1 Virtual Flash Emulation Function ------------------------------------------------------- Appendix 4-3
Appendix 4.3 Precautions about EIT ------------------------------------------------------------------------------------ Appendix 4-3
Appendix 4.4 Precautions To Be Observed when Programming Internal Flash Memory -------------------------- Appendix 4-3
Appendix 4.5 Precautions to Be Observed after Reset ---------------------------------------------------------------- Appendix 4-4
Appendix 4.6.1 When Using Input/Output Ports in Output Mode ----------------------------------- Appendix 4-4
Appendix 4.6.2 About the Port Input Disable Function ------------------------------------------------ Appendix 4-4
Appendix 4.7 Precautions about the DMAC -------------------------------------------------------------------------- Appendix 4-5
Appendix 4.7.1 About Writing to the DMAC Related Registers ------------------------------------- Appendix 4-5
Appendix 4.7.2 Manipulating the DMAC Related Registers by DMA Transfer ------------------ Appendix 4-5
Appendix 4.7.3 About the DMA Interrupt Request Status Register -------------------------------- Appendix 4-5
Appendix 4.7.4 About the Stable Operation of DMA Transfer --------------------------------------- Appendix 4-5
Appendix 4.8 Precautions about the Multijunction Timers ------------------------------------------------------------ Appendix 4-6
Appendix 4.8.1 Precautions on Using TOP Single-Shot Output Mode ---------------------------- Appendix 4-6
Appendix 4.8.2 Precautions on Using TOP Delayed Single-Shot Output Mode ---------------- Appendix 4-8
Appendix 4.8.3 Precautions on Using TOP Continuous Output Mode ---------------------------- Appendix 4-9
Appendix 4.8.4 Precautions on Using TIO Measure Free-Run/Clear Input Modes ------------ Appendix 4-9
Appendix 4.8.5 Precautions on Using TIO PWM Output Mode ------------------------------------- Appendix 4-9
Appendix 4.8.6 Precautions on Using TIO Single-Shot Output Mode ----------------------------- Appendix 4-9
Appendix 4.8.7 Precautions on Using TIO Delayed Single-Shot Output Mode ----------------- Appendix 4-10
Appendix 4.8.8 Precautions on Using TIO Continuous Output Mode------------------------------ Appendix 4-10
Appendix 4.8.9 Precautions on Using TMS Measure Input ------------------------------------------ Appendix 4-10
Appendix 4.8.10 Precautions on Using TML Measure Input------------------------------------------- Appendix 4-11
Appendix 4.8.11 Precautions on Using TOU PWM Output Mode ------------------------------------ Appendix 4-12
Appendix 4.8.12 Precautions on Using TOU Single-Shot PWM Output Mode -------------------- Appendix 4-12
Appendix 4.8.13 Precautions on Using TOU Delayed Single-Shot Output Mode ---------------- Appendix 4-12
Appendix 4.8.14 Precautions on Using TOU Single-Shot Output Mode ---------------------------- Appendix 4-13
Appendix 4.8.15 Precautions on Using TOU Continuous Output Mode ---------------------------- Appendix 4-13
Appendix 4.9 Precautions about the A-D Converters ---------------------------------------------------------------- Appendix 4-14
Appendix 4.10 Precautions about Serial I/O ---------------------------------------------------------------------------- Appendix 4-17
Appendix 4.10.1 Precautions on Using CSIO Mode ---------------------------------------------------- Appendix 4-17
Appendix 4.10.2 Precautions on Using UART Mode --------------------------------------------------- Appendix 4-18
Appendix 4.11 Precautions about RAM Backup Mode --------------------------------------------------------------- Appendix 4-19
Appendix 4.11.1 Precautions to Be Observed at Power-On ------------------------------------------ Appendix 4-19
Appendix 4.12 Precautions about JTAG ------------------------------------------------------------------------------- Appendix 4-20
Appendix 4.12.1 Notes on Board Design when Connecting JTAG ---------------------------------- Appendix 4-20
Appendix 4.12.2 Processing Pins when Not Using JTAG --------------------------------------------- Appendix 4-22
Appendix 4.13 Precautions about Noise -------------------------------------------------------------------------------- Appendix 4-23
Appendix 4.13.1 Reduction of Wiring Length ------------------------------------------------------------- Appendix 4-23
Appendix 4.13.2 Inserting a Bypass Capacitor between VSS and VCC Lines ------------------- Appendix 4-26
Appendix 4.13.3 Processing Analog Input Pin Wiring -------------------------------------------------- Appendix 4-26
Appendix 4.13.4 Consideration about the Oscillator and VCNT Pin -------------------------------- Appendix 4-27
The 32180 group (hereafter simply the 32180) belongs to the M32R/ECU series in the M32R family of
Mitsubishi microcomputers. For details about the current development status of the 32180, please contact
your nearest office of Mitsubishi or its distributor.
Table 1.1.1 Product List
Type NameROM SizeRAM SizePackage TypeOperating Ambient Temperature
M32180F8VFP1 Mbyte48 Kbytes240-pin QFP: 240P6Y-A (0.5 mm pitch)–40°C to 125°C (@64 MHz)
M32180F8TFP1 Mbyte48 Kbytes240-pin QFP: 240P6Y-A (0.5 mm pitch)–40°C to 85°C (@80 MHz)
1.1.1 M32R Family CPU Core with Built-in FPU (M32R-FPU)
(1) Based on a RISC architecture
• The 32180 is a group of 32-bit RISC single-chip microcomputers. The M32R-FPU in this group of
microcomputers incorporates a fully IEEE 754-compliant, single-precision FPU in order to materialize
the common instruction set and the high-precision arithmetic operation of the M32R CPU. The 32180
products listed in the above table are built around the M32R-FPU and incorporates flash memory,
RAM and various peripheral functions, all integrated into a single chip.
• The M32R-FPU is constructed based on a RISC architecture. Memory is accessed using load/store
instructions, and various arithmetic/logic operations are executed using register-to-register operation
instructions.
• The internally has sixteen 32-bit general-purpose registers. The instruction set consists of 100 discrete instructions in total (83 instructions common to the M32R family plus 17 FPU and extended
instructions). These instructions are either 16 bits or 32 bits long.
• In addition to the ordinary load/store instructions, the M32R-FPU supports compound instructions
such as Load & Address Update and Store & Address Update. These instructions help to speed up
data transfers.
(2) Five-stage pipelined processing
• The M32R-FPU supports five-stage pipelined instruction processing consisting of Instruction Fetch,
Decode, Execute, Memory Access and Write Back (processed in six stages when performing floating-point arithmetic). Not just load/store instructions and register-to-register operation instructions,
but also floating-point arithmetic instructions and compound instructions such as Load & Address
Update and Store & Address Update are executed in one CPUCLK period (which is equivalent to 12.5
ns when f(CPUCLK) = 80 MHz).
• Although instructions are supplied to the execution stage in the order in which they were fetched, it is
possible that if the load/store instruction supplied first is extended by wait cycles inserted in memory
access, the subsequent register-to-register operation instruction will be executed before that instruction. Using such a facility, which is known as the “out-of-order-completion” mechanism, the M32RFPU is able to control instruction execution without wasting clock cycles.
(3) Compact instruction code
• The M32R-FPU supports two instruction formats: one 16 bits long, and one 32 bits long. Use of the
16-bit instruction format especially helps to suppress the code size of a program.
• Moreover, the availability of 32-bit instructions makes programming easier and provides higher performance at the same clock speed than in architectures where the address space is segmented. For
example, some 32-bit instructions allow control to jump to an address 32 Mbytes forward or backward
from the currently executed address in one instruction, making programming easy.
1-2
32180 Group User’s Manual (Rev.1.0)
Page 20
1
1.1.2 Built-in Multiplier/Accumulator
(1) Built-in high-speed multiplier
• The M32R-FPU contains a 32 bits × 16 bits high-speed multiplier which enables the M32R-FPU to
execute a 32 bits × 32 bits integral multiplication instruction in three CPUCLK periods.
(2) DSP-comparable sum-of-products instructions
• The M32R-FPU supports the following four types of sum-of-products calculation instructions (or multiplication instructions) which each can be executed in one CPUCLK period using a 56-bit accumulator.
(1) 16 high-order bits of register × 16 high-order bits of register
(2) 16 low-order bits of register × 16 low-order bits of register
(3) All 32 bits of register × 16 high-order bits of register
(4) All 32 bits of register × 16 low-order bits of register
• The M32R-FPU has some special instructions to round the value stored in the accumulator to 16 or
32 bits or shift the accumulator value before storing in a register to have its digits adjusted. Because
these instructions too are executed in one CPUCLK period, when used in combination with highspeed data transfer instructions such as Load & Address Update or Store & Address Update, they
enable the M32R-FPU to exhibit superior data processing capability comparable to that of a DSP.
OVERVIEW
1.1 Outline of the 32180 Group
1.1.3 Built-in Single-precision FPU
• The M32R-FPU supports single-precision floating-point arithmetic fully compliant with IEEE 754 standards. Specifically, five exceptions specified in IEEE 754 standards (Inexact, Underflow, Division by
Zero, Overflow and Invalid Operation) and four rounding modes (round to nearest, round toward 0,
round toward + Infinity and round toward – Infinity) are supported. What’s more, because generalpurpose registers are used to perform floating-point arithmetic, the overhead associated with transferring the operand data can be reduced.
1.1.4 Built-in Flash Memory and RAM
• The 32180 contains a RAM that can be accessed with zero wait state, allowing to design a high-speed
embedded system.
• The internal flash memory can be written to while mounted on a printed circuit board (on-board writing). Use of flash memory facilitates development work, because the chip used at the development
stage can be used directly in mass-production, allowing for a smooth transition from prototype to
mass-production without the need to change the printed circuit board.
• The internal flash memory can be rewritten as many as 100 times.
• The internal flash memory has a virtual flash emulation function, allowing the internal RAM to be
superficially mapped into part of the internal flash memory. When combined with the internal RealTime Debugger (RTD) and the M32R family’s common debug interface (Scalable Debug Interface or
SDI), this function makes the ROM table data tuning easy.
• The internal RAM can be accessed for reading or rewriting data from an external device independently of the M32R-FPU by using the Real-Time Debugger. The external device is communicated
using the Real-Time Debugger’s exclusive clock-synchronized serial I/O.
1-3
32180 Group User’s Manual (Rev.1.0)
Page 21
1
1.1.5 Built-in Clock Frequency Multiplier
• The 32180 contains a clock frequency multiplier, which is schematically shown in Figure 1.1.1 below.
OVERVIEW
1.1 Outline of the 32180 Group
XIN pin
(8MHz-10MHz)
Figure 1.1.1 Conceptual Diagram of the Clock Frequency Multiplier
Table 1.1.2 Clock
Functional BlockFeatures
CPUCLK• CPU clock: Defined as f(CPUCLK) when it indicates the operating clock frequency for
BCLK• Peripheral clock: Defined as f(BCLK) when it indicates the operating clock frequency
Clock output (BCLK pin output)• A clock with the same frequency as f(BCLK) is output from this pin.
X8
PLL
1/4
the M32R-FPU core, internal flash memory and internal RAM.
for the internal peripheral I/O and external data bus.
CPUCLK (CPU clock)
(64MHz-80MHz)
BCLK (peripheral clock)
(16MHz-20MHz)
1.1.6 Powerful Peripheral Functions Built-in
(1) Multijunction timer (MJT)
(2) 10-channel DMAC
(3) Two 16-channel A-D converters (ADC)
(4) 6-channel high-speed serial I/O (SIO)
(5) Real-time debugger (RTD)
(6) 8-level interrupt controller (ICU)
(7) Three operation modes
(8) Wait controller
(9) 2-channel Full-CAN
(10) M32R family’s common debug function (Scalable Debug Interface or SDI)
1-4
32180 Group User’s Manual (Rev.1.0)
Page 22
OVERVIEW
1
1.2 Block Diagram
1.2 Block Diagram
Figure 1.2.1 shows a block diagram of the 32180. The features of each block are described in Table 1.2.1.
• DMA transfer request: Failed to send, transmission completed or reception completed
Real-Time Debugger• Internal RAM can be rewritten or monitored independently of the CPU by entering a command
(RTD)from the outside.
• Comes with exclusive clock-synchronized serial ports.
• Interrupt request: RTD interrupt command input
Interrupt Controller (ICU) • Controls interrupt requests from the internal peripheral I/O.
• Supports 8-level interrupt priority including an interrupt disabled state.
• External interrupt: 35 sources (SBI# and TIN0–TIN33)
• TIN pin input sensing: Rising, falling or both edges or high or low level
Wait Controller• Controls wait states for access to the extended external area.
• Insertion of 0–7 wait states by setting up in software + wait state extension by entering WAIT# signal
PLL• A multiply-by-8 clock generating circuit
Clock• Maximum external input clock frequency (XIN) is 10.0 MHz.
• CPUCLK: Operating clock for the M32R-FPU core, internal flash memory and internal RAM
The maximum CPU clock is 80 MHz (when f(XIN) = 10 MHz).
• BCLK: Operating clock for the internal peripheral I/O and external data bus
The maximum peripheral clock is 20 MHz (peripheral module access when
f(XIN) = 10 MHz).
• Clock output (BCLK pin output): A clock with the same frequency as BCLK is output from this pin.
JTAG• Boundary scan function
VDC• Internal power supply generating circuit: Generates the internal power supply (2.5 V) from an
external single power supply (5 or 3.3 V).
Ports• Input/output pins: 158 pins
• The port input threshold can be set in a program to one of three levels individually for each port
group (with or without Schmitt circuit, selectable).
Note 1: The maximum external input clock frequency (XIN) for the M32180F8VFP is 8.0 MHz.
(Note 1)
1.2 Block Diagram
1-7
32180 Group User’s Manual (Rev.1.0)
Page 25
1
1.3 Pin Functions
1.3 Pin Functions
Figure 1.3.1 shows the 32180’s pin function diagram. Pin functions are described in Table 1.3.1.
Notes: • The symbol "#" suffixed to the pin (or signal) names means that the pins (or signals) are active-low.
• : Operates with the VCCE power supply.
VCCE
VCC-BUS
: Operates with the VCC-BUS power supply.
OSC-VCC
: Operates with the OSC-VCC power supply.
Figure 1.3.1 Pin Function Diagram
1-8
32180 Group User’s Manual (Rev.1.0)
Page 26
OVERVIEW
1
Table 1.3.1 Description of Pin Functions (1/5)
TypePin NameSignal NameInput/Output Description
Power supplyVCCEMain power supply –Power supply for the device (5.0 V ± 0.5 V or 3.3 V ± 0.3 V).
EXCVCCInternal power supply –This pin connects an external capacitor.
VCC-BUSBus power supply–Power supply for the bus control pins (5.0 V ± 0.5 V or 3.3 V
± 0.3 V).
VDDERAM power supply –Backup power supply for the internal RAM (5.0 V ± 0.5 V or
3.3 V ± 0.3 V).
EXCVDDInternal power–This pin connects an external capacitor for the internal power
supply of RAMsupply of the internal RAM.
VSSGround–Connect all VSS pins to ground (GND).
ClockXIN,Clock inputInputThese are clock input/output pins. A PLL-based ×8 frequency
XOUTClock outputOutputmultiplier is included, which accepts as input a clock whose
frequency is 1/8 of the internal CPU clock frequency. (XIN
input is 10 MHz when f(CPUCLK) = 80 MHz.)
BCLKSystem clockOutputThis pin outputs a clock whose frequency is twice that of the
external input clock (XIN). (BCLK output is 20 MHz when
f(CPUCLK) = 80 MHz.) Use this clock to synchronize the
operation of external devices.
OSC-VCCClock power supply –Power supply for the oscillator circuit. Connect OSC-VCC to
the main power supply.
OSC-VSSClock ground–Connect OSC-VSS to ground.
VCNTPLL control–Connect a resistor and capacitor for control of the PLL circuit.
ResetRESET#ResetInputReset input pin for the internal circuit.
ModeMOD0,ModeInputSet the microcomputer’s operation mode.
Flash protectFPFlash protectInputThis special pin protects the flash memory against rewrites
in hardware.
Address busA11–A30Address busOutputTwenty address lines (A11–A30) are included, allowing four
blocks each up to 2 MB memory space to be connected
external to the chip. A31 is not output.
Note 1: Boot mode requires that the FP pin should be at the high level. For details about boot mode, see Chapter 6, “Internal
Memory.”
1.3 Pin Functions
1-9
32180 Group User’s Manual (Rev.1.0)
Page 27
OVERVIEW
1
Table 1.3.1 Description of Pin Functions (2/5)
TypePin NameSignal NameInput/Output Description
Data busDB0–DB15 Data busInput/output This 16-bit data bus is used to connect external devices.
When writing in byte units during a write cycle, the output
data at the invalid byte position is undefined. During a
read cycle, data on the entire 16-bit bus is always read in.
However, only the data at the valid byte position is
transferred into the internal circuit.
Bus controlCS0#–CS3# Chip selectOutputThese are chip select signals for external devices.
RD#ReadOutputThis signal is output when reading an external device.
WR#WriteOutputThis signal is output when writing to an external device.
BHW#/BLW# Byte high/low write OutputWhen writing to an external device, this signal indicates the
valid byte position to which data is transferred. BHW# and
BLW# correspond to the upper address side (bits 0–7 are
valid) and the lower address side (bits 8–15 are valid),
respectively.
BHE#Byte high enableOutputDuring an external device access, this signal indicates that
the high-order data (bits 0–7) is valid.
BLE#Byte low enableOutputDuring an external device access, this signal indicates that
the low-order data (bits 8–15) is valid.
WAIT#WaitInputWhen accessing an external device, a low-level input on
WAIT# pin extends the wait cycle.
HREQ#Hold requestInputThis input is used by an external device to request control
of the external bus. A low-level input on HREQ# pin places
the CPU in a hold state.
HACK#Hold acknowledge OutputThis signal notifies that the CPU has entered a hold state
and relinquished control of the external bus.
MultijunctionTIN0–TIN33 Timer inputInputInput pins for the multijunction timer.
timerTO0–TO44 Timer outputOutputOutput pins for the multijunction timer.
TCLK0Timer clockInputClock input pins for the multijunction timer.
–TCLK3
1.3 Pin Functions
1-10
32180 Group User’s Manual (Rev.1.0)
Page 28
OVERVIEW
1
Table 1.3.1 Description of Pin Functions (3/5)
TypePin NameSignal NameInput/Output Description
A-D converterAVCC0,Analog power supply –AVCC0 and AVCC1 are the power supply for the A-D0 and
AVCC1the A-D1 converter, respectively. Connect AVCC0 and AVCC1
to the power supply rail.
AVSS0,Analog ground–AVSS0 and AVSS1 are the analog ground for the A-D0 and
AVSS1the A-D1 converter, respectively. Connect AVSS0 and AVSS1
to ground.
AD0IN0Analog inputInput16-channel analog input pins for the A-D0 converter, i.e.,
–AD0IN15the first block A-D converter.
AD1IN0Analog inputInput16-channel analog input pins for the A-D1 converter, i.e.,
–AD1IN15the second block A-D converter.
VREF0,Reference voltage InputVREF0 and VREF1 are the reference voltage input pin for
VREF1inputthe A-D0 and the A-D1 converter, respectively.
InterruptSBI#System breakInputThis is the system break interrupt (SBI) input pin for the
controllerinterruptinterrupt controller.
Serial I/OSCLKI0/UART transmit/receive Input/output When channel 0 is in UART mode:
SCLKO0clock output or CSIOThis pin outputs a clock derived from BRG output by
transmit/receive clockdividing it by 2.
input/outputWhen channel 0 is in CSIO mode:
This pin accepts as input a transmit/receive clock when
external clock is selected or outputs a transmit/receive
clock when internal clock is selected.
SCLKI1/UART transmit/receive Input/output When channel 1 is in UART mode:
SCLKO1clock output or CSIOThis pin outputs a clock derived from BRG output by
transmit/receive clockdividing it by 2.
input/outputWhen channel 1 is in CSIO mode:
This pin accepts as input a transmit/receive clock when
external clock is selected or outputs a transmit/receive
clock when internal clock is selected.
SCLKI4/UART transmit/receive Input/output When channel 4 is in UART mode:
SCLKO4clock output or CSIOThis pin outputs a clock derived from BRG output by
transmit/receive clockdividing it by 2.
input/outputWhen channel 4 is in CSIO mode:
This pin accepts as input a transmit/receive clock when
external clock is selected or outputs a transmit/receive
clock when internal clock is selected.
SCLKI5/UART transmit/receive Input/output When channel 5 is in UART mode:
SCLKO5clock output or CSIOThis pin outputs a clock derived from BRG output by
transmit/receive clockdividing it by 2.
input/outputWhen channel 5 is in CSIO mode:
This pin accepts as input a transmit/receive clock when
external clock is selected or outputs a transmit/receive
clock when internal clock is selected.
1.3 Pin Functions
1-11
32180 Group User’s Manual (Rev.1.0)
Page 29
OVERVIEW
1
Table 1.3.1 Description of Pin Functions (4/5)
TypePin NameSignal NameInput/Output Description
Serial I/OTXD0Transmit dataOutputTransmit data output pin for serial I/O channel 0.
RXD0Received dataInputReceived data input pin for serial I/O channel 0.
TXD1Transmit dataOutputTransmit data output pin for serial I/O channel 1.
RXD1Received dataInputReceived data input pin for serial I/O channel 1.
TXD2Transmit dataOutputTransmit data output pin for serial I/O channel 2.
RXD2Received dataInputReceived data input pin for serial I/O channel 2.
TXD3Transmit dataOutputTransmit data output pin for serial I/O channel 3.
RXD3Received dataInputReceived data input pin for serial I/O channel 3.
TXD4Transmit dataOutputTransmit data output pin for serial I/O channel 4.
RXD4Received dataInputReceived data input pin for serial I/O channel 4.
TXD5Transmit dataOutputTransmit data output pin for serial I/O channel 5.
RXD5Received dataInputReceived data input pin for serial I/O channel 5.
Real-timeRTDTXDRTD transmit dataOutputSerial data output pin for the real-time debugger.
debuggerRTDRXDRTD received data InputSerial data input pin for the real-time debugger.
(RTD)RTDCLKRTD clock inputInputSerial data transmit/receive clock input pin for the real-time
debugger.
RTDACKRTD acknowledge OutputA low-level pulse is output from this pin synchronously with
the start clock for the real-time debugger’s serial data output
word. The low-level pulse width indicates the type of command/
data received by the real-time debugger.
CANCTX0, CTX1 Transmit dataOutputThis pin outputs data from the CAN module.
CRX0, CRX1 Received dataInputThis pin accepts as input the data for the CAN module.
JTAGJTMSTest mode selectInputTest mode select input to control the state transition of the
test circuit.
JTCKTest clockInputClock input for the debug module and test circuit.
JTRSTTest resetInputTest reset input to initialize the test circuit asynchronously
with device operation.
JTDITest data inputInputThis pin accepts as input the test instruction code or test data
that is serially received.
JTDOTest data outputOutputThis pin outp uts the test in struction code or test data serially.
1.3 Pin Functions
1-12
32180 Group User’s Manual (Rev.1.0)
Page 30
1
Table 1.3.1 Description of Pin Functions (5/5)
TypePin NameSignal NameInput/Output Description
Input/outputP00–P07Input/output port 0 Input/output Programmable input/output port.
portsP10–P17Input/output port 1
(Note 1)P20–P27Input/output port 2
P30–P37Input/output port 3
P41–P47Input/output port 4
P61–P63Input/output port 6
P65–P67
P70–P77Input/output port 7
P82–P87Input/output port 8
P93–P97Input/output port 9
P100–P107 Input/output port 10
P110–P117 Input/output port 11
P124–P127 Input/output port 12
P130–P137 Input/output port 13
P140–P147 Input/output port 14
P150–P157 Input/output port 15
P160–P167 Input/output port 16
P172–P177 Input/output port 17
P180–P187 Input/output port 18
P190–P197 Input/output port 19
P200–P203 Input/output port 20
P210–P217 Input/output port 21
P220–P227 Input/output port 22
Note 1: Input/output port 5 is reserved for future use. P221 and P223 are input-only ports.
OVERVIEW
1.3 Pin Functions
1-13
32180 Group User’s Manual (Rev.1.0)
Page 31
OVERVIEW
1
1.4 Pin Assignments
1.4 Pin Assignments
Figure 1.4.1 shows the 32180’s pin assignment diagram. A pin assignment table is shown in Table 1.4.1.
Note: • The symbol "#" suffixed to the pin (or signal) names means that the pins (or signals) are active-low.
Figure 1.4.1 Pin Assignment Diagram of the 240QFP (Top View)
1-14
32180 Group User’s Manual (Rev.1.0)
JTCK
JTMS
P100/TO8
P103/TO11
P104/TO12
P105/TO13
P106/TO14
P101/TO9/TXD3
P102/TO10/CTX1
P107/TO15
Page 32
OVERVIEW
1
The pins directed for input go to a high-impedance state (Hi-z) when reset. The term “when reset” means that
input on RESET# pin is held low (the device remains reset), and that the RESET# pin is released back high
(the device comes out of reset).
Table 1.4.1 Pin Assignments of the M32180F8VFP/TFP (1/6)
2.7Supplementary Explanation for BSET, BCLR,
LOCK and UNLOCK Instruction Execution
2.8Precautions on CPU
Page 39
2
2.1 CPU Registers
2.1 CPU Registers
The M32R-FPU has 16 general-purpose registers, 6 control registers, an accumulator and a program counter.
The accumulator is of 56-bit configuration, and all other registers are of 32-bit configuration.
2.2 General-purpose Registers
The 16 general-purpose registers (R0–R15) are of 32-bit width and are used to retain data and base address, as
well as for integer calculations, floating-point operations, etc. R14 is used as the link register and R15 as the stack
pointer. The link register is used to store the return address when executing a subroutine call instruction. The
Interrupt Stack Pointer (SPI) and the User Stack Pointer (SPU) are alternately represented by R15 depending on
the value of the Stack Mode (SM) bit in the Processor Status Word Register (PSW).
After reset, the value of the general-purpose registers is undefined.
CPU
b31
R0
R1
R2
R3
R4
R5
R6
R7
Note 1: The stack pointer functions as either the SPI or the SPU depending on
the value of the SM bit in the PSW.
There are 6 control registers which are the Processor Status Word Register (PSW), the Condition Bit Register
(CBR), the Interrupt Stack Pointer (SPI), the User Stack Pointer (SPU), the Backup PC (BPC) and the Floatingpoint Status Register (FPSR).
The dedicated MVTC and MVFC instructions are used for writing and reading these control registers.
In addition, the SM bit, IE bit and C bit of the PSW can also be set by the SETPSW or CLRPSW instruction.
CRn
CR0
CR1
CR2
CR3
b0
PSW
CBR
SPI
SPU
b31
Processor Status Word Register
Condition Bit Register
Interrupt Stack Pointer
User Stack Pointer
Notes: • CRn (n = 0-3, 6 and 7) denotes the control register number.
• The dedicated MVTC and MVFC instructions are used for writing and reading these control registers.
• The SM bit, IE bit and C bit of the PSW can also be set by the SETPSW or CLRPSW instructions.
Figure 2.3.1 Control Registers
CR6
CR7
BPC
FPSR
Backup PC
Floating-point Status Register
2-2
32180 Group User’s Manual (Rev.1.0)
Page 40
2
2.3.1 Processor Status Word Register: PSW (CR0)
7654321891011121314b15b0
CPU
2.3 Control Registers
00000000000000
BIEBSM
??00000?00000000
BPSW field
bBit NameFunctionR W
0–15No function assigned. Fix to "0".00
16BSMSaves value of SM bit when EIT occursR W
Backup SM Bit
17BIESaves value of IE bit when EIT occursR W
Backup IE Bit
18–22No function assigned. Fix to "0".00
23BCSaves value of C bit when EIT occursR W
Backup C Bit
24SM0: Uses R15 as the interrupt stack pointerR W
Stack Mode Bit1: Uses R15 as the user stack pointer
25IE0: Does not accept interruptR W
Interrupt Enable Bit1: Accepts interrupt
26–30No function assigned. Fix to "0".00
31CIndicates carry, borrow or overflow resultingR W
The Processor Status Word Register (PSW) indicates the M32R-FPU status. It consists of the current PSW field
which is regularly used, and the BPSW field where a copy of the PSW field is saved when EIT occurs.
The PSW field consists of the Stack Mode (SM) bit, the Interrupt Enable (IE) bit and the Condition (C) bit.
The BPSW field consists of the Backup Stack Mode (BSM) bit, the Backup Interrupt Enable (BIE) bit and the
Backup Condition (BC) bit.
After reset, BSM, BIE and BC are undefined. All other bits are "0".
2-3
32180 Group User’s Manual (Rev.1.0)
Page 41
2
2.3 Control Registers
2.3.2 Condition Bit Register: CBR (CR1)
The Condition Bit Register (CBR) is derived from the PSW register by extracting its Condition (C) bit. The value
written to the PSW register’s C bit is reflected in this register. The register can only be read. (Writing to the
register with the MVTC instruction is ignored.)
After reset, the value of CBR is H’0000 0000.
b0b31
0000000000000000000000000000000
CBR
C
2.3.3 Interrupt Stack Pointer: SPI (CR2) and User Stack Pointer: SPU (CR3)
The Interrupt Stack Pointer (SPI) and the User Stack Pointer (SPU) retain the address of the current stack
pointer. These registers can be accessed as the general-purpose register R15. R15 switches between representing the SPI and SPU depending on the value of the Stack Mode (SM) bit in the PSW.
After reset, the values of the SPI and SPU are undefined.
b0b31
SPISPI
CPU
b0b31
SPUSPU
2.3.4 Backup PC: BPC (CR6)
The Backup PC (BPC) is used to save the value of the Program Counter (PC) when an EIT occurs. Bit 31 is fixed
to "0".
When an EIT occurs, the register sets either the PC value when the EIT occurred or the PC value for the next
instruction depending on the type of EIT. The BPC value is loaded to the PC when the RTE instruction is
executed. However, the values of the lower 2 bits of the PC are always "00" when returned. (PC always returns
to the word-aligned address.)
After reset, the value of the BPC is undefined.
b0b31
BPCBPC
0
2-4
32180 Group User’s Manual (Rev.1.0)
Page 42
2
2.3 Control Registers
2.3.5 Floating-point Status Register: FPSR (CR7)
234567891011121314b151b0
FSFXFUFZ
00000000000000
18192021222324252627282930b3117b16
EZEO
EUEX
0000000100000000
bBit NameFunctionR W
0FSReflects the logical sum of FU, FZ, FO and FV.R –
Floating-point Exception Summary Bit
1FXSet to "1" when an inexact exception occurs (if EIT processing isR W
Inexact Exception Flagunexecuted (Note 1)). Once set, the flag retains the value "1" until
2FUSet to "1" when an underflow exception occurs (if EIT processing isR W
Underflow Exception Flagunexecuted (Note 1)). Once set, the flag retains the value "1" until
3FZSet to "1" when a zero divide exception occurs (if EIT processing isR W
Zero Divide Exception Flagunexecuted (Note 1)). Once set, the flag retains the value "1" until
4FOSet to "1" when an overflow exception occurs (if EIT processing isR W
Overflow Exception Flagunexecuted (Note 1)). Once set, the flag retains the value "1" until
5FVSet to "1" when an invalid operation exception occurs (if EIT processingR W
Invalid Operation Exception Flagis unexecuted (Note 1)). Once set, the flag retains the value "1" until
6–16No function assigned. Fix to "0".00
17EX0: Mask EIT processing to be executed when an inexact exception occurs.R W
Inexact Exception Enable Bit1: Execute EIT processing when an inexact exception occurs.
18EU0: Mask EIT processing to be executed when an underflow exceptionR W
Underflow Exception Enable Bit occurs.
19EZ0: Mask EIT processing to be executed when a zero divide exceptionR W
Zero Divide Exception Enable Bit occurs.
20EO0: Mask EIT processing to be executed when an overflow exceptionR W
Overflow Exception Enable Bit occurs.
21EV0: Mask EIT processing to be executed when an invalid operationR W
Invalid Operation Exception Enable Bit exception occurs.
22No function assigned. Fix to "0".00
23DN0: Handle the denormalized number as a denormalized number.R W
Denormalized Number Zero Flush Bit 1: Handle the denormalized number as zero.
(Note 2)
24CE0: No unimplemented operation exception occurred.R
Unimplemented Operation1: An unimplemented operation exception occurred. When the bit is
Exception Cause Bit set to "1", the execution of an FPU operation inst r u ctio n will clear it to "0".
25CX0: No inexact exception occurred.R
Inexact Exception Cause Bit1: An inexact exception occurred. When the bit is set to "1",
0FO0
FV
EV
DNCECXCUCZCOCVRM
it is cleared to "0" in software.
it is cleared to "0" in software.
it is cleared to "0" in software.
it is cleared to "0" in software.
it is cleared to "0" in software.
1: Execute EIT processing when an underflow exception occurs.
1: Execute EIT processing when a zero divide exception occurs.
1: Execute EIT processing when an overflow exception occurs.
1: Execute EIT processing when an invalid operation exception occurs.
th e execution of an FPU operation instruction will clear it to "0".
<After reset: H’0000 0100>
CPU
(Note 3)
(Note 3)
2-5
32180 Group User’s Manual (Rev.1.0)
Page 43
2
26CU0: No underflow exception occurredR (Note 3)
Underflow Exception Cause Bit1: An underflow exception occurred. When the bit is set to "1",
the execution of an FPU operation instruction will clear it to "0".
27CZ0: No zero divide exception occurred.R
Zero Divide Exception Cause Bit1: A zero divide exception occurred. When the bit is set to "1",
the execution of an FPU operation instruction will clear it to "0".
28CO0: No overflow exception occurred.R
Overflow Exception Cause Bit1: An overflow exception occurred. When the bit is set to "1",
the execution of an FPU operation instruction will clear it to "0".
29CV0: No invalid operation exception occurred.R
Invalid Operation Exception Cause Bit 1: An invalid operation exception occurred. When the bit is set to "1",
the execution of an FPU operation instruction will clear it to "0".
Note 1: The phrase “If EIT processing unexecuted” means whenever one of the exceptions occurs, enable bits 17 to 21 are set to
"0" which masks the EIT processing so that it cannot be executed. If two exceptions occur at the same time and their
corresponding exception enable bits are set differently (one enabled, and the other masked), EIT processing is executed. In
this case, these two flags do not change state regardless of the enable bits settings.
Note 2: If a denormalized number is given to the operand when DN = "0", an unimplemented exception occurs.
Note 3: This bit is cleared by writing "0". Writing "1" has no effect (the bit retains the value it had before the write).
2.3 Control Registers
CPU
(Note 3)
(Note 3)
(Note 3)
2-6
32180 Group User’s Manual (Rev.1.0)
Page 44
2
2.4 Accumulator
2.4 Accumulator
The Accumulator (ACC) is a 56-bit register used for DSP function instructions.
The accumulator is handled as a 64-bit register when accessed for read or write. When reading data from the
accumulator, the value of bit 8 is sign-extended. When writing data to the accumulator, bits 0 to 7 are ignored. The
accumulator is also used for the multiply instruction “MUL,” in which case the accumulator value is destroyed by
instruction execution.
Use the MVTACHI and MVTACLO instructions for writing to the accumulator. The MVTACHI and MVTACLO
instructions write data to the high-order 32 bits (bits 0–31) and the low-order 32 bits (bits 32–63), respectively.
Use the MVFACHI, MVFACLO and MVFACMI instructions for reading data from the accumulator. The MVFACHI,
MVFACLO and MVFACMI instructions read data from the high-order 32 bits (bits 0–31), the low-order 32 bits (bits
32–63) and the middle 32 bits (bits 16–47), respectively.
After reset, the value of accumulator is undefined.
CPU
(Note 1)
15b0167 831 3247 48b63
ACC
Write and read ranges of MVTACHI
and MVFACHI instructions
Note 1: When read, bits 0 to 7 always show the sign-extended value of the value of bit 8. Writing to this
bit field is ignored.
Read range of MVFACMI instruction
Write and read ranges of MVTACLO
and MVFACLO instructions
2.5 Program Counter
The Program Counter (PC) is a 32-bit counter that retains the address of the instruction being executed. Since the
M32R FPU instruction starts with even-numbered addresses, the LSB (bit 31) is always "0".
After reset, the value of PC is H’0000 0000.
b0b31
PCPC
0
2-7
32180 Group User’s Manual (Rev.1.0)
Page 45
2
2.6 Data Formats
2.6 Data Formats
2.6.1 Data Types
The data types that can be handled by the M32R-FPU instruction set are signed or unsigned 8, 16 and 32-bit
integers and single-precision floating-point numbers. The signed integers are represented by 2’s complements.
CPU
Signed byte
(8-bit) integer
Unsigned byte
(8-bit) integer
Signed halfword
(16-bit) integer
Unsigned halfword
(16-bit) integer
Signed word
(32-bit) integer
Unsigned word
(32-bit) integer
Single-precision
floating-point number
b0
S
b0
b0
S
b0
b0
S
b0
b0 b1b8b9b31
SEF
S: Sign bit; E: Exponent field; F: Fraction field
b7
b7
b15
b15
b31
b31
Figure 2.6.1 Data Types
2-8
32180 Group User’s Manual (Rev.1.0)
Page 46
2
2.6.2 Data Formats
(1) Data formats in registers
The data sizes in the M32R-FPU registers are always words (32 bits).
When loading byte (8-bit) or halfword (16-bit) data from memory into a register, the data is sign-extended
(LDB, LDH instructions) or zero-extended (LDUB, LDUH instructions) to a word (32-bit) quantity before
being loaded in the register.
When storing data from a register into a memory, the 32-bit data, the 16-bit data on the LSB side and the 8bit data on the LSB side of the register are stored into memory by the ST, STH and STB instructions,
respectively.
CPU
2.6 Data Formats
<Load>
b0b31
Rn
Sign-extended (LDH instruction) or
zero-extended (LDUH instruction)
b0b31
Rn
b0b31
Rn
<Store>
b0b31
Rn
b0b31
Rn
b0b31
Rn
Sign-extended (LDB instruction) or
zero-extended (LDUB instruction)
From memory (LDH, LDUH instructions)
16
From memory (LD instruction)
Word
16
To memory (STH instruction)
Word
(LDB, LDUB instructions)
Halfword
To memory (STB instruction)
Halfword
From memory
24
Byte
24
Byte
Figure 2.6.2 Data Formats in Registers
To memory (ST instruction)
2-9
32180 Group User’s Manual (Rev.1.0)
Page 47
2
(2) Data formats in memory
The data sizes in memory can be byte (8 bits), halfword (16 bits) or word (32 bits). Although byte data can
be located at any address, halfword and word data must be located at the addresses aligned with a
halfword boundary (least significant address bit = "0") or a word boundary (two low-order address bits =
"00"), respectively. If an attempt is made to access memory data that overlaps the halfword or word boundary, an address exception occurs.
CPU
2.6 Data Formats
Address
+0 address+1 address+2 address+3 address
b0b31
Byte
b0
Halfword
b0b31
Word
Figure 2.6.3 Data Formats in Memory
(3) Endian
The diagrams below show a general endian system and the endian adopted for the M32R family of
Mitsubishi microcomputers.
7 815 1623 24
Byte
Byte
15
Halfword
Word
Bit endian
(H'01)
Byte
Byte
b31
Halfword
Byte endian
(H'01234567)
Big endian
Little endian
Note: • Even when bits are arranged in big endian, H'01 is not B'10000000.
Note: • The condition bit C changes state when data is written to CR0 (PSW) using the MVTC instruction.
Figure 2.6.6 Transfer Instructions
2-11
32180 Group User’s Manual (Rev.1.0)
b31
b31b0
b31b0
Page 49
2
(5) Transfer from memory (signed) to registers
CPU
2.6 Data Formats
• Signed 32 bits
Memory
LD24 Rsrc, #label
LD Rdest, @Rsrc
label
+0+1+2
• Signed 16 bits
label
LD24 Rsrc, #label
LDH Rdest, @Rsrc
• Signed 8 bits
label
+0+1+2+3
Determined by MSB
0: Positive number
1: Negative number
LD24 Rsrc, #label
LDB Rdest, @Rsrc
+0+1+2
Determined by MSB
0: Positive number
1: Negative number
Figure 2.6.7 Transfer from Memory (Signed) to Registers
(6) Transfer from memory (unsigned) to registers
Register
Rdest
+3
Rdest
0000
FFFF
Rdest
+3
000000
FFFFFF
b31b0
b31b0
b31b0
• Unsigned 32 bits
Memory
LD24 Rsrc, #label
LD Rdest, @Rsrc
• Unsigned 16 bits
LD24 Rsrc, #label
LDUH
Rdest, @Rsrc
• Unsigned 8 bits
label
+0+1+2+3
label
+0+1+2+3
label
LD24 Rsrc, #label
LDUB Rdest, @Rsrc
+0+1+2+3
Figure 2.6.8 Transfer from Memory (Unsigned) to Registers
2-12
Register
Rdest
b31b0
Rdest
0000
b31b0
Rdest
000000
b31b0
32180 Group User’s Manual (Rev.1.0)
Page 50
2
(7) Notes on data transfer
When transferring data, be aware that data arrangements in registers and memory are different.
• Word data (32 bits)
CPU
2.6 Data Formats
Data in registersData in memory
(R0–R15)
HHHLLHLL
b0b31
• Halfword data (16 bits)
(R0–R15)
b0b31
(R0–R15)
b0b31
• Byte data (8 bits)
(R0–R15)
b0
(R0–R15)
HL
HL
b31b0 b7
+0+1+2+3
HHHLLHLL
b0b31
+0+1+2+3
HL
b0b15
+0+1+2+3
HL
b16b31
+0+1+2+3
+0+1+2+3
b0
(R0–R15)
b0
(R0–R15)
b0
Figure 2.6.9 Difference in Data Arrangements
b31b8 b15
+0+1+2+3
b31b16 b23
+0+1+2+3
b31b24 b31
2-13
32180 Group User’s Manual (Rev.1.0)
Page 51
CPU
2.7 Supplementary Explanation for BSET, BCLR, LOCK and UNLOCK Instruction Execution
2
2.7 Supplementary Explanation for BSET, BCLR, LOCK and UNLOCK
Instruction Execution
The LOCK bit is set when executing the BSET or BCLR instruction, and is cleared when the BSET or BCLR
instruction finishes.
The LOCK instruction sets the LOCK bit, as well as performs an ordinary load operation. The UNLOCK instruction
is used to clear the LOCK bit.
The LOCK bit is located inside the CPU, and cannot directly be accessed for read or write by users. This bit
controls granting of bus control requested by devices other than the CPU.
• When LOCK bit = "0"
Control of the bus requested by devices other than the CPU is granted
• When LOCK bit = "1"
Control of the bus requested by devices other than the CPU is denied
In the 32180 group, control of the bus may be requested by devices other than the CPU in the following two cases:
• When DMA transfer is requested by the internal DMAC
• When HREQ# input is pulled low to request that the CPU be placed in a hold state
2.8 Precautions on CPU
• Usage Notes for 0 Division Instruction
Problem and Conditions
Inaccurate calculations for the instructions listed in (2) will result from execution of the 0 division instruction
under the conditions described in (1).
(1) If 0 division calculation is executed when the divisor = 0 for instructions DIV, DIVU, REM and REMU,
(2) the result will be inaccurate calculations for any of the following instructions that are executed immediately after 0 division:
Assuming that the 0 division occurrence itself is not expected by the system and therefore is the cause of
miscalculations, before executing division or remainder instructions, do a 0 check on the divisor to make sure 0
division does not occur.
2-14
32180 Group User’s Manual (Rev.1.0)
Page 52
CHAPTER 3
ADDRESS SPACE
3.1Outline of the Address Space
3.2Operation Modes
3.3Internal ROM and Extended External Areas
3.4Internal RAM and SFR Areas
3.5EIT Vector Entry
3.6ICU Vector Table
3.7Notes on Address Space
Page 53
ADDRESS SPACE
3
3.1 Outline of the Address Space
3.1 Outline of the Address Space
The logical addresses of the M32R are always handled in 32 bits, providing a linear address space of up to 4
Gbytes. The address space of the M32R/ECU consists of the following:
(1) User space
• Internal ROM area
• Extended external area
• Internal RAM area
• SFR (Special Function Register) area
(2) System space (not open to the user)
(1) User space
The 2 Gbytes from the address H’0000 0000 to the address H’7FFF FFFF comprise the user space.
Located in this space are the internal ROM area, an extended external area, the internal RAM area and the
SFR (Special Function Register) area (in which a set of internal peripheral I/O registers exist). Of these, the
internal ROM and extended external areas are located differently depending on mode settings as will be
described later.
(2) System space
The 2 Gbytes from the address H’8000 0000 to the address H’FFFF FFFF comprise the system space.
This space is reserved for use by development tools such as an in-circuit emulator and debug monitor, and
cannot be used by the user.
3-2
32180 Group User’s Manual (Rev.1.0)
Page 54
3
s
s
(
)
CS0
s
s
Logical address
H'0000 0000
16 Mbyte
ADDRESS SPACE
3.1 Outline of the Address Space
EIT vector entry
Internal ROM area
1 Mbyte
Note 1
area
CS1 area
H'0000 0000
H'000F FFFF
H'0010 0000
H'001F FFFF
H'0020 0000
2 Gbytes
H'7FFF FFFF
H'8000 0000
2 Gbytes
User space
System space
Ghost area
in 16-Mbyte
units
CS2 area
CS3 area
SFR area
16 Kbyte
RAM area
48 Kbyte
Reserved area
64 Kbytes
H'003F FFFF
H'0040 0000
H'005F FFFF
H'0060 0000
H'007F FFFF
H'0080 0000
H'0080 3FFF
H'0080 4000
H'0080 FFFF
H'0081 0000
H'0081 FFFF
H'0082 0000
H'FFFF FFFF
Note 1: This area is located differently depending on how chip mode is set.
Figure 3.1.1 Address Space
3-3
Ghost area in
128-Kbyte units
H'00FF FFFF
32180 Group User’s Manual (Rev.1.0)
Page 55
ADDRESS SPACE
l
)
l
)
3
3.2 Operation Modes
3.2 Operation Modes
The microcomputer is placed in one of the following modes depending on how CPU operation mode is set by
MOD0 and MOD1 pins. The operation mode used for rewriting the internal flash memory is described separately
in Section 6.5, “Programming the Internal Flash Memory.”
Note 1: Connect VCCE and VSS to the VCCE input power supply and ground, respectively.
Note 2: For the operation mode used to rewrite the internal flash memory (FP = VCCE) which is not shown in the above
table, see Section 6.5, “Programming the Internal Flash Memory.”
The internal ROM and extended external areas are located differently depending on how operation mode is set.
(All other areas in the address space are located the same way.) The diagram below shows how the internal ROM
and extended external areas are mapped into the address space in each operation mode. (For flash rewrite mode,
see Section 6.5, “Programming the Internal Flash Memory.”)
Non-CS0 area
H'0000 0000
H'000F FFFF
H'0010 0000
H'001F FFFF
H'0020 0000
H'003F FFFF
H'0040 0000
H'005F FFFF
H'0060 0000
H'007F FFFF
Interna
ROM area
(1 Mbytes
<Single-chip mode>
Interna
ROM area
(1 Mbytes
CS0 area
CS1 area
CS2 area
Extended external area
CS3 area
<External extension mode>
CS0 area
CS1 area
CS2 area
Extended external area
CS3 area
<Processor mode>
Figure 3.2.1 Internal ROM and Extended External Area Address Mapping of the M32180F8 in Each Operation Mode
3-4
32180 Group User’s Manual (Rev.1.0)
Page 56
ADDRESS SPACE
3
3.3 Internal ROM and Extended External Areas
3.3 Internal ROM and Extended External Areas
The 8-Mbyte area in the user space from the address H’0000 0000 to the address H’007F FFFF comprise the
internal ROM and extended external areas. For the address mapping of these areas that differs with each operation mode, see Section 3.2, “Operation Modes.”
3.3.1 Internal ROM Area
The internal ROM is allocated to the addresses shown below. Located at the beginning of this area is the EIT
vector entry (and the ICU vector table).
Table 3.3.1 Internal ROM Allocation Address
Type NameSizeAllocation Address
M32180F81 MbytesH’0000 0000 to H’000F FFFF
3.3.2 Extended External Area
The extended external area is only available when external extension or processor mode is selected by operation mode settings. When accessing the extended external area, the control signals necessary to access external devices are output.
The CS0# through CS3# signals are output corresponding to the address mapping of the extended external
area. The CS0#, CS1#, CS2# and CS3# signals are output for the CS0, CS1, CS2 and CS3 areas, respectively.
Table 3.3.2 Address Mapping of the Extended External Area in Each Operation Mode
Operation ModeAddress Mapping of Extended External Area
Single-chip modeNone
External extension modeAddresses H’0010 0000 to H’001F FFFF (CS0 area: 1 Mbytes)
Addresses H’0020 0000 to H’003F FFFF (CS1 area: 2 Mbytes)
Addresses H’0040 0000 to H’005F FFFF (CS2 area: 2 Mbytes)
Addresses H’0060 0000 to H’007F FFFF (CS3 area: 2 Mbytes)
Addresses H’0020 0000 to H’003F FFFF (CS1 area: 2 Mbytes)
Addresses H’0040 0000 to H’005F FFFF (CS2 area: 2 Mbytes)
Addresses H’0060 0000 to H’007F FFFF (CS3 area: 2 Mbytes)
3-5
32180 Group User’s Manual (Rev.1.0)
Page 57
ADDRESS SPACE
3
3.4 Internal RAM and SFR Areas
3.4 Internal RAM and SFR Areas
The 8-Mbyte area from the address H’0080 0000 to the address H’00FF FFFF comprise the internal RAM and
SFR (Special Function Register) areas. Of these, the space that the user can actually use is a 128-Kbyte area
from the address H’0080 0000 to the address H’0081 FFFF. The other areas here are ghosts in 128-Kbyte units.
(Do not use the ghost area intentionally during programming.)
3.4.1 Internal RAM Area
The internal RAM area is allocated to the addresses shown below.
Table 3.4.1 Internal RAM Allocation Address
Type NameSizeAllocation Address
M32180F848 KbytesH’0080 4000 to H’0080 FFFF
3.4.2 SFR (Special Function Register) Area
The addresses H’0080 0000 to H’0080 3FFFF comprise the SFR (Special Function Register) area. Located in
this area are the internal peripheral I/O registers.
H'0080 0000
SFR area
(16 Kbytes)
H'0080 3FFF
H'0080 4000
H'0080 7FFF
H'0080 8000
Internal RAM
(48 Kbytes)
Virtual flash emulation areas
separated in 4-Kbyte units
can be allocated here.
For details, see Section 6.6.
H'0080 FFFF
Figure 3.4.1 Internal RAM and SFR (Special Function Register) Areas of the M32180F8
3-6
32180 Group User’s Manual (Rev.1.0)
Page 58
3
r
(
)
r
0
3
r
l
)
JT
(
OP
)
O
)
JT
(
)
JT
(
0
)
C
t
4
5
r
JT
(
)
JT
(
OU1
)
JT
(
)
JT
(
0
)
JT
(
OU0
)
JT
(
OU2
)
JT
(
)
CAN0
CAN1
0080 0AEE
0080 0B8C
0080 0C8C
E
0080 0CE2
ADDRESS SPACE
3.4 Internal RAM and SFR Areas
H'0080 0000
H'0080 007E
H'0080 0080
H'0080 00EE
H'0080 0100
H'0080 0146
H'0080 0180
H'0080 0186
H'0080 01E0
H'0080 01F8
H'0080 0200
H'0080 023E
H'0080 0240
H'0080 02FE
H'0080 0300
H'0080 03BE
H'0080 03C0
H'0080 03D8
H'0080 03E0
H'0080 03FE
H'0080 0400
H'0080 0478
07815
+0 address +1 address
Interrupt Controlle
ICU
A-D0 Converte
Serial I/O
Wait Controlle
Flash contro
MJT (common part
M
T
MJT(TI
M
M
DMA
TMS
TML
Multijunction
timer (MJT)
H'0080 078C
H'0080 078E
H'0080 0790
H'0080 07E2
H'0080 0A00
H'0080 0A26
H'0080 0A80
H'
H'
H'0080 0B8E
H'0080 0B90
H'0080 0BE2
H'
H'0080 0C8
H'0080 0C90
H'
H'0080 0FE0
H'0080 0FFE
H'0080 1000
H'0080 11FE
07815
+0 address +1 address
M
TID
M
T
Serial I/O
A-D1 Converte
M
M
T
M
M
T
M
Multijunction
timer (MJT)
Multijunction
timer (MJT)
H'0080 0700
Input/output por
H'0080 077F
Note: • The Real-time Debugger (RTD) is an independent module that is operated from the outside, and is transparent to
the CPU.
H'0080 0180CS0 Area Wait Control RegisterCS1 Area Wait Control Register16-4
H'0080 0182CS2 Area Wait Control RegisterCS3 Area Wait Control Register16-4
H'0080 01E0Flash Mode RegisterFlash Status Register 16-4
H'0080 01E2Flash Control Register 1Flash Control Register 26-7
H'0080 01E4Flash Control Register 3Flash Control Register 46-9
H'0080 01E6(Use inhibited area)
H'0080 01E8Virtual Flash S Bank Register 06-11
H'0080 01EAVirtual Flash S Bank Register 16-11
H'0080 01ECVirtual Flash S Bank Register 26-11
H'0080 01EEVirtual Flash S Bank Register 36-11
H'0080 01F0Virtual Flash S Bank Register 46-11
H'0080 01F2Virtual Flash S Bank Register 56-11
H'0080 01F4Virtual Flash S Bank Register 66-11
H'0080 01F6Virtual Flash S Bank Register 76-11
H'0080 0200(Use inhibited area)Clock Bus & Input Event Bus Control Register10-16
H'0080 0202Prescaler Register 0Prescaler Register 110-12
H'0080 0700P0 Data RegisterP1 Data Register8-7
H'0080 0702P2 Data RegisterP3 Data Register8-7
H'0080 0704P4 Data Register(Use inhibited area)8-7
H'0080 0706P6 Data RegisterP7 Data Register8-7
H'0080 0708P8 Data RegisterP9 Data Register8-7
H'0080 070AP10 Data RegisterP11 Data Register8-7
H'0080 070CP12 Data RegisterP13 Data Register8-7
H'0080 070EP14 Data RegisterP15 Data Register8-7
H'0080 0710P16 Data RegisterP17 Data Register8-7
H'0080 0712P18 Data RegisterP19 Data Register8-7
H'0080 0714P20 Data RegisterP21 Data Register8-7
H'0080 0716P22 Data Register(Use inhibited area)8-7
Address+0 address+1 addressSee pages
H'0080 0720P0 Direction RegisterP1 Direction Register8-8
H'0080 0722P2 Direction RegisterP3 Direction Register8-8
H'0080 0724P4 Direction Register(Use inhibited area)8-8
H'0080 0726P6 Direction RegisterP7 Direction Register8-8
H'0080 0728P8 Direction RegisterP9 Direction Register8-8
H'0080 072AP10 Direction RegisterP11 Direction Register8-8
H'0080 072CP12 Direction RegisterP13 Direction Register8-8
H'0080 072EP14 Direction RegisterP15 Direction Register8-8
H'0080 0730P16 Direction RegisterP17 Direction Register8-8
H'0080 0732P18 Direction RegisterP19 Direction Register8-8
H'0080 0734P20 Direction RegisterP21 Direction Register8-8
H'0080 0736P22 Direction Register(Use inhibited area)8-8
H'0080 1028CAN0 Global Mask Register Standard ID 0CAN0 Global Mask Register Standard ID 113-48
H'0080 102ACAN0 Global Mask Register Extended ID 0CAN0 Global Mask Register Extended ID 113-49
H'0080 102CCAN0 Global Mask Register Extended ID 2(Use inhibited area)13-50
H'0080 102E(Use inhibited area)
H'0080 1030CAN0 Local Mask Register A Standard ID 0CAN0 Local Mask Register A Standard ID 113-48
H'0080 1032CAN0 Local Mask Register A Extended ID 0CAN0 Local Mask Register A Extended ID 113-49
H'0080 1034CAN0 Local Mask Register A Extended ID 2(Use inhibited area)13-50
H'0080 1036(Use inhibited area)
H'0080 1038CAN0 Local Mask Register B Standard ID 0CAN0 Local Mask Register B Standard ID 113-48
H'0080 103ACAN0 Local Mask Register B Extended ID 0CAN0 Local Mask Register B Extended ID 113-49
H'0080 103CCAN0 Local Mask Register B Extended ID 2(Use inhibited area)13-50
H'0080 103E(Use inhibited area)
H'0080 1040CAN0 Single Shot Mode Control Register13-52
H'0080 1042(Use inhibited area)
H'0080 1044CAN0 Single-Shot Interrupt Request Status Register13-33
H'0080 1046(Use inhibited area)
H'0080 1048CAN0 Single-Shot Interrupt Request Enable Register3-34
H'0080 1050CAN0 Message Slot 0 Control RegisterCAN0 Message Slot 1 Control Register13-53
H'0080 1428CAN1 Global Mask Register Standard ID 0CAN1 Global Mask Register Standard ID 113-48
H'0080 142ACAN1 Global Mask Register Extended ID 0CAN1 Global Mask Register Extended ID 113-49
H'0080 142CCAN1 Global Mask Register Extended ID 2(Use inhibited area)13-50
H'0080 142E(Use inhibited area)
H'0080 1430CAN1 Local Mask Register A Standard ID 0CAN1 Local Mask Register A Standard ID 113-48
H'0080 1432CAN1 Local Mask Register A Extended ID 0CAN1 Local Mask Register A Extended ID 113-49
H'0080 1434CAN1 Local Mask Register A Extended ID 2(Use inhibited area)13-50
H'0080 1436(Use inhibited area)
H'0080 1438CAN1 Local Mask Register B Standard ID 0CAN1 Local Mask Register B Standard ID 113-48
H'0080 143ACAN1 Local Mask Register B Extended ID 0CAN1 Local Mask Register B Extended ID 113-49
H'0080 143CCAN1 Local Mask Register B Extended ID 2(Use inhibited area)13-50
H'0080 143E(Use inhibited area)
H'0080 1440CAN1 Single-Shot Mode Control Register13-52
H'0080 1442(Use inhibited area)
H'0080 1444CAN1 Single-Shot Interrupt Request Status Register13-33
H'0080 1446(Use inhibited area)
H'0080 1448CAN1 Single-Shot Interrupt Request Enable Register13-34
H'0080 1450CAN1 Message Slot 0 Control RegisterCAN1 Message Slot 1 Control Register13-53
H'0080 1452CAN1 Message Slot 2 Control RegisterCAN1 Message Slot 3 Control Register13-53
H'0080 1454CAN1 Message Slot 4 Control RegisterCAN1 Message Slot 5 Control Register13-53
H'0080 1456CAN1 Message Slot 6 Control RegisterCAN1 Message Slot 7 Control Register13-53
H'0080 1458CAN1 Message Slot 8 Control RegisterCAN1 Message Slot 9 Control Register13-53
H'0080 145ACAN1 Message Slot 10 Control RegisterCAN1 Message Slot 11 Control Register13-53
The EIT vector entry is located at the beginning of the internal ROM/extended external areas. The branch instruction for jumping to the start address of each EIT event processing handler is written here. Note that it is the branch
instruction and not the jump address itself that is written here. For details, see Chapter 4, “EIT.”
TRAP15
EI (External Interrupt) (Note 1)
FPE (Floating-Point Exception)
Note 1: When flash entry bit = 1 (flash E/W enable mode), the EI vector entry is located at H'0080 4000.
Figure 3.5.1 EIT Vector Entry
3-35
32180 Group User’s Manual (Rev.1.0)
Page 87
ADDRESS SPACE
3
3.6 ICU Vector Table
3.6 ICU Vector Table
The ICU vector table is used by the internal interrupt controller of the microcomputer. This table has the addresses
shown below, at which the start addresses of interrupt handlers for the interrupt requests from respective internal
peripheral I/Os are set. For details, see Chapter 5, “Interrupt Controller.”
The microcomputer has the function to map 4-Kbyte memory blocks beginning with the address H’0080 8000
into areas (S banks) of the internal flash memory that are divided in 4-Kbyte units. This functions is referred to as
the virtual flash emulation function.
This function allows the data located in 4-Kbyte blocks of the internal RAM to be changed with the flash memory
contents at the addresses specified by the Virtual Flash Bank Register. For details about this function, see
Section 6.6, “Virtual Flash Emulation Function.”
3-38
32180 Group User’s Manual (Rev.1.0)
Page 90
CHAPTER 4
EIT
4.1Outline of EIT
4.2EIT Events
4.3EIT Processing Procedure
4.4EIT Processing Mechanism
4.5Acceptance of EIT Events
4.6Saving and Restoring the PC and PSW
4.7EIT Vector Entry
4.8Exception Processing
4.9Interrupt Processing
4.10Trap Processing
4.1 1EIT Priority Levels
4.12Example of EIT Processing
4.13Precautions on EIT
Page 91
4
4.1 Outline of EIT
4.1 Outline of EIT
If some event occurs when the CPU is executing an ordinary program, it may become necessary to suspend the
program being executed and execute another program. Events like this one are referred to by a generic name as
EIT (Exception, Interrupt and Trap).
(1) Exception
This is an event related to the context being executed. It is generated by an error or violation during instruction
execution. This type of event includes Address Exception (AE), Reserved Instruction Exception (RIE) and FloatingPoint Exception (FPE).
(2) Interrupt
This is an event generated irrespective of the context being executed. It is generated by a hardware-derived signal
from an external source, as well as by the internal peripheral I/O. This type of event includes Reset Interrupt (RI),
System Break Interrupt (SBI) and External Interrupt (EI).
(3) Trap
This refers to a software interrupt generated by executing a TRAP instruction. This type of event is intentionally
generated in a program as in the OS’s system call by the programmer.
Reserved Instruction Exception (RIE) occurs when execution of a reserved instruction (unimplemented
instruction) is detected.
(2) Address Exception (AE)
Address Exception (AE) occurs when an attempt is made to access a misaligned address in Load or Store
instructions.
(3) Floating-point Exception (FPE)
Floating-point Exception (FPE) occurs when Unimplemented Exception (UIPL) or one of the five exceptions
specified in the IEEE 754 standard (OVF/UDF/IXCT/DIV0/IVLD) is detected. Each exception processing is
outlined below.
1) Overflow Exception (OVF)
The exception occurs when the absolute value of the operation result exceeds the largest describable
precision in the floating-point format. The following table shows the operation results when an OVF occurs.
EIT
4.2 EIT Events
Table 4.2.1 Operation Results When an OVF Occurred
Operation Result (Content of the Destination Register)
Sign of the Result
+ +MAX
- -Infinity
+ +I nfinity
- -MAX
+ +MAX
- -MAX
+ +I nfinity
- -Infinity
Operation Result (Content of the Destination Register)
When the OVF EIT processing is
masked (Note 1)
No change
When the OVF EIT processing is
executed (Note 2)
No change
Rounding Mode
-Infinity
+Infinity
0
Nearest
Note 1: When the overflow exception enable (EO) bit (FPSR register bit 20) = "0"
Note 2: When the overflow exception enable (EO) bit (FPSR register bit 20) = "1"
Note: • If an OVF occurs while EIT processing for OVF is masked, an IXCT occurs at the same time.
• +MAX = H’7F7F FFFF, –MAX = H’FF7F FFFF
2) Underflow Exception (UDF)
The exception occurs when the absolute value of the operation result is less than the largest describable
precision in the floating-point format. The following table shows the operation results when a UDF occurs.
Table 4.2.2 Operation Results when a UDF Occurred
When UDF EIT processing is masked (Note 1)When UDF EIT processing is executed (Note 2)
DN = 0: An unimplemented exception occurs
DN = 1: 0 is returned
Note 1: When the underflow exception enable (EU) bit (FPSR register bit 18) = "0"
Note 2: When the underflow exception enable (EU) bit (FPSR register bit 18) = "1"
The exception occurs when the operation result differs from a result led out with an infinite range of
precision. The following table shows the operation results and the respective conditions in which each
IXCT occurs.
Table 4.2.3 Operation Results when an IXCT Occurred
Operation Result (Content of the Destination Register)
Occ urren c e Con dition
When the IXCT EIT processing for is
masked (Note 1)
When the IXCT EIT processing is
executed (Note 2)
EIT
Overflow occurs in OVF masked
condition
Rounding occursRounded valueNo change
Note 1: When the inexact exception enable (EX) bit (FPSR register bit 17) = "0"
Note 2: When the inexact exception enable (EX) bit (FPSR register bit 17) = "1"
4) Zero Division Exception (DIV0)
The exception occurs when a finite nonzero value is divided by zero. The following table shows the
operation results when a DIV0 is occurs.
Table 4.2.4 Operation Results When a DIV0 Occurred
Dividend
Nonzero finite value
Note 1: When the zero division exception enable (EZ) bit (FPSR register bit 19) = "0"
Note 2: When the zero division exception enable (EZ) bit (FPSR register bit 19) = "1"
Please note that the DIV0 EIT processing does not occur in the following conditions.
Table 4.2.5 Cases in Which No DIV0 Occur
DividendBehavior
0An invalid operation exception occurs
InfinityNo exceptions occur (with the result = "Infinity")
When the DIV0 EIT processing is masked
Reference OVF operation resultsNo change
Operation Result (Content of the Destination Register)
(Note 1)
+-Infinity (Sign is derived by exclusive
ORing the signs of the divisor and
dividend.)
The exception occurs when an invalid operation is executed. The following table shows the operation
results and the respective conditions in which each IVLD occurs.
Table 4.2.6 Operation Results When an IVLD Occurred
Operation Result (Content of the Destination Register)
Occ urrence Condition
Operation for SNaN operand
+Infinity-(+Infinity), -Infinity-(-Infinity)
0 x In finity
0 / 0, Infini ty / Infi n ity
When FTOI
When an integer conversion
overflowed
When NaN or Infinity was converted
into an integer
When < or > com parison was performed on NaN
Note 1: When the invalid operation exception enable (EV) bit (FPSR register bit 21) = "0"
Note 2: When the invalid operation exception enable (EV) bit (FPSR register bit 21) = "1"
Note: • NaN (Not a Number)
SNaN (Signaling NaN): a NaN in which the MSB of the decimal fraction is "0". When SNaN is used as the
source operand in an operation, an IVLD occurs. SNaNs are useful in identifying program bugs when used
as the initial value in a variable. However, SNaNs cannot be generated by hardware.
QNaN (Quiet NaN): a NaN in which the MSB of the decimal fraction is "1". Even when QNaN is used as the
source operand in an operation, an IVLD will not occur (excluding comparison and format conversion).
Because a result can be checked by the arithmetic operations, QNaN allows the user to debug without
executing an EIT processing. QNaNs are created by hardware.
instruction was
executed
When FTOS
instruction was
executed
When the IVLD EIT processing is mask ed (Note 1)
QNaN
Return value when pre-conversion signed bit is:
"0": H7FFF FFFF
"1": H 8000 0000
Return value when pre-conversion signed bit is:
"0": H 0000 7FFF
"1": HFFFF 8000
Comparison results (comparison invalid)
When the IVLD EIT
processing is executed
(Note 2)
No change
EIT
6) Unimplemented Exception (UIPL)
The exception occurs when the denormalized number zero flush (DN) bit (FPSR register bit 23) = "0" and
a denormalized number is given as an operation operand. (Note 1)
Because the UIPL has no enable bits available, it cannot be masked when they occur. The destination
register remains unchanged.
Note 1: A UDF occurs when the intermediate result of an operation is a denormalized number, in which case if
the DN bit (FPSR register bit 23) = "0", an UIPL occurs.
4.2.2 Interrupt
(1) Reset Interrupt (RI)
Reset Interrupt (RI) is always accepted by entering the RESET# signal. The reset interrupt is assigned the
highest priority.
For details about the reset interrupt, see Chapter 7, “Reset.”
(2) System Break Interrupt (SBI)
System Break Interrupt (SBI) is an emergency interrupt which is used when power outage is detected or a fault
condition is notified by an external watchdog timer. This interrupt can only be used in cases when after interrupt
processing, control will not return to the program that was being executed when the interrupt occurred.
(3) External Interrupt (EI)
External Interrupt (EI) is requested from internal peripheral I/Os managed by the interrupt controller. The
interrupt controller manages these interrupts by assigning each one of eight priority levels including an
interrupt-disabled state.
4-5
32180 Group User’s Manual (Rev.1.0)
Page 95
4
4.2 EIT Events
4.2.3 Trap
Traps are software interrupts which are generated by executing the TRAP instruction. Sixteen distinct vector
addresses are provided corresponding to TRAP instruction operands 0–15.
4.3 EIT Processing Procedure
EIT processing consists of two parts, one in which they are handled automatically by hardware, and one in which
they are handled by user-created programs (EIT handlers). The procedure for processing EITs when accepted,
except for a rest interrupt, is shown below.
EIT request
Instruction
A
generated
InstructionBInstruction
C
Program suspended
and EIT request
accepted
processing-canceled
Program execution restarted
InstructionCInstruction
Instruction
type (RIE, AE)
D
Instruction processing-completed
type (FPE, EI, TRAP)
EIT
RTE
instruction
(Note 1)
BPSW→PSW
BPC→PC
PC→BPC
PSW→BPSW
Note 1: Indicates saving and restoring the PSW register bits between its PSW and BPSW fields.
Hardware preprocessing
(Note 1)
EIT vector
entry
Branch
instruction
(SBI)
BPC, PSW, FPSR
and general-purpose
registers are saved
to the stack
SBI
(System Break
Interrupt processing)
Hardware postprocessing
User-created EIT handler
EIT handler except for SBI
General-purpose
Processing
by handler
registers, PSW, FPSR
and BPC are restored
from the stack
Program terminated
or system is reset
Figure 4.3.1 Outline of the EIT Processing Procedure
When an EIT is accepted, the CPU branches to the EIT vector after hardware preprocessing (as will be described
later). The EIT vector has an entry address assigned for each EIT. This is where the BRA (branch) instruction for
the EIT handler (not the jump address itself) is written.
In the hardware preprocessing, the PC is transferred to the BPC (backup PC), and the content of the PSW register’s
PSW field is transferred to the BPSW field in that register.
Other necessary operations must be performed in the user-created EIT handler. These include saving the BPC and
PSW registers (including the BPSW field) and the general-purpose registers to be used in the EIT handler to the
stack. In addition, the accumulator and the FPSR register must be saved to the stack as necessary. Remember
that all these registers must be saved to the stack in a program by the user.
When processing by the EIT handler is completed, restore the saved registers from the stack and finally execute
the RTE instruction. Control is thereby returned from the EIT processing to the program that was being executed
when the EIT occurred. (This does not apply to the System Break Interrupt, however.)
In the hardware postprocessing, the BPC is returned to the PC, and the content of the PSW register’s BPSW field
is returned to the PSW field in that register. Note that the values stored in the BPC and the PSW register’s BPSW
field after executing the RTE instruction are undefined.
4-6
32180 Group User’s Manual (Rev.1.0)
Page 96
4
4.4 EIT Processing Mechanism
4.4 EIT Processing Mechanism
The EIT processing mechanism consists of the M32R CPU core and the interrupt controller for internal peripheral I/
Os. It also has the backup registers for the PC and PSW (the BPC register and the BPSW field of the PSW
register). The EIT processing mechanism is shown below.
M32R/ECU
M32R CPU core
EIT
RESET#
SBI#
Internal
peripheral
I/Os
Interrupt
controller
(ICU)
RI
SBI
EI
AE, RIE, FPE, TRAP
IE flag
(PSW)
PSWBPSW
PSW register
RI
Priority
SBI
EI
BPC register
PC register
High
Low
Figure 4.4.1 EIT Processing Mechanism
4-7
32180 Group User’s Manual (Rev.1.0)
Page 97
4
4.5 Acceptance of EIT Events
4.5 Acceptance of EIT Events
When an EIT event occurs, the CPU suspends the program it has hitherto been executing and branches to EIT
processing by the relevant handler. Conditions under which each EIT event occurs and the timing at which they are
accepted are shown below.
Table 4.5.1 Acceptance of EIT Events
EIT EventType of ProcessingAcceptance TimingValues Set in BPC Register
Reserved InstructionInstruction processing-During instruction executionPC value of the instruction that
Exception (RIE)canceled typegenerated RIE
Address Exception (AE)Instruction processing-During instruction executionPC value of the instruction that
canceled typegenerated AE
Floating-Point Exception Instruction processing-Break in instructionsPC value of the instruction that
(FPE)completed typegenerated FPE + 4
Reset Interrupt (RI)Instruction processing-Each machine cycleUndefined value
aborted type
System Break InterruptInstruction processing-Break in instructionsPC value of the next instructi o n
(SBI)completed type(word boundary only)
External Interrupt (EI)Instruction processing-Break in instructionsPC value of the next instruction
completed type(word boundary only)
Trap (TRAP)Instruction processing-Break in instructionsPC value of TRAP instruction + 4
completed type
EIT
4.6 Saving and Restoring the PC and PSW
The following describes operation of the microcomputer at the time when it accepts an EIT and when it executes the
RTE instruction.
(1) Hardware preprocessing when an EIT is accepted
[1] Save the PSW register’s SM, IE and C bits in its backup field.
BSM←SM
BIE←IE
BC←C
[2] Update the PSW register’s SM, IE and C bits
SM←Remains unchanged (RIE, AE, FPE, TRAP) or cleared to "0" (SBI, EI, RI)
IE←Cleared to "0"
C←Cleared to "0"
[3] Save the PC register
BPC←PC
[4] Set the vector address in the PC register
Branches to the EIT vector and executes the branch (BRA) instruction written in it, thereby transferring
control to the user-created EIT handler.
(2) Hardware postprocessing when the RTE instruction is executed
[A] Restore the PSW register’s SM, IE and C bits from its backup field.
SM←BSM
IE←BIE
C←BC
[B] Restore the PC register from the BPC register.
PC←BPC
Note: • The values stored in the BPC and the PSW register’s BSM, BIE and BC bits after executing the RTE
instruction are undefined.
4-8
32180 Group User’s Manual (Rev.1.0)
Page 98
EIT
4
[1] Saving the SM, IE and C bits
BSM
BIE
BC
[2] Updating the SM, IE and C bits
SM
IE
C
[A] Restoring the SM, IE and C bits from the
backup field
SM
IE
C
The values stored in the BSM, BIE
and BC bits after executing the RTE
instruction are undefined.
SM
←
IE
←
C
←
Unchanged or 0
←
0
←
0
←
BSM
←
BIE
←
BC
←
PSWBPCPC
4.6 Saving and Restoring the PC and PSW
[3] Saving the PC
BPC
[4] Setting the vector address in the PC
PC
[B] Restoring the PC from the BPC register
The value stored in the BPC register
after executing the RTE instruction is
undefined.
PC←
Vector address←
When EIT is accepted
When RTE instruction
is executed
PSW
[1]
[2]
[A][B]
Figure 4.6.1 Saving and Restoring the PC and PSW
[3]
[4]
BPSW fieldPSW field
16 1723 24 2531(LSB)15870(MSB)
00000000000000000000000000
SMIECBCBSMBIE
4-9
32180 Group User’s Manual (Rev.1.0)
Page 99
EIT
4
4.7 EIT Vector Entry
4.7 EIT Vector Entry
The EIT vector entry is located in the user space beginning with the address H’0000 0000. The table below lists the
EIT vector entry.
Table 4.7.1 EIT Vector Entry
NameAbbreviation Vector AddressSMIEBPC
Reset InterruptRIH'0000 0000 (Note 1) 00Undefined
System BreakSBIH'0000 001000PC of the next instruction
Interrupt
Reserved InstructionRIEH'0000 0020Unchanged 0PC of the instruction that generated RIE
Exception
Address ExceptionAEH'0000 0030Unchanged 0PC of the instruction that generated RIE
TrapTRAP0H'0000 0040Unchanged 0PC of TRAP instruction + 4
TRAP1H'0000 0044Unchanged 0PC of TRAP instruction + 4
TRAP2H'0000 0048Unchanged 0PC of TRAP instruction + 4
TRAP3H'0000 004CUnchanged 0PC of TRAP instruction + 4
TRAP4H'0000 0050Unchanged 0PC of TRAP instruction + 4
TRAP5H'0000 0054Unchanged 0PC of TRAP instruction + 4
TRAP6H'0000 0058Unchanged 0PC of TRAP instruction + 4
TRAP7H'0000 005CUnchanged 0PC of TRAP instruction + 4
TRAP8H'0000 0060Unchanged 0PC of TRAP instruction + 4
TRAP9H'0000 0064Unchanged 0PC of TRAP instruction + 4
TRAP10H'0000 0068Unchanged 0PC of TRAP instruction + 4
TRAP11H'0000 006CUnchanged 0PC of TRAP instruction + 4
TRAP12H'0000 0070Unchanged 0PC of TRAP instruction + 4
TRAP13H'0000 0074Unchanged 0PC of TRAP instruction + 4
TRAP14H'0000 0078Unchanged 0PC of TRAP instruction + 4
TRAP15H'0000 007CUnchanged 0PC of TRAP instruction + 4
External InterruptEIH'0000 0080 (Note 2) 00PC of the next instruction
Floating-Point Exception FPEH'0000 0090Unchanged 0PC of the instruction that generated FPE + 4
Note 1: During boot mode, the CPU starts executing the boot program after reset. For details, see Section 6.5,
“Programming the Internal Flash Memory.”
Note 2: During flash E/W enable mode, this vector address is moved to the beginning of the internal RAM (address H’0080
4000). For details, see Section 6.5, “Programming the Internal Flash Memory.”
4-10
32180 Group User’s Manual (Rev.1.0)
Page 100
4
4.8 Exception Processing
4.8.1 Reserved Instruction Exception (RIE)
[Occurrence Conditions]
Reserved Instruction Exception (RIE) occurs when a reserved instruction (unimplemented instruction) is
detected. Instruction check is performed on the op-code part of the instruction.
When a reserved instruction exception occurs, the instruction that generated it is not executed. If an external interrupt is requested at the same time a reserved instruction exception is detected, it is the reserved
instruction exception that is accepted.
[EIT Processing]
(1) Saving SM, IE and C bits
The PSW register’s SM, IE and C bits are saved to the respective backup bits: BSM, BIE and BC.
BSM ←SM
BIE ←IE
BC←C
(2) Updating SM, IE and C bits
The PSW register’s SM, IE and C bits are updated as shown below.
SM←Unchanged
IE←0
C←0
EIT
4.8 Exception Processing
(3) Saving the PC
The PC value of the instruction that generated the reserved instruction exception is set in the BPC register.
For example, if the instruction that generated the reserved instruction exception is at address 4, the value 4
is set in the BPC register. Similarly, if the instruction that generated the reserved instruction exception is at
address 6, the value 6 is set in the BPC register. In this case, the value of the BPC register bit 30 indicates
whether the instruction that generated the reserved instruction exception resides on a word boundary (BPC
register bit 30 = "0") or not on a word boundary (BPC register bit 30 = "1").
However, in either case of the above, the address to which the RTE instruction returns after the EIT handler
has terminated is address 4. (This is because the 2 low-order address bits are cleared to ‘00’ when returned
to the PC.)
+0+1+2+3
Address
Return
address
Figure 4.8.1 Example of a Return Address for Reserved Instruction Exception (RIE)
H'00
H'04
H'08
H'0C
RIE occurred
BPC
H'04
Return
address
Address
H'00
H'04
H'08
H'0C
+0+1+2+3
BPC
RIE occurred
H'06
4-11
32180 Group User’s Manual (Rev.1.0)
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.