Before using this material, please visit the above website to confirm that this is
the most current document available.
Revision date: Oct. 5, 2001
Rev. 1.0
Page 2
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 evaluate all information 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 reexport 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 3
REVISION HISTORY 32172/32173 GROUP USER’S MANUAL
Rev.DateDescription
PageSummary
1.010/5/2001 -First edition issued
Page 4
How to read internal I/O register tables
➀ Bit Numbers: Each register is connected with an internal bus of 16-bit
wide, so the bit numbers of the registers located at even
addresses are D0-D7, and those at odd addresses are
D8-D15.
➁ State of Register at Reset: Represents the initial state of each register
immediately after reset with hexadecimal numbers
(undefined bits after reset are indicated each in column ➂.)
➂ At read: ... read enabled
? ... read disabled (read value invalid)
0 ... Read always as 0
1 ... Read always as 1
④ At write:: Write enabled
∆ : Write enable conditionally
(include some conditions at write)
- : Write disabled (Written value invalid)
<Example of representation>
Not implemented
in the shaded portion.
1
D
0Not assigned.
1Abit
2
3
Bit nameFunction
(...................)
Bbit
(...................)
Cbit
(...................)
1234D0
Abit
BbitCbit
0: ----1: -----
0: ----1: -----
0: ----1: ----
Registers represented with thick rectangles
are accessible only with halfwords or words
(not accessible with bytes)
Inserting a Bypass Capacitor between VSS and VCC Lines ........
Appendix
Appendix
Appendix
Appendix
3-2
Appendix
3-4
Appendix
3-5
Appendix
3-6
Appendix
3-8
1-2
2-2
3-2
(15)
Page 20
*** This is a blank page ***
(16)
Page 21
CHAPTER 1CHAPTER 1
OVERVIEW
1.1 Overview
1.2 Block Diagram
1.3 Pin Functions
1.4 Pin Layout
Page 22
1
1.1 Overview
1.1.1 M32R Family CPU Core
(1) Uses the RISC architecture
• The 32172/32173 are 32-bit, RISC single-chip microcomputers built around the M32R family
CPU core (hereafter referred to as the "M32R") and incorporating flash memory, RAM, and
various other peripheral functions... all integrated into a single chip.
• The M32R uses the RISC architecture. Memory accesses are performed using Load and Store
instructions, and various arithmetic operations are executed using register-to-register
operating instructions. The M32R internally has sixteen 32-bit general-purpose registers and a
total of 83 discrete instructions.
• In addition to Load and Store instructions, the M32R supports compound instructions such as
Load & Address Update and Store & Address Update. These instructions are useful for
speeding up data transfers.
Overview
1.1 Overview
(2) 5-stage pipelined processing
• The M32R uses 5-stage pipelined instruction processing consisting of Instruction Fetch,
Decode, Execute, Memory Access, and Write Back. Not just load and store instructions or
register-to-register operation instructions, compound instructions such as Load & Address
Update and Store & Address Update also are executed in one cycle.
• Instructions are entered into the execution stage in the order they are fetched, but this does not
always mean that the first instruction entered is executed first. If the execution of a load or store
instruction entered earlier is delayed by one or more wait cycles inserted in memory access, a
register-to-register operation instruction entered later may be executed before said load or
store instruction. By using "out-of-order-completion" like this, the M32R controls instruction
execution without wasting clock cycles.
(3) Compact instruction code
• Instructions of the M32R come in either a 16-bit instruction or a 32-bit instruction format. Use of
the 16-bit instruction format especially helps to reduce the code size of a program.
• Some 32-bit instructions can branch directly to a location 32 Mbytes forward or backward from
the currently executed instruction address. The availability of such instructions makes
programming easier than for architectures with segmented address spaces.
1-2Rev.1.0
Page 23
1
1.1.2 Built-in Multiply-Accumulate Operation Function
(1) Built in high-speed multiplier
• The M32R incorporates a 32-bit x 16-bit high-speed multiplier/accumulator which allows the
processor to execute a 32-bit x 32-bit integer multiplication instruction in three cycles (one
cycle is 25 ns when CPU memory clock = 40 MHz).
(2) Supports Multiply-Accumulate operation instructions comparable to DSP
• The M32R supports the following four modes of Multiply-Accumulate operation instructions (or
multiplication instructions) based on a 56-bit accumulator:
16 high-order register bits x 16 high-order register bits
16 low-order register bits x 16 low-order register bits
All 32 register bits x 16 high-order register bits
All 32 register bits x 16 low-order register bits
• The M32R has instructions to round off the value stored in the accumulator to 16 or 32 bits, as
well as instructions to shift the accumulator value to adjust digits and store the digit-adjusted
value in a register. These instructions also can be executed in one cycle, so that when
combined with high-speed data transfer instructions such as Load & Address Update and
Store & Address Update, they enable the M32R to exhibit high data processing capability
comparable to that of DSP.
Overview
1.1 Overview
1.1.3 Built-in Flash Memory and RAM
• The 32172/32173 contains flash memory and RAM that can be accessed with no wait states,
making it possible to build a high-speed embedded system.
• The internal flash memory allows for on-board programming (you can write to it while being
mounted on the printed circuit board). Use of flash memory means the chip engineered at the
development phase can be used directly in mass-production, so that you can smoothly migrate
from prototype to mass-production without changing the printed circuit board.
• The internal flash memory can be rewritten 100 times.
• The internal flash memory has a virtual-flash emulation function, allowing the internal RAM
tobe artificially mapped into part of the internal flash memory. This function, when combined
with the internal Real-Time Debugger (RTD), facilitates data tuning on ROM tables.
• The internal RAM can be accessed for read or rewrite from an external device independently of
the M32R by using RTD (real-time debugger). It is communicated with external devices by
RTD's exclusive clock-synchronized serial I/O.
1-3Rev.1.0
Page 24
1
1.1.4 Built-in Clock Multiplier Circuit
• The 32172/32173 internally multiplies the frequency of the input clock signal by 4 (or by 2 for
the internal peripheral clock). When the input clock frequency is 10.0 MHz, the CPU clock
frequency is 40 MHz and that of the internal peripheral clock is 20 MHz.
1.1.5 Built-in Powerful Peripheral Functions
(1) Built-in input/output timers
• The timers used in the 32172/32173 consist of the following 26 channels of timers. (When not
using the PDC module as a sensor interface circuit, eight more channels of input timers are
available.)
16-bit output related timers x 16 channels
16-bit input related timers x 6 channels
32-bit input related timers x 4 channels
Each timer has multiple modes to choose from, depending on the purpose of use.
Overview
1.1 Overview
(2) Built-in 10-channel DMA
• The microcomputer contains 10 channels of DMA, allowing for data transfer between internal
peripheral I/Os and between internal RAM and internal peripheral I/O. DMA transfer requests
can be issued from the user-created software, as well as can be triggered by a signal
generated by the internal peripheral I/O (A-D converter, input/output timer, or serial I/O).
• The microcomputer also supports cascaded operation between DMA channels (starting DMA
transfer on a channel at the end of transfer on another channel). This makes advanced transfer
processing possible without causing any additional CPU load.
(3) Built-in two blocks of A-D converters
• The microcomputer contains an 8-channel A-D converter and a 4-channel A-D converter, both
capable of 10-bit resolution.
• In addition to ordinary A-D conversion, the converters support comparator mode in which a set
value and the A-D converted value are compared to determine which is larger or smaller than
the other.
• When A-D conversion is finished, the converters can generate a DMA transfer request, as well
as an interrupt.
(4) High-speed serial I/O
• The microcomputer contains eight channels of serial I/Os which can be set for clocksynchronized serial I/O or UART.
• The transfer rate in clock-synchronized serial I/O mode is a high 2 Mbits per second, allowing
for fast data transfer.
• The serial I/O has the function to generate a DMA transfer request when data reception is
1-4Rev.1.0
Page 25
1
completed or the transmit register becomes empty.
(5) Built-in Real-time Debugger (RTD)
• The Real-time Debugger (RTD) provides a function for accessing directly from the outside to
the M32R/E's internal RAM. It uses a dedicated clock-synchronized serial I/O to communicate
with external devices.
• Use of the RTD allows the contents of the internal RAM to be read out or its data to be rewritten
from the outside, independently of the M32R.
• An RTD interrupt can be generated to indicate that RTD-based data transmission or reception
is completed.
(6) 8-level interrupt controller
• The Interrupt Controller controls interrupt requests from internal peripheral I/Os by using eight
priority levels (including interrupt-disabled state) which are assigned to each interrupt source. It
also handles external interrupt requests generated upon detection of power outage or
generated by the watchdog timer as System Break Interrupt (SBI).
(7) Three operation modes
Overview
1.1 Overview
• The M32R/E supports three operation modes: single-chip, external extended, and processor
modes. The M32R/E's address space and external pin functions are switched over according
to each mode. Modes are selected using the MOD0 and MOD1 pins.
(8) Wait controller
• The Wait Controller supports access to external devices. In other than single-chip mode, up to
4 Mbytes of space is available for an external extended area.
1.1.6 Built-in Full-CAN Function
• The microcomputer contains two CAN modules compliant with CAN Specification V2.0B
active, each of which has 16-channel message slots.
1.1.7 Two Built-in D-A Converters
• The microcomputer contains two blocks of 8-bit resolution D-A converters.
1-5Rev.1.0
Page 26
1
• In addition to ordinary D-A conversion, these converters support the function to successively
output any data. Also, the converters have a 256-byte output buffer (available for only the DA0 converter).
1.1.8 Built-in Timer/Arithmetic Circuits for PD (Phase Digital) Sensors
• The microcomputer contains two blocks of timer/arithmetic circuits that operate along with PD
(Phase Digital) sensors.
• With various arithmetic circuits needed for position predictive operations incorporated, and the
timers interlocked with the D-A converters, fast data processing is possible.
• When not using the PD circuit, the PD sensor-handling timers can be used as ordinary input
measurement timers or input event counters.
1.1.9 Built-in Debug Function
Overview
1.1 Overview
• The 32172/32173 supports the JTAG interface. Using this JTAG interface, the microcomputer
can perform boundary scan test.
1-6Rev.1.0
Page 27
1
1.2 Block Diagram
1.2 Block Diagram
Figure 1.2.1 shows a block diagram of the 32172/32173. The features of each block are outlined in
Tables 1.2.1 to 1.2.3.
• When not using the PD circuit, the above timers can be used as input
measurement timers or input event counters
CAN• Two blocks of CAN modules, each with 16-channel message slots
JTAG• Boundary scan function, Mitsubishi original SDI debug function included
Overview
1-9Rev.1.0
Page 30
1
1.3 Pin Functions
1.3 Pin Functions
Figure 1.3.1 shows a pin function diagram of the 32172/32173. Table 1.3.1 provides a description
of pin functions.
Figure 1.3.2Pin Function Diagram of 175FBGA Package
1-11Rev.1.0
Page 32
1
1.3 Pin Functions
Table 1.3.1 Description of Pin Functions (1/6)
Classification Pin NameDescriptionTypeFunction
Power supplyVCCEPower supply ––Supplies power to external I/O ports (5 V).
VCCIPower supply ––Supplies power to the internal logic (3.3 V).
VDDRAM power supply ––Power supply pin for internal RAM backup (3.3 V).
FVCCFlash power supply ––Power supply pin for the internal flash memory (3.3 V).
VSSGround ––Connect all VSS to ground (GND).
ClockXIN,ClockInputClock input/output pin. With a PLL-based
XOUTOutputfrequency multiplier circuit included, enter a clock with
1/4 the operating frequency (XIN input = 10.0 MHz for
the CPU clock of 40 MHz).
______
BCLK/WRSystemOutput When this signal is System Clock (BCLK), it outputs a
clockclock whose is twice that of extemal inpout clock.
OSC-VCCPower supply ––Power supply for the PLL circuit. Connect OSC-VCC to
OSC-VSSGround ––Connect OSC-VSS to ground.
VCNTPLL controlInputPLL circuit control pin. Connect a resistor and capacitor
Reset
ModeMOD0ModeInputSets operation mode.
AddressA12-A30AddressOutput To allow four blocks of up to 1 MB memory space to
busbusbe connected external to the chip, 19 address lines
_____
RESETResetInputResets the internal circuits.
MOD1 FP MOD0 MOD1 Mode
Use this clock for external synchronized design.
(BCLK output = 20 MHz when CPU clock operates at
40 MHz).
When this signal is Write (WR), during extemal write
access it indicates the valid data on the data bus to
transfer.
input clock (BCLK output = 20 MHz when the external
input clock is 10 MHz).
the power supply (3.3 V).
to this pin. (For details about an external circuit, refer to
Section 20.1.1, "Example of an Oscillator Circuit."
X 0 0Single-chip mode
X 0 1External extended mode
0 1 0Processor mode
1 1 0Boot mode
X 1 1(Reserved)
(A12-A30) are provided. A31 is not output to the
outside.
__
Overview
Note: For details about boot mode, refer to Chapter 6, "Internal Memory."
1-12Rev.1.0
Page 33
1
1.3 Pin Functions
Table 1.3.1 Description of Pin Functions (2/6)
Classification Pin NameDescription TypeFunction
Data busDB0-DB15Data busInput/Output 16-bit data bus for connecting external devices. In write
cycle, the CPU outputs BHW/BHE and BLW/BLE
indicating the valid byte position to write on the 16-bit
data bus. In read cycle, the CPU always reads data
from the full 16-bit data bus. However, data at only the
valid byte position is transferred to the internal circuit
TIN1A, TIN1B Timer inputInputPD1 sensor interface and timer input pin.
A-D converterAVCC0Analog power ––AVCC0 is the power supply for the A-D and D-A
supplyconverters. Connect AVCC0 to the power supply (5 V).
AVSS0Analog ground ––AVSS0 is the analog ground for the A-D and D-A
converters. Connect AVSS0 to ground.
VREF0Reference voltageInputVREF0 is the reference voltage input pin for the A-D
inputand D-A converters (5 V).
AD0IN0Analog inputInput8-channel analog input pins for the A-D0 converter.
– AD0IN7
AD1IN0Analog inputInput4-channel analog input pins for the A-D1 converter.
– AD1IN3
(/AD0IN8)Analog inputInput
– (AD0IN15,)
(/AD1IN4)
– (/AD1IN15)
D-ADA0Analog outputOutput Analog output pin for the D-A0 converter.
converterDA1Analog outputOutput Analog output pin for the D-A1 converter.
Serial I/OSCLKI0/UART transmit/Input/ For UART mode: These pins output a clock derived
SCLKO0,receive clockOutput from BRG by dividing it by 2.
SCLKI1/output or CSIOFor CSIO mode: These pins accept as input the
SCLKO1transmit/receive
clock input/outputor output the transmit/receive clock when an internal
20-channel analog input pins used to monitor the pin levels.
transmit/receive clock when an external clock is selected
clock is selected
Overview
1-14Rev.1.0
Page 35
1
Table 1.3.1 Description of Pin Functions (4/6)
Overview
1.3 Pin Functions
Classification
Serial I/OSCLKI4,Clock outputInputFor UART mode: Use inhibited (in input state)
Pin NameDescriptionTypeFunction
SCLKI5For CSIO mode: Transmit/receive clock input when
external clock is selected
SCLKO4,Clock outputOutput For UART mode: Clock output derived from BRG by
SCLKO5dividing it by 2
For CSIO mode: Transmit/receive clock output
TXD0-TXD7Transmit dataOutput Serial I/O transmit data output pins.
RXD0-RXD7Received dataInputSerial I/O received data input pins.
1-15Rev.1.0
Page 36
1
1.3 Pin Functions
Table 1.3.1 Description of Pin Functions (5/6)
Classification Pin Name DescriptionTypeFunction
Real-timeRTDTXD Transmit dataOutputSerial data output pin for the real-time debugger.
debuggerRTDRXD Received dataInputSerial data input pin for the real-time debugger.
RTDCLKClock inputInputSerial data transmit/receive clock input pin for
the real-time debugger.
RTDACK AcknowledgeOutputOutputs a low-level pulse synchronously with the
first clock cycle of 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.
Flash onlyFPFlash ProtectInputThis is a mode pin which has the function to
protect the flash memory against E/W in hardware.
CAN
JTAGJTMSTest modeInputTest mode select input to control the state
Input/output P00-P07Input/output port 0 Input/OutputProgrammable input/output port.
portP10-P17Input/output port 1 Input/OutputProgrammable input/output port.
(Note)P20-P27Input/output port 2 Input/OutputProgrammable input/output port.
CTX0,CTX1
CRX0,CRX1
JTCKClockInputClock input for the debug module and test circuit.
JTRSTTest resetInputTest reset input to initialize the test circuit
JTDISerial inputInputThis pin takes in the test instruction code or
JTDOSerial outputOutputThis pin outputs the test instruction code or
P30-P37Input/output port 3 Input/OutputProgrammable input/output port.
Data outputOutputThese pins output the data from the CAN module.
Data inputInputThese pins take in the data for the CAN module.
transition of the test circuit.
asynchronously.
test data serially.
test data serially.
Overview
1-16Rev.1.0
Page 37
1
Table 1.3.1 Description of Pin Functions (6/6)
Classification Pin NameDescriptionTypeFunction
Input/output P41-P47Input/output port 4Input/OutputProgrammable input/output port.
port
(Note 1)(However, P64 is an input-only port.)
P61-P64Input/output port 6Input/OutputProgrammable input/output port.
P70-P77Input/output port 7Input/OutputProgrammable input/output port.
P82-P87Input/output port 8Input/OutputProgrammable input/output port.
P93-P97Input/output port 9Input/OutputProgrammable input/output port.
(However, P93 and P97 are input-only ports.)
P100-P107Input/output port 10 Input/OutputProgrammable input/output port.
P110-P117Input/output port 11 Input/OutputProgrammable input/output port.
P124-P127Input/output port 12 Input/OutputInput-only port.
P130-P137Input/output port 13 Input/OutputInput-only port.
P150, P153Input/output port 15 Input/OutputProgrammable input/output port.
P172-P175Input/output port 17 Input/OutputProgrammable input/output port.
(However, P172 and P173 are input-only pins.)
P220,P221Input/output port 22 Input/OutputProgrammable input/output port.
P225 (Note 2)(However, P22 is a CAN input-only pin.)
Overview
1.3 Pin Functions
Note 1: Input/output port 5 is reserved for future use. Input/output ports 14, 16, 18, 19, 20, and 21 are
nonexistent.
Note2: Use of P225 requires caution because it has a debug event function.
1-17Rev.1.0
Page 38
1
1.4 Pin Layout
1.4 Pin Layout
Figure 1.4.1 shows a pin layout diagram of the 32172/32173. Table 1.4.1 lists a pin arrangement of
the 32172/32173.
The M32R has sixteen general-purpose registers, five control registers, an accumulator, and a
program counter. The accumulator is a 56-bit configuration, and all other registers are a 32-bit
configuration.
2.2 General-purpose Registers
General-purpose registers are 32 bits in width and there are sixteen of them (R0 to R15), which are
used to hold data and base addresses. Especially, R14 is used as a link register, and R15 is used
as a stack pointer. The link register is used to store the return address when executing a subroutine
call instruction. The stack pointer is switched between an interrupt stack pointer (SPI) and a user
stack pointer (SPU) depending on the value of the Processor Status Word register (PSW)'s stack
mode (SM) bit.
CPU
00
Note: The stack pointer is switched between an interrupt stack pointer (SPI) and a user stack pointer
There are five control registers-Processor Status Word Register (PSW), Condition Bit Register
(CBR), Interrupt Stack Pointer (SPI), User Stack Pointer (SPU), and Backup PC (BPC).
Dedicated "MVTC" and "MVFC" instructions are used to set and read these control registers.
2: Dedicated "MVTC" and "MVFC" instructions are used to set and read the control registers.
Figure 2.3.1 Control Registers
0 31
CR0
CR1
CR2
CR3
CR6Backup PC
Control Registers
PSW
CBR
SPI
SPU
BPC
Processor status Word Register
Condition Bit Register
Interrupt Stack Pointer
User Stack Pointer
2-3Rev.1.0
Page 48
2
2.3 Control Registers
2.3.1 Processor Status Word Register: PSW (CR0)
The Processor Status Word Register (PSW) is used to indicate the status of the M32R. It consists
of a regularly used PSW field and a special BPSW field which is used to save the PSW field when
an EIT occurs.
The PSW field consists of several bits labeled Stack Mode (SM), Interrupt Enable (IE), and
Condition bit (C). The BPSW field consists of backup bits of the foregoing, i.e., Backup SM bit
(BSM), Backup IE bit (BIE), and Backup C bit (BC).
BPSW fieldPSW field
CPU
0(MSB)
PS
W
DBit NameFunctionInitialRW
16 BSM (Backup SM)Holds the value of SM bit when EITIndeterminate
is accepted.
17 BIE (Backup IE)Holds the value of IE bit when EITIndeterminate
is accepted.
23 BC (Backup C)Holds the value of C bit when EITIndeterminate
is accepted.
24 SM (Stack Mode)0: Interrupt stack pointer is used.0
1: User stack pointer is used.
25 IE (Interrupt Enable)0: No interrupt is accepted.0
1: Interrupt is accepted.
16 1723 24 25
1587
SMIECBCBSMBIE
(Note 1)
31(LSB)
00000000000000000000000000
31 C (Condition bit)Depending on instruction execution, it indicates0
whether operation resulted in a carry, borrow, or overflow.
Note 1: "Initial" shows the state immediately after reset, R = O means the register is readable,
W = O means the register is writable.
Note 2: For changes of the state of each bit when an EIT event occurs, refer to Chapter 4, "EIT.”
2-4Rev.1.0
Page 49
2
2.3 Control Registers
2.3.2 Condition Bit Register: CBR (CR1)
The Condition Bit Register (CBR) is created as a separate register from the PSW by extracting the
Condition bit (C) from it. The value written to the PSW C bit is reflected in this register. This register
is a read-only register (writes to this register by "MVTC" instruction are ignored).
The Interrupt Stack Pointer (SPI) and User Stack Pointer (SPU) hold the current address of the
stack pointer. These registers can be accessed as general-purpose register R15. In this case,
whether R15 is used as SPI or as SPU depends on the PSW's Stack Mode (SM) bit.
CPU
C
SPI
SPU
0(MSB)
SPI
0(MSB)
SPU
31(LSB)
31(LSB)
2.3.4 Backup PC: BPC (CR6)
The Backup PC (BPC) is a register 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 value held in the PC immediately before the EIT occurred or the value of
the next instruction is set in this register. When the "RTE" instruction is executed, the saved value
is returned from the BPC to the PC. However, the two low-order bits of the PC when thus returned
are always fixed to "00" (control always returns to word boundaries.)
31(LSB)0(MSB)
BPC
BPC
0
2-5Rev.1.0
Page 50
2
2.4 Accumulator
2.4 Accumulator
The accumulator (ACC) is a 56-bit register used by DSP function instructions. When read out or
written to, it is handled as a 64-bit register. When reading, the value of bit 8 is sign-extended. When
writing, bits 0-7 are ignored. Also, the accumulator is used by the multiplication instruction "MUL."
Note that when executing this instruction, the value of the accumulator is destroyed.
The "MVTACHI" and "MVTACLO" instructions are used to write to the accumulator. The
"MVTACHI" instruction writes data to the 32 high-order bits (bits 0-31), and the "MVTACLO"
instruction writes data to the 32 low-order bits (bits 32-63).
The "MVFACHI," "MVFACLO," and "MVFACMI" instructions are used to read data from the
accumulator. The "MVFACHI" instruction reads data from the 32 high-order bits (bits 0-31), the
"MVFACLO" instruction reads data from the 32 low-order bits (bits 32-63), and the "MVFACHI"
instruction reads data from the 32 middle bits (bits 16-47).
CPU
(Note)
78
ACC
Range of bits read/written to by
MVFACHI/MVTACHI instructions
Note: Bits 0-7 always show the sign-extended value of bit 8. Writes to this bit field are ignored.
Range of bits read by MVFACMI
instruction
324863(LSB)3116150(MSB)
Range of bits read/written to by
MVFACLO/MVTACLO instructions
47
2.5 Program Counter
The Program Counter (PC) is a 32-bit counter used to hold the address of the currently executed
instruction. Because M32R instructions each start from an even address, the LSB (bit 31) is always 0.
31(LSB)0(MSB)
PC
PC
0
2-6Rev.1.0
Page 51
2
2.6 Data Formats
2.6.1 Data Types
There are several data types that can be handled by the M32R's instruction set. These include
signed and unsigned 8, 16, and 32-bit integers. Values of signed integers are represented by
2's complements.
CPU
2.6 Data Formats
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
Figure 2.6.1 Data Types
0(MSB)
S
0(MSB)
0(MSB)
S
0(MSB)
0(MSB)
S
0(MSB)
7(LSB)
7(LSB)
15(LSB)
15(LSB)
31(LSB)
31(LSB)
S : Sign bit
2-7Rev.1.0
Page 52
2
2.6.2 Data Formats
(1) Data formats in register
Data sizes in M32R registers are always words (32 bits).
When loading byte (8-bit) or halfword (16-bit) data from memory into a register, the data is signextended (LDB, LDH instructions) or zero-extended (LDUB, LDUH instructions) into word (32-bit)
data before being stored in the register. When storing data from M32R register into memory, the
register data is stored in memory in different sizes depending on the instructions used. The ST
instruction stores the entire 32-bit data of the register, the STH instruction stores the least
significant 16-bit data, and the STB instruction stores the least significant 8-bit data.
CPU
2.6 Data Formats
<When loading>
0(MSB)31(LSB)
Rn
Sign-extended (LDH instruction) or
zero-extended (LDUH instruction
0(MSB)31(LSB)
Rn
0(MSB)31(LSB)
Rn
<When storing>
0(MSB)31(LSB)
Rn
0(MSB)31(LSB)
Rn
Sign-extended (LDB instruction) or
zero-extended (LDUB instruction
From memory (LDH, LDUH instructions)
)
16
From memory (LD instructions)
Word
16
From memory (LDB,
LDUB instructions)
)
24
Halfword
24
To memory (STB instruction)
Halfword
Byte
Byte
0(MSB)31(LSB)
Rn
To memory (ST instruction)
Figure 2.6.2 Data Formats in Register
To memory (STH instruction)
Word
2-8Rev.1.0
Page 53
2
(2) Data formats in memory
Data sizes in memory are either byte (8 bits), halfword (16 bits), or word (32 bits). Byte data can
be located at any address. However, halfword data must be located at halfword boundaries
(where the LSB address bit = "0"), and word data must be located at word boundaries (where two
LSB address bits = "00"). If an attempt is made to access memory data across these halfword or
word boundaries, an address exception is generated.
CPU
2.6 Data Formats
Address
+ 0 address + 1 address + 2 address + 3 address
0
Byte
(MSB)15(LSB)
Halfword
0(MSB)
Word
Figure 2.6.3 Data Formats in Memory
7 815 1623 24
Byte
Halfword
31
Byte
Byte
Byte
Halfword
31(LSB)
Word
2-9Rev.1.0
Page 54
2
(3) Endian
The following shows the generally used endian methods and the M32R family endian.
Bit endianByte endian
(H'01)
(H'01234567)
CPU
2.6 Data Formats
MSBLSB
Big endian
Little endian
B'0000001
D0D7
MSBLSB
B'0000001
D7D0
Note: Even for bit big endian, H'01 is not B'10000000.
Figure 2.6.4 Endian Methods
MPU name
Endian
(Bit/Byte)
Address
Data
arrangement
Bit number
7700 family
M16C family
Little/Little
+0+1+2+3+0+1+2+3+0+1+2+3
MSBLSBMSBLSBMSBLSB
LLLHHLHH
7-031-2415-823-160-724-318-15 16-23
HHHLLHLL
MSBLSB
H'01
MSBLSB
H'67
LLLHHLHH
Competition
Little/Big
H'23H'45H'6
HHHLLHLL
H'45H'23H'0
M32R family
HHHLLHLL
7-031-2415-823-16
7
1
M16 family
Big/Big
Ex:0x01234567
Note: The M32R's endian method is big endian for both bit and byte.
Note: For the MVTC instruction, the condition bit C does not change unless CRdest is CR0 (PSW).
Figure 2.6.6 Transfer instructions
2-11Rev.1.0
Page 56
2
(5) Memory (signed) to register transfer
CPU
2.6 Data Formats
• Signed 32 bits
MemoryRegister
LD24 Rsrc, #label
LD Rdest, @Rsrc
label
+0+1+2
• Signed 16 bits
LD24 Rsrc, #label
LDH Rdest, @Rsrc
• Signed 8 bits
LD24 Rsrc, #label
LDB Rdest, @Rsrc
label
label
+0+1+2+3
Check the MSB
0 = positive
1 = negative
+0+1+2
Check the MSB
0 = positive
1 = negative
Figure 2.6.7 Memory (signed) to register transfer
(6) Memory (unsigned) to register transfer
Rdest
+3
Rdest
310
0000
FFFF
310
Rdest
+3
000000
FFFFFF
310
• Unsigned 32 bits
LD24 Rsrc, #label
LD Rdest, @Rsrc
label
MemoryRegister
+0+1+2+3
• Unsigned 16 bits
LD24 Rsrc, #label
LDUH
• Unsigned 8 bits
LD24 Rsrc, #label
LDUB Rdest, @Rsrc
Rdest, @Rsrc
label
+0+1+2+3
label
+0+1+2+3
Figure 2.6.8 Memory (unsigned) to register transfer
2-12Rev.1.0
Rdest
310
Rdest
0000
310
Rdest
000000
310
Page 57
2
(7) Things to be noted for data transfer
Note that in data transfer, data arrangements in registers and those in memory are different.
CPU
2.6 Data Formats
Data in register
(R0-R15)
Word data (32 bits)
HHHLLHLL
D0D31
MSBLSB
(R0-R15)
Half-word data (16 bits)
D0D31
MSBLSB
(R0-R15)
Byte data (8 bits)
D0D3
MSBLSB
Figure 2.6.9 Difference in Data Arrangements
HL
1
Data in memory
+0+1+2+3
HHHLLHLL
D0D31
MSBLSB
+0+1+2+3
HL
D0D15
MSBLSB
+0+1+2+3
D0 D7
MSB LSB
2-13Rev.1.0
Page 58
2
CPU
2.6 Data Formats
❊ This is a blank page. ❊
2-14Rev.1.0
Page 59
CHAPTER 3CHAPTER 3
ADDRESS SPACE
3.1 Outline of the Address Space
3.2 Operation Modes
3.3 Internal ROM and External
Extended Areas
3.4 Internal RAM and SFR Areas
3.5 EIT Vector Entry
3.6 ICU Vector Table
3.7 Precautions on Address
Space
Page 60
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-bit width, providing a 4-Gbyte linear
address space. The address space of the M32R consists of the following:
(1) User space
• Internal ROM area
• External extended area
• Internal RAM area
• SFR (Special Function Register) area
(2) Boot program space
(3) System space (not open to the user)
(1) User space
A 2 Gbytes of space in addresses from H'0000 0000 to H'7FFF FFFF is the user space. Located
in this space are the internal ROM, external extended, and internal RAM areas and the SFR
(Special Function Register) area (i.e., internal peripheral I/O registers). Of these, the internal
ROM and external extended areas are allocated to different addresses depending on mode
settings which are described later.
(2) Boot program space
A 1 Gbytes of space in addresses from H'8000 0000 to H'BFFF FFFF is the boot program space.
This space stores a program (boot program) which enables on-board programming when the
internal flash area is blank.
(3) System space
A 1 Gbytes of space in addresses from H'C000 0000 to H'FFFF FFFF is the system space. This
space is reserved for use by development tools such as an in-circuit emulator or debug monitor,
and cannot be used by the user.
3-2Rev.1.0
Page 61
3
ADDRESS SPACE
3.1 Outline of the Address Space
<Logical Space of the M32172F2>
Logical Address
H’0000 0000
2 Gbytes
H’7FFF FFFF
H’8000 0000
1 Gbytes
User Space
Boot Program
Space
(Note 2)
(16 Mbytes)
Boot ROM
Area
(8 Kbytes)
Reserved Area
(8 Kbytes)
Ghost Areas,
16 Mbytes
Each
H’8000 0000
H’8000 1FFF
H’8000 2000
H’8000 3FFF
H’8000 4000
Ghost Areas,
16 Kbytes
Each
External Extended
Area (8 Mbytes)
EIT Vector Entry
User ROM Area
(Note 1)
Reserved Area
(768 Kbytes)
CS0 Area
(1 Mbytes)
(Note 1)
CS1 Area
(2 Mbytes)
(Note 1)
CS2 Area
(2 Mbytes)
(Note 1)
CS3 Area
(2 Mbytes)
(Note 1)
SFR Area
(16 Kbytes)
Internal RAM
(16 Kbytes)
Reserved Area
(96 Kbytes)
H’0000 0000
H’0003 FFFF
H’0004 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
H’0080 0000
H’0080 3FFF
H’0080 4000
H’0080 7FFF
H’0080 8000
H’0081 FFFF
H’0082 0000
Ghost Areas,
128 Kbytes Each
H’BFFF FFFF
H’BFFF FFFF
H’C000 0000
1 Gbytes
System Space
H’FFFF FFFF
Note 1: Locations vary with chip mode settings.
Note 2: The boot program space can be read out only when FP = 1, MOD0 = 1, and MOD1 = 0.
Figure 3.1.1 Address Space of the M32172F2
3-3Rev.1.0
H’00FF FFFF
Page 62
3
ADDRESS SPACE
3.1 Outline of the Address Space
<Logical Space of the M32173F2>
Logical Address
H’0000 0000
2 Gbytes
H’7FFF FFFF
H’8000 0000
1 Gbytes
User Space
Boot Program
Space
(Note 2)
(16 Mbytes)
Boot ROM
Area
(8 Kbytes)
Reserved Area
(8 Kbytes)
Ghost Areas,
16 Mbytes
Each
H’8000 0000
H’8000 1FFF
H’8000 2000
H’8000 3FFF
H’8000 4000
Ghost Areas,
16 Kbytes
Each
External Extended
Area (8 Mbytes)
EIT Vector Entry
User ROM Area
(Note 1)
Reserved Area
(768 Kbytes)
CS0 Area
(1 Mbytes)
(Note 1)
CS1 Area
(2 Mbytes)
(Note 1)
CS2 Area
(2 Mbytes)
(Note 1)
CS3 Area
(2 Mbytes)
(Note 1)
SFR Area
(16 Kbytes)
Internal RAM
(32 Kbytes)
Reserved Area
(80 Kbytes)
H’0000 0000
H’0003 FFFF
H’0004 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
H’0080 0000
H’0080 3FFF
H’0080 4000
H’0080 BFFF
H’0080 C000
H’0081 FFFF
H’0082 0000
Ghost Areas,
128 Kbytes Each
H’BFFF FFFF
H’BFFF FFFF
H’C000 0000
1 Gbytes
System Space
H’FFFF FFFF
Note 1: Locations vary with chip mode settings.
Note 2: The boot program space can be read out only when FP = 1, MOD0 = 1, and MOD1 = 0.
Figure 3.1.2 Address Space of the M32173F2
3-4Rev.1.0
H’00FF FFFF
Page 63
ADDRESS SPACE
3
3.2 Operation Modes
3.2 Operation Modes
The 32172/32173 is placed in one of the following modes by settings of chip operation mode
(setting the MOD0 and MOD1 pins) . For details about internal flash memory rewrite mode, refer to
Section 6.5, "Programming the Internal Flash Memory."
Note 1: VCC and VSS are connected to +5 V and GND, respectively.
Note 2: For internal flash memory rewrite mode (when FP=VCC) not listed in the above table, refer to
Section 6.5, "Programming the Internal Flash Memory."
The locations of the internal ROM and external extended areas in the address space of the 32172/
32173 vary depending on its operation mode. (All other areas in address space located the same
way.) Also, during external extended mode, the available size of the external extended area varies
with pin functions of CS0, CS1, CS2, and CS3. Figure 3.2.1 shows an address map of internal
ROM and external extended areas in each mode. Figure 3.2.2 shows an address map of internal
ROM and external extended areas varying with pin functions of CS0, CS1, CS2, and CS3 during
external extended mode. (For details about internal flash memory rewrite mode, refer to Section
Figure 3.2.1 Internal ROM and External Extended Areas in Each Operation Mode of the
M32172F2/M32173F2
3-6Rev.1.0
Page 65
3
ADDRESS SPACE
3.2 Operation Modes
Pin functions
(Note)
H'0000 0000
H'0003 FFFF
H'0004 0000
H'000F FFFF
H'0010 0000
H'001F FFFF
H'0020 0000
H'003F FFFF
H'0040 0000
CS0
CS1
A12 /CS2
A13 /CS3
Internal ROM Area
(256 Kbytes)
Reserved Area
(768 Kbytes)
CS0 Area
(1 Mbytes)
CS1 Area
(1 Mbytes)
Ghost of
CS1 Area
CS0
CS1
A12/ CS2
A13 /CS3
Internal ROM Area
(256 Kbytes)
Reserved Area
(768 Kbytes)
CS0 Area
(512 Kbytes)
Ghost of
CS0 Area
CS1 Area
(512 Kbytes)
Ghost of
CS1 Area
CS2 Area
(512 Kbytes)
CS0
CS1
A12/ CS2
A13/ CS3
Internal ROM Area
(256 Kbytes)
Reserved Area
(768 Kbytes)
CS0 Area
(256 Kbytes)
Ghost of
CS0 Area
CS1 Area
(256 Kbytes)
Ghost of
CS1 Area
CS2 Area
(256 Kbytes)
CS0
CS1
A12 /CS2
A13/ CS3
Internal ROM Area
(256 Kbytes)
Reserved Area
(768 Kbytes)
CS0 Area
(256 Kbytes)
Ghost of
CS0 Area
CS0 Area
(256 Kbytes)
Ghost of
CS0 Area
CS1 Area
(256 Kbytes)
Ghost of
CS1 Area
CS1 Area
(256 Kbytes)
Ghost of
CS1 Area
H'005F FFFF
H'0060 0000
Ghost of
CS2 Area
Ghost of
CS2 Area
CS3 Area
(256 Kbytes)
Ghost of
CS3 Area
CS3 Area
(256 Kbytes)
Ghost of
CS3 Area
CS3 Area
(256 Kbytes)
Ghost of
CS3 Area
H'007F FFFF
Note: The pin functions enclosed in are effective.
Figure 3.2.2 Internal ROM and External Extended Areas Varying with Pin Functions of the
M32172F2/M32173F2
3-7Rev.1.0
Page 66
ADDRESS SPACE
3
3.3 Internal ROM and External Extended Areas
3.3 Internal ROM and External Extended Areas
The 8-Mbyte area in user space addresses from H'0000 0000 to H'007F FFFF is used for the
internal ROM and external extended areas.
For details on how the locations of the internal ROM and external extended areas vary depending
on 32172/32173 operation mode settings, refer to Section 3.2, "Operation Modes."
3.3.1 Internal ROM Area
The internal ROM is allocated to the addresses listed below. Located at the beginning of this area
is the EIT vector entry (and ICU vector table).
The external extended area is available only when external extended or processor mode is
selected for the chip operation mode. For access to the external extended area, the 32172/32173
outputs the control signals that are required for accessing an external device.
The 32172/32173's CS0, CS1, CS2, and CS3 signals are output according to the address into
which the external extended area is mapped. Namely, the CS0 signal is output for the CS0 area,
_________
the CS1 signal is output for the CS1 area, the CS2 sognal is output for the CS2 area, and the CS3
signal is output for the CS3 area.
Table 3.3.2 Address Mapping of the External Extended Area in Each Operation Mode of the
32172/32173
Operation ModeAddress Mapping of External Extended Area
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)
3-8Rev.1.0
Page 67
ADDRESS SPACE
3
3.4 Internal RAM and SFR Areas
3.4 Internal RAM and SFR Areas
The 8-Mbyte area in user space addresses from H'0080 0000 to H'00FF FFFF is used for the
internal RAM area and the SFR (Special Function Register) area. Of these, the space that the user
can actually use is a 128-Kbyte area from H'0080 0000 to H'0081 FFFF, and the other addresses
comprise ghost areas in units of 128 Kbytes. (When programming, do not use the ghost area
unless absolutely necessary.)
3.4.1 Internal RAM Area
For the M32172F2, the internal RAM is allocated to addresses H'0080 4000 through H'0080 7FFF
(16 Kbytes). For the M32173F2, the internal RAM is allocated to addresses H'0080 4000 through
H'0080 BFFF (32 Kbytes).
3.4.2 SFR (Special Function Register) Area
Addresses H'0080 0000 to H'0080 3FFF are 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
Internal RAM
(16 Kbytes)
H'0080 7FFF
Figure 3.4.1 Internal RAM Area and SFR (Special Function Register) Area of the M32172F2
Virtual-flash emulation area
separated in units of 8 Kbytes
can be mapped into this area.
For details, see Section 6.7.
3-9Rev.1.0
Page 68
ADDRESS SPACE
3
H'0080 0000
SFR area
(16 Kbytes)
H'0080 3FFF
H'0080 4000
Internal RAM
(32 Kbytes)
H'0080 BFFF
Figure 3.4.2 Internal RAM Area and SFR (Special Function Register) Area of the M32173F2
3.4 Internal RAM and SFR Areas
Virtual-flash emulation area
separated in units of 8 or 4
Kbytes can be mapped into this
area. For details, see Section 6.7.
3-10Rev.1.0
Page 69
3
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 0400
H’0080 0478
H’0080 0700
H’0080 0744
H’0080 07E0
H’0080 07F2
H’0080 0800
H’0080 08F8
H’0080 09FF
07 815
+0 address +1 address+0 address +1 address
H’0080 0A00
Interrupt Controller
(ICU)
A-D0 Converter
Serial I/O0-3
Wait Controller
DMAC
Input/output Ports
Flash Control
Timers
(TML, TMS)
H’0080 0A46
H’0080 0A80
H’0080 0AEE
H’0080 0C8C
H’0080 0CDE
H’0080 0D8C
H’0080 0DDE
H’0080 1000
H’0080 11FE
H’0080 1400
H’0080 15FE
H’0080 1800
H’0080 18BA
H’0080 1C78
H’0080 1DFE
07 815
Serial I/O4-7
A-D1 Converter
Timers
(TOM0_0—7, TID0)
Timers
(TOM1_0—7, TID1)
CAN0
CAN1
PD Controller
(PD0, PD1)
D-A0, 1 Converters
Note: The Realtime Debugger (RTD) is an independent module operated on from the outside, and is
designed not to be transparent to the CPU.
CAN1 Transmit/Receive & Error Interrupt Control Register (ICAN1CR)
PDC Compare Match & Error Interrupt Control Register (IPDCOPCR)
SIO6,7 Transmit/Receive Interrupt Control Register (ISIO67CR)
SIO5 Receive Interrupt Control Register (ISIO5RXCR)
SIO4 Receive Interrupt Control Register (ISIO4RXCR)
DMA5-9 Interrupt Control Register (IDMA59CR)
SIO1 Transmit Interrupt Control Register (ISIO1TXCR)
SIO0 Transmit Interrupt Control Register (ISIO0TXCR)
A-D0 Conversion Interrupt Control Register (IAD0CCR)
TID1 Output Interrupt Control Register (ITID1CR)
TMS0 Output Interrupt Control Register (ITMS0CR)
TOM0 Output Interrupt Control Register (ITOM0CR)
Timer Input Interrupt Control Register 1 (IMJTOCR1)
Timer Input Interrupt Control Register 3 (IMJTICR3)
Timer Input Interrupt Control Register 5 (IMJTICR5)
PDC Input & Error Interrupt Control Register (IPDCCR)
A-D0 Single Mode Register 0 (AD0SIM0)
A-D0 Scan Mode Register 0 (AD0SCM0)
A-D0 Successive Approximation Register
A-D0 Comparate Data Register
A-D0 Digital Input Control Register
10-bit A-D0 Data Register 0
10-bit A-D0 Data Register 1
10-bit A-D0 Data Register 2
10-bit A-D0 Data Register 3
10-bit A-D0 Data Register 4
10-bit A-D0 Data Register 5
10-bit A-D0 Data Register 6
10-bit A-D0 Data Register 7
10-bit A-D0 Data Register 8
10-bit A-D0 Data Register 9
10-bit A-D0 Data Register 10
10-bit A-D0 Data Register 11
10-bit A-D0 Data Register 12
10-bit A-D0 Data Register 13
10-bit A-D0 Data Register 14
10-bit A-D0 Data Register 15
CAN0 Transmit/Receive & Error Interrupt Control Register (ICAN0CR)
RTD Interrupt Control Register (IRTDCR)
SIO5 Transmit Interrupt Control Register (ISIO5TXCR)
SIO4 Transmit Interrupt Control Register (ISIO4TXCR)
SIO2,3 Transmit/Receive Interrupt Control Register (ISIO23CR)
A-D1 Conversion Interrupt Control Register (IAD1CCR)
SIO1 Receive Interrupt Control Register (ISIO1RXCR)
SIO0 Receive Interrupt Control Register (ISIO0RXCR)
DMA0-4 Interrupt Control Register (IDMA04CR)
TID0 Output Interrupt Control Register (ITID0CR)
TOM1 Output Interrupt Control Register (ITOM1CR)
Timer Input Interrupt Control Register 0 (IMJTOCR0)
Timer Input Interrupt Control Register 2 (IMJTOCR2)
Timer Input Interrupt Control Register 4 (IMJTICR4)
PWM Off Input Interrupt Control Register (IPWMOFFCR)
TML0 Old Measurement 3 Register H (TML0OLDMR3H)
TML0 Old Measurement 3 Register L (TML0OLDMR3L)
TML0 Old Measurement 2 Register H (TML0OLDMR2H)
TML0 Old Measurement 2 Register L (TML0OLDMR2L)
TML0 Old Measurement 1 Register H (TML0OLDMR1H)
TML0 Old Measurement 1 Register L (TML0OLDMR1L)
TML0 Old Measurement 0 Register H (TML0OLDMR0H)
TML0 Old Measurement 0 Register L (TML0OLDMR0L)
CAN0 Global Mask Register Standard ID0 (C0GMSKS0)
CAN0 Global Mask Register Extended ID0 (C0GMSKE0)CAN0 Global Mask Register Extended ID1 (C0GMSKE1)
CAN0 Global Mask Register Extended ID2 (C0GMSKE2)
CAN0 Local Mask Register A Standard ID0 (C0LMSKAS0)
CAN0 Local Mask Register A Extended ID0 (C0LMSKAE0)CAN0 Local Mask Register A Extended ID1 (C0LMSKAE1)
CAN0 Local Mask Register A Extended ID2 (C0LMSKAE2)
CAN0 Local Mask Register B Standard ID0 (C0LMSKBS0)CAN0 Local Mask Register B Standard ID1 (C0LMSKBS1)
CAN0 Local Mask Register B Extended ID0 (C0LMSKBE0)CAN0 Local Mask Register B Extended ID1 (C0LMSKBE1)
CAN0 Local Mask Register B Extended ID2 (C0LMSKBE2)
+0 address+1 addressAddress
CAN0 Control Register (CAN0CNT)
CAN0 Status Register (CAN0STAT)
CAN0 Extended ID Register (CAN0EXTID)
CAN0 Configuration Register (CAN0CONF)
CAN0 Timestamp Count Register (CAN0TSTMP)
CAN0 Transmit Error Count Register (CAN0TEC)
CAN0 Slot Interrupt Status Register (CAN0SLIST)
CAN0 Slot Interrupt Mask Register (CAN0SLIMK)
CAN0 Error Interrupt Mask Register (CAN0ERIMK)
CAN0 Global Mask Register Standard ID1 (C0GMSKS1)
CAN0 Local Mask Register A Standard ID1 (C0LMSKAS1)
CAN1 Global Mask Register Standard ID0 (C1GMSKS0)
CAN1 Global Mask Register Extended ID0 (C1GMSKE0)CAN1 Global Mask Register Extended ID1 (C1GMSKE1)
CAN1 Global Mask Register Extended ID2 (C1GMSKE2)
CAN1 Local Mask Register A Standard ID0 (C1LMSKAS0)
CAN1 Local Mask Register A Extended ID0 (C1LMSKAE0) CAN1 Local Mask Register A Extended ID1 (C1LMSKAE1)
CAN1 Local Mask Register A Extended ID2 (C1LMSKAE2)
CAN1 Local Mask Register B Standard ID0 (C1LMSKBS0)CAN1 Local Mask Register B Standard ID1 (C1LMSKBS1)
CAN1 Local Mask Register B Extended ID0 (C1LMSKBE0)CAN1 Local Mask Register B Extended ID1 (C1LMSKBE1)
CAN1 Local Mask Register B Extended ID2 (C1LMSKBE2)
+0 address+1 addressAddress
CAN1 Control Register (CAN1CNT)
CAN1 Status Register (CAN1STAT)
CAN1 Extended ID Register (CAN1EXTID)
CAN1 Configuration Register (CAN1CONF)
CAN1 Timestamp Count Register (CAN1TSTMP)
CAN1 Transmit Error Count Register (CAN1TEC)
CAN1 Slot Interrupt Status Register (CAN1SLIST)
CAN1 Slot Interrupt Mask Register (CAN1SLIMK)
CAN1 Error Interrupt Mask Register (CAN1ERIMK)
CAN1 Global Mask Register Standard ID1 (C1GMSKS1)
CAN1 Local Mask Register A Standard ID1 (C1LMSKAS1)
D-A0 Data Register 0 (DA0DT0)D-A0 Data Register 1 (DA0DT1)
D-A0 Data Register 2 (DA0DT2)
D-A0 Data Register 4 (DA0DT4)
D-A0 Data Register 6 (DA0DT6)
D-A0 Data Register 8 (DA0DT8)
D-A0 Data Register 10 (DA0DT10)D-A0 Data Register 11 (DA0DT11)
D-A0 Data Register 12 (DA0DT12)D-A0 Data Register 13 (DA0DT13)
D-A0 Data Register 14 (DA0DT14)D-A0 Data Register 15 (DA0DT15)
D-A0 Data Register 16 (DA0DT16)
D-A0 Data Register 18 (DA0DT18)
D-A0 Data Register 20 (DA0DT20)
D-A0 Data Register 22 (DA0DT22)D-A0 Data Register 23 (DA0DT23)
D-A0 Data Register 24 (DA0DT24)D-A0 Data Register 25 (DA0DT25)
D-A0 Data Register 26 (DA0DT26)D-A0 Data Register 27 (DA0DT27)
D-A0 Data Register 28 (DA0DT28)
D-A0 Data Register 30 (DA0DT30)D-A0 Data Register 31 (DA0DT31)
D-A0 Data Register 32 (DA0DT32)
D-A0 Data Register 34 (DA0DT34)
D-A0 Data Register 36 (DA0DT36)
D-A0 Data Register 38 (DA0DT38)D-A0 Data Register 39 (DA0DT39)
D-A0 Data Register 40 (DA0DT40)
D-A0 Data Register 42 (DA0DT42)D-A0 Data Register 43 (DA0DT43)
D-A0 Data Register 44 (DA0DT44)D-A0 Data Register 45 (DA0DT45)
D-A0 Data Register 46 (DA0DT46)
D-A0 Data Register 48 (DA0DT48)D-A0 Data Register 49 (DA0DT49)
D-A0 Data Register 50 (DA0DT50)D-A0 Data Register 51 (DA0DT51)
D-A0 Data Register 52 (DA0DT52)D-A0 Data Register 53 (DA0DT53)
D-A0 Data Register 54 (DA0DT54)
D-A0 Data Register 56 (DA0DT56)
D-A0 Data Register 58 (DA0DT58)
D-A0 Data Register 60 (DA0DT60)
D-A0 Data Register 64 (DA0DT64)
D-A0 Data Register 66 (DA0DT66)
D-A0 Data Register 68 (DA0DT68)
D-A0 Data Register 70 (DA0DT70)
D-A0 Data Register 72 (DA0DT72)
D-A0 Data Register 3 (DA0DT3)
D-A0 Data Register 5 (DA0DT5)
D-A0 Data Register 7 (DA0DT7)
D-A0 Data Register 9 (DA0DT9)
D-A0 Data Register 17 (DA0DT17)
D-A0 Data Register 19 (DA0DT19)
D-A0 Data Register 21 (DA0DT21)
D-A0 Data Register 29 (DA0DT29)
D-A0 Data Register 33 (DA0DT33)
D-A0 Data Register 35 (DA0DT35)
D-A0 Data Register 37 (DA0DT37)
D-A0 Data Register 41 (DA0DT41)
D-A0 Data Register 47 (DA0DT47)
D-A0 Data Register 55 (DA0DT55)
D-A0 Data Register 57 (DA0DT57)
D-A0 Data Register 59 (DA0DT59)
D-A0 Data Register 61 (DA0DT61)
D-A0 Data Register 63 (DA0DT63)D-A0 Data Register 62 (DA0DT62)
D-A0 Data Register 65 (DA0DT65)
D-A0 Data Register 67 (DA0DT67)
D-A0 Data Register 69 (DA0DT69)
D-A0 Data Register 71 (DA0DT71)
D-A0 Data Register 73 (DA0DT73)
D-A0 Data Register 75 (DA0DT75)D-A0 Data Register 74 (DA0DT74)
D-A0 Data Register 77 (DA0DT77)D-A0 Data Register 76 (DA0DT76)
D-A0 Data Register 79 (DA0DT79)D-A0 Data Register 78 (DA0DT78)H’0080 1D4E
Blank areas are reserved for future use.
Figure 3.4.24 Register Mapping of the SFR Area (21)
D-A0 Data Register 80 (DA0DT80)
D-A0 Data Register 82 (DA0DT82)
D-A0 Data Register 84 (DA0DT84)
D-A0 Data Register 86 (DA0DT86)
D-A0 Data Register 88 (DA0DT88)
D-A0 Data Register 90 (DA0DT90)D-A0 Data Register 91 (DA0DT91)
D-A0 Data Register 92 (DA0DT92)
D-A0 Data Register 94 (DA0DT94)
D-A0 Data Register 96 (DA0DT96)
D-A0 Data Register 98 (DA0DT98)
D-A0 Data Register 100 (DA0DT100)D-A0 Data Register 101 (DA0DT101)
D-A0 Data Register 102 (DA0DT102)D-A0 Data Register 103 (DA0DT103)
D-A0 Data Register 104 (DA0DT104)D-A0 Data Register 105 (DA0DT105)
D-A0 Data Register 106 (DA0DT106)
D-A0 Data Register 108 (DA0DT108)
D-A0 Data Register 110 (DA0DT110)
D-A0 Data Register 112 (DA0DT112)D-A0 Data Register 113 (DA0DT113)
D-A0 Data Register 114 (DA0DT114)D-A0 Data Register 115 (DA0DT115)
D-A0 Data Register 116 (DA0DT116)D-A0 Data Register 117 (DA0DT117)
D-A0 Data Register 118 (DA0DT118)
D-A0 Data Register 120 (DA0DT120)D-A0 Data Register 121 (DA0DT121)
D-A0 Data Register 122 (DA0DT122)
D-A0 Data Register 124 (DA0DT124)
D-A0 Data Register 126 (DA0DT126)
D-A0 Data Register 128 (DA0DT128)D-A0 Data Register 129 (DA0DT129)
D-A0 Data Register 130 (DA0DT130)
D-A0 Data Register 132 (DA0DT132)D-A0 Data Register 133 (DA0DT133)
D-A0 Data Register 134 (DA0DT134)D-A0 Data Register 135 (DA0DT135)
D-A0 Data Register 136 (DA0DT136)
D-A0 Data Register 138 (DA0DT138)D-A0 Data Register 139 (DA0DT139)
D-A0 Data Register 140 (DA0DT140)D-A0 Data Register 141 (DA0DT141)
D-A0 Data Register 142 (DA0DT142)D-A0 Data Register 143 (DA0DT143)
D-A0 Data Register 144 (DA0DT144)
D-A0 Data Register 146 (DA0DT146)
D-A0 Data Register 148 (DA0DT148)
D-A0 Data Register 150 (DA0DT150)
D-A0 Data Register 154 (DA0DT154)
D-A0 Data Register 156 (DA0DT156)
D-A0 Data Register 158 (DA0DT158)
D-A0 Data Register 160 (DA0DT160)
D-A0 Data Register 162 (DA0DT162)
D-A0 Data Register 81 (DA0DT81)
D-A0 Data Register 83 (DA0DT83)
D-A0 Data Register 85 (DA0DT85)
D-A0 Data Register 87 (DA0DT87)
D-A0 Data Register 89 (DA0DT89)
D-A0 Data Register 93 (DA0DT93)
D-A0 Data Register 95 (DA0DT95)
D-A0 Data Register 97 (DA0DT97)
D-A0 Data Register 99 (DA0DT99)
D-A0 Data Register 107 (DA0DT107)
D-A0 Data Register 109 (DA0DT109)
D-A0 Data Register 111 (DA0DT111)
D-A0 Data Register 119 (DA0DT119)
D-A0 Data Register 123 (DA0DT123)
D-A0 Data Register 125 (DA0DT125)
D-A0 Data Register 127 (DA0DT127)
D-A0 Data Register 131 (DA0DT131)
D-A0 Data Register 137 (DA0DT137)
D-A0 Data Register 145 (DA0DT145)
D-A0 Data Register 147 (DA0DT147)
D-A0 Data Register 149 (DA0DT149)
D-A0 Data Register 151 (DA0DT151)
D-A0 Data Register 153 (DA0DT153)D-A0 Data Register 152 (DA0DT152)
D-A0 Data Register 155 (DA0DT155)
D-A0 Data Register 157 (DA0DT157)
D-A0 Data Register 159 (DA0DT159)
D-A0 Data Register 161 (DA0DT161)
D-A0 Data Register 163 (DA0DT163)
D-A0 Data Register 165 (DA0DT165)D-A0 Data Register 164 (DA0DT164)
D-A0 Data Register 167 (DA0DT167)D-A0 Data Register 166 (DA0DT166)
D-A0 Data Register 169 (DA0DT169)D-A0 Data Register 168 (DA0DT168)
Blank areas are reserved for future use.
Figure 3.4.25 Register Mapping of the SFR Area (22)
D-A0 Data Register 170 (DA0DT170)
D-A0 Data Register 172 (DA0DT172)
D-A0 Data Register 174 (DA0DT174)
D-A0 Data Register 176 (DA0DT176)
D-A0 Data Register 178 (DA0DT178)
D-A0 Data Register 180 (DA0DT180)D-A0 Data Register 181 (DA0DT181)
D-A0 Data Register 182 (DA0DT182)
D-A0 Data Register 184 (DA0DT184)
D-A0 Data Register 186 (DA0DT186)
D-A0 Data Register 188 (DA0DT188)
D-A0 Data Register 190 (DA0DT190)D-A0 Data Register 191 (DA0DT191)
D-A0 Data Register 192 (DA0DT192)D-A0 Data Register 193 (DA0DT193)
D-A0 Data Register 194 (DA0DT194)D-A0 Data Register 195 (DA0DT195)
D-A0 Data Register 196 (DA0DT196)
D-A0 Data Register 198 (DA0DT198)
D-A0 Data Register 200 (DA0DT200)
D-A0 Data Register 202 (DA0DT202)D-A0 Data Register 203 (DA0DT203)
D-A0 Data Register 204 (DA0DT204)D-A0 Data Register 205 (DA0DT205)
D-A0 Data Register 206 (DA0DT206)D-A0 Data Register 207 (DA0DT207)
D-A0 Data Register 208 (DA0DT208)
D-A0 Data Register 210 (DA0DT210)D-A0 Data Register 211 (DA0DT211)
D-A0 Data Register 212 (DA0DT212)
D-A0 Data Register 214 (DA0DT214)
D-A0 Data Register 216 (DA0DT216)
D-A0 Data Register 218 (DA0DT218)D-A0 Data Register 219 (DA0DT219)
D-A0 Data Register 220 (DA0DT220)
D-A0 Data Register 222 (DA0DT222)D-A0 Data Register 223 (DA0DT223)
D-A0 Data Register 224 (DA0DT224)D-A0 Data Register 225 (DA0DT225)
D-A0 Data Register 226 (DA0DT226)
D-A0 Data Register 228 (DA0DT228)D-A0 Data Register 229 (DA0DT229)
D-A0 Data Register 230 (DA0DT230)D-A0 Data Register 231 (DA0DT231)
D-A0 Data Register 232 (DA0DT232)D-A0 Data Register 233 (DA0DT233)
D-A0 Data Register 234 (DA0DT234)
D-A0 Data Register 236 (DA0DT236)
D-A0 Data Register 238 (DA0DT238)
D-A0 Data Register 240 (DA0DT240)
D-A0 Data Register 244 (DA0DT244)
D-A0 Data Register 246 (DA0DT246)
D-A0 Data Register 248 (DA0DT248)
D-A0 Data Register 250 (DA0DT250)
D-A0 Data Register 252 (DA0DT252)
D-A0 Data Register 171 (DA0DT171)
D-A0 Data Register 173 (DA0DT173)
D-A0 Data Register 175 (DA0DT175)
D-A0 Data Register 177 (DA0DT177)
D-A0 Data Register 179 (DA0DT179)
D-A0 Data Register 183 (DA0DT183)
D-A0 Data Register 185 (DA0DT185)
D-A0 Data Register 187 (DA0DT187)
D-A0 Data Register 189 (DA0DT189)
D-A0 Data Register 197 (DA0DT197)
D-A0 Data Register 199 (DA0DT199)
D-A0 Data Register 201 (DA0DT201)
D-A0 Data Register 209 (DA0DT209)
D-A0 Data Register 213 (DA0DT213)
D-A0 Data Register 215 (DA0DT215)
D-A0 Data Register 217 (DA0DT217)
D-A0 Data Register 221 (DA0DT221)
D-A0 Data Register 227 (DA0DT227)
D-A0 Data Register 235 (DA0DT235)
D-A0 Data Register 237 (DA0DT237)
D-A0 Data Register 239 (DA0DT239)
D-A0 Data Register 241 (DA0DT241)
D-A0 Data Register 243 (DA0DT243)D-A0 Data Register 242 (DA0DT242)
D-A0 Data Register 245 (DA0DT245)
D-A0 Data Register 247 (DA0DT247)
D-A0 Data Register 249 (DA0DT249)
D-A0 Data Register 251 (DA0DT251)
D-A0 Data Register 253 (DA0DT253)
D-A0 Data Register 255 (DA0DT255)D-A0 Data Register 254 (DA0DT254)
Blank areas are reserved for future use.
Figure 3.4.26 Register Mapping of the SFR Area (23)
3-34Rev.1.0
Page 93
ADDRESS SPACE
3
3.5 EIT Vector Entry
3.5 EIT Vector Entry
The EIT vector entry is located at the beginning of the internal ROM/extended external areas.
Instructions for branching to the start addresses of respective EIT event handlers are written here.
Note that it is branch instructions and not the jump addresses that are written here. For details, refer
to Chapter 4, "EIT."
Note: When the flash entry bit = 1 (flash enable mode), the EI vector entry is located at H'0080 4000.
Figure 3.5.1 EIT Vector Entry
3-35Rev.1.0
Page 94
ADDRESS SPACE
3
3.6 ICU Vector Table
3.6 ICU Vector Table
The ICU vector table is used by the internal Interrupt Controller. The start addresses of interrupt
handlers for interrupt requests from internal peripheral I/Os are set at the corresponding addresses
of this table, as shown below. For details, refer to Chapter 5, "Interrupt Controller."
Figures 3.6.1 and 3.6.2 show a configuration of the ICU vector table.
Figure 3.6.2 Configuration of the ICU Vector Table (2/2)
3-37Rev.1.0
Page 96
ADDRESS SPACE
3
3.7 Precautions on Address Space
3.7 Precautions on Address Space
• Virtual-flash emulation function
The 32172 has a function for mapping up to two 8-Kbyte blocks of the internal RAM beginning with
the first address into the internal flash memory areas divided in units of 8 Kbytes (L banks).
Similarly, the 32173 has a function for mapping up to three 8-Kbyte blocks of the internal RAM
beginning with the first address into the internal flash memory areas divided in units of 8 Kbytes (L
banks), as well as mapping up to two 4-Kbyte blocks of the internal RAM beginning with the H'0080
A000 area into the internal flash memory areas divided in units of 4 Kbytes (S banks) (the latter
available for only the 32173). This is referred to as the virtual-flash emulation function. For details
about this function, refer to Section 6.7, "Virtual-flash Emulation Function."
3-38Rev.1.0
Page 97
CHAPTER 4CHAPTER 4
EIT
4.1 Outline of EIT
4.2 EIT Events
4.3 EIT Processing Procedure
4.4 EIT Processing Mechanism
4.5 Accepting EIT Events
4.6 Saving and Restoring PC
and PSW
4.7 EIT Vector Entry
4.8 Exception Handling
4.9 Interrupt Handling
4.10 Trap Handling
4.11 EIT Priority
4.12 Example of EIT Processing
4.13 Precautions on EIT
Page 98
4
4.1 Outline of EIT
4.1 Outline of EIT
If an event occurs while the CPU is executing an ordinary program, the CPU may have to suspend
execution of the program and execute another program. Such an event is referred to by the generic
name "EIT (Exception, Interrupt, Trap)."
(1) Exception
This event relates to the context being executed, and is generated by an error or a violation of
rules in instruction execution. In the M32R/E, Address Exception (AE) and Reserved Instruction
Exception (RIE) fall under the category of this type of event.
(2) Interrupt
This event occurs independently of the context being executed. It is generated by a signal sent by
means of hardware from the outside. In the M32R/E, External Interrupt (EI), System Break
Interrupt (SBI), and Reset Interrupt (RI) fall under the category of this type of event.
EIT
(3) Trap
This refers to a software interrupt, which is issued by executing the TRAP instruction. As in the
case of system calls of the OS, this type of event is generated intentionally in a program by the
programmer.
EITExceptionReserved Instruction Exception (RIE)
Address Exception (AE)
InterruptReset Interrupt (RI)
System Break Interrupt (SBI)
External Interrupt (EI)
TrapTRAP
Figure 4.1.1 Classification of EIT
4-2Rev.1.0
Page 99
4
4.2 EIT Events
4.2.1 Exceptions
(1) Reserved Instruction Exception (RIE)
A Reserved Instruction Exception (RIE) occurs when execution of a reserved instruction (an
unimplemented instruction) is detected.
(2) Address Exception (AE)
An Address Exception (AE) occurs when access to an unaligned address is attempted in a Load
or Store instruction.
4.2.2 Interrupts
EIT
4.2 EIT Events
(1) Reset Interrupt (RI)
A Reset Interrupt (RI) is accepted by asserting a RESET signal to the CPU. The Reset Interrupt
has the highest priority.
(2) System Break Interrupt (SBI)
The System Break Interrupt (SBI) is an emergency interrupt which is issued when power outage
is detected or a fault condition is notified from an external watchdog timer. This interrupt can be
used only when after interrupt processing, the CPU does not as a rule return to the program it
was executing when the interrupt occurred.
(3) External Interrupt (EI)
The External Interrupt (EI) is an interrupt request from one of the internal peripheral I/Os
managed by the Interrupt Controller. The M32R's internal Interrupt Controller controls these
interrupts by means of eight interrupt priority levels (including an interrupt-disabled state).
_____
4.2.3 Trap
The Trap (TRAP) is a software interrupt, which is generated by executing the TRAP instruction.
Sixteen vector addresses are provided, corresponding to operands 0-15 of the TRAP instruction.
4-3Rev.1.0
Page 100
4
4.3 EIT Processing Procedure
4.3 EIT Processing Procedure
EIT processing consists of two parts, one automatically processed by hardware, and one
processed 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
Suspend program
execution
Accept EIT
request
Program execution restarts
InstructionCInstruction
Instruction
processing
cancel type
(RIE, AE)
• • • •
D
Instruction processing
complete type
(EI, TRAP)
EIT
PC BPC
PSW (B)PSW
Hardware
preprocessing
EIT vector
entry
Branch
instruction
(SBI)
User-created processing program
EIT handlers except for SBI
Save BPC, (B)PSW,
and general-purpose
registers to the stack
SBI
(System Break
Interrupt)
processing
Processing
by handler
Note: (B)PSW denotes the PSW Register’s BPSW field.
Figure 4.3.1 Outline of EIT Processing Procedure
Hardware
postprocessing
Restore generalpurpose registers
(B)PSW, and BPC
from the stack
Terminate the program or
reset the system
(B)PSW PSW
BPC PC
RTE
instruction
4-4Rev.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.