32171 Group is a 32-bit, single-chip RISC microcomputer
with built-in flash memory, which was developed for use in
general industrial and household equipment.
To make full use of microcomputer built-in mass volume
flash memory, this microcomputer contains a variety of peripheral functions ranging from two independent blocks of
16-channel A-D converters to 37-channel multifunction timers, 10-channel DMAs, 3-channel serial I/Os, and 1-channel
real time debugger. Also included 1-channel Full-CAN modules and JTAG (boundary scan facility).
With lower power consumption and low noise characteristics
also considered, these microcomputers are ideal for embedded equipment applications.
Features
M32R RISC CPU core
• Uses the M32R family RISC CPU core (Instruction set
common to all microcomputers in the M32R family)
• Five-stage pipelined processing
• Sixteen 32-bit general-purpose registers
• 16-bit/32-bit instructions implemented
• DSP function instructions (sum-of-products calculation
using 56-bit accumulator)
To meet the need for use at high temperatures, the microcomputer is designed to be able to operate in the temperature
range of -40 to +125oC when CPU clock operating
frequency = 32 MHz. When CPU clock operating frequency =
40 MHz, the microcomputer can be used in the temperature
o
range of -40 to +85
Note: This does not guarantee continuous operation at
The M32171 Group uses the M32R RISC CPU core, and has
an instruction set which is common to all microcomputers in
the M32R family.
Instructions are processed in five pipelined stages consisting
of instruction fetch, decode, execution, memory access, and
write back. Thanks to its “out-of-order-completion” mechanism,
the M32R CPU allows for clock cycle efficient, instruction execution control.
The M32R CPU internally has sixteen 32-bit general-purpose
registers. The instruction set consists of 83 discrete instructions, which come in either a 16-bit instruction or a 32-bit instruction format. Use of the 16-bit instruction format helps to
reduce the code size of a program. Also, the availability of 32bit instructions facilitates programming and increases the performance at the same clock speed, as compared to
architectures with segmented address spaces.
Sum-of-products instructions comparable to DSP
The M32R CPU contains a multiplier/accumulator that can
execute 32 bits × 16 bits in one cycle. Therefore, it executes a
32 bit × 32 bit integer multiplication instruction in three cycles.
Also, the M32R CPU supports the following four sum-of-products instructions (or multiplication instructions) for DSP function use.
(4) All 32 register bits × 16 low-order register bits
Furthermore, the M32R CPU has instructions for rounding the
value stored in the accumulator to 16 or 32 bits, and instructions for shifting the accumulator value to adjust digits before
storing in a register. Because these instructions also can be
executed in one cycle, DSP comparable data processing capability can be obtained by using them in combination with
high-speed data transfer instructions such as Load & Address
Update or Store & Address Update.
Address space
The M32171 Group’s logical addresses are always handled in
32 bits, providing 4 Gbytes of linear address space. The
M32171 Group’s address space consists of the following.
User space
A 2-Gbyte area from H’0000 0000 to H’7FFF FFFF is the user
space. Located in this space are the user ROM area, external
extended area, internal RAM area, and SFR (Special Function Register) area (internal peripheral I/O registers). Of
these, the user ROM area and external extended area are located differently depending on mode settings.
Boot program space
A 1-Gbyte area from H’8000 0000 to H’BFFF FFFF is the boot
program area. This space contains the on-board programming program (boot program) used in blank state by the internal flash memory.
System space
A 1-Gbyte area from H’C000 0000 to H’FFFF FFFF is the
system area. 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.
Three operation modes
The M32170 and M32174 Group has three operation modes:
single-chip mode, external extended mode, and processor
mode. These operation modes are changed from one to another by setting the MOD0 and MOD1 pins.
PowerVCCEPower supply—Supplies power (5 V or 3.3V) to external I/O ports.
supplyVCCIPower supply—Supplies power (3.3 V) to the internal logic.
VDDRAM power supply —nternal RAM backup power supply (3.3 V).
FVCCFlash power supply —Internal flash memory backup power supply (3.3 V).
VSSGround —Connect all VSS pins to ground (GND).
ClockXIN,ClockInputClock input/output pins. These pins contain a PLL-based
XOUTOutputfrequency multiply-by-4, so input the clock whose frequency is quarter
the operating frequency. (XIN input = 10 MHz when CPU clock operates
at 40 MHz)
BCLK /System clockOutput
______
WRexternal inpout clock. (BCLK output = 20 MHz when CPU clock operates at 40
When this signal is System Clock(BCLK), it outputs a clock whose is twice
MHz). Use this clock when circuits are synchronized externally.
When this signal is Write(WR), during external write access it indicates the
valid data on the data bus to transfer.
______
that of
OSC-VCCPower supply—Power supply to the PLL circuit. Connect OSC-VCC to the power supply(3.3V)
OSC-VSSGround —Connect OSC-VSS to ground.
VCNTPLL controlInputThis pin controls the PLL circuit. Connect a resistor and capacitor to this pin.
Reset
ModeMOD0ModeInputThese pins set an operation mode.
AddressA12-A30AddressOutput19 lines of address bus (A12-A30) are provided to accommodate two
busbus
Data busDB0-DB15Data busInput/outputThis 16-bit data bus connects to external device.
______
RESETResetInputThis pin resets the internal circuits.
channels of 1 MB memory space (max.) connected external to the chip.
A31 is not output.
In the write cycle, of the 16-bit data bus the valid byte positions to write are
output as BHW/ BHE and BLW/ BLE. In read cycle, data on the entire 16-bit
data bus is read. However, only the data at the valid byte positions are
transferred to the M32R’s internal circuit.
_________ ________________ _______
Note: FP pin should be “H” level in Boot Mode.
8
2001-5-14 Rev.1.0
Table 5 Description of Pin Function (2/4)
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
TypePin typeDescriptionInput/Output Function
Bus
___
CS0,ChipOutputChip select signals for external devices.
controlCS1select
__
RDReadOutputThis signal is output when reading external devices.
___
_______
BHW/ BHEByte highOutputIndicates the byte positions to which valid are transferred when writing to
___
write
_______
BLW/ BLEByte lowOutput
external devices.BHW/ BHE and BLW/ BLE correspond to the upper address
side(D0-D7 effective) and the lower address side(D8-D15 effective),respectivel.
write
____
WAITWaitInput
_________
If WAIT input is low when the M32R accesses external devices, the wait cycle
extended.
_____
HREQHoldInputThis pin is used by an external device to request control of the external bus.
____
request
HACKHoldOutputThis signal indicates to the external device that the M32R has entered a hold
The M32R goes to a hold state when HREQ input is pulled low.
acknowledgestate and relinquished control of the external bus.
Multijunction
TIN0, TIN3Timer inputInputInput pins for multijunction timer.
timerTIN16-TIN23
TO0Timer outputOutputOutput pins for multijunction timer.
-TO20
TCLK0Timer clockInputClock input pins for multijunction timer.
-TCLK3
________ _______________ _______
__________
A-DAVCC0,Analog power –AVCC0 is the power supply for the A-D0 converters.Connect AVCC0
converter
upply
to the power supply (5V or 3.3V).
AVSS0Analog ground –AVSS0 is the analog ground for the A-D0 converters. Connect AVCC0 to ground
AD0IN0Analog inputInput16-channel analog input pin for A-D0 converter.
-AD0IN15
VREF0ReferenceInputVREF0 is the reference voltage input pin (5V or 3.3V) for the A-D0 converters.
voltage input
___
Interrupt
SBISystemInputSystem break interrupt(SBI) input pin of the interrupt controller.
controllerbreak
interrupt
9
2001-5-14 Rev.1.0
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Table 6 Description of Pin Functions (3/4)
TypePin nameDescription Input/outputFunction
SerialSCLKI0/UART transmit/ Input/outputWhen channel 0 is in UART mode:
I/O
SCLKO0receive clock Clock output derived from BRG output by dividing it by 2
output or CSIO
transmit/receiveWhen channel 0 is in CSIO mode:
clock Transmit/receive clock input when external clock is selected
input/output Transmit/receive clock output when internal clock is selected
SCLKI1/UART transmit/ Input/outputWhen channel 1 is in UART mode:
SCLKO1receive clock Clock output derived from BRG output by dividing it by 2
output or CSIO
transmit/receiveWhen channel 1 is in CSIO mode:
clock Transmit/receive clock input when external clock is selected
input/output Transmit/receive clock output when internal clock is selected
Mitsubishi Microcomputers
32171 Group
TXD0Transmit dataOutputTransmit data output pin for serial I/O channel 0
RXD0Receive dataInputReceive data input pin for serial I/O channel 0
TXD1Transmit dataOutputTransmit data output pin for serial I/O channel 1
RXD1Receive dataInputReceive data input pin for serial I/O channel 1
TXD2Transmit dataOutputTransmit data output pin for serial I/O channel 2
RXD2Receive dataInputReceive data input pin for serial I/O channel 2
Real-Time
Debugger
Flash-FPFlash protectInputThis pin protects the flash memory against E/W in hardware.
only
CANCTXTransmit dataOutputData output pin from CAN module.
RTDTXDTransmit dataOutputSerial data output pin of the real-time debugger
RTDRXDReceive dataInputSerial data input pin of the real-time debugger
RTDCLKClock inputInputSerial data transmit/receive clock input pin of the real-time debugger
RTDACKAcknowledgeOutputThis pin outputs a low pulse synchronously with the real-time debugger’s
first clock of serial data output word. The low pulse width indicates the
type of the command/data the realtime debugger has received.
CRXReceive dataInputData input pin to CAN module.
JTAGJTMSTest modeInputTest select input for controlling the test circuit’s state transition
JTCKClockInputClock input to the debugger module and test circuit.
JTRSTTest resetInput Test reset input for initializing the test circuit asynchronously.
JTDOSerial outputOutputSerial output of test instruction code or test data.
JTDISerial inputInputSerial input of test instruction code or test data.
10
2001-5-14 Rev.1.0
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Table 7 Description of Pin Functions (4/4)
TypePin nameDescriptionInput/outputFunction
Input/
output
port
(Note)
P00-P07Input/output port 0Input/outputProgrammable input/output port.
P10-P17Input/output port 1Input/outputProgrammable input/output port.
P20-P27Input/output port 2Input/outputProgrammable input/output port.
P30-P37Input/output port 3Input/outputProgrammable input/output port.
P41-P47Input/output port 4Input/outputProgrammable input/output port.
P61-P64Input/output port 6Input/outputProgrammable input/output port.
(However, P64 is an input-only 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.
Mitsubishi Microcomputers
32171 Group
P100Input/output port 10Input/outputProgrammable input/output port.
-P107
P110Input/output port 11Input/outputProgrammable input/output port.
-P127
P130Input/output port 13Input/outputProgrammable input/output port.
-P137
P150, P153Input/output port 15Input/outputProgrammable input/output port.
P174, P175Input/output port 17Input/outputProgrammable input/output port.
P220,Input/output port 22Input/outputProgrammable input/output port.
P221, P225(However, P221 is an input-only port)
Note: Input/output port 5 is reserved for future use.
Input/output ports 14, 16, 18, 19, 20, and 21 do not exist.
11
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
< Logical space of the M32171F4VFP >
Logical address
H'0000 0000
(16M bytes)
2G bytes
H'7FFF FFFF
H'8000 0000
1G bytes
H'BFFF FFFF
H'C000 0000
User space
Boot
program
space
BOOT ROM
area
(8K bytes)
Reserved area
(8K bytes)
Expanded external area
(4M bytes)
Ghost area
in units of
16M bytes
H'8000 0000
H'8000 1FFF
H'8000 2000
H'8000 3FFF
H'8000 4000
Ghost area
in units of
16K bytes
H'BFFF FFFF
EIT vector entry
User ROM
area
Reserved area
(512K bytes)
CS0 area
CS1 area
Ghost area in
CS1
(1M byte)
SFR area
(16K bytes)
Internal RAM
(16K bytes)
Reserved area
(96K bytes)
H'0000 0000
H'0007 FFFF
H'000F FFFF
H'0010 0000
H'001F FFFF
H'0020 0000
H'002F FFFF
H'0030 0000
H'003F FFFF
H'0040 0000
Ghost area in
units of 4M bytes
H'007F FFFF
H'0080 0000
H'0080 3FFF
H'0080 4000
H'0080 7FFF
H'0080 8000
H'0081 FFFF
H'0082 0000
1G bytes
System
space
H'FFFF FFFF
Figure 4 Address Space of the M32171F4VFP
12
Ghost area in
units of 128K bytes
H'00FF FFFF
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
< Logical space of the M32171F3VFP >
Logical address
H'0000 0000
(16M bytes)
2G bytes
H'7FFF FFFF
H'8000 0000
1G bytes
H'BFFF FFFF
H'C000 0000
User space
Boot
program
space
BOOT ROM
area
(8K bytes)
Reserved area
(8K bytes)
Expanded external area
(4M bytes)
Ghost area
in units of
16M bytes
H'8000 0000
H'8000 1FFF
H'8000 2000
H'8000 3FFF
H'8000 4000
Ghost area
in units of
16K bytes
H'BFFF FFFF
EIT vector entry
User ROM
area
Reserved area
(640K bytes)
CS0 area
CS1 area
Ghost area in
CS1
(1M byte)
SFR area
(16K bytes)
Internal RAM
(16K bytes)
Reserved area
(96K bytes)
H'0000 0000
H'0005 FFFF
H'000F FFFF
H'0010 0000
H'001F FFFF
H'0020 0000
H'002F FFFF
H'0030 0000
H'003F FFFF
H'0040 0000
Ghost area in
units of 4M bytes
H'007F FFFF
H'0080 0000
H'0080 3FFF
H'0080 4000
H'0080 7FFF
H'0080 8000
H'0081 FFFF
H'0082 0000
1G bytes
System
space
H'FFFF FFFF
Figure 5 Address Space of the M32171F3VFP
Ghost area in
units of 128K bytes
H'00FF FFFF
13
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
< Logical space of the M32171F2VFP >
Logical address
H'0000 0000
(16M bytes)
2G bytes
H'7FFF FFFF
H'8000 0000
1G bytes
H'BFFF FFFF
H'C000 0000
User space
Boot
program
space
BOOT ROM
area
(8K bytes)
Reserved area
(8K bytes)
Expanded external area
(4M bytes)
Ghost area
in units of
16M bytes
H'8000 0000
H'8000 1FFF
H'8000 2000
H'8000 3FFF
H'8000 4000
Ghost area
in units of
16K bytes
H'BFFF FFFF
EIT vector entry
User ROM
area
Reserved area
(768K bytes)
CS0 area
CS1 area
Ghost area in
CS1
(1M byte)
SFR area
(16K bytes)
Internal RAM
(16K bytes)
Reserved area
(96K bytes)
H'0000 0000
H'0003 FFFF
H'000F FFFF
H'0010 0000
H'001F FFFF
H'0020 0000
H'002F FFFF
H'0030 0000
H'003F FFFF
H'0040 0000
Ghost area in
units of 4M bytes
H'007F FFFF
H'0080 0000
H'0080 3FFF
H'0080 4000
H'0080 7FFF
H'0080 8000
H'0081 FFFF
H'0082 0000
1G bytes
System
space
H'FFFF FFFF
Figure 6 Address Space of the M32171F2VFP
14
Ghost area in
units of 128K bytes
H'00FF FFFF
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
H'0080 0000
to
H'0080 007E
H'0080 0080
to
H'0080 00EE
H'0080 0100
to
H'0080 0146
H'0080
0180
H'0080 0200
to
H'0080 023E
H'0080 0240
to
H'0080 02FE
H'0080 0300
to
H'0080 03BE
H'0080 03C0
to
H'0080 03D8
07 815
+0
address+1address
Interrupt
controller
(ICU)
A-D converter
Serial I/O
Wait controller
MJT (common part)
MJT (TOP)
MJT (TIO)
MJT (TMS)
Multijunction
timer
(MJT)
H'0080 07E0
to
H'0080 07F2
H'0080 0FE0
to
H'0080 0FFE
H'0080 1000
to
H'0080 11FE
H'0080 3FFE
07 815
+0
address+1address
Flash control
MJT (TML1)
CAN
Figure 7 SFR Area
H'0080 03E0
to
H'0080 03F
H'0080 0400
H'0080 047E
H'0080 0700
H'0080 0756
Note: The Real-time debugger (RTD) is an independent module operated from external circuits,
and is transparent to the CPU.
E
to
to
MJT (TML0)
DMAC
Input/output ports
15
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Built-in Flash Memory and RAM
The M32171F4VFP contains 512-Kbyte flash memory and
16-Kbyte RAM. The M32171F3VFP contains 384-Kbyte
flash memory and 16-Kbyte RAM. The M32171F2VFP contains 256-Kbyte flash memory and 16-Kbyte RAM.
The internal flash memory can be programmed on-board
(i.e., while being mounted on the printed circuit board). This
means that the same chip as will be used in mass-production can be used directly from the development stage on,
allowing for system development without having to change
the printed circuit board when proceeding from trial production to mass-production.
< Internal flash >
H'0000 0000
H'0000 1FFF
H'0000 2000
H'0000 3FFF
H'0000 4000
H'0000 5FF
H'0007 C000
H'0007 DFF
H'0007 E000
H'0007 FFFF
F
F
L bank 0
(8K bytes)
L bank 1
(8K bytes)
L bank 2
(8K bytes)
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
L bank 62
(8K bytes)
L bank 63
(8K bytes)
Built-in Virtual-Flash Emulation Function
Internal flash memory, which is divided from the first address
in units of 8 Kbyte (L banks), can be replaced in 8 -Kbyte
blocks (H70080 4000-H’0080 5FFF) from the beginning of
the internal RAM. And also the internal flash memory, which
is divided from the first address in units of 4-Kbyte area (All S
banks), can be replaced within two 4 Kbytes areas (H’0080
6000-H’0080 7FFF).
This function allows parts of the program which are frequently changed during development to be altered or evaluated without having to reset the microcomputer each time.
What’s more, when combined with the realtime debugger,
this function helps to reduce the program evaluation period,
because data in the RAM can be rewritten without requiring
any CPU load.
< Internal RAM >
8K bytes
4K bytes
4K bytes
H'0080 4000
H'0080 5FF
H'0080 6000
H'0080 7FFF
F
Note 1: If the same bank area is set in multiple virtual-flash bank registers and the virtual-flash emulation enable bit is enabled,
the corresponding internal RAM area is assigned to either bank register according to the priority FELBANK0 > FESBANK0
> FESBANK1.
Note 2: When access is made to the 8-Kbyte area (L bank) specified with pseudo-flash bank register 0, the internal RAM
area is accessed. During pseudo-flash emulation mode, RAM data can read and written to and from both the internal RAM
area and the virtual-flash setup area.
Figure 8 Virtual-Flash Emulation Areas of the M32171F4VFP (Replaced in Units of 8 Kbytes)
16
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
H'0000 0000
H'0000 0FFF
H'0000 1000
H'0000 1FFF
H'0000 2
000
H'0000 2FF
H'0007 E000
H'0007 EFFF
H'0007 F000
H'0007 FFFF
F
S bank 0
(4K bytes)
S bank 1
(4K bytes)
S bank 2
(4K bytes)
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
·
S bank 126
(4K bytes)
S bank 127
(4K bytes)
< Internal RAM>
8K bytes
4K bytes
4K bytes
H'0080 4000
H'0080 5FF
H'0080 6000
H'0080 7000
F
Note 1: If the same bank area is set in multiple virtual-flash bank registers and the virtual-flash emulation enable bit is enabled,
the corresponding internal RAM area is assigned to either bank register according to the priority FELBANK0 > FESBANK0
> FESBANK1.
Note 2: When access is made to the 4-Kbyte area (S bank) specified with virtual-flash bank registers 0 and 1, the internal RAM
area is accessed. During virtual-flash emulation mode, RAM data can read and written to and from both the internal RAM
area and the virtual-flash setup area.
< Internal flash >
Figure 9 Virtual-Flash Emulation Areas of the M32171F4VFP (Replaced in Units of 4 Kbytes)
Virtual-Flash Emulation Areas of M32171F4VFP, M32171F3VFP,
and M32171F2VFP are shown as follows.
The microcomputer has a total of 97 input/output ports
P0-P22. (However, P5 is reserved for future use, P14, P16,
and P18-P21 do not exist.) The input/output ports can be
used as input ports or output ports by setting uptheir direction
registers.
Each input/output port is a dual-function pin shared with
otherinternal peripheral I/O or external extended bus signal
lines. These pin functions are selected by using the chip operation mode select or the input/output port operation mode
registers. These input/output ports are interfaced using a
dedicated power supply to allow for connections to the peripheral circuits operating with 5V or 3.3V.
Port functionThe input/output ports can be set for input or output mode bitwise by using the input/output port
direction control register. (However, P64 is an SBI input-only port, and P221 is CAN input-only port.)
Pin functionDual-functions shared with peripheral I/O or external extended signals (or multi-functions shared with
peripheral I/Os which have multiple functions.)
Pin functionP0 - P4: Changed by setting CPU operation mode (MOD0 and MOD1 pins)
changeoverP6 - 22 : Changed by setting the input/output port operation mode register.
(However, peripheral I/O pin functions are selected using the peripheral I/O register.)
Note: Input/output ports P14, P16, and P18-P21 do not exist.
___
Table 10 CPU Operation Modes and P0-P4 Pin Functions
Note: VCCE connects to +5V or +3.3V, and VSS connects to GND.
External extended signal pin
18
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
CPU
operation mode
settings (Note1)
(Reserved)
P0
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10
0257
DB0
DB8DB9DB10DB11DB12DB13DB14DB15
A23A24A25A26A27A28A29A30
A15A16A17A18A19A20A21A22
BCLK/
WR
13
DB1DB2DB3DB4DB5DB6DB7
BLW/BLE
(P61)
WAITHREQHACKRTDTXD RTDRXD RTDACK RTDC
BHW/BHE
(P62)
TXD0RXD0
RDCS0CS1A13A14
(P63)
TO 16TO 1 7TO 18T O 19TO 20
TO 11TO 1 2TO 13T O 14TO 15TO 10TO 9TO 8
4
SBI
SCLKI 0/
SCLKO 0
TXD1RXD1
6
LK
SCLKI 1/
SCLKO 1
Input/output
port operation
mode register
settings
P11
P12
TI N 16TIN 17TIN 18TIN 19TIN 20TIN 21TIN 22TIN 23
P13
P14
TIN 0TIN
P15
P16
P17
P18
P19
P20
P21
P22
CTXCRXA12
TO 3TO 4TO 5TO 6TO 7TO 2TO 1TO 0
TCLK 0TCLK 1TCLK 2TCLK 3
3
TXD 2RXD 2
Note 1: The pin function are selected by setting the MOD0 and MOD1 pins.
Note 2: P14, P16, P18, P19, P20, and P21 do not exist.
Figure 10 Input/output Ports and Pin Function Assignments
19
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Built-in 10-Channel DMAC
The microcomputer contains 10 channels of DMAC, allowing
for data transfer between internal peripheral I/Os, between
internal RAM and internal peripheral I/O, and between internal RAMs.
The microcomputer also supports cascaded connection between DMA channels (starting DMA transfer on a channel at
end of transfer on another channel). This makes advanced
transfer processing possible without causing any additional
CPU load.
DMA transfer requests can be issued from the user-cre
ated software, as well as can be triggered by a signal generated by the internal peripheral I/O (A-D converter, MJT, or
serial I/O).
Table 11 Outline of the DMAC
ItemContent
Number of channels10 channels
Transfer request• Software trigger
• Request from internal peripheral I/O: A-D converter, multijunction timer, or serial I/O
(reception completed, transmit buffer empty)
• Cascaded connection between DMA channels possible (Note)
Maximum number of times transferred 256 times
Transferable address space• 64 Kbytes (address space from H’0080 0000 to H’0080 FFFF)
• Transfers between internal peripheral I/Os, between internal RAM and internal peripheral IO,
and between internal RAMs are supported
Transfer data size16 bits or 8 bits
Transfer methodSingle transfer DMA (control of the internal bus is relinquished for each transfer performed),
dual-address transfer
Transfer modeSingle transfer mode
Direction of transferOne of three modes can be selected for the source and destination of transfer:
(Fixed priority)
Maximum transfer rate13.3 Mbytes per second (when internal peripheral clock = 20 MHz)
Interrupt requestGroup interrupt request can be generated when each transfer count register underflows
Transfer area64 Kbytes from H’0080 0000 to H’0080 FFFF (Transfer is possible in the entire internal
RAM/SFR area)
Note: The following DMA channels can be cascaded.
DMA transfer on channel 1 started at end of one DMA transfer on channel 0
DMA transfer on channel 2 started at end of one DMA transfer on channel 1
DMA transfer on channel 0 started at end of one DMA transfer on channel 2
DMA transfer on channel 4 started at end of one DMA transfer on channel 3
DMA transfer on channel 6 started at end of one DMA transfer on channel 5
DMA transfer on channel 7 started at end of one DMA transfer on channel 6
DMA transfer on channel 5 started at end of one DMA transfer on channel 7
DMA transfer on channel 9 started at end of one DMA transfer on channel 8
DMA transfer on channel 5 started at end of all DMA transfers on channel 0 (underflow of transfer count register)
20
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
One DMA2 transfer completed
Software start
A-D conversion completed
MJT (TIO8_udf)
MJT (input event bus 2)
Software
MJT (output event bus 0)
One DMA0 transfer completed
Software
MJT (output event bus 1)
MJT (TIN18 input signal)
One DMA1 transfer completed
Serial I/O0 (transmit buffer empty)
Serial I/O1 (reception completed)
One DMA3 transfer completed
Serial I/O0 (reception completed)
One DMA7 transfer completed
All DMA0 transfers completed (udf)
Serial I/O2 (reception completed)
Software start
MJT (TIN0 input signal)
Software
MJT (TIN19 input signal)
Software start
MJT (TIN20 input signal)
start
start
start
DMA channel 0
DMA
request
selector
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
Source
Destination
Transfer count
1
Source
Destination
Transfer count
2
Source
Destination
Transfer count
3
Source
Destination
Transfer count
4
Source
Destination
Transfer count
5
Determination block
Source
Destination
Transfer count
udf
udf
udf
udf
udf
DMA start
udf
Internal bus
Internal bus arbitration
Interrupt
request
Software start
Serial I/O1 (transmit buffer empty)
One DMA5 transfer completed
Software start
Serial I/O2 (transmit buffer empty)
One DMA6 transfer completed
Software start
MJT (input event bus 0)
Software start
One DMA8 transfer
completed
Figure 11 Block Diagram of the DMAC
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
DMA channel
DMA
request
selector
6
Source
Destination
DMA start
udf
udf
udf
udf
Internal bus arbitration
Interrupt
request
Transfer count
7
Source
Destination
Transfer count
8
Source
Destination
Transfer count
9
Source
Destination
Transfer count
Determination block
21
2001-5-14 Rev.1.0
Built-in 37-Channel Multijunction Timers (MJT)
The microcomputer contains a total of 37 channels of
multijunction timers consisting of 11 channels of 16-bit output related timers, 10 channels of 16-bit input/output related
timers, eight channels of 16-bit input related timers, eight
channels of 32-bit input related timers, Each timer has multiple operation modes to choose from, depending on the pur-
poses of use.
Also, the maltijunction timers internally have a clock bus, input event bus, and an output event bus, so that multiple timers can be used in combination allowing for a flexible timer
configuration.
The output related timers have a correcting function that
allows the timer’s count value to be incremented or
decremented as necessary while count is in progress, mak-
ing real time output control possible.
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Output related timer : 11ch
Input/output related timer : 10ch
16-bit input related timer : 8ch
TCLK pin
1/2 internal
peripheral clock
TIN pin
Note: This is a conceptual diagram and does not show the actual timer configuration.
PRS
Clock bus
E/L
E/L
32-bit input related timer : 8ch
Input event bus
CLK
EN
CLK
EN
·
·
·
Timer
Timer
·
·
·
·
Figure 12 Conceptual Diagram of the Multijunction Timer (MJT)
To DMAC,
A-D converter
Output event bus
Interrupt output
F/F
Interrupt output
F/F
E/L
PRS
: Junction box (Selector)
F/F
TO pin
TO pin
: Edge/Level selector
: Prescaler
: Output flip-flop
22
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Table 12 Outline of Multijunction Timers
NameTypeNumber of channelsContent
TOPOutput-related11One of three input modes can be selected in software.
(Timer Output)16-bit timer< With correction function >
(down-counter)• Single-shot output mode
• Delayed single-shot output mode
< Without correction function >
• Continuous output mode
TIOInput/output-related10One of three input modes or four output modes can be
(Timer16-bit timerselected by software.
Figure 13 Block Diagram of Multijunction Timers (MJT) (1/3)
24
: Output flip-flop
S
0 1 2 3
: Selector
2001-5-14 Rev.1.0
3 2 1 0 3 2 1 0
clk
TMS 0
ovf
cap3cap2cap1cap0
S
clkTML 0
cap3cap2cap1cap0
S
S
S
S
TIN20
TIN2
1
TIN2
2
TIN2
3
IRQ11
IRQ11
IRQ11
IRQ11
0 1 2 3
IRQ
7
3 2 1 0 3 2 1 0
0 1 2 3
TIN20
S
TIN21
S
TIN22
S
TIN23
S
S
DRQ12
clkTMS 1
ovf
cap3cap2cap1cap0
S
S
S
S
S
DRQ5
TIN16
TIN1
7
TIN1
8
TIN19
DRQ6
IRQ10
IRQ10
IRQ10
IRQ10
IRQ
7
TIN16
S
TIN17
S
TIN18
S
TIN19
S
(Note1)
clkTML 1
cap3cap2cap1cap0
S
TCLK3
TCLK3
S
S
S
S
S
S
S
S
S
AD0TRG
(To A-D0 converter)
Clock bus
Input event bus
Output event bus
1/2 internal
peripheral
clock
1/2 internal
peripheral
clock
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Figure 14 Block Diagram of Multijunction Timers (MJT) (2/3)
25
2001-5-14 Rev.1.0
s
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Clock busInput event busOutput event bu
3 2 1 0 3 2 1 00 1 2 3
TIN18
TIN0
TIN19
TIN20
AD0 completed
TIO8-udf
SIO0-TXD
SIO1-RXD
SIO0-RXD
RXD
SIO2-
SIO1-
TXD
TXD
SIO2-
S
S
S
S
S
S
S
S
S
DMA
DMA
DMA
DMA
DMA
DMA
DMA
DMA
DMA
udf
0
end
udf
1
end
udf
2
end
udf
3
end
udf
4
udf
5
end
udf
6
end
udf
7
end
udf
8
end
DMAIRQ
DMAIRQ
DMAIRQ
DMAIRQ
DMAIRQ
DMAIRQ
DMAIRQ
DMAIRQ
DMAIRQ
0
0
0
0
0
1
1
1
1
S
3 2 1 0 3 2 1 0
Figure 15 Block Diagram of Multijunction Timers (MJT) (3/3)
DMA
udf
9
DMAIRQ
1
0 1 2 3
26
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Built-in Two Independent A-D Converters
The microcomputer contains two 16-channel converters with
10-bit resolution (A-D0 converter and A-D1 converter). In
addition to single conversion on each channel, continuous
A-D conversion on a combined group of 4, 8, and 16 channels is possible. The A-D converted value can be read out in
either 10 bits or 8 bits.
In addition to ordinary A-D conversion, the converters support comparator mode in which the set value and 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 generated
a DMA transfer request, as well as an interrupt.
The A-D converters are interfaced using a dedicated power
supply to allow for connections to the peripheral circuits op-
erating with 5V or 3.3V.
Table 13 Outline of the A-D Converters
ItemContent
Analog input16 channels
A-D conversion method Successive approximation method.
Resolution10 bits (Conversion results can be read out in either 10 or 8 bits.)
Absolute accuracyNormal rate mode
Scan modeSingle -shot scan mode, continuous scan mode.
Conversion start triggerSoftware startStarted by setting A-D conversion start bit to 1.
Hardware startA-D0 converter started by MJT output event bus 3.
Conversion rate During single modeNormal299 × 1/ f (BCLK)
f(BCLK) : Internal peripheral clock
(Note 2)
Interrupt request generationWhen A-D conversion is finished, when comparate operation is finished, when single-shot
DMA transfer request generation When A-D conversion is finished, when comparate operation is finished, when single-shot
Note 1: The rated value of conversion accuracy here is that of the microcomputer's own as a single unit which can be exhibited when the
microcomputer is used in an environment where it may not be affected by the power supply wiring or noise on the board.
Note 2: When input clock (XIN) = 10 MHz, f(BCLK) = 20 MHz.
operating frequency
(Shortest time )Double speed 173 × 1/ f (BCLK)
During comparator modeNormal47 × 1/ f (BCLK)
(Shortest time )Double speed 29 × 1/ f (BCLK)
scan is finished, or when one cycle of continuous scan is finished.
scan is finished, or when one cycle of continuous scan is finished.
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
A-D comparate
Data Register
10-bit A-D Successive
Approximation Register
(AD0SAR)
10-bit D-A Converter
Selector
Successive Approximation
-type A-D Converter Unit
AD0SIM0,1
Output event bus 3
(multijunction timer)
Comparator
Single Mode Register
Scan Mode RegisterAD0SCM0,1
A-D Control Circuit
• Mode selection
• Channel selection
• Conversion time
selection
• Flag control
• Interrupt control
Interrupt request
DMA transfer request
Figure 16 Block Diagram of the A-D0 Converter
28
2001-5-14 Rev.1.0
3-channel High-speed Serial I/Os
The microcomputer contains three channels of serial I/Os
consisting of two channels that can be set for CSIO mode
(clock-synchronized serial I/O) or UART mode (asynchronous serial I/O) and one other channel that can only be set
for UART mode.
The SIO has the function to generate a DMA transfer request when data reception is completed or the transmit register becomes empty, and is capable of high-speed serial
communication without causing any additional CPU load.
Table 14 Outline of Serial I/O
ItemContent
Number of channelsCSIO/UART: 2 channels (SIO0,SIO1)
During UART mode : Internal clock only
Transfer modeTransmit half-duplex, receive half-duplex, transmit/receive full-duplex
BRG count sourcef(BCLK), f(BCLK)/8, f(BCLK)/32, f(BCLK)/256 (When internal clock is selected) (Note2)
Data formatCSIO mode : Data length = Fixed to 8 bits
Order of transfer = Fixed to LSB first
UARTmode : Start bit = 1 bit
Character length = 7, 8, or 9 bits
Parity bit = Added or not added (When added, selectable between odd and even parity)
Stop bit = 1 or 2 bits
Order of transfer = Fixed to LSB first
Baud rateCSIO mode : 152 bits per second to 2 Mbits per second (when operating with f(BCLK) = 20 MHz)
UARTmode : 19 bits per second to 156 Kbits per second (when operating with f(BCLK) = 20 MHz)
Error detectionCSIO mode : Overrun error only
UARTmode : Overrun, parity, and framing errors
(The error-sum bit indicates which error has occurred)
Fixed cycle clockWhen using SIO0 and SIO1 as UART, this function outputs a divided-by-2 BRG clock from the SCLK pin.
output function
Note 1: During CSIO mode, the maximum input frequency of an external clock is f(BCLK) divided by 16.
Note 2: When f(BCLK) is selected for the BRG count source, the BRG set value is subject to limitations.
29
2001-5-14 Rev.1.0
SIO0
TXD0
RXD0
SIO1
SIO0 Transmit Buffer Register
SIO0 Transmit Shift Register
SIO0 Receive Shift Register
SIO0 Receive Buffer Register
BCLK,
BCLK/8,
BCLK/32,
BCLK/256
BCLK
Clock divider
Transmit/receive
UART
mode
1
(Set value + 1)
generator (BRG)
control circuit
1/16
Baud rate
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
Transmit interrupt
Receive interrupt
Transmit DMA transfer request
Receive DMA transfer request
CSIO
mode
When external clock selected
When internal clock selected
1/2
CSIO mode
When internal clock selected
When UART mode selected
Mitsubishi Microcomputers
32171 Group
To interrupt
controller
To DMA3
To DMA4
SCLKI0/ SCLKO0
Internal data bus
TXD1
RXD1
SIO1 Transmit Shift Register
SIO1 Receive Shift Register
SIO2
TXD2
RXD2
SIO2 Transmit Shift Register
SIO2 Receive Shift Register
Note 1 : When BCLK is selected, the BRG set value is subject to limitations.
Note 2 : SIO2 does not have the SCLKI/SCLKO function.
Figure 17 Block Diagram of Serial I/O
Transmit/receive
control circuit
Transmit/receive
control circuit
Transmit interrupt
Receive interrupt
Transmit DMA transfer request
Receive DMA transfer request
Transmit interrupt
Receive interrupt
Transmit DMA transfer request
Receive DMA transfer request
To interrupt
controller
To DMA6
To DMA3
SCLKI1/ SCLKO1
To interrupt
controller
To DMA7
To DMA5
30
2001-5-14 Rev.1.0
CAN Module
The M32171 Group contains two Full CAN modules compliant with CAN Specification V2.0B (CAN0 and CAN1), each
of which has 16-channel message slots and three mask reg-
isters.
Data bus
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
CAN0 Message
Control Register
CAN0 Extended
CAN0 Configuration
CAN0 Time Stamp
CTX
CRX
CAN0 Status
Register
CAN0 REC
Register
CAN0 TEC
Register
CAN0 Protocol
Controller
2.0B active
Figure 18 Block Diagram of the CAN Module
Slot 0-15
Register
Register
CAN0 Control
Register
Acceptance
Filtering
16-bit Timer
Register
CAN0 Global
Mask Register
CAN0 Local
Mask Register A
CAN0 Local
Mask Register B
Message Memory
(1) Message ID
(2) Data length code
(3) Message data
(4) Time stamp
CAN0 Slot
Status Register
CAN0 Slot
Interrupt Control
Register
CAN0 Error
Interrupt Control
Register
Interrupt Control
Circuit
CAN0 Transmit/Receive
& Error Interrupt
31
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
8-level Interrupt Controller
The Interrupt Controller controls interrupt requests from
each internal peripheral I/O (31 sources) by using eight priority levels assigned to each interrupt source, including interrupts disabled. In addition to these interrupts, it handles
System Break Interrupt (SBI), Reserved Instruction Exception (RIE), and Address Exception (AE) as nonmaskable in-
terrupts.
Wait Controller
The Wait Controller supports access to external devices.
For access to an external extended area of up to 1 Mbytes
(during external extended or processor mode), the Wait
Controller controls bus cycle extension by inserting one to
four wait cycles or using external WAIT signal input.
M32171F4VFP, M32171F3VFP, M32171F2VFP
____
Realtime Debugger (RTD)
The Realtime Debugger (RTD) provides a function for accessing directly from the outside to the internal RAM. It uses
a dedicated clock-synchronized serial I/O to communicate
with the outside.
Use of the RTD communicating via dedicated serial lines allows the internal RAM to be read out and rewritten without
having to halt the CPU.
M32R
CPU
Data Bus(CPU
Internal RAM
(16KB)
Virtual-DPRAM
structure
)Data Bus(RTD)
R/W without CPU intervention
Real-Time Debugger
(RTD)
Figure 19 Conceptual Diagram of the Realtime Debugger (RTD)
RTDCLK
RTDRXD
RTDTXD
RTDAC
Command
K
addressData
DataData
32
2001-5-14 Rev.1.0
Mitsubishi Microcomputers
32171 Group
SINGLE-CHIP 32-BIT CMOS MICROCOMPUTER
CPU Instruction Set
The M32R employs a RISC architecture, supporting a total
of 83 discrete instructions.
(1) Load/store instructions
Perform data transfer between memory and registers.
Perform register to register transfer or register to immediate
transfer
LD24 Load 24-bit immediate
LDILoad immediate
MVMove register
MVFCMove from control register
MVTCMove to control register
SETHSet high-order 16-bit
.
(3) Branch instructions
Used to change the program flow.
BCBranch on C-bit
BEQBranch on equal
BEQZBranch on equal zero
BGEZBranch on greater than or equal zero
BGTZBranch on greater than zero
BLBranch and link
BLEZBranch on less than or equal zero
BLTZBranch on less than zero
BNCBranch on not C-bit
BNEBranch on not equal
BNEZBranch on not equal zero
BRABranch
JLJump and link
JMPJump
NOPNo operation
(4) Arithmetic/logic instructions
Perform comparison, arithmetic/logic operation, multiplication/division, or shift between registers.
SLLShift left logical
SLL3Shift left logical 3-operand
SLLIShift left logical immediate
SRAShift right arithmetic
SRA3Shift right arithmetic 3-operand
SRAIShift right arithmetic immediate
SRLShift right logical
SRL3Shift right logical 3-operand
SRLIShift right logical immediate
(5) Instructions for the DSP function
Perform 32 bit × 16 bit or 16 bit × 16 bit multiplication or sumof-products calculation. These instructions also perform
rounding of the accumulator data or transfer between accumulator and general-purpose register.
MACHIMultiply-accumulate high-order
halfwords
MACLOMultiply-accumulate low-order
halfwords
MACWHIMultiply-accumulate word and
high-order halfword
MACWLOMultiply-accumulate word and
low-order halfword
MULHIMultiply high-order halfwords
MULLOMultiply low-order halfwords
MULWHIMultiply word and high-order
halfword
MULWLOMultiply word and low-order
halfword
MVFACHIMove from accumulator high-order word
MVFACLOMove from accumulator low-order word
MVFACMIMove from accumulator middle-order
word
MVTACHIMove to accumulator high-order word
MVTACLOMove to accumulator low-order word
RACRound accumulator
RACHRound accumulator halfword
HEAD OFFICE: 2-2-3, MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
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 non-flammable
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.