M32C MitsubishiElectricSemiconductor
M32C MitsubishiElectricSemiconductor
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
Applications
Audio, cameras, office equipment, communications equipment, portable equipment, etc.
Index
About M32C/83 Group .......................................... 1 Three-phase motor control timers’ functions ..... 155
Central Processing Unit (CPU) ........................... 20 Serial I/O ........................................................... 168
Reset ................................................................... 24 CAN Module ...................................................... 198
SFR ..................................................................... 37 Intelligent I/O ..................................................... 235
Software Reset ................................................... 48 Base timer (group 0 to 3) .................................. 240
Processor Mode .................................................. 48 Time measurement (group 0 and 1) .................. 247
Bus Settings ........................................................ 52 WG function (group 0 to 3) ................................ 252
Bus Control ......................................................... 55 Serial I/O (group 0 to 2) .................................... 264
System Clock ...................................................... 65 A-D Converter ................................................... 281
Power Saving ...................................................... 76 D-A Converter ................................................... 296
Protection ............................................................ 81 CRC Calculation Circuit .................................... 298
Interrupt Outline .................................................. 83 X-Y Converter ................................................... 300
______
INT Interrupts ...................................................... 98 DRAM Controller ............................................... 303
______
NMI Interrupt ....................................................... 99 Programmable I/O Ports ................................... 310
Key Input Interrupt .............................................. 99 VDC .................................................................. 334
Address Match Interrupt .................................... 100 Usage Precaution ............................................. 335
Intelligent I/O and CAN Interrupt ....................... 101 Electrical characteristics ................................... 344
Precautions for Interrupts .................................. 104 Outline Performance ......................................... 381
Watchdog Timer ................................................ 106 Flash Memory ................................................... 383
DMAC ............................................................... 109 CPU Rewrite Mode ........................................... 384
DMAC II ............................................................ 121 Outline Performance of CPU Rewrite Mode ..... 384
Timer ................................................................. 129 Inhibit Rewriting Flash Memory Version ............ 397
Timer A .............................................................. 131 Parallel I/O Mode .............................................. 399
Timer B .............................................................. 147 Standard serial I/O mode .................................. 400
1
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
Performance Outline
Table 1.1.1 and 1.1.2 are performance outline of M32C/83 group.
2
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
3
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
RAM size
(byte)
M30835FJGP
M30835MJGP
31K M30833FJGP
M30833MJGP
M30833FJFP
M30833MJFP
20K
10K
128K 192K 256K 512K ROM size
(byte)
4
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
The M32C/83 group products currently supported are listed in Table 1.1.3.
Type No. M 3 0 8 3 5 F J – (X X X ) G P
Package type:
FP : Package 100P6S-A
GP : Package 100P6Q-A, 144P6Q-A
ROM capacity:
J : 512K bytes
Memory type:
M : Mask ROM version
F : Flash memory version
M32C/83 Group
M16C Family
5
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
P31 / A9 ( MA1 ) ( / D9 )
P20 / A0 ( / D0 ) / AN20
P21 / A1 ( / D1 ) / AN21
P22 / A2 ( / D2 ) / AN22
P23 / A3 ( / D3 ) / AN23
P24 / A4 ( / D4 ) / AN24
P25 / A5 ( / D5 ) / AN25
P26 / A6 ( / D6 ) / AN26
P27 / A7 ( / D7 ) / AN27
P120 / OUTC30
P121 / OUTC31
P122 / OUTC32
P123 / OUTC33
P124 / OUTC34
P12 / D10
P14 / D12
P13 / D11
P11 / D9
Vss
Vcc
Vss
Vcc
108
107
106
105
104
103
102
101
100
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
75
74
73
D8 / P10 109 72 P44 / CS3 / A20 (MA12)
AN07 / D7 / P07 110 71 P45 / CS2 / A21
AN06 / D6 / P06 111 70 P46 / CS1 / A22
AN05 / D5 / P05 112 69 P47 / CS0 / A23
AN04 / D4 / P04 113 68 P125 / OUTC35
P114 114 67 P126 / OUTC36
OUTC13 / P113 115 66 P127 / OUTC37
BE1IN / ISRxD1 / OUTC12 / INPC12 / P112 116 65 P50 / WRL / WR / CASL
ISCLK1 / OUTC11 / INPC11 / P111 117 64 P51 / WRH / BHE / CASH
BE1OUT / ISTxD1 / OUTC10 / P110 118 63 P52 / RD / DW
AN03 / D3 / P03 119 62 P53 / CLKOUT / BCLK / ALE
AN02 / D2 / P02 120 61 P130 / OUTC24
AN01 / D1 / P01 121 60 P131 / OUTC25
AN00 / D0 / P00 122 59 Vcc
INPC07 / AN157 / P157 123 58 P132 / OUTC26
INPC06 / AN156 / P156 124 57 Vss
OUTC05 / INPC05 / AN155 / P155 125 56 P133 / OUTC23
OUTC04 / INPC04 / AN154 / P154
INPC03 / AN153 / P153
126
127
M32C/83 (144P6Q-A) 55
54
P54 / HLDA / ALE
P55 / HOLD
BE0IN / ISRxD0 / INPC02 / AN152 / P152 128 53 P56 / ALE / RAS
ISCLK0 / OUTC01 / INPC01 / AN151 / P151 129 52 P57 / RDY
Vss 130 51 P134 / OUTC20 / ISTxD2 / IEOUT
BE0OUT / ISTxD0 / OUTC00 / INPC00 / AN150 / P150 131 50 P135 / OUTC22 / ISRxD2 / IEIN
Vcc 132 49 P136 / OUTC21 / ISCLK2
KI3 / AN7 / P107 133 48 P137 / OUTC27
KI2 / AN6 / P106 134 47 P60 / CTS0 / RTS0 / SS0
KI1 / AN5 / P105 135 46 P61 / CLK0
KI0 / AN4 / P104 136 45 P62 / RxD0 / SCL0 / STxD0
AN3 / P103 137 44 P63 / TxD0 / SDA0 / SRxD0
AN2 / P102 138 43 P64 / CTS1 / RTS1 / SS1 / OUTC21 / ISCLK2
AN1 / P101 139 42 P65 / CLK1
AVss 140 41 Vss
AN0 / P100 141 40 P66 / RxD1 / SCL1 / STxD1
VREF 142 39 Vcc
AVcc 143 38 P67 / TxD1 / SDA1 / SRxD1
STxD4 / SCL4 / RxD4 / ADTRG / P97 144 37 P70 / TA0OUT / TxD2 / SDA2 / SRxD2
/ OUTC20 / ISTxD2 / IEOUT
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
11
1
2
3
4
5
6
7
8
9
SRxD4 / SDA4 / TxD4 / ANEX1 / P96
CLK4 / ANEX0 / P95
SS4 / RTS4 / CTS4 / TB4IN / DA1 / P94
SS3 / RTS3 / CTS3 / TB3IN / DA0 / P93
IEOUT / OUTC20 / SRxD3 / SDA3 / TxD3 / TB2IN / P92
IEIN / STxD3 / SCL3 / RxD3 / TB1IN / P91
CLK3 / TB0IN / P90
P146
P145
P144
OUTC17 / INPC17 / P143
OUTC16 / INPC16 / P142
OUTC15 / P141
OUTC14 / P140
BYTE
CNVss
VCONT / XCIN / P87
XCOUT / P86
RESET
XOUT
Vss
XIN
Vcc
NMI / P85
INT2 / P84
CANIN / INT1 / P83
CANOUT / OUTC32 / INT0 / P82
OUTC30 / U / TA4IN / P81
BE0IN / ISRxD0 / INPC02 / U / TA4OUT / P80
CANIN / ISCLK0 / OUTC01 / INPC01 / TA3IN / P77
CANOUT / BE0OUT / ISTxD0 / OUTC00 / INPC00 / TA3OUT / P76
BE1IN / ISRxD1 / OUTC12 / INPC12 / W / TA2IN / P75
ISCLK1 / OUTC11 / INPC11 / W / TA2OUT / P74
BE1OUT / ISTxD1 / OUTC10 / SS2 / RTS2 / CTS2 / V / TA1IN / P73
CLK2 / V / TA1OUT / P72
IEIN / ISRxD2 / OUTC22 / STxD2 / SCL2 / RxD2 / TA0IN / TB5IN / P71
6
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
7
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
49 P136 OUTC21/ISCLK2
50 P135 OUTC22/ISRxD2/IEIN
51 P134 OUTC20/ISTxD2/IEOUT
52 P57 RDY
53 P56 ALE/RAS
54 P55 HOLD
55 P54 HLDA/ALE
56 P133 OUTC23
57 VSS
58 P132 OUTC26
59 VCC
60 P131 OUTC25
61 P130 OUTC24
62 P53 CLKOUT/BCLK/ALE
63 P52 RD/DW
64 P51 WRH/BHE/CASH
65 P50 WRL/WR/CASL
66 P127 OUTC37
67 P126 OUTC36
68 P125 OUTC35
69 P47 CS0/A23
70 P46 CS1/A22
71 P45 CS2/A21
72 P44 CS3/A20(MA12)
73 P43 A19(MA11)
74 VCC
75 P42 A18(MA10)
76 VSS
77 P41 A17(MA9)
78 P40 A16(MA8)
79 P37 A15(MA7)(/D15)
80 P36 A14(MA6)(/D14)
81 P35 A13(MA5)(/D13)
82 P34 A12(MA4)(/D12)
83 P33 A11(MA3)(/D11)
84 P32 A10(MA2)(/D10)
85 P31 A9(MA1)(/D9)
86 P124 OUTC34
87 P123 OUTC33
88 P122 OUTC32
89 P121 OUTC31
90 P120 OUTC30
91 VCC
92 P30 A8(MA0)(/D8)
93 VSS
94 P27 AN37 A7(/D7)
95 P26 AN36 A6(/D6)
96 P25 AN35 A5(/D5)
8
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
9
10
de
v
r
Un elop
de me
n t
Description
STxD4 / SCL4 /
RxD4 / ADTRG / P97
AVcc
VREF
AN0 / P100
AVss
AN1 / P101
AN2 / P102
AN3 / P103
KI0 / AN4 / P104
KI1 / AN5 / P105
KI2 / AN6 / P106
KI3 / AN7 / P107
D0 / AN00 / P00
D1 / AN01 / P01
D2 / AN02 / P02
D3 / AN03 / P03
D4 / AN04 / P04
D5 / AN05 / P05
D6 / AN06 / P06
D7 / AN07 / P07
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
100
SRxD4 / SDA4 / TxD4 / ANEX1 / P96 1 80 P10 / D8
CLK4 / ANEX0 / P95 2 79 P11 / D9
SS4 / RTS4 / CTS4 / TB4IN / DA1 / P94 3 78 P12 / D10
SS3 / RTS3 / CTS3 / TB3IN / DA0 / P93 4 77 P13 / D11
IEOUT / OUTC20 / SRxD3 / SDA3 / TxD3 / TB2IN / P92 5 76 P14 / D12
IEIN / STxD3 / SCL3 / RxD3 / TB1IN / P91 6 75 P15 / D13 / INT3
CLK3 / TB0IN / P90 7 74 P16 / D14 / INT4
BYTE 8 73 P17 / D15 / INT5
CNVss 9 72 P20 / A0 ( / D0 ) / AN20
VCONT / XCIN / P87 10 71 P21 / A1 ( / D1 ) / AN21
XCOUT / P86 11 70 P22 / A2 ( / D2 ) / AN22
RESET 12 69 P23 / A3 ( / D3 ) / AN23
XOUT 13 68 P24 / A4 ( / D4 ) / AN24
Vss 14 67 P25 / A5 ( / D5 ) / AN25
XIN 15 66 P26 / A6 ( / D6 ) / AN26
P57 / RDY
P65 / CLK1
P61 / CLK0
P55 / HOLD
P52 / RD / DW
P47 / CS0 / A23
P46 / CS1 / A22
P45 / CS2 / A21
P30 / A8 ( MA0 ) ( / D8 )
P31 / A9 ( MA1 ) ( / D9 )
Vss
Vcc
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
60
59
58
57
56
55
54
53
52
51
D10 / P12 76 50 P42 / A18 ( MA10 )
D9 / P11 77 49 P43 / A19 ( MA11 )
D8 / P10 78 48 P44 / CS3 / A20 (MA12)
D7 / AN07 / P07 79 47 P45 / CS2 / A21
D6 / AN06 / P06 80 46 P46 / CS1 / A22
D5 / AN05 / P05 81 45 P47 / CS0 / A23
D4 / AN04 / P04 82 44 P50 / WRL / WR / CASL
D3 / AN03 / P03 83 43 P51 / WRH / BHE / CASH
D2 / AN02 / P02 84 42 P52 / RD / DW
D1 / AN01 / P01 85 41 P53 / CLKOUT / BCLK / ALE
D0 / AN00 / P00 86 40 P54 / HLDA / ALE
KI3 / AN37 / P107
KI2 / AN36 / P106
87
88
M32C/83 (100P6Q-A) 39
38
P55 / HOLD
P56 / ALE / RAS
KI1 / AN35 / P105 89 37 P57 / RDY
KI0 / AN34 / P104 90 36 P60 / CTS0 / RTS0 / SS0
AN33 / P103 91 35 P61 / CLK0
AN32 / P102 92 34 P62 / RxD0 / SCL0 / STxD0
AN31 / P101 93 33 P63 / TxD0 / SDA0 / SRxD0
AVss 94 32 P64 / CTS1 / RTS1 / SS1 / OUTC21 / ISCLK2
AN30 / P100 95 31 P65 / CLK1
VREF 96 30 P66 / RxD1 / SCL1 / STxD1
AVcc 97 29 P67 / TxD1 / SDA1 / SRxD1
/ ISTxD2 / IEOUT
STxD4 / SCL4 / RxD4 / ADTRG / P97 98 28 P70 / TA0OUT / TxD2 / SDA2 / SRxD2 / OUTC20
SRxD4 / SDA4 / TxD4 / ANEX1 / P96 99 27 P71 / TA0IN / TB5IN / RxD2 / SCL2 / STxD2 / OUTC22
26 / ISRxD2 / IEIN
CLK4 / ANEX0 / P95 100 P72 / TA1OUT / V / CLK2
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
11
1
2
3
4
5
6
7
8
9
SS4 / RTS4 / CTS4 / TB4IN / DA1 / P94
SS3 / RTS3 / CTS3 / TB3IN / DA0 / P93
IEOUT / OUTC20 / SRxD3 / SDA3 / TxD3 / TB2IN / P92
IEIN / STxD3 / SCL3 / RxD3 / TB1IN / P91
CLK3 / TB0IN / P90
BYTE
CNVss
VCONT / XCIN / P87
XCOUT / P86
RESET
XOUT
Vss
XIN
Vcc
NMI / P85
INT2 / P84
CANIN / INT1 / P83
CANOUT / OUTC32 / INT0 / P82
OUTC30 / U / TA4IN / P81
BE0IN / ISRxD0 /INPC02 / U / TA4OUT / P80
CANIN / ISCLK0 / OUTC01 / INPC01 / TA3IN / P77
CANOUT / BE0OUT / ISTxD0 / OUTC00 / INPC00 / TA3OUT / P76
BE1IN / ISRxD1 / OUTC12 / INPC12 / W / TA2IN / P75
ISCLK1 / OUTC11 / INPC11 / W / TA2OUT / P74
BE1OUT / ISTxD1 / OUTC10 / SS2 / RTS2 / CTS2 / V / TA1IN / P73
11
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
12
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
13
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
Clock input XIN I These pins are provided for the main clock generating circuit.
Connect a ceramic resonator or crystal between the XIN and
Clock output XOUT O the XOUT pins. To use an externally derived clock, input it to
the XIN pin and leave the XOUT pin open.
Analog power AVCC I Connect this pin to VCC.
supply input AVSS I Connect this pin to VSS.
Reference VREF I This pin is a reference voltage input for the A-D converter.
voltage input
P0 I/O port P00 to P07 I/O An 8-bit CMOS I/O port.
It has an input/output port direction register that allows the
user to set each pin for input or output individually.
The user can specify in units of four bits via software whether
or not they are tied to a pull-up resistor.
Data bus D0 to D7 I/O When set as a separate bus, these pins input and output 8
low-order data bits.
Analog input port AN00 to AN07 I P00 to P07 are analog input ports for the A-D converter.
P1 I/O port P10 to P17 I/O This is an 8-bit I/O port equivalent to P0.
External interrupt input INT3 to INT5 I P15 to P17 function as external interrupt pins.
port
Data bus D8 to D15 I/O When set as a separate bus, these pins input and output 8
high-order data bits.
P2 I/O port P20 to P27 I/O This is an 8-bit I/O port equivalent to P0.
P3 I/O port P30 to P37 I/O This is an 8-bit I/O port equivalent to P0.
Address bus/data bus A8/D8 to I/O If the external bus is set as a 16-bit wide multiplexed bus,
A15/D15 these pins output 8 middle-order address bits, and input and
output 8 middle-order data separated in time by multiplexing.
Address bus MA0 to MA7 O If accessing to DRAM area, these pins output row address
and column address separated in time by multiplexing.
P4 I/O port P40 to P47 I/O This is an 8-bit I/O port equivalent to P0.
Address bus A16 to A22 O These pins output 8 high-order address bits.
A23 Highest address bit (A23) outputs inversely.
Chip select CS0 to CS3 O P40 to P47 are chip select output pins to specify access area.
Address bus MA8 to MA12 O If accessing to DRAM area, these pins output row address and
column address separated in time by multiplexing.
14
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
P5 I/O port P50 to P57 I/O This is an 8-bit I/O port equivalent to P0.
Clock output CLKOUT I/O P53 in this port outputs a divide-by-8 or divide-by-32 clock of
XIN or a clock of the same frequency as XCIN.
Bus control WRL / WR, O Output WRL, WRH and RD, or WR, BHE and RD bus control
WRH / BHE, O signals.
RD O WRL, WRH, and RD selected
In 16-bit data bus, data is written to even addresses when the
WRL signal is “L”.
Data is written to odd addresses when the WRH signal is “L”.
Data is read when RD is “L”.
WR, BHE, and RD selected
Data is written when WR is “L”.
Data is read when RD is “L”.
Odd addresses are accessed when BHE is “L”. Even
addresses are accessed when BHE is “H”.
Use WR, BHE, and RD when all external memory is an 8-bit
data bus.
BCLK, O Output operation clock for CPU.
HOLD, I While the input level at the HOLD pin is “L”, the microcomputer
is placed in the hold state.
HLDA O While in the hold state, HLDA outputs a “L” level.
ALE, O ALE is used to latch the address.
RDY I While the input level of the RDY pin is “L”, the microcomputer
is in the ready state.
Bus control for DRAM DW, O When DW signal is “L”, write to DRAM.
CASL, O Timing signal when latching to line address of even address.
CASH, O Timing signal when latching to line address of odd address.
RAS O Timing signal when latching to row address.
P6 I/O port P60 to P67 I/O This is an 8-bit I/O port equivalent to P0.
UART port CTS/RTS/SS I/O P60 to P63 are I/O ports for UART0.
CLK P64 to P67 are I/O ports for UART1.
RxD/SCL/STxD
TxD/SDA/SRxD
Intelligent I/O port OUTC/ISCLK I/O ISCLK is a clock I/O port for intelligent I/O communication.
OUTC is an output port for waveform generation function.
P7 I/O port P70 to P77 I/O This is an 8-bit I/O port equivalent to P0.
However, P70 and P71 are N-channel open drain outputs.
Timer A port TAOUT O P70 to P77 are I/O ports for timers A0–A3.
TAIN I
Timer B port TBIN I P71 is an input port for timer B5.
Three phase motor V, V O P72 and P73 are V phase outputs.
control output port W, W P74 and P75 are W phase outputs.
UART port CTS/RTS/SS I/O P70 to P73 are I/O ports for UART2.
CLK
RxD/SCL/STxD
TxD/SDA/SRxD
Intelligent I/O port INPC/OUTC I/O INPC is an input port for time measurement function.
ISCLK/ISTxD/ OUTC is an output port for waveform generation function.
ISRxD ISCLK is a clock I/O port for intelligent I/O communication.
IEOUT/IEIN ISTxD/IEOUT/BEOUT is transmit data output port for intelligent
BEOUT/BEIN I/O communication.
ISRxD/IEIN/BEIN is receive data input port for intelligent I/O
communication.
CANOUT CAN O P76 and P77 are I/O ports for CAN communication function.
CANIN I
15
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
P8 I/O port P80-P84, P86, P87 I/O This is a 7-bit I/O port equivalent to P0.
Sub clock input XCIN I P86 and P87 function as I/O ports for the sub clock
generating circuit by software. Connect a crystal between
Sub clock output XCOUT O the XCIN and the XCOUT pins.
Low-pass filter connect VCOUT O When using PLL frequency synthesizer, connect P87 to a
pin for PLL frequency low-pass filter. To stabilize PLL frequency, connect P86 to
synthesizer Vss.
Timer A port TA4OUT O P80 to P81 are I/O ports for timer A4.
TA4IN I
Three phase motor U, U O P80 and P81 are U phase output ports.
control output port
External interrupt input INT0 to INT2 I P82 to P84 are external interrupt input ports.
port
Intelligent I/O port INPC/ISRxD/BEIN I INPC is an input port for time measurement function.
ISRxD/BEIN is receive data input port for intelligent I/O
communication.
Input port P85/NMI I Input port and input ports for NMI interrupt.
P9 I/O port P90 to P97 I/O This is an 8-bit I/O port equivalent to P0.
Timer B port TB0IN to TB4IN I P90 to P94 are input port for timer B4.
UART port CTS/RTS/SS I/O P90 to P93 are I/O ports for UART3.
CLK I/O P94 to P97 are I/O ports for UART4.
RxD/SCL/STxD I/O
TxD/SDA/SRxD I/O
D-A output port DA0, DA1 O P93 and P94 are D-A output ports.
A-D related port ANEX1, ANEX2 I P95 to P96 are expanded input port for A-D converter.
ADTRG I P97 is A-D trigger input port.
Intelligent I/O port OUTC/IEOUT I/O OUTC is an output port for waveform generation function.
IEOUT is transmit data output port for intelligent I/O
communication.
IEIN I IEIN is receive data input port for intelligent I/O
communication.
The protect register prevents a false write to P9 direction register and function select register A3.
P10 I/O port P100 to P107 I/O This is an 8-bit I/O port equivalent to P0.
Key input interrupt port KI0 to KI3 I P104 to P107 are key input interrupt ports.
Analog input port AN0 to AN7 I P100 to P107 are analog input ports for A-D convertor.
16
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
P11 I/O port P110 to P114 I/O This is an 5-bit I/O port equivalent to P0.
(Note)
Intelligent I/O port INPC/OUTC I/O INPC is an input port for time measurement function.
ISCLK I/O OUTC is an output port for waveform generation function.
ISTxD/ISRxD ISCLK is a clock I/O port for intelligent I/O communication.
BEOUT/BEIN I/O ISTxD/BEOUT is transmit data output port for intelligent I/O
communication.
ISRxD/BEIN is receive data input port for intelligent I/O
communication.
P12 I/O port P120 to P127 I/O This is an 8-bit I/O port equivalent to P0.
(Note)
Intelligent I/O port OUTC O OUTC is an output port for waveform generation function.
P13 I/O port P130 to P137 I/O This is an 8-bit I/O port equivalent to P0.
(Note)
Intelligent I/O port OUTC I/O OUTC is an output port for waveform generation function.
ISCLK/ISTxD/ I/O ISCLK is a clock I/O port for intelligent I/O communication.
ISRxD I/O ISTxD/IEOUT is transmit data output port for intelligent I/O
IEOUT/IEIN I/O communication.
ISRxD/IEIN is receive data input port for intelligent I/O
communication.
P14 I/O port P140 to P146 I/O This is a 7-bit I/O port equivalent to P0.
(Note)
Intelligent I/O port INPC/OUTC I/O INPC is an input port for time measurement function.
OUTC is an output port for waveform generation function.
P15 I/O port P150 to P157 I/O This is an 8-bit I/O port equivalent to P0.
(Note)
Intelligent I/O port INPC/OUTC I/O INPC is an input port for time measurement function.
ISCLK/ISTxD/ I/O OUTC is an output port for waveform generation function.
ISRxD ISCLK is a clock I/O port for intelligent I/O communication.
BEOUT/BEIN I/O ISTxD/BEOUT is transmit data output port for intelligent I/O
communication.
ISRxD/BEIN is receive data input port for intelligent I/O
communication.
Analog input port AN150 to AN157 I P150 to P157 are analog input ports for A-D convertor.
17
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
Block Diagram
The M32C/83 group includes the following devices in a single-chip. ROM and RAM for code instructions
and data, storage, CPU for executing operation and peripheral functions such as timer, serial I/O, D-A
converter, DMAC, CRC operation circuit, A-D converter, DRAM controller, intelligent I/O and I/O ports.
Figure 1.1.6 is a block diagram of the M32C/83 group (144-pin version).
8 8 8 8 8 8 8 8
I/O ports
Internal peripheral functions
Timer (16 bits) A-D converter
(10-bit X 2 circuits) System clock generator
Output (5) Input (6) XIN - XOUT
Timer A0 Timer B0 XCIN - XCOUT
Timer A1 Timer B1 UART/Clock synchronous Ring oscillator
Timer A2 Timer B2
SI/O (8-bit X 5 channels)
Timer A3 Timer B3
Timer A4 Timer B4
Timer B5 X-Y converter Memory (Note)
(16-bit X 16-bit)
Three-phase control ROM
circuit
CRC arithmetic circuit
(CCITT) RAM
Watchdog timer (15 bits)
Port P15 Port P14 Port P13 Port P12 Port P11 Port P10 Port P9 P85 Port P8
8 7 8 8 5 8 8 7
18
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description
Memory
Figure 1.2.1 is a memory map of the M32C/83 group. The address space extends 16 Mbytes from address
00000016 to FFFFFF16. From FFFFFF16 down is ROM. For example, in the M30835FJGP, there are 512K
bytes of internal ROM from F8000016 to FFFFFF16. The vector table for fixed interrupts such as the reset
_______
and NMI are mapped to FFFFDC16 to FFFFFF16. The starting address of the interrupt routine is stored
here. The address of the vector table for timer interrupts, etc., can be set as desired using the internal
register (INTB). See the section on interrupts for details.
From 00040016 up is RAM. For example, in the M30835FJGP, 31 Kbytes of internal RAM are mapped to
the space from 00040016 to 007FFF16. In addition to storing data, the RAM also stores the stack used when
calling subroutines and when interrupts are generated.
The SFR area is mapped from 00000016 to 0003FF16. This area accommodates the control registers for
peripheral devices such as I/O ports, A-D converter, serial I/O, and timers, etc. Any part of the SFR area
that is not occupied is reserved and cannot be used for any other purpose.
The special page vector table is mapped from FFFE0016 to FFFFDB16. If the starting addresses of subrou-
tines or the destination addresses of jumps are stored here, subroutine call instructions and jump instruc-
tions can be used as 2-byte instructions, reducing the number of program steps.
In memory expansion mode and microprocessor mode, a part of the spaces are reserved and cannot be
used.
00000016
SFR area
00040016
Internal RAM FFFE0016
area
AAAAA
XXXXXX16
Internal reserved
AAAAA
area (Note 1) Special page
00800016 vector table
AAAAA
External area
Internal ROM
area NMI
Address Address
Type No. FFFFFF16 FFFFFF16 Reset
XXXXX16 YYYYY16
M30835F/MJ
007FFF16 F8000016 Note 1: During memory expansion and microprocessor modes, can not be used.
M30833F/MJ
Note 2: In memory expansion mode, can not be used.
19
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Software Reset
b23 R3
A0
Address register (Note)
A1
SB Static base register (Note)
FB Frame base register (Note)
PC Program counter
DRC0
DMA transfer count reload register
b23
DRC1
DMA0
DMA memory address register
DMA1
DSA0
DMA SFR address register
DSA1
DRA0
DMA memory address reload register
DRA1
20
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Processor Mode SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
(1) Data registers (R0, R0H, R0L, R1, R1H, R1L, R2, R3, R2R0 and R3R1)
Data registers (R0, R1, R2, and R3) are configured with 16 bits, and are used primarily for transfer and
arithmetic/logic operations.
Registers R0 and R1 each can be used as separate 8-bit data registers, high-order bits as (R0H/R1H),
and low-order bits as (R0L/R1L). Registers R2 and R0, as well as R3 and R1 can function as 32-bit data
registers (R2R0/R3R1).
21
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Processor Mode
22
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Processor Mode SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AAAAAAAAA
b15
AA
A
AAAAAAAAAAA
AA
A AAAAA
AA
AAAAAAAA
IPL AA
AAA U I O B S Z D C
b0
Flag register (FLG)
Carry flag
Debug flag
Zero flag
Sign flag
Overflow flag
Reserved area
Reserved area
23
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
Reset
There are two kinds of resets; hardware and software. In both cases, operation is the same after the reset.
(See “Software Reset” for details of software resets.) This section explains hardware resets.
When the supply voltage is in the range where operation is guaranteed, a reset is enabled by holding the
reset pin Low (0.2VCC max.) for at least 20 cycles. When the reset pin level is then returned to High while
main clock is stable, the reset status is cancelled and program execution resumes from the address in the
reset vector table.
Since the value of RAM is indeterminate when power is applied, the initial values must be set. Also, if a
reset signal is input during write to RAM, the access to the RAM will be interrupted. Consequently, the value
of the RAM being written may change to an unintended value due to the interruption.
Figure 1.4.1 shows the example reset circuit. Figure 1.4.2 shows the reset sequence.
____________
Table 1.4.1 shows the status of other pins while the RESET pin level is Low. Figures 1.4.3 and 1.4.4 show
the internal status of the microcomputer immediately after the reset is cancelled.
5V
4.2V
VCC
0V
RESET VCC 5V
RESET
0.8V
0V
24
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
XIN
More than 20 cycles are needed
Microprocessor
mode BYTE = “H”
BCLK
Content of reset vector
RD
WR
CS0
Microprocessor
mode BYTE = “L” Content of reset vector
RD
WR
CS0
Single chip
FFFFC16 Content of reset vector
mode
Address
FFFFE16
25
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
____________
Table 1.4.1. Pin status when RESET pin level is “L”
Status
Pin name CNVSS = VCC
CNVSS = VSS
BYTE = VSS BYTE = VCC
P54 Input port (floating) HLDA output (The output value depends on the input to the
HOLD pin)
26
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(1) Processor mode register 0 (Note 1) (000416) 8016 (26) UART2 receive /ACK interrupt control register (006B16) X X X X ? 0 0 0
(2) Processor mode register 1 (000516) X 0 0 0 0 0 X X (27) Timer A0 interrupt control register (006C16) X X X X ? 0 0 0
(3) System clock control register 0 (000616) 0 0 0 0 X 0 0 0 (28) UART3 receive/ACK interrupt control register (006D16) X X X X ? 0 0 0
(4) System clock control register 1 (000716) 2016 (29) Timer A2 interrupt control register (006E16) X X X X ? 0 0 0
(5) Wait control register (000816) FF16 (30) UART4 receive/ACK interrupt control register (006F16) X X X X ? 0 0 0
(6) Address match interrupt control register (000916) X X X X 0 0 0 0 (31) Timer A4 interrupt control register (007016) X X X X ? 0 0 0
(7) Protect register (000A16) X X X X 0 0 0 0 (32) UART0/UART3 bus collision detection interrupt (007116) X X X X ? 0 0 0
control register
(8) External data bus width control register (Note 2) (000B16) XXXXX0 0 0 (33) UART0 receive/ACK interrupt control register (007216) X X X X ? 0 0 0
(9) Main clock divided register (000C16) X X X 0 1 0 0 0 (34) A-D0 interrupt control register (007316) X X X X ? 0 0 0
(10) Oscillation stop detect register (000D16) 0016 (35) UART1 receive/ACK interrupt control register (007416) X X X X ? 0 0 0
(11) Watchdog timer start register (000E16) ??16 (36) Intelligent I/O interrupt control register 0 (007516) X X X X ? 0 0 0
(12) Watchdog timer control register (000F16) 0 0 0 ? ? ? ? ? (37) Timer B1 interrupt control register (007616) X X X X ? 0 0 0
(13) Address match interrupt register 0 (001016) 0016 (38) Intelligent I/O interrupt control register 2 (007716) X X X X ? 0 0 0
(14) Address match interrupt register 1 (001416) 0016 (41) INT5 interrupt control register (007A16) X X 0 0 ? 0 0 0
(15) VDC control register for PLL (001716) X X X X X X 0 1 (44) Intelligent I/O interrupt control register 8 (007D16) X X X X ? 0 0 0
(16) Address match interrupt register 2 (001816) 0016 (45) INT1 interrupt control register (007E16) X X 0 0 ? 0 0 0
Intelligent I/O interrupt control register 10/
(001916) 0016 (46) (007F16) X X X X ? 0 0 0
CAN interrupt 1 control register
(001A16) 0016 (47) Intelligent I/O interrupt control register 11/ (008116) X X X X ? 0 0 0
CAN interrupt 2 control register
(17) VDD control register 1 (001B16) 0016 (48) A -D1 interrupt control register (008616) X X X X ? 0 0 0
(18) Address match interrupt register 3 (001C16) 0016 (49) DMA1 interrupt control register (008816) X X X X ? 0 0 0
(001D16) 0016 (50) UART2 transmit /NACK interrupt control register (008916) X X X X ? 0 0 0
(19) VDD control register 1 (001F16) 0016 (52) UART3 transmit /NACK interrupt control register (008B16) X X X X ? 0 0 0
(20) DRAM control register (004016) ? X X X ? ? ? ? (53) Timer A1 interrupt control register (008C16) X X X X ? 0 0 0
(21) DRAM refresh interval set register (004116) ??16 (54) UART4 transmit /NACK interrupt control register (008D16) X X X X ? 0 0 0
(22) Flash memory control register 0 (005716) X X 0 0 0 0 0 1 (55) Timer A3 interrupt control register (008E16) X X X X ? 0 0 0
(23) DMA0 interrupt control register (006816) X X X X ? 0 0 0 (56) UART2 bus collision detection interrupt (008F16) X X X X ? 0 0 0
control register
(24) Timer B5 interrupt control register (006916) X X X X ? 0 0 0 (57) UART0 transmit /NACK interrupt control register (009016) X X X X ? 0 0 0
(25) DMA2 interrupt control register (006A16) X X X X ? 0 0 0 (58) UART1/UART4 bus collision detection (009116) X X X X ? 0 0 0
interrupt control register
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
Note 1: When the VCC level is applied to the CNVSS pin, it is 0316 at a reset.
Note 2: When the BYTE pin is "L", bit 3 is "1". When the BYTE pin is "H", bit 3 is "0".
27
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(59) UART1 transmit/NACK interrupt control register (009216) X X X X ? 0 0 0 (92) Interrupt enable register 7 (00B716) 0 X X 0 0 0 0 0
(60) Key input interrupt control register (009316) X X X X ? 0 0 0 (93) Interrupt enable register 8 (00B816) 0 0 X 0 0 0 0 0
(61) Timer B0 interrupt control register (009416) X X X X ? 0 0 0 (94) Interrupt enable register 9 (00B916) 0 X X X 0 0 0 0
(62) Intelligent I/O interrupt control register 1 (009516) X X X X ? 0 0 0 (95) Interrupt enable register 10 (00BA16) 0 X X X 0 0 0 0
(63) Timer B2 interrupt control register (009616) X X X X ? 0 0 0 (96) Interrupt enable register 11 (00BB16) 0 X X 0 0 0 0 0
(64) Intelligent I/O interrupt control register 3 (009716) X X X X ? 0 0 0 (97) Group 0 time measurement/waveform (00C016) ??16
generate register 0
(65) Timer B4 interrupt control register (009816) X X X X ? 0 0 0 (00C116) ??16
(66) Intelligent I/O interrupt control register 5 (009916) X X X X ? 0 0 0 (98) Group 0 time measurement/waveform (00C216) ??16
generate register 1
(67) INT4 interrupt control register (009A16) X X 0 0 ? 0 0 0 (00C316) ??16
(68) Intelligent I/O interrupt control register 7 (009B16) X X X X ? 0 0 0 (99) Group 0 time measurement/waveform (00C416) ??16
generate register 2
(69) INT2 interrupt control register (009C16) X X 0 0 ? 0 0 0 (00C516) ??16
(70) Intelligent I/O interrupt control register 9/ (009D16) X X X X ? 0 0 0 (100) Group 0 time measurement/waveform (00C616) ??16
CAN interrupt 0 control register
generate register 3
(71) INT0 interrupt control register (009E16) X X 0 0 ? 0 0 0 (00C716) ??16
(72) Exit priority register (009F16) X X 0 X 0 0 0 0 (101) Group 0 time measurement/waveform (00C816) ??16
generate register 4
(73) Interrupt request register 0 (00A016) X X 0 0 X 0 0 X (00C916) ??16
(74) Interrupt request register 1 (00A116) X X 0 0 X 0 0 X (102) Group 0 time measurement/waveform (00CA16) ??16
generate register 5
(75) Interrupt request register 2 (00A216) X X 0 0 X 0 X X (00CB16) ??16
(76) Interrupt request register 3 (00A316) X X 0 0 0 0 0 X (103) Group 0 time measurement/waveform (00CC16) ??16
generate register 6
(77) Interrupt request register 4 (00A416) 0 0 X 0 0 0 0 X (00CD16) ??16
(78) Interrupt request register 5 (00A516) X X X 0 0 0 0 X (104) Group 0 time measurement/waveform (00CE16) ??16
generate register 7
(79) Interrupt request register 6 (00A616) X X X 0 0 0 0 X (00CF16) ??16
(80) Interrupt request register 7 (00A716) 0 X X 0 0 0 0 X (105) Group 0 waveform generate control register 0 (00D016) 0 X 0 0 X 0 0 0
(81) Interrupt request register 8 (00A816) 0 0 X 0 0 0 0 X (106) Group 0 waveform generate control register 1 (00D116) 0 X 0 0 X 0 0 0
(82) Interrupt request register 9 (00A916) 0 X X 0 0 0 0 X (107) Group 0 waveform generate control register 4 (00D416) 0 X 0 0 X 0 0 0
(83) Interrupt request register 10 (00AA16) 0 X X 0 0 0 0 X (108) Group 0 waveform generate control register 5 (00D516) 0 X 0 0 X 0 0 0
(84) Interrupt request register 11 (00AB16) 0 X X 0 0 0 0 X (109) Group 0 time measurement control register 0 (00D816) 0016
(85) Interrupt enable register 0 (00B016) X X 0 0 X 0 0 0 (110) Group 0 time measurement control register 1 (00D916) 0016
(86) Interrupt enable register 1 (00B116) X X 0 0 X 0 0 0 (111) Group 0 time measurement control register 2 (00DA16) 0016
(87) Interrupt enable register 2 (00B216) X X 0 0 X 0 X 0 (112) Group 0 time measurement control register 3 (00DB16) 0016
(88) Interrupt enable register 3 (00B316) X X 0 0 0 0 0 0 (113) Group 0 time measurement control register 4 (00DC16) 0016
(89) Interrupt enable register 4 (00B416) 0 0 X 0 0 0 0 0 (114) Group 0 time measurement control register 5 (00DD16) 0016
(90) Interrupt enable register 5 (00B516) X X X 0 0 0 0 0 (115) Group 0 time measurement control register 6 (00DE16) 0016
(91) Interrupt enable register 6 (00B616) X X X 0 0 0 0 0 (116) Group 0 time measurement control register 7 (00DF16) 0016
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
28
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(117) Group 0 base timer register (00E016) ??16 (144) Group 1 time measurement/waveform (010416) ??16
generate register 2
(00E116) ??16 (010516) ??16
(118) Group 0 base timer control register 0 (00E216) 0016 (145) Group 1 time measurement/waveform (010616) ??16
generate register 3
(119) Group 0 base timer control register 1 (00E316) 0016 (010716) ??16
(120) Group 0 time measurement prescaler register 6 (00E416) 0016 (146) Group 1 time measurement/waveform (010816) ??16
generate register 4
(121) Group 0 time measurement prescaler register 7 (00E516) 0016 (010916) ??16
(122) Group 0 function enable register (00E616) 0016 (147) Group 1 time measurement/waveform (010A16) ??16
generate register 5
(123) Group 0 function select register (00E716) 0016 (010B16) ??16
(124) Group 0 SI/O receive buffer register (00E816) ??16 (148) Group 1 time measurement/waveform (010C16) ??16
generate register 6
(00E916) X 0 0 0 X X X X (010D16) ??16
(125) Group 0 transmit buffer/receive data register (00EA16) ??16 (149) Group 1 time measurement/waveform (010E16) ??16
generate register 7
(126) Group 0 receive input register (00EC16) ??16 (010F16) ??16
(127) Group 0 SI/O communication mode register (00ED16) 0016 (150) Group 1 waveform generate control register 0 (011016) 0 X 0 0 X 0 0 0
(128) Group 0 transmit output register (00EE16) ??16 (151) Group 1 waveform generate control register 1 (011116) 0 X 0 0 X 0 0 0
(129) Group 0 SI/O communication control register (00EF16) 0 0 0 0 X 0 1 1 (152) Group 1 waveform generate control register 2 (011216) 0 X 0 0 X 0 0 0
(130) Group 0 data compare register 0 (00F016) ??16 (153) Group 1 waveform generate control register 3 (011316) 0 X 0 0 X 0 0 0
(131) Group 0 data compare register 1 (00F116) ??16 (154) Group 1 waveform generate control register 4 (011416) 0 X 0 0 X 0 0 0
(132) Group 0 data compare register 2 (00F216) ??16 (155) Group 1 waveform generate control register 5 (011516) 0 X 0 0 X 0 0 0
(133) Group 0 data compare register 3 (00F316) ??16 (156) Group 1 waveform generate control register 6 (011616) 0 X 0 0 X 0 0 0
(134) Group 0 data mask register 0 (00F416) ??16 (157) Group 1 waveform generate control register 7 (011716) 0 X 0 0 X 0 0 0
(135) Group 0 data mask register 1 (00F516) ??16 (158) Group 1 time measurement control register 1 (011916) 0016
(136) Group 0 receive CRC code register (00F816) ??16 (159) Group 1 time measurement control register 2 (011A16) 0016
(00F916) ??16 (160) Group 1 time measurement control register 6 (011E16) 0016
(137) Group 0 transmit CRC code register (00FA16) 0016 (161) Group 1 time measurement control register 7 (011F16) 0016
(138) Group 0 SI/O expansion mode register (00FC16) 0016 (012116) ??16
(139) Group 0 SI/O expansion receive control register (00FD16) 0016 (163) Group 1 base timer control register 0 (012216) 0016
(140) Group 0 SI/O special communication (00FE16) 0 0 0 0 0 0 X X (164) Group 1 base timer control register 1 (012316) 0016
interrupt detect register
(141) Group 0 SI/O expansion transmit (00FF16) 0 0 0 0 0 X X X
control register
(142) Group 1 time measurement/waveform (010016) ??16
generate register 0
(010116) ??16
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
29
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(165) Group 1 time measurement prescaler register 6 (012416) 0016 (191) Group 2 waveform generate register 4 (014816) ??16
(166) Group 1 time measurement prescaler register 7 (012516) 0016 (014916) ??16
(167) Group 1 function enable register (012616) 0016 (192) Group 2 waveform generate register 5 (014A16) ??16
(169) Group 1 SI/O receive buffer register (012816) ??16 (193) Group 2 waveform generate register 6 (014C16) ??16
(170) Group 1 transmit buffer/receive data register (012A16) ??16 (194) Group 2 waveform generate register 7 (014E16) ??16
(172) Group 1 SI/O communication mode register (012D16) 0016 (195) Group 2 waveform generate control register 0 (015016) 0016
(173) Group 1 transmit output register (012E16) ??16 (196) Group 2 waveform generate control register 1 (015116) 0016
(174) Group 1 SI/O communication control register (012F16) 0 0 0 0 X 0 1 1 (197) Group 2 waveform generate control register 2 (015216) 0016
(175) Group 1 data compare register 0 (013016) ??16 (198) Group 2 waveform generate control register 3 (015316) 0016
(176) Group 1 data compare register 1 (013116) ??16 (199) Group 2 waveform generate control register 4 (015416) 0016
(177) Group 1 data compare register 2 (013216) ??16 (200) Group 2 waveform generate control register 5 (015516) 0016
(178) Group 1 data compare register 3 (013316) ??16 (201) Group 2 waveform generate control register 6 (015616) 0016
(179) Group 1 data mask register 0 (013416) ??16 (202) Group 2 waveform generate control register 7 (015716) 0016
(180) Group 1 data mask register 1 (013516) ??16 (203) Group 2 base timer register (016016) ??16
(181) Group 1 receive CRC code register (013816) ??16 (016116) ??16
(013916) ??16 (204) Group 2 base timer control register 0 (016216) 0016
(182) Group 1 transmit CRC code register (013A16) 0016 (205) Group 2 base timer control register 1 (016316) 0016
(183) Group 1 SI/O expansion mode register (013C16) 0016 (207) Group 2 function enable register (016616) 0016
(184) Group 1 SI/O expansion receive control register (013D16) 0016 (208) Group 2 RTP output buffer register (016716) 0016
(185) Group 1 SI/O special communication (013E16) 0 0 0 0 0 0 X X (209) Group 2 SI/O communication mode register (016A16) 0 0 XX X 0 0 0
interrupt detect register
(186) Group 1 SI/O expansion transmit control register (013F16) 0 0 0 0 0 X X X (210) Group 2 SI/O communication control register (016B16) 0 0 0 0 X 1 1 0
(187) Group 2 waveform generate register 0 (014016) ??16 (211) Group 2 SI/O transmit buffer register (016C16) ??16
(188) Group 2 waveform generate register 1 (014216) ??16 (212) Group 2 SI/O receive buffer register (016E16) ??16
(189) Group 2 waveform generate register 2 (014416) ??16 (213) Group 2 IEBus address register (017016) ??16
(190) Group 2 waveform generate register 3 (014616) ??16 (214) Group 2 IEBus control register (017216) 0 0 XX X 0 0 0
(014716) ??16
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
30
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(215) Group 2 IEBus transmit interrupt (017316) X XX 0 0 0 0 0 (238) Group 3 waveform generate mask register 4 (019816) ??16
cause detect register
(216) Group 2 IEBus receive interrupt (017416) X XX 0 0 0 0 0 (019916) ??16
cause detect register
(217) Input function select register (017816) 0016 (239) Group 3 waveform generate mask register 5 (019A16) ??16
(219) Group 3 SI/O communication control register (017B16) 0 0 ? 0 X ? ? 0 (240) Group 3 waveform generate mask register 6 (019C16) ??16
(220) Group 3 SI/O transmit buffer register (017C16) ??16 (019D16) ??16
(017D16) ??16 (241) Group 3 waveform generate mask register 7 (019E16) ??16
(221) Group 3 SI/O receive buffer register (017E16) ??16 (019F16) ??16
(018116) ??16 (243) Group 3 base timer control register 0 (01A216) 0016
(223) Group 3 waveform generate register 1 (018216) ??16 (244) Group 3 base timer control register 1 (01A316) 0 X X 0 X 0 0 0
(224) Group 3 waveform generate register 2 (018416) ??16 (246) Group 3 RTP output buffer register (01A716) 0016
(227) Group 3 waveform generate register 5 (018A16) ??16 (251) Group 3 high-speed HDLC data (01B016) 0016
compare register 0
(018B16) ??16 (01B116) 0016
(228) Group 3 waveform generate register 6 (018C16) (252) Group 3 high-speed HDLC data (01B216) 0016
??16
mask register 0
(018D16) ??16 (01B316) 0016
(229) Group 3 waveform generate register 7 (018E16) ??16 (253) Group 3 high-speed HDLC data (01B416) 0016
compare register 1
(018F16) ??16 (01B516) 0016
(230) Group 3 waveform generate control register 0 (019016) 0016 (254) Group 3 high-speed HDLC data (01B616) 0016
mask register 1
(231) Group 3 waveform generate control register 1 (019116) 0016 (01B716) 0016
(232) Group 3 waveform generate control register 2 (019216) 0016 (255) Group 3 high-speed HDLC data (01B816) 0016
compare register 2
(233) Group 3 waveform generate control register 3 (019316) 0016 (01B916) 0016
(234) Group 3 waveform generate control register 4 (019416) 0016 (256) Group 3 high-speed HDLC data (01BA16) 0016
mask register 2
(235) Group 3 waveform generate control register 5 (019516) 0016 (01BB16) 0016
(236) Group 3 waveform generate control register 6 (019616) 0016 (257) Group 3 high-speed HDLC data (01BC16) 0016
compare register 3
(237) Group 3 waveform generate control register 7 (019716) 0016 (01BD16) 0016
31
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(258) Group 3 high-speed HDLC data (01BE16) 0016 (282) CAN0 message slot buffer 0 data 6 (01EC16) ??16
mask register 3 (Note)
(01BF16) 0016 (283) CAN0 message slot buffer 0 data 7 (01ED16) ??16
(Note)
(259) A-D1 register 0 (01C016) ??16 (284) CAN0 message slot buffer 0 time stamp high (01EE16) ??16
(Note)
(01C116) ??16 (285) CAN0 message slot buffer 0 time stamp low (01EF16) ??16
(Note)
(260) A-D1 register 1 (01C216) ??16 (286) CAN1 message slot buffer 0 standard ID 0 (01F016) XX X ? ? ? ? ?
(Note)
(01C316) ??16 (287) CAN1 message slot buffer 0 standard ID 1 (01F116) XX ? ? ? ? ? ?
(Note)
(261) A-D1 register 2 (01C416) ??16 (288) CAN1 message slot buffer 0 extended ID 0 (01F216) XX X X ? ? ? ?
(Note)
(01C516) ??16 (289) CAN1 message slot buffer 0 extended ID 1 (01F316) ??16
(Note)
(262) A-D1 register 3 (01C616) ??16 (290) CAN1 message slot buffer 0 extended ID 2 (01F416) XX ? ? ? ? ? ?
(Note)
(01C716) ??16 (291) CAN1 message slot buffer 0 data length code (01F516) XX X X ? ? ? ?
(Note)
(263) A-D1 register 4 (01C816) ??16 (292) CAN1 message slot buffer 0 data 0 (01F616) ??16
(Note)
(01C916) ??16 (293) CAN1 message slot buffer 0 data 1 (01F716) ??16
(Note)
(264) A-D1 register 5 (01CA16) ??16 (294) CAN1 message slot buffer 0 data 2 (01F816) ??16
(Note)
(01CB16) ??16 (295) CAN1 message slot buffer 0 data 3 (01F916) ??16
(Note)
(265) A-D1 register 6 (01CC16) ??16 (296) CAN1 message slot buffer 0 data 4 (01FA16) ??16
(Note)
(01CD16) ??16 (297) CAN1 message slot buffer 0 data 5 (01FB16) ??16
(Note)
(266) A-D1 register 7 (01CE16) ??16 (298) CAN1 message slot buffer 0 data 6 (01FC16) ??16
(Note)
(01CF16) ??16 (299) CAN1 message slot buffer 0 data 7 (01FD16) ??16
(Note)
(267) A-D1 control register 2 (01D416) X 0 0 X X 0 0 0 (300) CAN1 message slot buffer 0 time stamp high (01FE16) ??16
(Note)
(268) A-D1 control register 0 (01D616) 0016 (301) CAN1 message slot buffer 0 time stamp low (01FF16) ??16
(Note)
(269) A-D1 control register 1 (01D716) XX 0 0 0 0 0 0 (302) CAN0 control register 0 (020016) X X 0 1 0 X 0 1
(Note)
(270) CAN0 message slot buffer 0 standard ID 0 (01E016) XX X ? ? ? ? ? (020116) XXXX 0 0 0 0
(Note)
(271) CAN0 message slot buffer 0 standard ID 1 (01E116) XX ? ? ? ? ? ? (303) CAN0 status register (020216) 0016
(Note) (Note)
(272) CAN0 message slot buffer 0 extended ID 0 (01E216) XX X X ? ? ? ? (020316) X 0 0 0 0 X 0 1
(Note)
(273) CAN0 message slot buffer 0 extended ID 1 (01E316) ??16 (304) CAN0 expansion ID register (020416) 0016
(Note) (Note)
(274) CAN0 message slot buffer 0 extended ID 2 (01E416) XX ? ? ? ? ? ? (020516) 0016
(Note)
(275) CAN0 message slot buffer 0 data length code (01E516) XX X X ? ? ? ? (305) CAN0 configuration register (020616) 0 0 0 0 X XXX
(Note) (Note)
(276) CAN0 message slot buffer 0 data 0 (01E616) ??16 (020716) 0016
(Note)
(277) CAN0 message slot buffer 0 data 1 (01E716) ??16 (306) CAN0 time stamp register (020816) 0016
(Note) (Note)
(278) CAN0 message slot buffer 0 data 2 (01E816) ??16 (020916) 0016
(Note)
(279) CAN0 message slot buffer 0 data 3 (01E916) ??16 (307) CAN0 transmit error count register (020A16) 0016
(Note) (Note)
(280) CAN0 message slot buffer 0 data 4 (01EA16) ??16 (308) CAN0 receive error count register (020B16) 0016
(Note) (Note)
(281) CAN0 message slot buffer 0 data 5 (01EB16) ??16
(Note)
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit (bit 0 at address 024216) to 1 after reset.
32
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(309) CAN0 slot interrupt status register (020C16) 0016 (339) X0 register/Y0 register (02C016) ??16
(Note)
(020D16) 0016 (02C116) ??16
(310) CAN0 slot interrupt mask register (021016) 0016 (340) X1 register/Y1 register (02C216) ??16
(Note)
(021116) 0016 (02C316) ??16
(311) CAN0 error interrupt mask register (021416) XXX X X 0 0 0 (341) X2 register/Y2 register (02C416) ??16
(Note)
(312) CAN0 error interrupt status register (021516) XXX X X 0 0 0 (02C516) ??16
(Note)
(313) CAN0 baud rate prescaler (021716) 0116 (342) X3 register/Y3 register (02C616) ??16
(Note)
(314) CAN0 global mask register standard ID0 (022816) XXX 0 0 0 0 0 (02C716) ??16
(Note)
(315) CAN0 global mask register standard ID1 (022916) XX 0 0 0 0 0 0 (343) X4 register/Y4 register (02C816) ??16
(Note)
(316) CAN0 global mask register extended ID0 (022A16) ??16 (02C916) ??16
(Note)
(317) CAN0 global mask register extended ID1 (022B16) ??16 (344) X5 register/Y5 register (02CA16) ??16
(Note)
(318) CAN0 global mask register extended ID2 (022C16) ??16 (02CB16) ??16
(Note)
(319) CAN0 message slot 0 control register / (023016) XXX 0 0 0 0 0 (345) X6 register/Y6 register (02CC16) ??16
CAN0 local mask register A standard ID0 (Note)
(320) CAN0 message slot 1 control register / (023116) XX 0 0 0 0 0 0 (02CD16) ??16
CAN0 local mask register A standard ID1 (Note)
(321) CAN0 message slot 2 control register / (023216) 0016 (346) X7 register/Y7 register (02CE16) ??16
CAN0 local mask register A extended ID0 (Note)
(322) CAN0 message slot 3 control register / (023316) 0016 (02CF16) ??16
CAN0 local mask register A extended ID1 (Note)
(323) CAN0 message slot 4 control register / (023416) 0016 (347) X8 register/Y8 register (02D016) ??16
CAN0 local mask register A extended ID2 (Note)
(324) CAN0 message slot 5 control register (023516) 0016 (02D116) ??16
(Note)
(325) CAN0 message slot 6 control register (023616) 0016 (348) X9 register/Y9 register (02D216) ??16
(Note)
(326) CAN0 message slot 7 control register (023716) 0016 (02D316) ??16
(Note)
(327) CAN0 message slot 8 control register / (023816) XXX 0 0 0 0 0 (349) X10 register/Y10 register (02D416) ??16
CAN0 local mask register B standard ID0 (Note)
(328) CAN0 message slot 9 control register / (023916) XX 0 0 0 0 0 0 (02D516) ??16
CAN0 local mask register B standard ID1 (Note)
(329) CAN0 message slot 10 control register / (023A16) 0016 (350) X11 register/Y11 register (02D616) ??16
CAN0 local mask register B extended ID0 (Note)
(330) CAN0 message slot 11 control register / (023B16) 0016 (02D716) ??16
CAN0 local mask register B extended ID1 (Note)
(331) CAN0 message slot 12 control register / (023C16) 0016 (351) X12 register/Y12 register (02D816) ??16
CAN0 local mask register B extended ID2 (Note)
(332) CAN0 message slot 13 control register (023D16) 0016 (02D916) ??16
(Note)
(333) CAN0 message slot 14 control register (023E16) 0016 (352) X13 register/Y13 register (02DA16) ??16
(Note)
(334) CAN0 message slot 15 control register (023F16) 0016 (02DB16) ??16
(Note)
(335) CAN0 slot buffer select register (024016) 0016 (353) X14 register/Y14 register (02DC16) ??16
(Note)
(336) CAN0 control register 1 (024116) XX 0 0 0 0 X X (02DD16) ??16
(Note)
(337) CAN0 sleep control register (024216) XX X X XX X 0 (354) X15 register/Y15 register (02DE16) ??16
(Note)
(338) CAN0 acceptance filter support register (024416) 0016 (02DF16) ??16
(Note)
(024516) 0116 (355) XY control register (02E016) XX XX XX 0 0
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit (bit 0 at address 024216) to 1 after reset.
33
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(356) UART1 special mode register 4 (02E416) 0016 (382) Three-phase output buffer register 0 (030A16) X X 0 0 0 0 0 0
(357) UART1 special mode register 3 (02E516) 0016 (383) Three-phase output buffer register 1 (030B16) X X 0 0 0 0 0 0
(358) UART1 special mode register 2 (02E616) 0016 (384) Dead time timer (030C16) ??16
(359) UART1 special mode register (02E716) 0016 (385) Timer B2 interrupt occurrence (030D16) XXX X ? ? ? ?
frequency set counter
(360) UART1 transmit-receive mode register (02E816) 0016 (386) Timer B3 register (031016) ??16
(362) UART1 transmit buffer register (02EA16) ??16 (387) Timer B4 register (031216) ??16
(363) UART1 transmit-receive control register 0 (02EC16) 0816 (388) Timer B5 register (031416) ??16
(365) UART1 receive buffer register (02EE16) ??16 (389) Timer B3 mode register (031B16) 0 0 ? X 0 0 0 0
(366) UART4 special mode register 4 (02F416) 0016 (391) Timer B5 mode register (031D16) 0 0 ? 0 0 0 0 0
(367) UART4 special mode register 3 (02F516) 0016 (392) External interrupt cause select register (031F16) 0016
(368) UART4 special mode register 2 (02F616) 0016 (393) UART3 special mode register 4 (032416) 0016
(369) UART4 special mode register (02F716) 0016 (394) UART3 special mode register 3 (032516) 0016
(370) UART4 transmit-receive mode register (02F816) 0016 (395) UART3 special mode register 2 (032616) 0016
(371) UART4 bit rate generator (02F916) ??16 (396) UART3 special mode register (032716) 0016
(372) UART4 transmit buffer register (02FA16) ??16 (397) UART3 transmit-receive mode register (032816) 0016
(373) UART4 transmit-receive control register 0 (02FC16) 0816 (399) UART3 transmit buffer register (032A16) ??16
(375) UART4 receive buffer register (02FE16) ??16 (400) UART3 transmit-receive control register 0 (032C16) 0816
(376) Timer B3,B4,B5 count start flag (030016) 0 0 0 X XX XX (402) UART3 receive buffer register (032E16) ??16
(378) Timer A2-1 register (030416) ??16 (404) UART2 special mode register 3 (033516) 0016
(379) Timer A4-1 register (030616) ??16 (406) UART2 special mode register (033716) 0016
(380) Three-phase PWM control register 0 (030816) 0016 (408) UART2 bit rate generator (033916) ??16
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
34
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(409) UART2 transmit buffer register (033A16) ??16 (432) Timer B1 mode register (035C16) 0 0 ? X 0 0 0 0
(410) UART2 transmit/receive control register 0 (033C16) 0816 (434) Timer B2 special mode register (035E16) XXX X X X X 0
(411) UART2 transmit/receive control register 1 (033D16) 0216 (435) Count source prescaler register (035F16) 0 XXX 0 0 0 0
(412) UART2 receive buffer register (033E16) ??16 (436) UART0 pecial mode register 4 (036416) 0016
(413) Count start flag (034016) 0016 (438) UART0 special mode register 2 (036616) 0016
(414) Clock prescaler reset flag (034116) 0 X X XXX XX (439) UART0 special mode register (036716) 0016
(415) One-shot start flag (034216) 0016 (440) UART0 transmit/receive mode register (036816) 0016
(416) Trigger select register (034316) 0016 (441) UART0 bit rate generator (036916) ??16
(417) Up-down flag (034416) 0016 (442) UART0 transmit buffer register (036A16) ??16
(419) Timer A1 (034816) ??16 (444) UART0 transmit/receive control register 1 (036D16) 0216
(421) Timer A3 (034C16) ??16 (447) DMA0 cause select register (037816) 0 X 0 0 0 0 0 0
(422) Timer A4 (034E16) ??16 (449) DMA2 cause select register (037A16) 0 X 0 0 0 0 0 0
(423) Timer B0 (035016) ??16 (451) CRC data register (037C16) ??16
(424) Timer B1 (035216) ??16 (452) CRC input register (037E16) ??16
(427) Timer A1 mode register (035716) 0 0 0 0 0 X 0 0 (455) A-D0 register 2 (038416) ??16
(429) Timer A3 mode register (035916) 0 0 0 0 0 X 0 0 (456) A-D0 register 3 (038616) ??16
The content of other registers and RAM are undefined when the microcomputer is reset. The initial values must therefore be set.
35
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
(458) A-D0 register 5 (038A16) ??16 (488) Port P9 direction register (03C716) 0016
(459) A-D0 register 6 (038C16) ??16 (490) Port P11 (Note) (03C916) XXX ? ? ? ? ?
(038D16) ??16 (491) Port P10 direction register (Note) (03CA16) 0016
(460) A-D0 register 7 (038E16) ??16 (492) Port P11 direction register (Note) (03CB16) XXX 0 0 0 0 0
(461) A-D0 control register 2 (039416) X 0 0 0 0 0 0 0 (494) Port P13 (Note) (03CD16) ??16
(462) A-D0 control register 0 (039616) 0016 (495) Port P12 direction register (Note) (03CE16) 0016
(463) A-D0 control register 1 (039716) 0016 (496) Port P13 direction register (Note) (03CF16) 0016
(464) D-A register 0 (039816) ??16 (497) Port P14 (Note) (03D016) X ? ? ? ? ? ? ?
(465) D-A register 1 (039A16) ??16 (498) Port P15 (Note) (03D116) ??16
(466) D-A control register (039C16) XXXX XX 0 0 (499) Port P14 direction register (Note) (03D216) X 0 0 0 0 0 0 0
(467) Function select register A8 (Note) (03A016) XXXX 0 0 0 0 (500) Port P15 direction register (Note) (03D316) 0016
(468) Function select register A9 (Note) (03A116) 0016 (501) Pull-up control register 2 (03DA16) 0016
(469) Function select register C (03AF16) 0 0 X 0 0 0 0 0 (502) Pull-up control register 3 (03DB16) 0016
(470) Function select register A0 (03B016) 0016 (503) Pull-up control register 4 (Note) (03DC16) XX XX 0 0 0 0
(471) Function select register A1 (03B116) 0016 (504) Port P0 (03E016) ??16
(472) Function select register B0 (03B216) 0016 (505) Port P1 (03E116) ??16
(473) Function select register B1 (03B316) 0016 (506) Port P0 direction register (03E216) 0016
(474) Function select register A2 (03B416) XX XXX 0 0 0 (507) Port P1 direction register (03E316) 0016
(475) Function select register A3 (03B516) 0016 (508) Port P2 (03E416) ??16
(476) Function select register B2 (03B616) XX XXX 0 0 0 (509) Port P3 (03E516) ??16
(477) Function select register B3 (03B716) 0016 (510) Port P2 direction register (03E616) 0016
(478) Function select register A5 (Note) (03B916) XX XX 0 0 0 0 (511) Port P3 direction register (03E716) 0016
(479) Function select register A6 (Note) (03BC16) 0016 (512) Port P4 (03E816) ??16
(480) Function select register A7 (Note) (03BD16) 0016 (513) Port P5 (03E916) ??16
(481) Port P6 (03C016) ??16 (514) Port P4 direction register (03EA16) 0016
(482) Port P7 (03C116) ??16 (515) Port P5 direction register (03EB16) 0016
(483) Port P6 direction register (03C216) 0016 (516) Pull-up control register 0 (03F016) 0016
(484) Port P7 direction register (03C316) 0016 (517) Pull-up control register 1 (03F116) XX XX 0 0 0 0
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values must therefore be set.
Note :This register exists in 144-pin version.
36
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
SFR
Address Register Address Register
000016 003016 ROM area set register ROA *
000116 003116 Debug moritor area set register DBA *
000216 003216 Expansion area set register 0 EXA0 *
000316 003316 Expansion area set register 1 EXA1 *
000416 Processor mode register 0 PM0 003416 Expansion area set register 2 EXA2 *
000516 Processor mode register 1 PM1 003516 Expansion area set register 3 EXA3 *
000616 System clock control register 0 CM0 003616
000716 System clock control register 1 CM1 003716
000816 Wait control register WCR 003816
000916 Address match interrupt control register AIER 003916
000A16 Protect register PRCR 003A16
000B16 External data bus width control register DS 003B16
000C16 Main clock divided register MCD 003C16
000D16 Oscillation stop detect register CM2 003D16
000E16 Watchdog timer start register WDTS 003E16
000F16 Watchdog timer control register WDC 003F16
001016 004016 DRAM control register DRAMCONT
001116 Address match interrupt register 0 RMAD0 004116 DRAM refresh interval set register REFCNT
001216 004216
001316 004316
001416 004416
001516 Address match interrupt register 1 RAMD1 004516
001616 004616
001716 VDC control register for PLL PLV 004716
001816 004816
001916 Address match interrupt register 2 RAMD2 004916
001A16 004A16
001B16 VDC control register 1 VDC1 * 004B16
001C16 004C16
001D16 Address match interrupt register 3 RAMD3 004D16
001E16 004E16
001F16 VDC control register 0 VDC0 * 004F16
002016 005016
002116 Emulator interrupt vector table register EIAD0 * 005116
002216 005216
002316 Emulator interrupt detect register EITD * 005316
002416 Emulator protect register EPRR * 005416
002516 005516 Flash memory control register 2 FMR2 *
002616 005616 Flash memory control register 1 FMR1 *
002716 005716 Flash memory control register 0 FMR0
002816 005816
002916 005916
002A16 005A16
002B16 005B16
002C16 005C16
002D16 005D16
002E16 005E16
002F16 005F16
37
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
38
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
39
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
40
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
41
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
42
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
43
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
44
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
45
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
<144-pin version>
Address Register Address Register
03A016 Function select register A8 PS8 03D016 Port P14 register P14
03A116 Function select register A9 PS9 03D116 Port P15 register P15
03A216 03D216 Port P14 direction register PD14
03A316 03D316 Port P15 direction register PD15
03A416 03D416
03A516 03D516
03A616 03D616
03A716 03D716
03A816 03D816
03A916 03D916
03AA16 03DA16 Pull-up control register 2 PUR2
03AB16 03DB16 Pull-up control register 3 PUR3
03AC16 03DC16 Pull-up control register 4 PUR4
03AD16 03DD16
03AE16 03DE16
03AF16 Function select register C PSC 03DF16
03B016 Function select register A0 PS0 03E016 Port P0 register P0
03B116 Function select register A1 PS1 03E116 Port P1 register P1
03B216 Function select register B0 PSL0 03E216 Port P0 direction register PD0
03B316 Function select register B1 PSL1 03E316 Port P1 direction register PD1
03B416 Function select register A2 PS2 03E416 Port P2 register P2
03B516 Function select register A3 PS2 03E516 Port P3 register P3
03B616 Function select register B2 PSL2 03E616 Port P2 direction register PD2
03B716 Function select register B3 PSL3 03E716 Port P3 direction register PD3
03B816 03E816 Port P4 register P4
03B916 Function select register A5 PS5 03E916 Port P5 register P5
03BA16 03EA16 Port P4 direction register PD4
03BB16 03EB16 Port P5 direction register PD5
03BC16 Function select register A6 PS6 03EC16
03BD16 Function select register A7 PS7 03ED16
03BE16 03EE16
03BF16 03EF16
03C016 Port P6 register P6 03F016 Pull-up control register 0 PUR0
03C116 Port P7 register P7 03F116 Pull-up control register 1 PUR1
03C216 Port P6 direction register PD6 03F216
03C316 Port P7 direction register PD7 03F316
03C416 Port P8 register P8 03F416
03C516 Port P9 register P9 03F516
03C616 Port P8 direction register PD8 03F616
03C716 Port P9 direction register PD9 03F716
03C816 Port P10 register P10 03F816
03C916 Port P11 register P11 03F916
03CA16 Port P10 direction register PD10 03FA16
03CB16 Port P11 direction register PD11 03FB16
03CC16 Port P12 register P12 03FC16
03CD16 Port P13 register P13 03FD16
03CE16 Port P12 direction register PD12 03FE16
03CF16 Port P13 direction register PD13 03FF16 Port control register PCR
46
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
<100-pin version>
12345678901234567890123456789 12345678901234567890123456789
Address
12345678901234567890123456789
Register
12345678901234567890123456789
Address
03D016
12345678901234567890123456789
12345678901234567890123456789
Register
12345678901234567890123456789 12345678901234567890123456789
03A016
03A116 03D116 1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
03A216 03D216 1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
03A316 03D316 1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
03A416 03D416
03A516 03D516
03A616 03D616
03A716 03D716
03A816 03D816
03A916 03D916
03AA16 03DA16 Pull-up control register 2 PUR2
03AB16 03DB1612345678901234567890123456789012123456789
Pull-up control register 3 PUR3
12345678901234567890123456789012123456789
03DC1612345678901234567890123456789012123456789
03AC16
03AD16 03DD16
03AE16 03DE16
03AF16 Function select register C PSC 03DF16
03B016 Function select register A0 PS0 03E016 Port P0 register P0
03B116 Function select register A1 PS1 03E116 Port P1 register P1
03B216 Function select register B0 PSL0 03E216 Port P0 direction register PD0
03B316 Function select register B1 PSL1 03E316 Port P1 direction register PD1
03B416 Function select register A2 PS2 03E416 Port P2 register P2
03B516 Function select register A3 PS3 03E516 Port P3 register P3
03B616 Function select register B2 PSL2 03E616 Port P2 direction register PD2
03B716 Function select register B3 PSL3 03E716 Port P3 direction register PD3
12345678901234567890123456789
03B816
12345678901234567890123456789 03E816 Port P4 register P4
03B916 12345678901234567890123456789 03E916 Port P5 register P5
03BA16 03EA16 Port P4 direction register PD4
12345678901234567890123456789
12345678901234567890123456789
03BB16 03EB16 Port P5 direction register PD5
03BC16 12345678901234567890123456789 03EC16
03BD16 12345678901234567890123456789 03ED16
03BE16 03EE16
03BF16 03EF16
03C016 Port P6 register P6 03F016 Pull-up control register 0 PUR0
03C116 Port P7 register P7 03F116 Pull-up control register 1 PUR1
03C216 Port P6 direction register PD6 03F216
03C316 Port P7 direction register PD7 03F316
03C416 Port P8 register P8 03F416
03C516 Port P9 register P9 03F516
03C616 Port P8 direction register PD8 03F616
03C716 Port P9 direction register PD9 03F716
12345678901234567890123456789
12345678901234567890123456789
03C816 Port P10 register P10 03F816
03C916 12345678901234567890123456789 03F916
03CA16 1234567890123456789012345678901212345678901234567890123456789012
Port P10 direction register PD10 03FA16
12345678901234567890123456789
1234567890123456789012345678901212345678901234567890123456789012
03CB16 1234567890123456789012345678901212345678901234567890123456789012
12345678901234567890123456789
1234567890123456789012345678901212345678901234567890123456789012 03FB16
1234567890123456789012345678901212345678901234567890123456789012
03CC16 12345678901234567890123456789 03FC16
12345678901234567890123456789
03CD16 1234567890123456789012345678901212345678901234567890123456789012 03FD16
1234567890123456789012345678901212345678901234567890123456789012
03CE16 1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012 03FE16
1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
03CF16 1234567890123456789012345678901212345678901234567890123456789012
1234567890123456789012345678901212345678901234567890123456789012
03FF16 Port control register PCR
The blank area is reserved and cannot be used by user.
1234567
1234567
Note 1: 1234567
1234567 Addresses 03CB 16, 03CE 16 , 03CF16 , 03D216 , 03D316 does not exist in 100-pin version. Must set
12345
"FF16" to the addresses at initial setting.
12345
Note 2: 12345Addresses 03DC16 area does not exist in 100-pin version. Must set "0016" to addresses 03DC16 at initial setting.
1234
Note 3: 1234Addresses 03A016, 03A116, 03B916, 03BC16, 03BD16, 03C916, 03CC16, 03CD16, 03D3016, 03D116
does not exist in 100-pin version.
47
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Software Reset
Software Reset
Writing “1” to bit 3 of the processor mode register 0 (address 000416) applies a (software) reset to the
microcomputer. A software reset has the same effect as a hardware reset. The contents of internal RAM
are preserved.
Processor Mode
(1) Types of Processor Mode
One of three processor modes can be selected: single-chip mode, memory expansion mode, and micro-
processor mode. The functions of some pins, memory map, and access space differ according to the
selected processor mode.
• Single-chip mode
In single-chip mode, only internal memory space (SFR, internal RAM, and internal ROM) can be
accessed. Ports P0 to P15 can be used as programmable I/O ports or as I/O ports for the internal
peripheral functions.
• Memory expansion mode
In memory expansion mode, external memory can be accessed in addition to the internal memory
space (SFR, internal RAM, and internal ROM).
In this mode, some of the pins function as an address bus, a data bus, and as control signals. The
number of pins assigned to these functions depends on the bus and register settings. (See “Bus
Settings” for details.)
• Microprocessor mode
In microprocessor mode, the SFR, internal RAM and external memory space can be accessed. The
internal ROM area cannot be accessed.
In this mode, some of the pins function as the address bus, the data bus, and as control signals. The
number of pins assigned to these functions depends on the bus and register settings. (See “Bus
Settings” for details.)
(2) Setting Processor Modes
The processor mode is set using the CNVSS pin and the processor mode bits (bits 1 and 0 at address
000416). Do not set the processor mode bits to “102”.
Regardless of the level of the CNVSS pin, changing the processor mode bits selects the mode. There-
fore, never change the processor mode bits when changing the contents of other bits. Also do not
attempt to shift to or from the microprocessor mode within the program stored in the internal ROM area.
• Applying VSS to CNVSS pin
The microcomputer begins operation in single-chip mode after being reset. Memory expansion mode
is selected by writing “012” to the processor mode is selected bits.
• Applying VCC to CNVSS pin
The microcomputer starts to operate in microprocessor mode after being reset.
Figure 1.6.1 and 1.6.2 show the processor mode register 0 and 1.
Figure 1.6.3 shows the memory maps applicable for each processor modes.
48
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Processor Mode SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bit R W
symbol Bit name Function
b1 b0
PM00 0 0: Single-chip mode
Processor mode bit 0 1: Memory expansion mode
(Note 2) 1 0: Must not be set
PM01
1 1: Microprocessor mode
49
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Processor Mode
Bit
symbol Bit name Function R W
b1 b0
0 0 : Mode 0 (P44 to P47 : A20 to A23)
PM10 0 1 : Mode 1 (P44: A20,
External memory area P45 to P47: CS2 to CS0)
mode bit (Note 2) 1 0 : Mode 2 (P44, P45 : A20, A21,
P46, P47 : CS1, CS0)
PM11 1 1 : Mode 3 (Note 3)
(P44 to P47 : CS3 to CS0)
0 : No wait state
PM12 Internal memory wait bit
1 : Wait state inserted
PM14 0 0 : No ALE
ALE pin select bit 0 1 : P53/BCLK (Note 5)
(Note 2) 1 0 : P56/RAS
PM15 1 1 : P54/HLDA
Nothing is assigned.
When write, set "0". When read, its content is indeterminate.
Note 1: Set bit 1 of the protect register (address 000A16) to “1” when writing new values to this register.
Note 2: Valid in memory expansion mode or in microprocessor mode.
Note 3: When mode 3 is selected, DRAMC is not used.
Note 4: When accessing SFR area for CAN, PM13 must be set to "1".
Note 5: When selecting P53/BCLK, set bits 0 and 1 of system clock control register 0 (CM00, CM01) to "0".
50
de
v
r
Un elop
de me
n
Microprocessor mode
mode Mode 0 Mode 1 Mode 2 Mode 3 Mode 0 Mode 1 Mode 2 Mode 3
00000016 SFR area
SFR area SFR area SFR area SFR area SFR area SFR area SFR area SFR area
00040016 Internal RAM area Internal RAM area Internal RAM area Internal RAM area Internal RAM area Internal RAM area Internal RAM area Internal RAM area Internal RAM area
Processor Mode
Internal reserved area Internal reserved area Internal reserved area Internal reserved area Internal reserved area Internal reserved area Internal reserved area Internal reserved area
00080016
CS1 No use CS1 No use
External area 0 2Mbytes External area 0 2Mbytes
(Note1) CS1 CS1, 1Mbytes (Note1) CS1, 1Mbytes
CS1
External area 0 External area 0 External area 0 External area 0
20000016 4Mbytes 4Mbytes
(Note2) CS2, 1Mbytes CS2, 1Mbytes
CS2 External area 1 CS2 (Note2)
External area 1 External area 1
2Mbytes External area 0 External area 1 2Mbytes External area 0
External area 1 No use External area 1 No use
40000016
C0000016
CS0 CS3, 1Mbytes CS3, 1Mbytes
External area 2 External area 2
2Mbytes CS0 No use
External area 3 External area 3 3Mbytes No use CS0
E0000016 External area 3 External area 3 4Mbytes No use
No use CS0, 1Mbytes
External area 3 CS0 External area 3
F0000016 Internal reserved area Internal reserved area Internal reserved area Internal reserved area 2Mbytes
CS0, 1Mbytes
Internal ROM area Internal ROM area Internal ROM area Internal ROM area External area 3 External area 3
FFFFFF16 Internal ROM area
Each CS0 to CS3 can set 0 to 3 WAIT. Note 1: 20000016–00800016=2016 Kbytes. 32 K less than 2 MB.
Note 2: 40000016–00800016=4064 Kbytes. 32 K less than 4 MB.
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
M32C/83 group
Mitsubishi Microcomputers
51
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Bus Settings SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Settings
The BYTE pin, bit 0 to 3 of the external data bus width control register (address 000B16), bits 4 and 5 of the
processor mode register 0 (address 000416) and bit 0 and 1 of the processor mode register 1 (address
000516) are used to change the bus settings.
Table 1.7.1 shows the factors used to change the bus settings, figure 1.7.1 shows external data bus width
control register and table 1.7.2 shows external area 0 to 3 and external area mode.
52
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Settings
accessing memory using the multiplex bus configuration, two waits are inserted regardless of whether
you select “No wait” or “1 wait” in the appropriate bit of the wait control register.
____
The default after a reset is a separate bus configuration, and the full CS space multiplex bus configu-
____
ration cannot be selected in microprocessor mode. If you select “Full CS space multiplex bus”, the 16
bits from A0 to A15 are output for the address
AA
A R W
AA
A
DS0 External area 0 data bus 0 : 8 bits data bus width
width bit 1 : 16 bits data bus width
AA
A
DS1 External area 1 data bus 0 : 8 bits data bus width
width bit 1 : 16 bits data bus width
AA
A
DS2 External area 2 data bus 0 : 8 bits data bus width
width bit 1 : 16 bits data bus width
DS3 External area 3 data bus 0 : 8 bits data bus width
width bit (Note) 1 : 16 bits data bus width
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note: The value after a reset is determined by the input via the BYTE pin.
When BYTE pin is "L", DS3 is "1". When "H", it is "0".
Memory expansion mode, 40000016 to <DRAMC area> <DRAMC area> <CS3 area>
Microprocessor mode BFFFFF16 40000016 to 40000016 to C0000016 to
(Note 1) BFFFFF16 BFFFFF16 CFFFFF16
EFFFFF16
<CS0 area> <CS0 area> <CS0 area>
C0000016 to
Microprocessor mode E0000016 to C0000016 to F0000016 to
FFFFFF16
FFFFFF16 FFFFFF16 FFFFFF16
53
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Bus Settings SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Data bus width All external Some external All external Some external All external Some external
BYTE pin level area is 8 bits area is 16 bits area is 8 bits area is 16 bits area is 8 bits area is 16 bits
P00 to P07 I/O port Data bus Data bus Data bus Data bus I/O port I/O port
P10 to P17 I/O port I/O port I/O port Data bus I/O port I/O port I/O port
P20 to P27 I/O port Address bus Address bus Address bus Address bus Address bus Address bus
/data bus /data bus /data bus /data bus
(Note 2) (Note 2)
P30 to P37 I/O port Address bus Address bus Address bus Address bus Address bus Address bus
/data bus /data bus
(Note 2)
P40 to P43 I/O port Address bus Address bus Address bus Address bus I/O port I/O port
P56 I/O port RAS (Note 3) RAS (Note 3) RAS (Note 3) RAS (Note 3) RAS (Note 3) RAS (Note 3)
Note 1:The default after a reset is the separate bus configuration, and "Full CS space multiplex bus" cannot be selected in
microprocessor mode. When you select "Full CS space multiplex bus" in extended memory mode, the address bus
operates with 64 Kbytes boundaries for each chip select.
Note 2: Address bus in separate bus configuration.
Note 3: The ALE output pin is selected using bits 4 and 5 of the processor mode register 1.
Note 4: When you have selected the DRAM controller and access the DRAM area, these are outputs CASL, CASH, DW, and
BCLK.
Note 5: The CS signal and address bus selection are set by the external area mode.
54
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
Bus Control
The following explains the signals required for accessing external devices and software waits. The signals
required for accessing the external devices are valid when the processor mode is set to memory expan-
sion mode and microprocessor mode.
(1) Address bus/data bus
_____
There are 24 pins, A0 to A22 and A23 for the address bus for accessing the 16 Mbytes address space.
_____
A23 is an inverted output of the MSB of the address.
The data bus consists of pins for data IO. The external data bus control register (address 000B16)
selects the 8-bit data bus, D0 to D7 for each external area, or the 16-bit data bus, D0 to D15. After a reset,
there is by default an 8-bit data bus for the external area 3 when the BYTE pin is High, or a 16-bit data
bus when the BYTE pin is Low.
When shifting from single-chip mode to extended memory mode, the value on the address bus is unde-
fined until an external area is accessed.
When accessing a DRAM area with DRAM control in use, a multiplexed signal consisting of row address
and column address is output to A8 to A20.
(2) Chip select signals
_____
The chip select signals share A0 to A22 and A23. You can use bits 0 and 1 of the processor mode register
1 (address 000516) to set the external area mode, then select the chip select area and number of
address outputs.
In microprocessor mode, external area mode 0 is selected after a reset. The external area can be split
into a maximum of four Blocks or Areas using the chip select signals. Table 1.7.4 shows the external
areas specified by the chip select signals.
Mode 0
(A23) (A22) (A21) (A20)
C0000016 to
Specified address range
55
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
The chip select signal turns Low (active) in synchronize with the address bus. However, its turning High
depends on the area accessed in the next cycle. Figure 1.7.2 shows the output examples of the address
bus and chip select signals.
Example 1: After accessing the external area, the Example 2: After accessing the external area, only the
address bus and chip select signal both are chip select signal is changed in the next
changed in the next cycle. cycle. (The address bus does not change.)
The following example shows the other chip select The following example shows the CPU accesses the
signal accessing area (j) in the cycle after having internal ROM/RAM area in the cycle after having
accessed external area (i). In this case, the address accessed external area. In this case, the chip select
bus and chip select signal both change between the signal changes between the two cycles but the
two cycles. address bus does not.
Access to Access to Access to Access to
external external external internal
area (i) area (j) area ROM/RAM
area
Data bus
Data Data Data bus Data
Address bus
Address Address bus Address
Chip select
(CSi) Chip select
Chip select
(CSj)
Example 3: After accessing the external area, only the Example 4: After accessing the external area, the
address bus is changed in the next cycle. address bus and chip select signal both are
(The chip select signal does not change.) not changed in the next cycle.
The following example shows the same chip select The following example shows CPU does not access
signal accessing area (i) in the cycle after having any area in the cycle after having accessed external
accessed external area (i). In this case, the address area (no instruction pre-fetch is occurred). In this
bus changes between the two cycles, but the chip case, the address bus and the chip select signal do
select signal does not. not change between the two cycles.
Access to Access to Access to
external external external
area (i) area (i) area No access
Note: These examples show the address bus and chip select signal for two consecutive cycles.
By combining these examples, chip select signal can be extended beyond two cycles.
Figure 1.7.2. Example of address bus and chip select signal outputs (Separate bus)
56
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
57
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
ALE ALE
(Note 1) (Note 1)
D0/A0 to D7/A7 Address Data D0/A0 to D15/A15 Address Data
A8 to A15 Address
(Note 2)
A16 to A19 Address A16 to A19 Address (Note 2)
58
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
BCLK
RD
CSi
AAAAAAAA
AAAAAAAA
(i=0 to 3)
(Note)
RDY
tsu(RDY - BCLK)
BCLK
AAAAAA
AAAAAA
RD
CSi
(i=0 to 3)
(Note)
RDY
tsu(RDY - BCLK)
AA
: Wait using RDY signal RDY received timing
Note: Chip select (CSi) may get longer by a state of CPU such as an instruction queue buffer.
_____ ________
Figure 1.7.4. Example of RD signal extended by RDY signal
59
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
__________
HOLD > DMAC > CPU
_____ ________
Figure 1.7.5. Example of RD signal extended by RDY signal
60
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
61
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
Bit symbol
WCR0
Bit name
External area 0
wait bit
b1 b0
Function
0 0: Without wait AA
A
A
AA
R W
A
AA
0 1: With 1 wait
WCR1 1 0: With 2 waits
1 1: With 3 waits
A
AA
b3 b2
WCR2 External area 1
0 0: Without wait
AA
wait bit
0 1: With 1 wait
WCR3 1 0: With 2 waits
AA
1 1: With 3 waits
b5 b4
WCR4
A A
External area 2 0 0: Without wait
wait bit 0 1: With 1 wait
WCR5 1 0: With 2 waits
AA
1 1: With 3 waits
b7 b6
AA
WCR6 External area 3 0 0: Without wait
wait bit 0 1: With 1 wait
WCR7 1 0: With 2 waits
1 1: With 3 waits
Note 1: When using the multiplex bus configuration, there are two waits regardless of whether you have
specified "No wait" or "1 wait". However, you can specify "2 waits" or "3 waits".
Note 2: When using the separate bus configuration, the read bus cycle is executed in the BCLK1 cycle,
and the write cycle is executed in the BCLK2 cycle (with 1 wait).
0 2 BCLK cycles
SFR
1 3 BCLK cycles
0 1 BCLK cycle
Internal
ROM/RAM 1 2 BCLK cycles
Read :1 BCLK cycle
002
Write : 2 BCLK cycles
012 2 BCLK cycles
Separate bus
102 3 BCLK cycles
External 112 4 BCLK cycles
memory
002 3 BCLK cycle
area
012 3 BCLK cycles
Multiplex bus
102 3 BCLK cycles
112 4 BCLK cycles
62
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
< Separate bus (no wait) > Bus cycle (Note) Bus cycle (Note)
BCLK
Write signal
Read signal
BCLK
Write signal
Read signal
BCLK
Write signal
Read signal
Note 1: This timing example shows bus cycle length. Read cycle and write cycle may be continued after this
bus cycle.
Note 2: Address bus and chip select may get longer depending on the state of CPU such as an instruction
queue buffer.
Note 3: When accessing same external area (same CS area) continuously, chip select may output
continuously.
63
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus Control
BCLK
Write signal
Read signal
Chip select
(Note 2,3)
BCLK
Write signal
Read signal
ALE
BCLK
Write signal
Read signal
Address bus
/Data bus ( Address Data output Address Input
Note 2)
ALE
Chip select
(Note 2,3)
Note 1: This timing example shows bus cycle length. Read cycle and write cycle may be continued after this
bus cycle.
Note 2: Address bus and chip select may get longer depending on the state of CPU such as an instruction
queue buffer.
Note 3: When accessing same external area (same CS area) continuously, chip select may output
continuously.
64
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
System Clock
Clock Generating Circuit
The clock generating circuit contains three oscillator circuits as follows:
(1) Main clock generating circuit
(2) Sub clock generating circuit
(3) Ring oscillator (oscillation stop detect function)
Table 1.8.1 lists the clock generating circuit specifications and Table 1.8.2 lists registers controlling each
clock generating circuit. Figure 1.8.1 shows block diagram of the system clock generating circuit. Figure
1.8.2 to 1.8.5 show clock control related registers.
Note : CM0, CM1, CM2 and MCD registers are protected from a false write by program runaway. When you
want to rewrite these registers, set "1" to bit 0 of protect register (address 000A16) to release protect,
then rewrite the register.
65
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Main clock
XIN XOUT
fAD
Ring oscillator
circuit f1
CM05
a b
Divider 1 f8
CM02 CM21
c d f2n
Divider 2
Sub clock
S Q XCIN XCOUT e
Divider 3
f
(Wait mode) WAIT instruction R
CM07
fC BCLK
Software reset
CM04
RESET
1/32 fC32
NMI
Interrupt request level
judgment output
Divider 1
a 1/2 1/2 1/2 b
c 1/n 1/2 d
Divide rate 2n (n=0 to 15) is set by bit 0 to 3 at count source prescaler register (address 035F16)
Divider 3
1/m
e f
Divide rate m (m=1,2,3,4,6,8,10,12,14,16 ) is set by bit 0 to 4 at main clock divide register (address 000C16)
Ring
oscillator Clock edge detect
Clock /charge and Charge and Interrupt
from discharge discharge generating
XIN circuit control circuit circuit Interrupt
request signal
Watchdog timer
interrupt
Ring oscillator
Ring oscillator circuit
clock
CM21 switch
select signal
66
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
A A
Bit symbol Bit Function RW
name
AA
b1 b0
CM00 Clock output function 0 0 : I/O port P53
select bit (Note 2) 0 1 : fC output
A
AA
CM01 1 0 : f8 output
1 1 : f32 output
A
AA
CM02 WAIT peripheral 0 : Do not stop peripheral clock
function clock stop bit in wait mode
1 : Stop peripheral clock in
wait mode (Note 3)
Nothing is assigned.
A A
When write, set "0". When read, their contents are indeterminate.
Port XC select bit 0 : I/O port
AA
CM04
1 : XCIN-XCOUT generation (Note 4)
Main clock (XIN-XOUT) 0 : Main clock On
A A
CM05
stop bit (Note 5) 1 : Main clock Off (Note 6)
Watchdog timer 0 : Watchdog timer interrupt
AA
CM06
function select bit 1 : Reset (Note 7)
System clock select bit 0 : XIN, XOUT
CM07 (Note 8) 1 : XCIN, XCOUT
Note 1: Set bit 0 of the protect register (address 000A16) to “1” before writing to this register.
Note 2: The port P53 dose not function as an I/O port in microprocessor or memory expansion
mode.
When outputting ALE to P53 (bits 5 and 4 of processor mode register 0 is "01"), set
these bits to "00".
The port P53 function is not selected, even when you set "00" in microprocessor or
memory expansion mode and bit 7 of the processor mode register 0 is "1".
Note 3: fc32 is not included. When this bit is set to "1", PLL cannot be used in WAIT.
Note 4: When XcIN-XcOUT is used, set port P86 and P87 to no pull-up resistance with the input
port.
Note 5: When entering the power saving mode, the main clock is stopped using this bit. To stop
the main clock, set system clock stop bit (CM07) to "1" while an oscillation of sub clock is
stable. Then set this bit to "1".
When XIN is used after returning from stop mode, set this bit to "0".
When this bit is "1", XOUT is "H". Also, the internal feedback resistance remains ON, so
XIN is pulled up to XOUT ("H" level) via the feedback resistance.
Note 6: When the main clock is stopped, the main clock division register (address 000C16) is set
to the division by 8 mode.
However, in ring oscillator mode, the main clock division register is not set to the division
by 8 mode when XIN-XOUT is stopped by this bit.
Note 7: When "1" has been set once, "0" cannot be written by software.
Note 8: Set this bit "0" to "1" when sub clock oscillation is stable by setting CM04 to "1".
Set this bit "1" to "0" when main clock oscillation is stable by setting CM05 to "0".
Do not set CM04 and CM05 simultaneously.
67
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Bit symbol
CM10
Bit
name
All clock stop control bit 0 : Clock on
Function
AA
(Note 2)
Note 1: Set bit 0 of the protect register (address 000A16) to “1” before writing to this register.
A
Note 2: When this bit is "1", XOUT is "H", and the internal feedback resistance is disabled. XCIN
and XCOUT are high-inpedance.
Note 3: When all clocks are stopped (stop mode), the main clock division register
(address 000C16) is set to the division by 8 mode.
AA
A
MCD 000C16 XXX010002
A
AA
Bit symbol Bit name Function RW
b4 b3 b2 b1 b0
MCD0 Main clock division select
10010 : No division mode
A
AA
bit (Note 2, 4)
00010 : Division by 2 mode
MCD1 00011 : Division by 3 mode
A
AA
00100 : Division by 4 mode
00110 : Division by 6 mode
MCD2 01000 : Division by 8 mode
A
AA
01010 : Division by 10 mode
MCD3 01100 : Division by 12 mode
A
AA
01110 : Division by 14 mode
00000 : Division by 16 mode
MCD4
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note 1: Set bit 0 of the protect register (address 000A16) to “1” before writing to this register.
Note 2: These bits are "010002" (8-division mode) when main clock is stopped or you shift to stop
mode. However, in ring oscillator mode, this register is not set to the division by 8 mode when
XIN-XOUT is stopped by main clock stop bit.
Note 3: Do not attempt to set combinations of values other than those shown in this figure.
Note 4: SFR area of CAN is accessed with no division mode.
68
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Bit
symbol Bit name Function R W
Note 1: Set bit 0 of the protect register (address 000A16) to "1" before writing to this register.
Note 2: When XIN oscillation stop is detected in CM20="1", this bit becomes "1".
After this, although XIN starts oscillating, this bit does not become "0". When you change to XIN as
system clock after XIN restarts oscillating, write "0" to this bit.
Note 3: When CM20="1" and CM22="1", this bit cannot be written.
Note 4: When detecting oscillation stop, this bit becomes "1". "0" can be written by software.
When "0" is written during XIN oscillation stop, this bit does not becomes "1" although XIN oscillating stops.
Note 5: XIN state is judged by reading this bit several times in oscillation stop interrupt process program.
69
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Bit
symbol Bit name Function R W
b3 b2 b1b0
CNT0 0 0 0 0: No-division
0 0 0 1: Division by 2
0 0 1 0: Division by 4
CNT1 0 0 1 1: Division by 6
Division rate select bit • (Note)
•
CNT2 •
1 1 0 1: Division by 26
1 1 1 0: Division by 28
CNT3 1 1 1 1: Division by 30
0: Divider stops
CST Operation enable bit
1: Divider starts
Note : Write to these bits during the count stop.
Bit
symbol Bit name Function R W
Note 1: When rewriting this register, set bit 3 of protect regiser (address 000A16) to "1".
Note 2: Set this bit to "0" before shifting to stop mode.
70
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Microcomputer Microcomputer
(Built-in feedback resistance) (Built-in feedback resistance)
XIN XOUT XIN XOUT
Open
(Note)
Rd
Externally derived clock
CIN Vcc
COUT
Vss
Note: Insert a damping resistance if required. The resistance will vary depending on
the oscillator setting. Use the value recommended by the maker of the oscillator.
Insert a feedback resistance between XIN and XOUT when an oscillation
manufacture required.
71
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Microcomputer Microcomputer
(Built-in feedback resistance) (Built-in feedback resistance)
XCIN XCOUT XCIN XCOUT
Open
(Note)
RCd
Externally derived clock
Note: Insert a damping resistance if required. The resistance will vary depending on
the oscillator and the oscillation drive capacity setting. Use the value
recommended by the maker of the oscillator.
When the oscillation drive capacity is set to low, check that oscillation is stable.
Insert a feedback resistance between XCIN and XCOUT when an oscillation
manufacture required.
72
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
XIN switching
Confirm XIN is ON
End
73
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Wait Mode
When main clock or ring oscillator clock is selected as clock source for BCLK, the BCLK is the clock
derived by dividing the main clock or ring oscillator clock by 1, 2, 3, 4, 6, 8, 10, 12, 14 or 16.
Main clock divide rate select bit of main clock division register (bit 0 to 4 at address 000C16)
The BCLK is derived by dividing the main clock (XIN-XOUT) by 8 after a reset. (Main clock division register
= "XXX010002")
When main clock is stopped under changing to stop mode or selecting XIN-XOUT (main clock select bit =
"0"), the main clock division register is set to the division by 8 ("XXX010002").
When ring oscillator clock is selected as clock source for BCLK, although main clock is stoped, the
contents of main clock division register is maintained.
74
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generating Circuit
Clock Output
You can output clock from the P53 pin.
• BCLK output function select bit of processor mode register 0 (bit 7 at address 000416)
• ALE select bits of processor mode register 1 (bit 4 and 5 at address 000516)
• Clock output function select bits of system clock select register (bits 1 and 0 at address 000616)
Table 1.8.4 shows clock output setting (single chip mode) and Table 1.8.5 shows clock output setting
(memory expansion/microprocessor mode).
Note: The processor mode register 0 and 1 are protected from false write by program run away.
Set bit 1 to "1" at protect register (address 000A16) and release protect before rewriting processor
mode register 0 and 1.
75
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Power Saving
Power Saving
There are three power save modes. Figure 1.8.9 shows the clock transition between each of the three
modes, (1), (2), and (3).
• Normal operating mode
CPU and peripheral function operate when supplying clock. Power dissipation is reduced by making
BCLK slow.
• Wait mode
BCLK is stopped. Peripheral function clock is stopped as desired. Main clock and sub clock isn't
stopped. Power dissipation is reduced than normal operating mode.
• Stop mode (Note 1)
Main clock, sub clock and PLL synthesizer are stopped. CPU and peripheral function clock are
stopped. Power dissipation is the most few in this mode.
Note :When using stop mode, oscillation stop detect function must be canceled.
When switching BCLK from ring oscillator to main clock, switch clock after main clock oscillates fully
stable. After setting divided by 8 (main clock division register =0816) in ring oscilltor mode, switching
to the middle mode (divided by 8) is recommended.
76
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Power Saving
WAIT peripheral function clock stop bit of system clock control register 0 (bit 2 at address 000616)
0: Do not stop f1, f8 and f2n in wait mode and do not stop supplying clock to PLL circuit
1: Stop f1, f8 and f2n in wait mode and stop supplying clock to PLL circuit
Interrupt priority set bits for exiting a stop/wait state of exit priority register (bits 0 to 2 at address
009F16) :RLVL0 to RLVL2
Set the same level as the flag register (FLG) processor interrupt level (IPL).
Interrupt priority set bits of interrupt control register (bits 0 to 2)
Set to a priority level above the level set by RLVL0 to RLVL2 bits
Interrupt enable flag of FLG register
I=1
When using an interrupt to exit Wait mode, the microcomputer resumes operating the clock that was oper-
ating when the WAIT command was executed as BCLK from the interrupt routine.
ALE “L”
Port Retains status before wait mode
When f8, f32 selected Does not stop when the WAIT peripheral function clock stop bit is
“0”. When the WAIT peripheral function clock stop bit is “1”, the
status immediately prior to entering wait mode is maint ained.
________ ________
Note :When self-refresh is done in operating DRAM control, CAS and RAS becomes “L”.
77
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Power Saving
ALE “H”
78
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Power Saving
Reset
CPU operation
Note 1, 5 Note 2, 4
All oscillation is stopped is stopped
CM10="1"
Low-speed/ low power WAIT instruction
Stop mode Note 3 Wait mode
dissipation mode interrupt
Interrupt
Note 1
XIN oscillation is stopped
Ring oscillator / ring oscillator Note 6
Detect Interrupt WAIT instruction
low power dissipation mode Wait mode
oscillation stop interrupt
Note 1 :Switch clocks after the main clock oscillation is fully stabled.
Note 2 :Switch clocks after oscillation of sub clock is fully stable.
Note 3 :The main clock division register is set to the division by 8 mode (MCD="0816").
Note 4 :When changing to low power dissipation mode, the main clock division register is set to
the division by 8 mode (MCD="0816").
Note 5 :Low power dissipation mode can not be changed to high-speed / middle-speed mode.
Note 6 :Other oscillation mode cannot be changed to low power dissipation mode.
79
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Power Saving
BCLK :f(XIN)/8
CM07=“0” MCD=“0816”
High-speed/middle-speed mode
MCD=“XX16” CM04=“1”
Main clock is oscillating Note 1, 3 Main clock is oscillating MCD=“XX16”
Sub clock is stopped Sub clock is oscillating Note 1, 3
High-speed mode High-speed mode
CM21=“0”
BCLK :f(XIN) BCLK :f(XIN) Note 1
CM07=“0” MCD=“1216” CM04=“0”
CM07=“0” MCD=“1216”
80
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Protection
Protection
The protection function is provided so that the values in important registers cannot be changed in the event
that the program runs out of control. Figure 1.8.11 shows the protect register. The following registers are
protected by the protect register.
(1) Registers protected by PRC0 (bit 0)
• System clock control registers 0 and 1 (addresses 000616 and 000716)
• Main clock division register (address 000C16)
• Oscillation stop detect register (address 000D16)
• PLL control register 0 (address 037616)
(2) Registers protected by PRC1 (bit 1)
• Processor mode registers 0 and 1 (addresses 000416 and 000516)
• Three-phase PWM control registers 0 and 1 (addresses 030816 and 030916)
(3) Registers protected by PRC2 (bit 2)
• Port P9 direction register (address 03C716)
• Function select register A3 (address 03B516)
(4) Registers protected by PRC3 (bit 3)
• VDC control register for PLL (address 001716)
• VDC control register 0 (address 001F16)
If, after “1” (write-enabled) has been written to the PRC2, a value is written to any address, the bit automati-
cally reverts to “0” (write-inhibited). Change port P9 input/output and function select register A3 immedi-
ately after setting "1" to PRC2. Interrupt and DMA transfer should not be inserted between instructions.
However, the PRC0, PRC1 and PRC3 do not automatically return to “0” after a value has been written to an
address. The program must therefore be written to return these bits to “0”.
81
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Protect register
b7 b6 b5 b4 b3 b2 b1 b0
Symbol Address When reset
PRCR 000A16 XXXX00002
A
Enables writing to system clock control registers 0
and 1 (addresses 000616 and 000716), main clock
division register (address 000C16), oscillation stop
PRC0 Protect bit 0 detect register (address 000D16) and PLL control
register 0 (address 037616)
0 : Write-inhibited
1 : Write-enabled
A
Enables writing to processor mode registers 0 and
1 (addresses 000416 and 000516) and three-
PRC1 phase PWM control register 0 and 1 (addresses
Protect bit 1 030816 and 030916)
0 : Write-inhibited
1 : Write-enabled
Nothing is assigned.
When write, set “0”. When read, their contents are indeterminate.
Note 1: Writing a value to an address after “1” is written to this bit returns the bit
to “0”. Other bits do not automatically return to “0” and they must therefore
be reset by the program.
Note 2: User cannot use. Writing to VDC control registers 0 and 1 (addresses
001F16, 001B16) is enabled so that a careful handling is required.
82
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Interrupt Outline
Types of Interrupts
• Maskable interrupt : An interrupt which can be disabled by the interrupt enable flag (I flag) or
whose interrupt priority can be changed by priority level.
• Non-maskable interrupt : An interrupt which cannot be disabled by the interrupt enable flag (I flag) or
whose interrupt priority cannot be changed by priority level.
*1 Peripheral I/O interrupts are generated by the peripheral functions built into the microcomputer
system. High-speed interrupt can be used as highest priority in peripheral I/O interrupts.
Software Interrupts
Software interrupts are generated by some instruction that generates an interrupt request when ex-
ecuted. Software interrupts are nonmaskable interrupts.
(1) Undefined-instruction interrupt
This interrupt occurs when the UND instruction is executed.
(2) Overflow interrupt
This interrupt occurs if the INTO instruction is executed when the O flag is 1.
The following lists the instructions that cause the O flag to change:
ABS, ADC, ADCF, ADD, ADDX, CMP, CMPX, DIV, DIVU, DIVX, NEG, RMPA, SBB, SCMPU, SHA,
SUB, SUBX
(3) BRK interrupt
This interrupt occurs when the BRK instruction is executed.
(4) BRK2 interrupt
This interrupt occurs when the BRK2 instruction is executed. This interrupt is used exclusively for
debugger purposes. You normally do not need to use this interrupt.
83
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Hardware Interrupts
There are Two types of hardware Interrupts; special interrupts and Peripheral I/O interrupts.
(1) Special interrupts
Special interrupts are nonmaskable interrupts.
• Reset
____________
A reset occurs when the RESET pin is pulled low.
______
• NMI interrupt
______
This interrupt occurs when the NMI pin is pulled low.
• Watchdog timer interrupt
This interrupt is caused by the watchdog timer.
• Ocsillation stop detect interrupt
This interrupt is caused by the ocsillation stop detect function.
It occurs when detecting the XIN ocsillation is stopped.
• Single-step interrupt
This interrupt is used exclusively for debugger purposes. These interrupts normally do not need to use
this interrupt. A single-step interrupt occurs when the D flag is set (= 1); in this case, an interrupt is
generated each time an instruction is executed.
• Address-match interrupt
This interrupt occurs when the program's execution address matches the contents of the address
match register while the address match interrupt enable bit is set (= 1).
This interrupt does not occur if any address other than the start address of an instruction is set in the
address match register.
84
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
High-speed interrupts
High-speed interrupts are interrupts in which the response is executed at 5 cycles and the return is 3
cycles.
When a high-speed interrupt is received, the flag register (FLG) and program counter (PC) are saved to
the save flag register (SVF) and save PC register (SVP) and the program is executed from the address
shown in the vector register (VCT).
Execute an FREIT instruction to return from the high-speed interrupt routine.
High-speed interrupts can be set by setting “1” in the high-speed interrupt specification bit allocated to bit
3 of the exit priority register. Setting “1” in the high-speed interrupt specification bit makes the interrupt set
to level 7 in the interrupt control register a high-speed interrupt.
You can only set one interrupt as a high-speed interrupt. When using a high-speed interrupt, do not set
multiple interrupts as level 7 interrupts. When using high speed interrupt, DMA II cannot be used.
The interrupt vector for a high-speed interrupt must be set in the vector register (VCT).
When using a high-speed interrupt, you can use a maximum of two DMAC channels.
The execution speed is improved when register bank 1 is used with high speed interrupt register selected
by not saving registers to the stack but to the switching register bank. In this case, switch register bank
mode for high-speed interrupt routine.
85
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Vector address + 0
AAAAAAAA
AAAAAAAA
MSB
Low address
LSB
Vector address + 1
AAAAAAAA
AAAAAAAA
Mid address
AAAAAAAA
Vector address + 2 High address
0 0 16
Vector address + 3
86
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
87
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
88
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
The interrupt enable flag (I flag), the processor interrupt priority level (IPL), interrupt request bit and
interrupt priority level select bit are all independent of each other, so they do not affect any other bit.
There are I flag and IPL in flag register (FLG). This flag and bit are described below.
Interrupt Enable Flag (I Flag) and processor Interrupt Priority Level (IPL)
I flag is used to disable/enable maskable interrupts. When this flag is set (= 1), all maskable interrupts
are enabled; when the flag is cleared to 0, they are disabled. This flag is automatically cleared to 0
after a reset.
IPL is configured with three bits, for specification of up to eight processor interrupt priority levels from
level 0 to level 7.
If a requested interrupt has priority greater than the processor interrupt priority level (IPL), the interrupt
is enabled.
Table 1.9.4 shows interrupt enable levels in relation to the processor interrupt priority level (IPL).
89
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
AAA
AAAA
BCNiIC(i=0 to 4) 007116, 009116, 008F16, 007116(Note 1), 009116(Note 2) XXXXX0002
DMiIC(i=0 to 3) 006816, 008816, 006A16, 008A16 XXXXX0002
ADiIC(i=0,1) 007316, 008616 XXXXX0002
AAAA
AAA
KUPIC (i=0) 009316 XXXXX0002
b7 b6 b5 b4 b3 b2 b1 b0
IIOiIC(i=0 to 5) 007516, 009516, 007716, 009716, 007916, 009916 XXXXX0002
IIOiIC(i=6 to 11) 007B16, 009B16, 007D16, 009D16, 007F16, 008116 XXXXX0002
CANiIC(i=0 to 2) 009D16, 007F16, 008116 XXXXX0002
AA
A A
Bit symbol Bit name Function R W
ILVL0 Interrupt priority level
AAAA
b2 b1 b0
select bit
000: Level 0 (interrupt disabled)
001: Level 1
ILVL1 010: Level 2
011: Level 3
AA
AA
A A
100: Level 4
ILVL2 101: Level 5
110: Level 6
AAAA
111: Level 7
IR Interrupt request bit 0 : Interrupt not requested
1 : Interrupt requested (Note 3)
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note 1: UART0 bus collision and start/stop condition detection interrupt control register is shared with UART3.
Note 2: UART1 bus collision and start/stop condition detection interrupt control register is shared with UART4.
Note 3: This bit can only be accessed for reset (= 0), but cannot be accessed for set (= 1).
90
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
AA
A
Interrupt control register
A
AA
b7 b6 b5 b4 b3 b2 b1 b0 Symbol Address When reset
INTiIC(i=0 to 2) 009E16, 007E16, 009C16 XX00 X0002
INTiIC(i=3 to 5)(*1) 007C16, 009A16, 007A16 XX00 X0002
AA
Bit symbol Bit name Function R W
ILVL0 Interrupt priority level
AA
b2 b1 b0
select bit
0 0 0 : Level 0 (interrupt disabled)
AA
0 0 1 : Level 1
ILVL1 0 1 0 : Level 2
0 1 1 : Level 3
AA
1 0 0 : Level 4
ILVL2 1 0 1 : Level 5
AA
1 1 0 : Level 6
1 1 1 : Level 7
IR Interrupt request bit 0: Interrupt not requested
1: Interrupt requested (Note 1)
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note 1: This bit can only be accessed for reset (= 0), but cannot be accessed for set (= 1).
Note 2: When related bit of external interrupt cause select register (address 031F16) are used for both edge,
select the falling edge (=0).
Note 3: When level sense is selected, set related bit of external interrupt cause select register (address 031F16) to
one edge.
*1 When using 16-bit data bus width in microprocessor mode or memory expansion mode, INT3 to INT5 are used
for data bus. In this case, set the interrupt disabled to INT3IC, INT4IC and INT5IC.
91
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Bit
symbol Bit name Function R W
b2 b1 b0
RLVL0 0 0 0 : Level 0
Interrupt priority set bits 0 0 1 : Level 1
for exiting Stop/Wait 0 1 0 : Level 2
RLVL1 state 0 1 1 : Level 3
(Note 1) 1 0 0 : Level 4
1 0 1 : Level 5
RLVL2 1 1 0 : Level 6
1 1 1 : Level 7
Nothing is assigned.
When write, set "0". When read, its content is indeterminate.
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note 1: Exits the Stop or Wait mode when the requested interrupt priority level is higher than
that set in the exit priority register.
Set to the same value as the processor interrupt priority level (IPL) set in the flag
register (FLG).
Note 2: The high-speed interrupt can only be specified for interrupts with interrupt priority level
7. Specify interrupt priority level 7 for only one interrupt.
Note 3: Do not set this bit to 0 after once setting it to 1.
When this bit is 1, do not set the high-speed interrupt select bit to 0. (This cannot be
used simultaneously with the high-speed interrupt.)
Transfers by DMAC II are unaffected by the interrupt enable flag (I flag) and processor
interrupt priority level (IPL).
Bit 0 to 2: Interrupt priority set bits for exiting Stop/Wait state (RLVL0 to RLVL2)
When using an interrupt to exit Stop mode or Wait mode, the relevant interrupt must be enabled and
set to a priority level above the level set by the RLVL0 to RLVL2 bits. Set the RLVL0 to RLVL2 bits to
the same level as the flag register (FLG) IPL.
92
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Interrupt Sequence
An interrupt sequence — what are performed over a period from the instant an interrupt is accepted to the
instant the interrupt routine is executed — is described here.
If an interrupt occurs during execution of an instruction, the processor determines its priority when the
execution of the instruction is completed, and transfers control to the interrupt sequence from the next
cycle. If an interrupt occurs during execution of either the SCMPU, SIN, SMOVB, SMOVF, SMOVU,
SSTR, SOUT or RMPA instruction, the processor temporarily suspends the instruction being executed,
and transfers control to the interrupt sequence.
In the interrupt sequence, the processor carries out the following in sequence given:
(1) CPU gets the interrupt information (the interrupt number and interrupt request level) by reading
address 00000016 (address 00000216 when high-speed interrupt). After this, the related interrupt
request bit is "0".
(2) Saves the contents of the flag register (FLG) immediately before the start of interrupt sequence in the
temporary register (Note) within the CPU.
(3) Sets the interrupt enable flag (I flag), the debug flag (D flag), and the stack pointer select flag (U flag)
to “0” (the U flag, however does not change if the INT instruction, in software interrupt numbers 32
through 63, is executed)
(4) Saves the contents of the temporary register (Note) within the CPU in the stack area. Saves in the
flag save register (SVF) in high-speed interrupt.
(5) Saves the content of the program counter (PC) in the stack area. Saves in the PC save register
(SVP) in high-speed interrupt.
(6) Sets the interrupt priority level of the accepted instruction in the IPL.
After the interrupt sequence is completed, the processor resumes executing instructions from the first
address of the interrupt routine.
Note: This register cannot be utilized by the user.
Time
Instruction in interrupt
Instruction Interrupt sequence
routine
(a) (b)
(a) The period from the occurrence of an interrupt to the completion of the instruction under execution.
(b) The time required for executing the interrupt sequence.
93
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Time (a) varies with each instruction being executed. The DIVX instruction requires a maximum time of
29* cycles.
Time (b) is shown in table 1.9.5.
* It is when the divisor is immediate or register. When the divisor is memory, the following value is
added.
• Normal addressing :2+X
• Index addressing :3+X
• Indirect addressing : 5 + X + 2Y
• Indirect index addressing : 6 + X + 2Y
X is number of wait of the divisor area. Y is number of wait of the indirect address stored area.
When X and Y are in odd address or in 8 bit bus area, double the value of X and Y.
Watchdog timer
Undefined instruction
Address match
BRK2 instruction
94
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Table 1.9.6 Relationship between Interrupts without Interrupt Priority Levels and IPL
Interrupt sources without interrupt priority levels Value that is set to IPL
_______
Watchdog timer, NMI 7
Reset 0
Other Not changed
Saving Registers
In an interrupt sequence, only the contents of the flag register (FLG) and program counter (PC) are
saved to the stack area.
The order in which these contents are saved are as follows: First, the FLG register is saved to the stack
area. Next, the 16 high-order bits and 16 low-order bits of the program counter expanded to 32-bit are
saved. Figure 1.9.7 shows the stack status before an interrupt request is acknowledged and the stack
status after an interrupt request is acknowledged.
In a high-speed interrupt sequence, the contents of the flag register (FLG) are saved to the flag save
register (SVF) and program counter (PC) are saved to PC save register (SVP).
If there are any other registers you want to be saved, save them in software at the beginning of the
interrupt routine. The PUSHM instruction allows you to save all registers except the stack pointer (SP)
by a single instruction.
In high speed interrupt, switch register bank, then register bank 1 is used as high speed interrupt register.
In this case, switch register bank mode for high-speed interrupt routine.
Program counter
m-6 m-6 (PCL)
[SP]
Program counter New stack
m-5 m-5 (PC M) pointer value
Program counter
m–4 m–4 (PC H)
m–3 m–3 0 0
Flag register
m–2 m–2 (FLGL)
Flag register
m–1 m–1 (FLG H)
[SP]
Content of Stack pointer Content of
m previous stack m
value before previous stack
Content of interrupt occurs Content of
m+1 previous stack m+1 previous stack
Stack status before interrupt request is acknowledged Stack status after interrupt request is acknowledged
Figure 1.9.7. Stack status before and after an interrupt request is acknowledged
95
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Interrupt Priority
If two or more interrupt requests are sampled active at the same time, the interrupt with the highest
priority will be acknowledged.
Maskable interrupts (Peripheral I/O interrupts) can be assigned any desired priority by setting the inter-
rupt priority level select bit accordingly. If some maskable interrupts are assigned the same priority level,
the priority between these interrupts are resolved by the priority that is set in hardware.
Certain nonmaskable interrupts such as a reset (reset is given the highest priority) and watchdog timer
interrupt have their priority levels set in hardware. Figure 1.9.8 lists the hardware priority levels of these
interrupts.
Software interrupts are not subjected to interrupt priority. They always cause control to branch to an
interrupt routine whenever the relevant instruction is executed.
_______
Reset > NMI > Watchdog > Peripheral I/O > Single step > Address match
96
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
DMA0
Reset
UART3 reception/ACK
UART4 transmission/NACK
UART4 reception/ACK
Low
Priority of peripheral I/O interrupts
(if priority levels are same)
97
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
______
INT Interrupts
________ ________
INT0 to INT5 are external input interrupts. The level sense/edge sense switching bits of the interrupt control
register select the input signal level and edge at which the interrupt can be set to occur on input signal level
and input signal edge. The polarity bit selects the polarity.
With the external interrupt input edge sense, the interrupt can be set to occur on both rising and falling
edges by setting the INTi interrupt polarity switch bit of the interrupt request select register (address
031F16) to “1”. When you select both edges, set the polarity switch bit of the corresponding interrupt control
register to the falling edge (“0”).
When you select level sense, set the INTi interrupt polarity switch bit of the interrupt request select register
(address 031F16) to “0”.
Figure 1.9.10 shows the interrupt request select register.
AAA
External interrupt request cause select register
b7 b6 b5 b4 b3 b2 b1 b0
AA
A R W
AA
A
IFSR0 INT0 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
AA
A
IFSR1 INT1 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
AA
A
AA
A
select bit (Note) 1 : Both edges
IFSR3 INT3 interrupt polarity 0 : One edge
AA
A
select bit (Note) 1 : Both edges
AA
A
select bit (Note) 1 : Both edges
AA
A
IFSR5 INT5 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
AA
A
IFSR6 UART0/3 interrupt 0 : UART3 bus collision /start,stop
cause select bit detect/false error detect
1 : UART0 bus collision /start,stop
AA
A
detect/false error detect
AA
A
IFSR7 UART1/4 interrupt 0 : UART4 bus collision /start,stop
cause select bit detect/false error detect
1 : UART1 bus collision /start,stop
detect/false error detect
98
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
______
NMI Interrupt
______ ______ ______
An NMI interrupt is generated when the input to the P85/NMI pin changes from “H” to “L”. The NMI interrupt
is a non-maskable external interrupt. The pin level can be checked in the port P85 register (bit 5 at address
03C416).
This pin cannot be used as a normal port input.
Notes:
______ ______ ______
When not intending to use the NMI function, be sure to connect the NMI pin to VCC (pulled-up). The NMI
interrupt is non-maskable. Because it cannot be disabled, the pin must be pulled up.
P107/KI3
Pull-up
transistor Port P105 direction
register
P105/KI1
P104/KI0
99
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
AAAAAAAAAAAAAA
AIER 000916 XXXX00002
AAAAAAAAAAAAAA
AA
A
Bit symbol Bit name Function RW
AAAAAAAAAAAAAA
AA
A
enable bit 1 : Interrupt enabled
AAAAAAAAAAAAAA
AA
A
AIER1 Address match interrupt 1 0 : Interrupt disabled
enable bit 1 : Interrupt enabled
AAAAAAAAAAAAAA
AA
A
AIER2 Address match interrupt 2 0 : Interrupt disabled
enable bit 1 : Interrupt enabled
AAAAAAAAAAAAAA
AA
A
AIER3 Address match interrupt 3 0 : Interrupt disabled
AAAAAAAAAAAAAA
enable bit 1 : Interrupt enabled
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Function
Address setting register for address match
interrupt
00000016 to FFFFFF16
AAA
Values that can be set R W
100
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
AAA
AAA
"0"
AAA
D Q "1" Interrupt
Interrupt request A R enable bit A
AAA
Write "0" to interrupt Interrupt
request flag A request bit
"0"
AAA
D Q
R
D Q "1" Interrupt
enable bit B
AAA
Interrupt request B R
Cleared when
Write "0" to interrupt an Interrupt
request flag B
AAA
request
received
"0"
Interrupt request n
Write "0" to interrupt
request flag n
AAA
AAA
D
R
Q
Interrupt request
latch bit
n=A to L
When using the intelligent I/O or CAN interrupt as an starting factor for DMA II, the interrupt latch bit must be
set to "0" in order to enable only the interrupt request factor used by the interrupt enable register.
101
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Bit
symbol Bit name Function R W
Nothing is assigned.
When write, set "0". When read, the content is indeterminate.
102
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Bit
symbol Bit name Function R W
103
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
_______
(3) The NMI interrupt
_______
• As for the NMI interrupt pin, this interrupt cannot be disabled. Connect it to the Vcc pin via a pull-up
resistor if unused.
_______
• The NMI pin also serves as P85, which is exclusively input. Reading the contents of the P8 register
allows reading the pin value. Use the reading of this pin only for establishing the pin level at the time
_______
when the NMI interrupt is input.
_______
• A low level signal with more than 1 clock cycle (BCLK) is necessary for NMI pin.
104
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
• When the polarity of the INT0 to INT5 pins is changed, the interrupt request bit is sometimes set to "1".
After changing the polarity, set the interrupt request bit to "0". Figure 1.9.12 shows the procedure for
______
changing the INT interrupt generate factor.
______
Figure 1.9.16. Switching condition of INT interrupt request
105
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Watchdog Timer
Watchdog Timer
The watchdog timer has the function of detecting when the program is out of control. The watchdog timer is
a 15-bit counter which down-counts the clock derived by dividing the BCLK using the prescaler. Whether a
watchdog timer interrupt is generated or reset is selected when an underflow occurs in the watchdog timer.
Watchdog timer interrupt is selected when bit 6 (CM06) of the system control register 0 (address 000816) is
"0" and reset is selected when CM06 is "1". No value other than "1" can be written in CM06. Once reset is
selected (CM06="1"), watchdog timer interrupt cannot be selected by software.
When XIN is selected for the BCLK, bit 7 (WDC7) of the watchdog timer control register (address 000F16)
selects the prescaler division ratio (by 16 or by 128). When XCIN is selected as the BCLK, the prescaler is
set for division by 2 regardless of WDC7. Therefore, the watchdog timer cycle can be calculated as follows.
However, errors can arise in the watchdog timer cycle due to the prescaler.
For example, when BCLK is 20MHz and the prescaler division ratio is set to 16, the monitor timer cycle is
approximately 26.2 ms, and approximately 17.5 ms when BCLK is 30MHz.
The watchdog timer is initialized by writing to the watchdog timer start register (address 000E16) and when
a watchdog timer interrupt request is generated. The prescaler is initialized only when the microcomputer is
reset. After a reset is cancelled, the watchdog timer and prescaler are both stopped. The count is started by
writing to the watchdog timer start register (address 000E16). CM06 is initialized only at reset. After reset,
watchdog timer interrupt is selected.
The watchdog timer and the prescaler stop in stop mode, wait mode and hold status. After exiting these
modes and status, counting starts from the previous value.
In the stop mode, wait mode and hold state, the watchdog timer and prescaler are stopped. Counting is
resumed from the held value when the modes or state are released. Figure 1.10.1 shows the block diagram
of the watchdog timer. Figure 1.10.2 and 1.10.3 show the watchdog timer-related registers.
Prescaler
“CM07 = 0”
“WDC7 = 0” "CM06=0"
1/16 Watchdog timer
interrupt request
“CM07 = 0”
BCLK “WDC7 = 1”
1/128 Watchdog timer
HOLD
“CM07 = 1” "CM06=1"
1/2 Reset
RESET
106
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Watchdog Timer
Bit
symbol Bit name Function R W
Function R W
The watchdog timer is initialized and starts counting after a write
instruction to this register. The watchdog timer value is always initialized
to "7FFF16" regardless of the value written.
107
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Watchdog Timer
AA RW
AA
name b1 b0
CM00 Clock output function 0 0 : I/O port P53
select bit (Note 2) 0 1 : fC output
CM01 1 0 : f8 output
1 1 : f32 output
AA
CM02 WAIT peripheral 0 : Do not stop peripheral clock
function clock stop bit in wait mode
1 : Stop peripheral clock in
wait mode (Note 3)
A A
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
A A
CM04 Port XC select bit 0 : I/O port
1 : XCIN-XCOUT generation (Note 4)
A A
CM05 Main clock (XIN-XOUT) 0 : Main clock On
stop bit (Note 5) 1 : Main clock Off (Note 6)
A
AA
Watchdog timer 0 : Watchdog timer interrupt
CM06
function select bit 1 : Reset (Note 7)
A
AA
System clock select bit 0 : XIN, XOUT
CM07 (Note 8) 1 : XCIN, XCOUT
Note 1: Set bit 0 of the protect register (address 000A16) to “1” before writing to this register.
Note 2: The port P53 dose not function as an I/O port in microprocessor or memory expansion
mode.
When outputting ALE to P53 (bits 5 and 4 of processor mode register 0 is "01"), set
these bits to "00".
The port P53 function is not selected, even when you set "00" in microprocessor or
memory expansion mode and bit 7 of the processor mode register 0 is "1".
Note 3: fc32 is not included. When this bit is set to "1", PLL cannot be used in WAIT.
Note 4: When XcIN-XcOUT is used, set port P86 and P87 to no pull-up resistance with the input
port.
Note 5: When entering the power saving mode, the main clock is stopped using this bit. To stop
the main clock, set system clock stop bit (CM07) to "1" while an oscillation of sub clock is
stable. Then set this bit to "1".
When XIN is used after returning from stop mode, set this bit to "0".
When this bit is "1", XOUT is "H". Also, the internal feedback resistance remains ON, so
XIN is pulled up to XOUT ("H" level) via the feedback resistance.
Note 6: When the main clock is stopped, the main clock division register (address 000C16) is set
to the division by 8 mode.
However, in ring oscillator mode, the main clock division register is not set to the division
by 8 mode when XIN-XOUT is stopped by this bit.
Note 7: When "1" has been set once, "0" cannot be written by software.
Note 8: Set this bit "0" to "1" when sub clock oscillation is stable by setting CM04 to "1".
Set this bit "1" to "0" when main clock oscillation is stable by setting CM05 to "0".
Do not set CM04 and CM05 simultaneously.
108
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
DMAC
This microcomputer has four DMAC (direct memory access controller) channels that allow data to be sent
to memory without using the CPU. DMAC is a function that transmit delete data of a source address (8 bits
/16 bits) to a destination address when transmission request occurs. When using three or more DMAC
channels, the register bank 1 and high-speed interrupt register are used as DMAC registers. If you are
using three or more DMAC channels, you cannot use high-speed interrupts. The CPU and DMAC use the
same data bus, but the DMAC has a higher bus access privilege than the CPU, and because of the use of
cycle-steeling, operations are performed at high-speed from the occurrence of a transfer request until one
word (16 bits) or 1 byte (8 bits) of data have been sent. Figure 1.11.1 shows the mapping of registers used
by the DMAC. Table 1.11.1 shows DMAC specifications. Figures 1.11.2 to 1.11.5 show the structures of the
registers used.
As the registers shown in Figure 1.11.1 are allocated in the CPU, use LDC instruction when writing. When
writing to DCT2, DCT3, DRC2, DRC3, DMA2 and DMA3, set register bank select flag (B flag) to "1" and use
MOV instruction to set R0 to R3, A0 and A1 registers. When writing to DSA2 and DSA3, set register bank
select flag (B flag) to "1" and use LDC instruction to set SB and FB registers.
DRC0
DMA 0, 1 transfer count reload register
DRC1
DMA0
DMA 0, 1 memory address register
DMA1
DSA0
DMA 0, 1 SFR address register
DSA1
DRA0
DMA 0, 1 memory address reload register
DRA1
When using three or more DMAC channels When using three or more DMAC channels
The register bank 1 is used as a DMAC register The high-speed interrupt register is used as a DMAC
register
DCT2 (R0) DMA2 transfer count register SVF Flag save register
DCT3 (R1) DMA3 transfer count register DRA2 (SVP) DMA2 memory address reload register
DRC2 (R2) DMA2 transfer count reload register DRA1 (VCT) DMA3 memory address reload register
DRC3 (R3) DMA3 transfer count reload register
In addition to writing to the software DMA request bit to start DMAC transfer, the interrupt request signals
output from the functions specified in the DMA request factor select bits are also used. However, in contrast
to the interrupt requests, repeated DMA requests can be received, regardless of the interrupt flag.
(Note, however, that the number of actual transfers may not match the number of transfer requests if the
DMA request cycle is shorter than the DMR transfer cycle. For details, see the description of the DMAC
request bit.)
109
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
110
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
Bit
symbol Bit name Function R W
DSEL0
DSEL1
DSEL4
0 : Not requested
DRQ DMA request bit
(Note 2, 3) 1 : Requested
Note 1: Set DMA inhibit before changing the DMA request cause. Set DRQ bit to "1" simultaneously.
e.g.) MOV.B #083h, DMiSL ; Set timer A0
Note 2: When setting DSR to "1", set DRQ bit to "1" using OR instruction etc. simultaneously.
e.g.) OR.B #0A0h, DMiSL
Note 3: Do not write "0" to this bit. There is no need to clear the DMA request bit.
111
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
1 1 0 1 0 Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt
control register 1 control register 8 control register 3 control register 10
1 1 0 1 1 Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt
control register 2 control register 9 control register 4 control register 11
1 1 1 0 0 Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt
control register 3 control register 10 control register 5 control register 0
1 1 1 0 1 Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt
control register 4 control register 11 control register 6 control register 1
1 1 1 1 0 Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt
control register 5 control register 0 control register 7 control register 2
1 1 1 1 1 Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt Intelligent I/O interrupt
control register 6 control register 1 control register 8 control register 3
Note 1: When INT3 pin is data bus in microprocessor mode, INT3 edge cannot be used as DMA3 request cause.
Note 2: UARTi receive /ACK switched by setting of UARTi special mode register and UARTi special mode
register 2 (i=0 to 3)
112
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
AA
Bit symbol Bit name Function R W
A A
Channel 0 transfer b1 b0
MD00 0 0 : DMA inhibit
mode select bit
0 1 : Single transfer
AA
MD01 1 0 : Must not be set
1 1 : Repeat transfer
A
AA
BW0 Channel 0 transfer 0 : 8 bits
unit select bit 1 : 16 bits
A
AA
RW0 Channel 0 transfer 0 : Fixed address to memory (forward direction)
direction select bit 1 : Memory (forward direction) to fixed address
A
AA
b5 b4
MD10 Channel 1 transfer
0 0 : DMA inhibit
A A
mode select bit
0 1 : Single transfer
MD11 1 0 : Must not be set
A A
1 1 : Repeat transfer
AA
unit select bit 1 : 16 bits
RW1 Channel 1 transfer 0 : Fixed address to memory (forward direction)
direction select bit 1 : Memory (forward direction) to fixed address
A A
Bit symbol Bit name Function R W
Channel 2 transfer b1 b0
MD20
AA
mode select bit 0 0 : DMA inhibit
0 1 : Single transfer
MD21 1 0 : Must not be set
A A
1 1 : Repeat transfer
AA
BW2
unit select bit 1 : 16 bits
A A
RW2 Channel 2 transfer 0 : Fixed address to memory (forward direction)
direction select bit 1 : Memory (forward direction) to fixed address
A A
MD30 Channel 3 transfer b5 b4
mode select bit 0 0 : DMA inhibit
0 1 : Single transfer
A
AA
MD31 1 0 : Must not be set
1 1 : Repeat transfer
A
AA
BW3 Channel 3 transfer 0 : 8 bits
unit select bit 1 : 16 bits
A
AA
RW3 Channel 3 transfer 0 : Fixed address to memory (forward direction)
direction select bit 1 : Memory (forward direction) to fixed address
113
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
AA
Function Setting range R W
Note 1: When "0" is set to this register, data transfer is not done even if DMA
is requested.
Note 2: Use LDC instruction to write to this register.
Note 3: When setting DCT2 and DCT3, set "1" to the register bank select flag
(B flag) of flag register (FLG), then set desired value to R0 and R1 of
register bank 1. Use MOV instruction to write to this register.
AA
A
Function Setting range RW
Note 2: When setting DRC2 and DRC3, set "1" to the register bank select
A
AA
flag (B flag) of flag register (FLG), then set desired value to R2 and
R3 of register bank 1. Use MOV instruction to write to this register.
114
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
Function
00000016 to FFFFFF16
(16 Mbytes area)
AA
A
R W
A
AA
Note 1: When the transfer direction select bit is "0" (fixed address to memory), this register
is destination memory address.
When the transfer direction select bit is "1" (memory to fixed address), this register
is source memory address.
Note 2: Use LDC instruction to write to this register.
Note 3: When setting DMA2 and DMA3, set "1" to the register bank select flag (B flag) of
flag register (FLG), and set desired value to A0 and A1 of register bank 1. Use
MOV instruction to write to this register.
AA
Function Setting range RW
00000016 to FFFFFF16
Set source or destination fixed address (16 Mbytes area)
(Note 1)
Note 1: When the transfer direction select bit is "0" (fixed address to memory), this register
is source fixed address.
When the transfer direction select bit is "1" (memory to fixed address), this register
is destination fixed address.
Note 2: Use LDC instruction to write to this register.
Note 3: When setting DSA2, set "1" to the register bank select flag (B flag) of flag register
(FLG), and set desired value to SB of register bank 1. Use LDC instruction to write
to this register.
Note 4: When setting DSA3, set "1" to the register bank select flag (B flag) of flag register
(FLG), and set desired value to FB of register bank 1. Use LDC instruction to write
to this register.
AA
Function Setting range R W
115
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
Figure 1.11.6 shows the example of the transfer cycles for a source read. Figure 1.11.6 shows the desti-
nation is external area, the destination write cycle is shown as two cycle (one bus cycle) and the source
read cycles for the different conditions. In reality, the destination write cycle is subject to the same condi-
tions as the source read cycle, with the transfer cycle changing accordingly. When calculating the transfer
cycle, remember to apply the respective conditions to both the destination write cycle and the source read
cycle. For example (2) in Figure 1.11.6, if data is being transferred in 16-bit units on an 8-bit bus, two bus
cycles are required for both the source read cycle and the destination write cycle.
116
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
BCLK
Address
CPU use Source Destination CPU use
bus
RD signal
WR signal
Data
CPU use Source Destination CPU use
bus
(2) •When 16-bit data is transferred and the source address is odd
•When 16-bit data is transferred and the width of data bus at the source is 8-bit
(When the width of data bus at the destination is 8-bit, there are also two destination write cycles).
BCLK
Address
CPU use Source Source + 1 Destination CPU use
bus
RD signal
WR signal
(3) •When one wait is inserted into the source read under the conditions in (1)
BCLK
RD signal
WR signal
Data
CPU use Source Destination CPU use
bus
(4) •When one wait is inserted into the source read under the conditions in (2)
(When 16-bit data is transferred and the width of data but at the destination is 8-bit, there are
two destination write cycles).
BCLK
Address
CPU use Source Source + 1 Destination CPU use
bus
RD signal
WR signal
Data
CPU use Source Source + 1 Destination CPU use
bus
Note: The same timing changes occur with the respective conditions at the destination as at the source.
117
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
No. of transfer cycles per transfer unit = No. of read cycles x j + No. of write cycles x k
Coefficient j, k
Coefficient j Coefficient k
Internal memory Internal ROM/RAM No wait 1 1
Internal ROM/RAM One wait 2 2
SFR area 2 2
External memory Separate bus No wait 1 2
Separate bus One wait 2 2
Separate bus Two waits 3 3
Separate bus Three waits 4 4
Multiplex bus 3 3
118
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
(3) Relationship between external factor request input and DMAi request bits, and DMA transfer timing
When the request inputs to DMAi occur in the same sampling cycle (between the falling edge of BCLK
and the next falling edge), the DMAi request bits are set simultaneously, but if the DMAi enable bits
are all set, DMA0 takes priority and the transfer starts. When one transfer unit is complete, the bus
privilege is returned to the CPU. When the CPU has completed one bus access, DMA1 transfer starts,
and, when one transfer unit is complete, the privilege is again returned to the CPU.
The priority is as follows: DMA0 > DMA1 > DMA2 > DMA3.
Figure 1.11.7. DMA transfer example by external factors shows what happens when DMA0 and DMA1
requests occur in the same sampling cycle.
In this example, DMA transfer request signals are input simultaneously from
external factors and the DMA transfers are executed in the minimum cycles.
BCLK
DMA0 AAA
AAA AAA
DMA1
A AAA AA Bus
CPU
INT0
AA
AAAAAAA
A
AA
A AAA AAAA priviledge
acquired
DMA0
request bit
INT1
DMA1
request bit
119
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
(2) When DMA transfer is done by a software trigger, set DSR and DRQ of the DMAi request cause select
register to "1" simultaneously using the OR instruction.
e.g.) OR.B #0A0h, DMiSL ; DMiSL is DMAi request cause select register
(3) When changing the DMAi request cause select bit of the DMAi request cause select register, set "1" to
the DMA request bit, simultaneously. In this case, the corresponding DMA channel is set to disabled. At
least 8 + 6 x N (N: enabled channel number) clock cycles are needed from the instruction to write to the
DMAi request cause select bit to enable DMA.
e.g.) When DMA request cause is changed to timer A0 and using DMA0 in single transfer after
DMA initial setting
push.w R0 ; Store R0 register
stc DMD0, R0 ; Read DMA mode register 0
and.b #11111100b, R0L ; Clear DMA0 transfer mode select bit to "00"
ldc R0, DMD0 ; DMA0 disabled
mov.b #10000011b, DM0SL ; Select timer A0
; (Write "1" to DMA request bit simultaneously)
nop At least 8 + 6 x N cycles
: (N: enabled channel number)
ldc R0, DMD0 ; DMA0 enabled
pop.w R0 ; Restore R0 register
120
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
DMAC II
When requested by an interrupt from any peripheral I/O, the DMAC performs a memory-to-memory trans-
fer, an immediate data transfer, or an arithmetic transfer (to transfer the sum of two data added).
Specifications of DMAC II are shown in Table 1.12.1.
Causes to activate DMAC II Interrupt request from any peripheral I/O whose interrupt priority is set to
"level 7" by the Interrupt Control Register
Chained transfer function Parameters (transfer count, transfer address, and other information)
are switched over when the transfer counter reaches zero.
Interrupt at end of transfer Interrupt is generated when the transfer counter reaches zero.
Multiple transfer function Multiple data transfers can be performed by one DMA II transfer request generated.
Note : When transfer unit is 16 bits and destination address is 0FFFF16, data is transfered to addresses
0FFFF16 and 1000016. When source address is 0FFFF16, data is transfered as in the previous.
Settings of DMAC II
DMAC II can be enabled for use by setting up the following registers and tables.
• Exit Priority Register (address 009F16)
• DMAC II Index
• Interrupt Control Register for the peripheral I/O that requests a transfer by DMAC II
• Relocatable Vector Table for the peripheral I/O that requests a transfer by DMAC II
• When using an intelligent I/O or CAN interrupt, Interrupt Enable Register’s interrupt request latch bit
(bit 0)
121
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
Bit
symbol Bit name Function R W
b2 b1 b0
RLVL0 0 0 0 : Level 0
Interrupt priority set bits 0 0 1 : Level 1
for exiting Stop/Wait 0 1 0 : Level 2
RLVL1 state 0 1 1 : Level 3
(Note 1) 1 0 0 : Level 4
1 0 1 : Level 5
RLVL2 1 1 0 : Level 6
1 1 1 : Level 7
Nothing is assigned.
When write, set "0". When read, its content is indeterminate.
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note 1: Exits the Stop or Wait mode when the requested interrupt priority level is higher than
that set in the exit priority register.
Set to the same value as the processor interrupt priority level (IPL) set in the flag
register (FLG).
Note 2: The high-speed interrupt can only be specified for interrupts with interrupt priority level
7. Specify interrupt priority level 7 for only one interrupt.
Note 3: Do not set this bit to 0 after once setting it to 1.
When this bit is 1, do not set the high-speed interrupt select bit to 0. (This cannot be
used simultaneously with the high-speed interrupt.)
Transfers by DMAC II are unaffected by the interrupt enable flag (I flag) and processor
interrupt priority level (IPL).
122
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
BASE + 14 End-of-transfer interrupt address (IADR0) (Note3) BASE + 28 Transfer source address (SADR7)
BASE + 16 End-of-transfer interrupt address (IADR1) (Note3) BASE + 30 Transfer destination address (DADR7)
Note 1: Delete this data when not using the arithmetic transfer function.
Note 2: Delete this data when not using the chained transfer function.
Note 3: Delete this data when not using an end-of-transfer interrupt.
123
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
Transfer mode(MOD)
b15 b8
(b7) (b0)b7 b0
Multiple transfer
MULT 0: Not multiple transfer 1: Multiple transfer
select bit
124
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
Operation of DMAC II
The DMAC II function is selected by setting the DMAC II select bit (bit 5 at address 009F16) to 1. All
peripheral I/O interrupt requests which have had their interrupt priorities set to “level 7” by the Interrupt
Control Register comprise DMAC II interrupt requests. These interrupt requests (priority level = 7) do not
generate an interrupt, however.
When an interrupt request is generated by any peripheral I/O whose interrupt priority is set to “level 7,”
DMAC II is activated no matter which state the I flag and processor interrupt priority level(IPL) is in. If an
_______
interrupt request with higher priority than that (e.g., NMI or watchdog timer) occurs, this higher priority
interrupt has precedence over and is accepted before DMAC II transfers. The pending DMAC II transfer
is started after the interrupt processing sequence for that interrupt finishes.
Transfer data
DMAC II transfers data in units of 8 or 16 bits as described below.
• Memory-to-memory transfer: Data is transferred from any memory location in the 64-Kbyte space to
any memory location in the same space.
• Immediate data transfer: Data is transferred as immediate data to any memory location in the 64-
Kbyte space.
• Arithmetic transfer: Two 8 or16 bits of data are added together and the result is transferred to any
memory location in the 64-Kbyte space.
When transfer unit is 16 bits and destination address is 0FFFF16, data is transfered to addresses
0FFFF16 and 1000016. When source address is 0FFFF16, data is transfered as in the previous.
125
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
Transfer modes
DMAC II supports single and burst transfers. Use the burst transfer select bit (bit 5) for transfer mode
setup in the DMAC II index to choose single or burst transfer mode. Use the DMAC II index transfer
counter to set the number of times a transfer is performed. Neither single transfer nor burst transfer is
performed if the value “000016” is set in the transfer counter.
126
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
Before the chained transfer function can be used, the relocatable vector table must be located in the
RAM area.
127
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC II
Execution time
The number of DMAC II execution cycles is calculated by the equation below.
The above equation applies only when all of the following conditions are met, however.
• No bus wait states are inserted.
• The DMAC II Index is set to an even address.
• During word transfer, the transfer source address, transfer destination address, and operation address
all are set to an even address.
Note that the first instruction in end-of-transfer interrupt processing is executed 7 cycles after DMAC II
transfers are completed.
When using an end-of-transfer interrupt (transfer counter = 2) after performing a memory to memory
single transfer twice from a variable source address to a fixed destination address, with the chained
transfer function unselected
128
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer
Timer
There are eleven 16-bit timers. These timers can be classified by function into timers A (five) and timers B
(six). All these timers function independently. Figures 1.13.1 and 1.13.2 show the block diagram of timers.
Clock prescaler
XIN f1 XCIN 1/32 fC32
1/8 f8 Reset
Clock prescaler reset flag (bit 7
at address 034116) set to “1”
1/2n f2n
(n = 0 to 15
Count source however, no division when n=0)
prescaler register
f1 f8 f2n fC32
• Timer mode
• One-shot mode
• PWM mode
Timer A0 interrupt
Timer A0
TA0IN Noise
filter • Event counter mode
• Timer mode
• One-shot mode
• PWM mode
Timer A1 interrupt
Noise
Timer A1
TA1IN filter
• Event counter mode
• Timer mode
• One-shot mode
• PWM mode
Timer A2 interrupt
Noise
Timer A2
TA2IN filter
• Event counter mode
• Timer mode
• One-shot mode
• PWM mode
Timer A3 interrupt
Noise
Timer A3
TA3IN filter
• Event counter mode
• Timer mode
• One-shot mode
• PWM mode
Timer A4 interrupt
Noise
Timer A4
TA4IN filter
• Event counter mode
Timer B2 overflow
129
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer
Clock prescaler
XIN f1 XCIN 1/32 fC32
1/8 f8 Reset
Clock prescaler reset flag (bit 7
at address 034116) set to “1”
1/2n f2n
(n = 0 to 15
Count source however, no division when n=0)
prescaler register
f1 f8 f2n fC32
Timer B2 overflow (to timer A count source)
• Timer mode
• Pulse width measuring mode
Noise
Timer B0 interrupt
TB0IN filter Timer B0
• Event counter mode
• Timer mode
• Pulse width measuring mode Timer B1 interrupt
TB1IN Noise Timer B1
filter
• Event counter mode
• Timer mode
• Pulse width measuring mode Timer B2 interrupt
Noise
TB2IN filter Timer B2
• Event counter mode
• Timer mode
• Pulse width measuring mode
Noise
Timer B3 interrupt
TB3IN filter Timer B3
• Event counter mode
• Timer mode
• Pulse width measuring mode Timer B4 interrupt
TB4IN Noise Timer B4
filter
• Event counter mode
• Timer mode
• Pulse width measuring mode Timer B5 interrupt
Noise
TB5IN filter Timer B5
• Event counter mode
130
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
Timer A
Figure 1.14.1 shows the block diagram of timer A. Figures 1.14.2 to 1.14.6 show the timer A-related registers.
Except in event counter mode, timers A0 through A4 all have the same function. Use the timer Ai mode
register (i = 0 to 4) bits 0 and 1 to choose the desired mode.
Timer A has the four operation modes listed as follows:
• Timer mode: The timer counts an internal count source.
• Event counter mode: The timer counts pulses from an external source or a timer over flow.
• One-shot timer mode: The timer outputs one effective pulse until the count reaches “000016”.
• Pulse width modulation (PWM) mode: The timer outputs pulses of a given width.
AAAA
Clock source
selection • Timer
Data bus low-order bits
AAAAA
f1 • One shot Low-order High-order
• PWM
f8 8 bits 8 bits
A
f32 • Timer Reload register (16)
(gate function)
fC32
A
• Event counter
Polarity Counter (16)
selection Up count/down count
TAiIN Clock selection
(i = 0 to 4) Always down count except
Count start flag in event counter mode
(Address 034016)
TAi Addresses TAj TAk
Down count Timer A0 034716 034616 Timer A4 Timer A1
TB2 overflow Timer A1 034916 034816 Timer A0 Timer A2
External Up/down flag Timer A2 034B16 034A16 Timer A1 Timer A3
TAj overflow trigger Timer A3 034D16 034C16 Timer A2 Timer A4
(j = i – 1. Note, however, that j = 4 when i = 0) (Address 034416) Timer A4 034F16 034E16 Timer A3 Timer A0
TAk overflow
(k = i + 1. Note, however, that k = 0 when i = 4)
131
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
Event counter
mode 16-bit counter (set to dividing ratio) 000016 to FFFF16
(Note 2)
One-shot timer 16-bit counter (set to one shot width) 000016 to FFFF16
mode (Note 6) (Note 3)
Pulse width 16-bit pulse width modulator
modulation mode (set to PWM pulse “H” width) 000016 to FFFE16
(16-bit PWM) (Note 4, 7) (Note 3)
132
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
133
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
AA
A
Bit symbol Bit name Function R W
Timer A0 up/down flag 0 : Down count
AA
A
TA0UD
1 : Up count (Note 2)
AA
A
TA1UD Timer A1 up/down flag 0 : Down count
1 : Up count (Note 2)
AA
A
TA2UD Timer A2 up/down flag 0 : Down count
1 : Up count (Note 2)
AA
A
TA3UD Timer A3 up/down flag 0 : Down count
1 : Up count
AA
A
(Note 2)
A
1 : Up count (Note 2)
Timer A2 two-phase pulse 0 : two-phase pulse signal
TA2P signal processing select bit processing disabled
1 : two-phase pulse signal
A
processing enabled (Note 3)
Timer A3 two-phase pulse 0 : two-phase pulse signal
TA3P signal processing select bit processing disabled
1 : two-phase pulse signal
A
processing enabled (Note 3)
Timer A4 two-phase pulse 0 : two-phase pulse signal
TA4P signal processing select bit processing disabled
1 : two-phase pulse signal
processing enabled (Note 3)
Note 1: Use MOV instruction to write to this register.
Note 2: This specification becomes valid when the up/down flag content is selected for up/down switching cause.
Note 3: When not using the two-phase pulse signal processing function, set the select bit to “0”.
AA
A
Bit symbol Bit name Function RW
TA0OS Timer A0 one-shot start flag 0 : Invalid
AA
A
1 : Timer start (Note 1)
TA1OS Timer A1 one-shot start flag 0 : Invalid
AA
A
1 : Timer start (Note 1)
TA2OS Timer A2 one-shot start flag 0 : Invalid
AA
A
1 : Timer start (Note 1)
AA
A
TA3OS Timer A3 one-shot start flag 0 : Invalid
1 : Timer start (Note 1)
AA
A
TA4OS Timer A4 one-shot start flag 0 : Invalid
1 : Timer start (Note 1)
AA
A
TAZIE Z phase input enable bit 0 : Invalid
1 : Valid
AA
A
TA0TGL Timer A0 event/trigger b7 b6
AA
A
0 1 : TB2 overflow is selected
TA0TGH 1 0 : TA4 overflow is selected
1 1 : TA1 overflow is selected
134
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
A
b1 b0
TA1TGL Timer A1 event/trigger
0 0 : Input on TA1IN is selected (Note)
A
select bit
0 1 : TB2 overflow is selected
TA1TGH 1 0 : TA0 overflow is selected
A
1 1 : TA2 overflow is selected
Timer A2 event/trigger b3 b2
A
TA2TGL 0 0 : Input on TA2IN is selected (Note)
select bit
0 1 : TB2 overflow is selected
A
TA2TGH 1 0 : TA1 overflow is selected
1 1 : TA3 overflow is selected
A
Timer A3 event/trigger b5 b4
TA3TGL 0 0 : Input on TA3IN is selected (Note)
select bit
A
0 1 : TB2 overflow is selected
TA3TGH 1 0 : TA2 overflow is selected
1 1 : TA4 overflow is selected
TA4TGL
TA4TGH
Timer A4 event/trigger
select bit
b7 b6
0 0 : Input on TA4IN is selected (Note)
0 1 : TB2 overflow is selected
1 0 : TA3 overflow is selected
1 1 : TA0 overflow is selected
A
A
Note: Set the corresponding port function select register A to I/O port, and port direction register to “0”.
Nothing is assigned.
When write, set “0”. When read, their contents are
indeterminate.
A
A
CPSR Clock prescaler reset flag 0 : Ignored
1 : Prescaler is reset
(When read, the value is “0”)
135
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
A
RW
AA
b3 b2 b1 b0
CNT0 Count value set bits 0 0 0 0 : No division
0 0 0 1 : Division by 2
CNT1 0 0 1 0 : Division by 4
0 0 1 1 : Division by 6
A
(Note 1)
CNT2
1 1 0 1 : Division by 26
CNT3 1 1 1 0 : Division by 28
1 1 1 1 : Division by 30
Nothing is assigned.
When write, set “0”. When read, their contents are
indeterminate.
Note 1: Set count start bit to “0” before writing to count value set bits.
0 : Stops counting
1 : Starts counting (Note 2) A
Note 2: When this bit is set to “0”, divider circuit is inactive.
136
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
137
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
Table 1.14.2. Timer specifications in event counter mode (when not processing two-phase pulse signal)
Item Specification
Count source • External signals input to TAiIN pin (effective edge can be selected by software)
• TB2 overflows or underflows, TAj overflows or underflows
Count operation • Up count or down count can be selected by external signal or software
• When the timer overflows or underflows, it reloads the reload register contents
before continuing counting (Note)
Divide ratio • 1/ (FFFF16 - n + 1) for up count
• 1/ (n + 1) for down count n : Set value
Count start condition Count start flag is set (= 1)
Count stop condition Count start flag is reset (= 0)
Interrupt request generation timing The timer overflows or underflows
TAiIN pin function Programmable I/O port or count source input
TAiOUT pin function Programmable I/O port, pulse output, or up/down count select input (Setting by corre-
sponding function select registers A, B and C)
Read from timer Count value can be read out by reading timer Ai register
Write to timer • When counting stopped
When a value is written to timer Ai register, it is written to both reload register and
counter
• When counting in progress
When a value is written to timer Ai register, it is written to only reload register
(Transferred to counter at next reload time)
Select function • Free-run count function
Even when the timer overflows or underflows, the reload register content is not
reloaded to it
• Pulse output function
Each time the timer overflows or underflows, the TAiOUT pin’s polarity is reversed
Note: This does not apply when the free-run function is selected.
138
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
Function Function
Bit (When not using two-phase
Bit name (When using two-phase R W
symbol pulse signal processing) pulse signal processing)
Two-phase pulse
0 (Set to “0” when not 0 : Normal processing
TCK1 signal processing operation
operation select using two-phase pulse
1 : Multiply-by-4
bit (Note 4,Note 5) signal processing) processing operation
Note 1: Count source is select by the event/trigger select bit (addresses 034216, 034316) in event counter mode.
Note 2: This bit is valid when only counting an external signal.
Note 3: Set the corresponding function select register A to I/O port, and port direction register to “0”.
Signal of TAiOUT pin counts down at the time of “L” and counts up at the time of “H”.
Note 4: This bit is valid for timer A3 mode register.
Timer A0 and A1 can be “0” or “1”.
Timer A2 is fixed to normal processing operation and timer A4 is fixed to multiply-by-4
processing operation.
Note 5: When performing two-phase pulse signal processing, make sure the two-phase pulse
signal processing operation select bit (address 034416) is set to “1”. Also, always be
sure to set the event/trigger select bit (address 034316) to “00”.
139
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
TAiOUT
TAiIN
(i=2,3) Up Up Up Down Down Down
count count count count count count
• Multiply-by-4 processing operation (TimerA3 and timer A4)
If the phase relationship is such that the TAiIN pin goes “H” when the input signal on
the TAiOUT pin is “H”, the timer counts up rising and falling edges on the TAiOUT and
TAiIN pins. If the phase relationship is such that the TAiIN pin goes “L” when the input
signal on the TAiOUT pin is “H”, the timer counts down rising and falling edges on the
TAiOUT and TAiIN pins.
TAiOUT
TAiIN
(i=3,4)
(when processing two-phase pulse signal with timers A2, A3, and A4)
Note 1: This does not apply when the free-run function is selected.
Note 2: Timer A3 is selectable. Timer A2 is fixed to normal processing operation and timer A4 is fixed to
multiply-by-4 operation.
140
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
TA3OUT
(A phase)
TA3IN
(B phase)
Count source
INT2 (Note)
(Z phase)
The pulse must be wider than this width. Note: When the rising edge of INT2 is selected.
Figure 1.14.9. The relationship between the two-phase pulse (A phase and B phase) and the Z phase
TA3OUT
(A phase)
TA3IN
(B phase)
Count source
INT2 (Note)
(Z phase)
Becoming “0” at this timing. Note: When the rising edge of INT2 is selected.
141
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
142
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
AA
A
TAiMR(i=0 to 4) 035616, 035716, 035816, 035916, 035A16 00000X002
AA
A
TMOD0 Operation mode select bit b1 b0
AA
A
Port output control is set by the function select registers A, B and C. – –
AA
A
MR1 External trigger select bit 0 : Falling edge of TAiIN pin's input signal (Note 2)
(Note 1) 1 : Rising edge of TAiIN pin's input signal (Note 2)
AA
A
MR2 Trigger select bit 0 : One-shot start flag is valid
1 : Selected by event/trigger select register
MR3
TCK0
0 (Set to “0” in one-shot timer mode)
143
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
144
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
AA
A
Symbol Address When reset
TAiMR(i=0 to 4) 035616, 035716, 035816, 035916, 035A16 00000X002
AA
A
Bit symbol Bit name Function R W
TMOD0 Operation mode b1 b0
AA
A
Port output control is set by the function select registers A, B and C. – –
MR1 External trigger select bit 0: Falling edge of TAiIN pin's input signal (Note 2)
AA
A
1: Rising edge of TAiIN pin's input signal (Note 2)
(Note 1)
MR2
AA
A
Trigger select bit 0: Count start flag is valid
1: Selected by event/trigger select register
AA
A
MR3 16/8-bit PWM mode 0: Functions as a 16-bit pulse width modulator
select bit 1: Functions as an 8-bit pulse width modulator
AA
A
b7 b6
TCK0 Count source select bit
0 0 : f1
AA
A
0 1 : f8
TCK1 1 0 : f2n (Note 3)
1 1 : fC32
Note 1: Valid only when the TAiIN pin is selected by the event/trigger select bit
(addresses 034216 and 034316). If timer overflow is selected, this bit can be “1” or “0”.
Note 2: Set the corresponding function select register A to I/O port, and port direction register to “0”.
Note 3: n = 0 to 15. n is set by the count source prescaler register (address 035F16).
145
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
Count source
“H”
TAiIN pin
input signal “L”
Trigger is not generated by this signal
1 / fi X n
PWM pulse output “H”
from TAiOUT pin “L”
1 / fi X (m + 1) X (2 8 – 1)
AAAAAAAAAAAAAAA
“L”
1 / fi X (m + 1)
AAAAAAAAAAAAAAA
Underflow signal of “H”
8-bit prescaler (Note2) “L”
1 / fi X (m + 1) X n
fi : Frequency of count source Cleared to “0” when interrupt request is accepted, or cleaerd by software
(f1, f8, f2n, fC32)
146
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
Timer B
Figure 1.15.1 shows the block diagram of timer B. Figures 1.15.2 and 1.15.4 show the timer B-related
registers. Use the timer Bi mode register (i = 0 to 5) bits 0 and 1 to choose the desired mode.
Timer B has three operation modes listed as follows:
Event counter mode 16-bit counter (set to dividing ratio) 000016 to FFFF16
(Note 2)
147
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
148
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
Nothing is assigned.
When write, set "0". When read, its content is indeterminate.
Nothing is assigned.
When write, set “0”. When read, their contents are
indeterminate.
A
A
CPSR Clock prescaler reset flag 0 : Ignored
1 : Prescaler is reset
(When read, the value is “0”)
149
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
b7
AA
A
Timer Bi mode register (i = 0 to 5) (Timer mode)
AA
A
b6 b5 b4 b3 b2 b1 b0
A A
Symbol Address When reset
TBiMR(i=0 to 5) 035B16, 035C16, 035D16, 031B16, 031C16, 031D16 00XX00002
A
AAA
Bit symbol Bit name Function R W
TMOD0 Operation mode select bit
b1 b0
AA
AA
0 0 : Timer mode
TMOD1
MR0 Invalid in timer mode.
AA
MR1 Can be “0” or “1”.
0 (Set to “0” in timer mode) (Note 1)
MR2 (Note 2)
Nothing is assigned. (i = 1, 2, 4, 5)
When write, set "0". When read, its content is indeterminate.
AA
MR3 Invalid in timer mode. When write, set "0". When read in timer
mode, its content is indeterminate.
AA
b7 b6
Count source select bit
TCK0 0 0 : f1
0 1 : f8
TCK1 1 0 : f2n (Note 3)
1 1 : fC32
Note 1: R/W is valid only in timer B0 and timer B3.
Note 2: In timer B1, timer B2, timer B4 and timer B5, nothing is assigned by bit 4(There is not R/W).
When write, set “0”. When read, its content is indeterminate.
Note 3: n = 0 to 15. n is set by the count source prescaler register (address 035F16).
150
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
b7 b6
AA
Timer Bi mode register (i = 0 to 5) (Event counter mode)
AA
b5 b4 b3 b2 b1 b0
Symbol Address When reset
AA
TBiMR(i=0 to 5) 035B16, 035C16, 035D16, 031B16, 031C16, 031D16 00XX00002
A
AA
A
Bit symbol Bit name Function R W
TMOD0 Operation mode b1 b0
AA
select bit 0 1 : Event counter mode
TMOD1
Count polarity select b3 b2
AA
MR0 0 0 : Counts external signal's falling edges
bit
0 1 : Counts external signal's rising edges
1 0 : Counts external signal's falling and
AA
MR1 rising edges
(Note 1) 1 1 : Inhibited
MR2 0 (Set to “0” in event counter mode) (Note 2)
Nothing is assigned. (i = 1, 2, 4, 5) (Note 3)
When write, set “0”. When read, its content is indeterminate.
AA
MR3 Invalid in event counter mode. When write, set "0". When
read in event counter mode, its content is indeterminate.
Invalid in event counter mode.
AA
TCK0
Can be “0” or “1”.
TCK1 Event clock select bit 0 : Input from TBiIN pin (Note 4)
1 : TBj overflow (Note 5)
Note 1: Valid only when input from the TBiIN pin is selected as the event clock.
If timer's overflow is selected, this bit can be “0” or “1”.
Note 2: R/W is valid only in timer B0 and timer B3.
Note 3: In timer B1, timer B2, timer B4 and timer B5, nothing is assigned by bit 4(There is not R/W).
When write, set “0”. When read, its content is indeterminate.
Note 4: Set the corresponding function select register A to I/O port, and port direction register to “0”.
Note 5: j = i – 1; however, j = 2 when i = 0, j = 5 when i = 3.
151
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
Note 1: An interrupt request is not generated when the first effective edge is input after the timer has started
counting.
Note 2: The value read out from the timer Bi register is indeterminate until the second effective edge is input
after the timer.
152
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
A
AA
TBiMR(i=0 to 5) 035B16, 035C16, 035D16, 031B16, 031C16, 031D16 00XX00002
A
AA
Bit symbol Bit name Function R W
b1 b0
TMOD0 Operation mode
AA
A
select bit 1 0 : Pulse period / pulse width
TMOD1 measurement mode
AA
A
b3 b2
MR0 Measurement mode
select bit 0 0 : Pulse period measurement 1
A
AA
0 1 : Pulse period measurement 2
1 0 : Pulse width measurement
A
AA
MR1 1 1 : Must not be set (Note 1)
A
AA
MR3 Timer Bi overflow 0 : Timer did not overflow
flag (Note 4) 1 : Timer has overflowed
b7 b6
A
AA
TCK0 Count source
0 0 : f1
select bit
0 1 : f8
TCK1 1 0 : f2n (Note 5)
1 1 : fC32
Note 1: Do the next measurement, In the measurement mode select bit.
Pulse period measurement 1 (bit 3, bit 2=“0 0”) : Interval between measurement pulse's falling edge to falling edge.
Pulse period measurement 2 (bit 3, bit 2=“0 1”) : Interval between measurement pulse's rising edge to rising edge.
Pulse width measurement (bit 3, bit 2=“1 0”) : Interval between measurement pulse's falling edge to rising edge,
and between rising edge to falling edge.
Note 2: R/W is valid only in timer B0 and timer B3.
Note 3: In timer B1, timer B2, timer B4 and timer B5, nothing is assigned by bit 4(There is not R/W).
When write, set “0”. When read, its content is indeterminate.
Note 4: It is indeterminate when reset.
The timer Bi overflow flag changes to “0” when the count start flag is “1” and a value is written to the
timer Bi mode register. This flag cannot be set to “1” by software.
Note 5: n = 0 to 15. n is set by the count source prescaler register (address 035F16).
Figure 1.15.7. Timer Bi mode register in pulse period/pulse width measurement mode
153
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
When measuring measurement pulse time interval from falling edge to falling edge
Count source
“H”
Measurement pulse
“L”
Transfer Transfer
(indeterminate value) (measured value)
“1”
Count start flag
“0”
Count source
“H”
Measurement pulse
“L”
Transfer Transfer Transfer Transfer
(indeterminate (measured value) (measured (measured value)
value) value)
Reload register counter
transfer timing
(Note 1) (Note 1) (Note 1) (Note 1) (Note 2)
Timing at which counter
reaches “000016”
“1”
Count start flag
“0”
154
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Note 1: Set bit 1 of the protect register (address 000A16) to “1” before writing to this register.
Note 2: Set bit 1 of this register to “1” after setting timer B2 interrupt occurrences frequency set counter.
Note 3: Effective only in three-phase mode 1(Three-phase PWM control register's bit 1 = “1”).
Note 4: Selecting three-phase PWM output mode causes the dead time timer, the U, V, W phase output control circuits,
and the timer B2 interrupt frequency set circuit works.
For U, U, V, V, W and W output from P80, P81, and P72 through P75, setting of function select registers A, B and
C is required.
Note 5: No value other than “0” can be written.
Note 6: The dead time timer starts in synchronization with the falling edge of timer Ai output. The data transfer from the
three-phase buffer register to the three-phase output shift register is made only once in synchronization with the
transfer trigger signal after writing to the three-phase output buffer register.
Note 7: The dead time timer starts in synchronization with the falling edge of timer A output and with the transfer trigger
signal. The data transfer from the three-phase output buffer register to the three-phase output shift register is
made with respect to every transfer trigger.
Note 8: The value, when read, is “0”.
155
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Nothing is assigned.
When write, set “0”. When read, their contents are “0”.
Note: When executing read instruction of this register, the contents of three-phase shift register is read out.
156
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Nothing is assigned.
When write, set to “0”.
157
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
AA
Bit symbol Bit name Function R W
PWCOM Timer B2 reload timing 0 : Next underflow
switching bit 1 : Synchronized rising edge of
triangular wave
Nothing is assigned.
When write, set “0”. When read, its content is “0”.
A A
Bit symbol Bit name Function R W
TA1TGL Timer A1 event/trigger
A
AAA
Set bit 1 and bit 0 to “0 1” before using
select bit to the V phase output control circuit.
TA1TGH
A
AA
(Note)
A
AA
select bit to the W phase output control circuit.
TA2TGH (Note)
TA3TGL
Inhibited in Three-phase PWM mode.
A A
TA3TGH
AA
TA4TGL Timer A4 event/trigger
Set bit 7 and bit 6 to “0 1” before using
select bit
to the U phase output control circuit.
TA4TGH (Note)
Note: Set the corresponding port function select register A to I/O port, and port direction register to “0”.
158
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Three-phase motor driving waveform output mode (three-phase PWM output mode)
Setting “1” in the mode select bit (bit 2 at 030816) shown in Figure 1.16.1 causes three-phase PWM
output mode that uses four timers A1, A2, A4, and B2. As shown in Figure 1.16.4 and 1.16.5 set timers
A1, A2, and A4 in one-shot timer mode, set the trigger in timer B2, and set timer B2 in timer mode using
the respective timer mode registers.
AA
A
TAiMR(i=1, 2, 4) 035716, 035816, 035A16 00000X002
AA
A A
Bit symbol Bit name Function R W
TMOD0 Operation mode select bit b1 b0
A A
This bit is invalid in M32C/80 series.
MR0 Port output control is set by the function select registers A, B and C.
A
AA
MR1 External trigger select bit Invalid in Three-phase PWM output mode.
MR2
MR3
Trigger select bit 1 : Selected by event/trigger select register
AA
0 1 : f8
TCK1 1 0 : f2n (Note)
1 1 : fC32
Note: n = 0 to 15. n is set by the count source prescaler register (address 035F16).
AAA
Timer B2 mode register
A
AA
b7 b6 b5 b4 b3 b2 b1 b0
A A
TMOD0 b1 b0
Operation mode select bit 0 0 : Timer mode
A
AAA
TMOD1
MR0
AA
A A
Invalid in timer mode
MR1 Can be “0” or “1”
A A
b7 b6
TCK0 Count source select bit
0 0 : f1
AA
0 1 : f8
1 0 : f2n (Note)
TCK1
1 1 : fC32
Note: n = 0 to 15. n is set by the count source prescaler register (address 035F16).
159
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Figure 1.16.6 shows the block diagram for three-phase waveform mode. The Low active output polarity
in three-phase waveform mode, the positive-phase waveforms (U phase, V phase, and W phase) and
___ ___ ___
negative waveforms (U phase, V phase, and W phase), six waveforms in total, are output from P80, P81,
P72, P73, P74, and P75 as active on the “L” level. Of the timers used in this mode, timer A4 controls the
___ ___
U phase and U phase, timer A1 controls the V phase and V phase, and timer A2 controls the W phase
___
and W phase respectively; timer B2 controls the periods of one-shot pulse output from timers A4, A1,
and A2.
In outputting a waveform, dead time can be set so as to cause the “L” level of the positive waveform
___
output (U phase, V phase, and W phase) not to lap over the “L” level of the negative waveform output (U
___ ___
phase, V phase, and W phase).
To set short circuit time, use three 8-bit timers, sharing the reload register, for setting dead time. A value
from 1 through 255 can be set as the count of the timer for setting dead time. The timer for setting dead
time works as a one-shot timer. If a value is written to the dead timer (030C16), the value is written to the
reload register shared by the three timers for setting dead time.
Any of the timers for setting dead time takes the value of the reload register into its counter, if a start
trigger comes from its corresponding timer, and performs a down count in line with the clock source
selected by the dead time timer count source select bit (bit 2 at 030916). The timer can receive another
trigger again before the workings due to the previous trigger are completed. In this instance, the timer
performs a down count from the reload register’s content after its transfer, provoked by the trigger, to the
timer for setting dead time.
Since the timer for setting dead time works as a one-shot timer, it starts outputting pulses if a trigger
comes; it stops outputting pulses as soon as its content becomes 0016, and waits for the next trigger to
come.
___ ___
The positive waveforms (U phase, V phase, and W phase) and the negative waveforms (U phase, V
___
phase, and W phase) in three-phase waveform mode are output, from respective ports by means of
setting “1” in the output control bit (bit 3 at 030816). Setting “0” in this bit causes the ports to be the high-
impedance state. This bit can be set to “0” not only by use of the applicable instruction, but by entering
_______
a falling edge in the NMI terminal or by resetting. Also, if “1” is set in the positive and negative phases
concurrent L output disable function enable bit (bit 4 at 030816) causes one of the pairs of U phase and
___ ___ ___
U phase, V phase and V phase, and W phase and W phase concurrently go to “L”, as a result, the output
control bit becomes the high-impedance state.
160
de
v
r
Un elop
de me
n t
INV13
DU1 DU0
INV11
T Q U phase output signal U(P81)
Rev.B2 for proof reading
D Q D Q D Q
T T
To be set to “0” when timer A4 stops T
Trigger D Q V(P72)
Trigger Dead time timer setting (8)
T
161
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
162
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
phase waveform, which has the opposite phase of the U phase waveform, are the same as in generating
a U phase waveform. In this way, a waveform can be picked up from the applicable terminal in a manner
in which the “L” level of the U phase waveform doesn’t lap over that of the U phase waveform, which has
the opposite phase of the U phase waveform. The width of the “L” level too can be adjusted by varying
___ ___
the values of timer B2, timer A4, and timer A4-1. In dealing with the V and W phases, and V and W
phases, the latter are of opposite phase of the former, have the corresponding timers work similarly to
___
dealing with the U and U phases to generate an intended waveform.
Signal wave
Timer B2
U phase
output signal
U phase
output signal
U phase
(Note 1)
U phase
Dead time
U phase
(Note 2)
U phase
Dead time
INV13(Triangular wave
modulation detect flag)
(Note 3)
163
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Assigning certain values to DU0 (bit 0 at 030A16) and DUB0 (bit 1 at 030A16), and to DU1 (bit 0 at
030B16) and DUB1 (bit 1 at 030B16) allows you to output the waveforms as shown in Figure 1.16.8, that
___ ___
is, to output the U phase alone, to fix U phase to “H”, to fix the U phase to “H,” or to output the U phase
alone.
Carrier wave
Signal wave
Timer B2
m n m n m p o
Timer A4 output
U phase
output signal
U phase
output signal
U phase
U phase
Dead time
164
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Sawtooth modulation
To generate a PWM waveform of sawtooth wave modulation, set “1” in the modulation mode select bit
(bit 6 at 030816). Also, set “0” in the timers A4, A1, and A2-1 control bit (bit 1 at 030916). In this mode, the
timer registers of timers A4, A1, and of A2 comprise conventional timers A4, A1, and A2 alone, and
reload the corresponding timer register’s content to the counter every time the timer B2 counter’s con-
tent becomes 000016. The effective interrupt output specification bit (bit 1 at 030816) and the effective
interrupt output polarity select bit (bit 0 at 030816) go nullified.
An example of U phase waveform is shown in Figure 1.16.9, and the description of waveform output
workings is given below. Set “1” in DU0 (bit 0 at 030A16), and set “0” in DUB0 (bit 1 at 030A16). In
addition, set “0” in DU1 (bit 0 at 030B16) and set “1” in DUB1 (bit 1 at 030B16).
When the timber B2 counter’s content becomes 000016, timer B2 generates an interrupt, and timer A4
starts outputting one-shot pulses at the same time. In this instance, the contents of the three-phase
buffer registers DU1 and DU0 are set in the three-phase output shift register (U phase), and the contents
of DUB1 and DUB0 are set in the three-phase output register (U phase). After this, the three-phase
buffer register’s content is set in the three-phase shift register every time the timer B2 counter’s content
becomes 000016.
___
The value of DU0 and that of DUB0 are output to the U terminal (P80) and to the U terminal (P81)
respectively. When the timer A4 counter counts the value written to timer A4 (034F16, 034E16) and when
timer A4 finishes outputting one-shot pulses, the three-phase output shift register’s content is shifted
one position, and the value of DU1 and that of DUB1 are output to the U phase output signal and to the
___
U output signal respectively. At this time, one-shot pulses are output from the timer for setting dead time
used for setting the time over which the “L” level of the U phase waveform doesn’t lap over the “L” level
___
of the U phase waveform, which has the opposite phase of the former. The U phase waveform output
that started from the “H” level keeps its level until the timer for setting dead time finishes outputting one-
shot pulses even though the three-phase output shift register’s content changes from “1” to “0 ”by the
effect of the one-shot pulses. When the timer for setting dead time finishes outputting one-shot pulses,
0 already shifted in the three-phase shift register goes effective, and the U phase waveform changes to
the “L” level. When the timer B2 counter’s content becomes 000016, the contents of the three-phase
buffer registers DU1 and DU0 are set in the three-phase shift register (U phase), and the contents of
___
DUB1 and DUB0 are set in the three-phase shift register (U phase) again.
A U phase waveform is generated by these workings repeatedly. With the exception that the three-
___ ___
phase output shift register on the U phase side is used, the workings in generating a U phase waveform,
which has the opposite phase of the U phase waveform, are the same as in generating a U phase
waveform. In this way, a waveform can be picked up from the applicable terminal in a manner in which
the “L” level of the U phase waveform doesn’t lap over that of the U phase waveform, which has the
opposite phase of the U phase waveform. The width of the “L” level can also be adjusted by varying the
___ ___
values of timer B2 and timer A4. In dealing with the V and W phases, and V and W phases, the latter are
of opposite phase of the former, have the corresponding timers work similarly to dealing with the U and
___
U phases to generate an intended waveform.
165
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
Carrier wave
Signal wave
Timer B2
The three-phase
Timer A4 output m n o p shift registers
shifts in
synchronization
with the falling
U phase output edge of timer A4.
signal
U phase
output signal
U phase
U phase
Dead time
166
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Three-phase motor control timers’ functions
___
Setting “1” both in DUB0 and in DUB1 provides a means to output the U phase alone and to fix the U
phase output to “H” as shown in Figure 1.16.10.
Carrier wave
Signal wave
Timer B2
Interrupt occurres. Interrupt occurres. Data transfer is made from the three-
Rewriting the value of timer A4. Rewriting the value of timer A4. phase buffer registers to the three-
Trigger signal for Rewriting three-phase phase shift registers in step with the
timer Ai start output buffer register timing of the timer B overflow.
(timer B2 overflow
signal)
The three-phase
shift registers shifts
Timer A4 output m n p in synchronization
with the falling
edge of timer A4.
U phase
output signal
U phase
output signal
U phase
U phase
Dead time
167
nt
r
de me
Un elop Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Serial I/O
Serial I/O is configured as five channels: UART0 to UART4.
UARTi (i=0 to 4) each have an exclusive timer to generate a transfer clock, so they operate independently
of each other.
Figure 1.17.1 shows the block diagram of UARTi.
UARTi has two operation modes: a clock synchronous serial I/O mode and a clock asynchronous serial I/O
mode (UART mode). The contents of the serial I/O mode select bits (bits 0 to 2 at addresses 036816,
02E816, 033816, 032816 and 02F816) determine whether UARTi is used as a clock synchronous serial I/O
or as a UART.
It has the bus collision detection function that generates an interrupt request if the TxD pin and the RxD pin
are different in level.
Figures 1.17.2 through 1.17.8 show the registers related to UARTi.
168
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
TxD
RxD polarity
RxDi reversing circuit
polarity TxDi
reversing
UART reception circuit
1/16 Receive
Clock source selection Reception clock Transmit/
control circuit (Note)
Bit rate Clock synchronous type receive
f1
Internal generator unit
f8 UART transmission Transmit
f2n 1 / (ni+1) 1/16 Transmission clock
Clock synchronous type control circuit
External
Clock synchronous type
(when internal clock is selected)
1/2
Vcc
CTS/RTS disabled
CTS2
ni : Values set to UARTi bit rate generator (UiBRG)
Note :UART 2 is not CMOS output but N channel open drain output.
No reverse
RxD data
RxDi reverse circuit
Reverse
Clock
synchronous type
UART
(7 bits)
Clock UART
PAR UART(7 bits) UARTi receive register
synchronous (8 bits)
1SP disabled type
SP SP PAR
2SP UART Clock
PAR UART
enabled synchronous type
(9 bits)
UART
(8 bits)
UART
(9 bits)
UARTi receive
0 0 0 0 0 0 0 D8 D7 D6 D5 D4 D3 D2 D1 D0 buffer register
Address 036E16
Logic reverse circuit + MSB/LSB conversion circuit Address 036F16
Address 02EE16
Address 02EF16
Address 033E16
Data bus high-order bits Address 033F16
Address 032E16
Address 032F16
Address 02FE16
Data bus low-order bits Address 02FF16
169
nt
r
de me
Un elop Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
Note: Use MOV instruction to write to this register.
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
170
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
171
nt
r
de me
Un elop Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Note 1: Set the corresponding function select register A to I/O port, and port direction register to “0”
Note 2: Select RTS output using the corresponding function select registers A, B and C.
Note 3: UART2 transfer pin (TxD2:P70) is N-channel open drain output. It is not set to CMOS output.
Note 4: Valid only in clock syncronous serial I/O mode and 8 bits UART mode.
172
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
173
nt
r
de me
Un elop Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit
symbol
Bit name Function R W
0: NACK/ACK interrupt (DMA source - ACK)
Transfer to receive buffer at the rising
edge of last bit of receive clock
Receive interrupt occurs at the rising edge
IIC mode select of last bit of receive clock
IICM2 1: UART transfer/receive interrupt (DMA
bit 2
source - UART receive)
Transfer to receive buffer at the falling
edge of last bit of receive clock
Receive interrupt occurs at the falling
edge of last bit of receive clock
Clock 0: Disabled
CSC
synchronous bit 1: Enabled
0: Disabled
SWC SCL wait output bit
1: Enabled
0: Disabled
ALS SDA output stop bit
1: Enabled
0: Disabled
STC UARTi initialize bit
1: Enabled
174
nt
de
r
Un elop
me Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Note 1: Set SS function after setting CTS/RTS disable bit (bit 4 of UARTi transfer/receive control
register 0) to "1".
Note 2: Set CLKi and TxDi both for output using the CLKi and TxDi function select register A. Set the
RxDi function select register A for input/output port and the port direction register to "0".
Note 3: Set STxDi for output using the STxDi function select registers A and B. Set the CLKi and
SRxDi function select register A for input/output port and the port direction register to "0".
Note 4: Nothing but "0" may be written.
Note 5: These bits are used for SDAi (TxDi) output digital delay when using UARTi for IIC interface.
Otherwise, must set to "000".
Note 6: When external clock is selected, delay is increased approximately 100ns.
175
nt
r
de me
Un elop Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit
Bit name Function R W
symbol
0: ACK
ACKD ACK data bit
1: NACK
AAA
AA
AExternal interrupt request cause select register
AAAA
AA
b7 b6 b5 b4 b3 b2 b1 b0
AA
Bit symbol Bit name Function R W
AA
IFSR0 INT0 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
AA
IFSR1 INT1 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
IFSR2
IFSR3
INT2 interrupt polarity
select bit (Note)
INT3 interrupt polarity
0 : One edge
1 : Both edges
0 : One edge
AA
AA
AA
select bit (Note) 1 : Both edges
AA
IFSR4 INT4 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
IFSR5 INT5 interrupt polarity 0 : One edge
select bit (Note) 1 : Both edges
AA
IFSR6 UART0/3 interrupt 0 : UART3 bus collision /start,stop
cause select bit detect/false error detect
1 : UART0 bus collision /start,stop
detect/false error detect
AA
IFSR7 UART1/4 interrupt 0 : UART4 bus collision /start,stop
cause select bit detect/false error detect
1 : UART1 bus collision /start,stop
detect/false error detect
176
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock synchronous serial I/O mode
_ Transmit buffer empty flag (bit 1 at addresses 036D16, 02ED16, 033D16, 032D16, 02FD16) = “0”
_______ _______
_ When CTS function selected, CTS input level = “L”
_ TxD output is selected by the corresponding peripheral function select register A, B and C.
• Furthermore, if external clock is selected, the following requirements must also be met:
_ CLKi polarity select bit (bit 6 at addresses 036C16, 02EC16, 033C16, 032C16,
02FC16) = “0”: CLKi input level = “H”
_ CLKi polarity select bit (bit 6 at addresses 036C16, 02EC16, 033C16, 032C16,
02FC16) = “1”: CLKi input level = “L”
Reception start condition • To start reception, the following requirements must be met:
_ Receive enable bit (bit 2 at addresses 036D 16, 02ED16, 033D16, 032D16, 02FD16) = “1”
_ Transmit enable bit (bit 0 at addresses 036D 16, 02ED16, 033D16, 032D16, 02FD16) = “1”
_ Transmit buffer empty flag (bit 1 at addresses 036D16, 02ED16, 033D16, 032D16, 02FD16) = “0”
• Furthermore, if external clock is selected, the following requirements must also be met:
_ CLKi polarity select bit (bit 6 at addresses 036C16, 02EC16, 033C16, 032C16,
02FC16) = “0”: CLKi input level = “H”
_ CLKi polarity select bit (bit 6 at addresses 036C16, 02EC16, 033C16, 032C16,
02FC16) = “1”: CLKi input level = “L”
Interrupt request • When transmitting
generation timing _ Transmit interrupt cause select bit (bit 4 at address 036D16, 02ED16, 033D16,
032D16, 02FD16) = “0”: Interrupts requested when data transfer from UARTi trans-
fer buffer register to UARTi transmit register is completed
_ Transmit interrupt cause select bit (bit 4 at address 036D16, 02ED16, 033D16,
032D16, 02FD16) = “1”: Interrupts requested when data transmission from UARTi
transfer register is completed
• When receiving
_ Interrupts requested when data transfer from UARTi receive register to UARTi
receive buffer register is completed
Note 1: “m” denotes the value 0016 to FF16 that is set to the UART bit rate generator.
177
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock synchronous serial I/O mode
Table 1.18.3 lists the functions of the input/output pins during clock synchronous serial I/O mode. Note
that for a period from when the UARTi operation mode is selected to when transfer starts, the TxDi pin
outputs a “H”. (If the N-channel open drain is selected, this pin is in floating state.)
Table 1.18.3. Input/output pin functions in clock synchronous serial I/O mode
Pin name Function Method of selection
TxDi Serial data output (Outputs dummy data when performing reception only)
(P63, P67, P70, (Note 1)
P92, P96)
RxDi Serial data input Port P62, P66, P71, P91 and P97 direction register (bits 2 and 6 at address
(P62, P66, P71, (Note 2) 03C216, bit 1 at address 03C316, bit 1 and 7 at address 03C716)= “0”
P91, P97) (Can be used as an input port when performing transmission only)
CLKi Transfer clock output Internal/external clock select bit (bit 3 at addresses 036816, 02E816,
(P61, P65, P72, (Note 1) 033816, 032816, 02F816) = “0”
P90, P95)
Transfer clock input Internal/external clock select bit (bit 3 at addresses 036816, 02E816,
(Note 2) 033816, 032816, 02F816) = “1”
Port P61, P65, P72, P90 and P95 direction register (bits 1 and 5 at address
03C216, bit 2 at address 03C316, bit 0 and 5 at address 03C716) = “0”
CTSi/RTSi CTS input CTS/RTS disable bit (bit 4 at addresses 036C16, 02EC16, 033C16, 032C16,
(P60, P64, P73, (Note 2) 02FC16) =“0”
P93, P94) CTS/RTS function select bit (bit 2 at addresses 036C16, 02EC16, 033C16,
032C16, 02FC16) = “0”
Port P60, P64, P73, P93 and P94 direction register (bits 0 and 4 at address
03C216, bit 3 at address 03C316, bits 3 and 4 at address 03C716) = “0”
RTS output (Note 1) CTS/RTS disable bit (bit 4 at addresses 036C16, 02EC16, 033C16,
032C16, 02FC16) = “0”
CTS/RTS function select bit (bit 2 at addresses 036C16, 02EC16, 033C16,
032C16, 02FC16) = “1”
Programmable I/O port CTS/RTS disable bit (bit 4 at addresses 036C16, 02EC16, 033C16,
(Note 2) 032C16, 02FC16) = “1”
________
Note 1: Select TxD output, CLK output and RTS output by the corresponding function select registers A, B and C.
Note 2: Select I/O port by the corresponding function select register A.
178
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock synchronous serial I/O mode
Transfer clock
“1”
Transmit enable
bit (TE) “0” Data is set in UARTi transmit buffer register
CLKi
TxDi D0 D 1 D2 D3 D4 D5 D6 D7 D0 D 1 D2 D3 D4 D5 D 6 D7 D 0 D1 D2 D 3 D 4 D 5 D6 D7
Transmit “1”
register empty
“0”
flag (TXEPT)
Transmit interrupt “1”
request bit (IR) “0”
RxDi D0 D 1 D2 D3 D4 D 5 D6 D7 D 0 D1 D2 D3 D 4 D5 D6 D7 D0 D1 D2 D 3 D4 D 5 D
Transferred from UARTi receive register Read out from UARTi receive buffer register
Receive complete “1” to UARTi receive buffer register
flag (Rl) “0”
The above timing applies to the following settings: The following conditions are met when the CLKi
• External clock is selected. input before data reception = “H”
• RTS function is selected. • Transmit enable bit “1”
• CLK polarity select bit = “0”. • Receive enable bit “1”
• Dummy data write to UARTi transmit buffer register
fEXT: frequency of external clock
Figure 1.18.1. Typical transmit/receive timings in clock synchronous serial I/O mode
179
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock synchronous serial I/O mode
CLKi
D0 D1 D2 D3 D4 D5 D6 D7
Note 1: The CLK pin level when not
TXDi
transferring data is “H”.
R XD i D0 D1 D2 D3 D4 D5 D6 D7
CLKi
Note 2: The CLK pin level when not
TXDi D0 D1 D2 D3 D4 D5 D6 D7 transferring data is “L”.
RXDi D0 D1 D2 D3 D4 D5 D6 D7
CLKi
TXDi D0 D1 D2 D3 D4 D5 D6 D7
LSB first
R XD i D0 D1 D2 D3 D4 D5 D6 D7
CLKi
TXDi D7 D6 D5 D4 D3 D2 D1 D0
MSB first
RXDi D7 D6 D5 D4 D3 D2 D1 D0
Note: This applies when the CLK polarity select bit = “0”.
180
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock synchronous serial I/O mode
TxDi “H”
D0 D1 D2 D3 D4 D5 D6 D7
(no reverse) “L”
TxDi “H”
D0 D1 D2 D3 D4 D5 D6 D7
(reverse) “L”
181
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock asynchronous serial I/O (UART) mode
182
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock asynchronous serial I/O (UART) mode
Table 1.19.3 lists the functions of the input/output pins in UART mode. Note that for a period from when
the UARTi operation mode is selected to when transfer starts, the TxDi pin outputs a “H”. (If the N-
channel open drain is selected, this pin is in floating state.)
CLKi Programmable I/O port Internal/external clock select bit (bit 3 at addresses 036816, 02E816,
(P61, P65, P72, (Note 2) 033816, 032816, 02F816) = “0”
P90, P95) Transfer clock input Internal/external clock select bit (bit 3 at addresses 036816, 02E816,
(Note 2) 033816, 032816, 02F816) = “1”
Port P61, P65, P72, P90 and P95 direction register (bits 1 and 5 at address
03C216, bit 2 at address 03C316, bits 0 and 5 at address 03C716) = “0”
CTSi/RTSi CTS input CTS/RTS disable bit (bit 4 at addresses 036C16, 02EC16, 033C16,
(P60, P64, P73, (Note 2) 032C16, 02FC16) =“0”
P93, P94) CTS/RTS function select bit (bit 2 at addresses 036C16, 02EC16, 033C16,
032C16, 02FC16) = “0”
Port P60, P64, P73, P93 and P94 direction register (bits 0 and 4 at address
03C216, bit 3 at address 03C316, bits 3 and 4 at address 03C716) = “0”
RTS output (Note 1) CTS/RTS disable bit (bit 4 at addresses 036C16, 02EC16, 033C16, 032C16,
02FC16) = “0”
CTS/RTS function select bit (bit 2 at addresses 036C16, 02EC16, 033C16,
032C16, 02FC16) = “1”
Programmable I/O port CTS/RTS disable bit (bit 4 at addresses 036C16, 02EC16, 033C16, 032C16,
(Note 2) 02FC16) = “1”
________
Note 1: Select TxD output, CLK output and RTS output by the corresponding function select registers A, B and C.
Note 2: Select I/O port by the corresponding function select register A.
183
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock asynchronous serial I/O (UART) mode
• Example of transmit timing when transfer data is 8 bits long (parity enabled, one stop bit)
The transfer clock stops momentarily as CTS is “H” when the stop bit is checked.
The transfer clock starts as the transfer starts immediately CTS changes to “L”.
Tc
Transfer clock
• Example of transmit timing when transfer data is 9 bits long (parity disabled, two stop bits)
Tc
Transfer clock
184
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock asynchronous serial I/O (UART) mode
• Example of receive timing when transfer data is 8 bits long (parity disabled, one stop bit)
BRGi count
source
“1”
Receive enable bit
“0”
Stop bit
RxDi Start bit D0 D1 D7
Sampled “L”
Receive data taken in
Transfer clock
Reception triggered when transfer clock Transferred from UARTi receive register to
Receive “1” is generated by falling edge of start bit UARTi receive buffer register
complete flag “0”
“H”
RTSi
“L” Becomes “L” by reading the receive buffer
Receive interrupt “1”
request bit “0”
“H”
Transfer clock
“L”
TxDi “H”
(no reverse) ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
“L”
TxDi “H”
(reverse) ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
“L”
ST : Start bit
P : Even parity
SP : Stop bit
185
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock asynchronous serial I/O (UART) mode
“H”
Transfer clock
“L”
“H”
TxDi ST SP
“L”
“H”
RxDi ST SP
“L”
186
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
Note 1: Make the settings given below when I2C mode is used.
Set 0 1 0 in bits 2, 1, 0 of the UARTi transmission/reception mode register.
Disable the RTS/CTS function. Choose the MSB First function.
Note 2: Follow the steps given below to switch from one factor to another.
1. Disable the interrupt of the corresponding number.
2. Switch from a factor to another.
3. Reset the interrupt request flag of the corresponding number.
4. Set an interrupt level of the corresponding number.
Note 3: Set an initial value of SDA transmission output when IIC mode (IIC mode select bit = "1") is valid and serial I/O is invalid.
187
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
TXDi/SDA
Timer To DMAi
Selector
I/O
UARTi transmission/
UARTi IICM=1 IICM=0 or IICM2=1 NACK interrupt
delay Transmission register request
D
To DMAi
Q
Arbitration
T
Noize IICM=0 or
Filter IICM=1 IICM2=1 UARTi reception/ACK
interrupt request
Reception register DMAi request
IICM=0 UARTi
IICM=1 and
Start condition detection IICM2=0
S Bus
Q busy
R
Stop condition detection
NACK
L-synchronous D Q
Falling edge output enabling bit T
detection
RxDi/SCL D Q
I/0 R T ACK
Data register
9th pulse
Selector Bus collision/start, stop
IICM=1 condition detection
UARTi Internal clock
interrupt request
IICM=1 SWC2 Bus collision
CLK
IICM=1 detection IICM=0
Noize control
Filter External clock UARTi
Noize
Filter Falling edge of 9th pulse
IICM=0 R
S SWC
Port reading
UARTi * With IICM set to 1, the port terminal is to be readable
CLKi IICM=0 even if 1 is assigned to P71 of the direction register.
Serector
I/0
Timer
UARTi Special Mode Register (UiSMR:Addresses 036716, 02E716, 033716, 032716, 02F716)
Bit 0 is the IIC mode select bit. When set to “1”, ports operate respectively as the SDAi data transmis-
sion-reception pin, SCLi clock I/O pin and port. A delay circuit is added to SDAi transmission output,
therefore after SCLi is sufficiently L level, SDAi output changes. Port (SCLi) is designed to read pin
level regardless of the content of the port direction register. SDAi transmission output is initially set to
port in this mode. Furthermore, interrupt factors for the bus collision detection interrupt, UARTi trans-
mission interrupt and UARTi reception interrupt change respectively to the start/stop condition detec-
tion interrupts, acknowledge non-detection interrupt and acknowledge detection interrupt.
188
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
The start condition detection interrupt is generated when the falling edge at the SDAi pin is detected
while the SCLi pin is in the H state. The stop condition detection interrupt is generated when the rising
edge at the SDAi pin is detected while the SCLi pin is in the H state.
The acknowledge non-detection interrupt is generated when the H level at the SDAi pin is detected at
the 9th rise of the transmission clock.
The acknowledge detection interrupt is generated when the L level at the SDAi pin is detected at the
9th rise of the transmission clock. Also, DMA transfer can be started when the acknowledge is de-
tected and UARTi transmission is selected as the DMAi request factor.
Bit 1 is the arbitration lost detection flag control bit (ABC). Arbitration detects a conflict between data
transmitted at SCLi rise and data at the SDAi pin. This detection flag is allocated to bit 11 in UARTi
transmission buffer register (addresses 036F16, 02EF16, 033F16, 032F16, 02FF16). It is set to “1” when
a conflict is detected. With the arbitration lost detection flag control bit, it can be selected to update the
flag in units of bits or bytes. When this bit is set to “1”, update is set to units of byte. If a conflict is then
detected, the arbitration lost detection flag control bit will be set to “1” at the 9th rise of the clock. When
updating in units of byte, always clear (“0” interrupt) the arbitration lost detection flag control bit after
the 1st byte has been acknowledged but before the next byte starts transmitting.
Bit 2 is the bus busy flag (BBS). It is set to “1” when the start condition is detected, and reset to “0”
when the stop condition is detected.
Bit 3 is the SCLi L synchronization output enable bit (LSYN). When this bit is set to “1”, the port data
register is set to “0” in sync with the L level at the SCLi pin.
Bit 4 is the bus collision detection sampling clock select bit (ABSCS). The bus collision detection
interrupt is generated when RxDi and TxDi level do not conflict with one another. When this bit is “0”,
a conflict is detected in sync with the rise of the transfer clock. When this bit is “1”, detection is made
when timer Ai (timer A3 with UART0, timer A4 with UART1, timer A0 with UART2, timer A3 with
UART3 and timer A4 with UART4) underflows. Operation is shown in Figure 1.21.2.
Bit 5 is the transmission enable bit automatic clear select bit (ACSE). By setting this bit to “1”, the
transmission bit is automatically reset to “0” when the bus collision detection interrupt factor bit is “1”
(when a conflict is detected).
Bit 6 is the transmission start condition select bit (SSS). By setting this bit to “1”, TxDi transmission
starts in sync with the rise at the RxDi pin.
189
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
1. Bus collision detect sampling clock select bit (Bit 4 of the UARTi special mode register)
0: Rising edges of the transfer clock
CLKi
TxDi/RxDi
1: Timer Ai underflow
Timer Ai
2. Auto clear function select bit of transmit enable bit (Bit 5 of the UARTi special mode
register)
CLKi
TxDi/RxDi
Bus collision
detect interrupt
request bit
Transmit
enable bit
3. Transmit start condition select bit (Bit 6 of the UARTi special mode register)
0: In normal state
CLKi
TxDi
Enabling transmission
TxDi
RxDi
190
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
UARTi Special Mode Register 2 (UiSMR2:Addresses 036616, 02E616, 033616, 032616, 02F616)
Bit 0 is the IIC mode select bit 2 (IICM2). Table 1.21.2 gives control changes by bit when the IIC mode
select bit is “1”. Start and stop condition detection timing characteristics are shown in Figure 1.21.4.
Always set bit 7 (start/stop condition control bit) to “1”.
Bit 1 is the clock synchronizing bit (CSC). When this bit is set to “1”, and the rising edge is detected at
pin SCLi while the internal SCL is High level, the internal SCL is changed to Low level, the baud rate
generator value is reloaded and the Low sector count starts. Also, while the SCLi pin is Low level, and
the internal SCL changes from Low level to High, baud rate generator stops counting. If the SCLi pin
is H level, counting restarts. Because of this function, the UARTi transmission-reception clock takes
the AND condition for the internal SCL and SCLi pin signals. This function operates from the clock half
period before the 1st rise of the UARTi clock to the 9th rise. To use this function, select the internal
clock as the transfer clock.
Bit 2 is the SCL wait output bit (SWC). When this bit is set to “1”, output from the SCLi pin is fixed to L
level at the clock’s 9th rise. When set to “0”, the Low output lock is released.
Bit 3 is the SDA output stop bit (ALS). When this bit is set to “1”, an arbitration lost is generated. If the
arbitration lost detection flag is “1”, then the SDAi pin simultaneously becomes high impedance.
Bit 4 is the UARTi initialize bit (STC). While this bit is set to “1”, the following operations are performed
when the start condition is detected.
1. The transmission shift register is initialized and the content of the transmission register is trans-
mitted to the transmission shift register. As such, transmission starts with the 1st bit of the next
input clock. However, the UARTi output value remains the same as when the start condition was
detected, without changing from when the clock is input to when the 1st bit of data is output.
2. The reception shift register is initialized and reception starts with the 1st bit of the next input
clock.
3. The SCL wait output bit is set to “1”. As such, the SCLi pin becomes Low level at the rise of the
9th bit of the clock.
When UART transmission-reception has started using this function, the content of the transmission
buffer available flag does not change. Also, to use this function, select an external clock as the transfer
clock.
Bit 5 is SCL wait output bit 2 (SWC2). When this bit is set to “1” and serial I/O is selected, an Low level
can be forcefully output from the SCLi pin even during UART operation. When this bit is set to “0', the
Low output from the SCLi pin is canceled and the UARTi clock is input and output.
Bit 6 is the SDA output disable bit (SDHI). When this bit is set to “1”, the SDAi pin is forced to high
impedance. To overwrite this bit, do so at the rise of the UARTi transfer clock. The arbitration lost
detection flag may be set.
191
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
SCL
SDA
(Start condition)
SDA
(Stop condition)
Note : Cycle number shows main clock input oscillation frequency f(XIN) cycle number.
UARTi Special Mode Register 3 (UiSMR3:Addresses 036516, 02E516, 033516, 032516, 02F516)
Bit 1 is clock phase set bit (CKPH). When both the IIC mode select bit (bit 0 of UARTi special mode
select register) and the IIC mode select bit 2 (bit 0 of UiSMR2 register) are "1", functions changed by
these bits are shown in table 1.21.3 and figure 1.21.4.
Bits 5 to 7 are SDAi digital delay setting bits (DL0 to DL2). By setting these bits, it is possible to turn the
SDAi delay OFF or set the BRG count source delay to 2 to 8 cycles.
192
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
SCL
SDA D7 D6 D5 D4 D3 D2 D1 D0 D8
(Internal clock, transfer data 9 bits long and MSB first selected.)
Receive interrupt Transmit interrupt
SCL
SDA D7 D6 D5 D4 D3 D2 D1 D0 D8
(Internal clock, transfer data 9 bits long and MSB first selected.)
Receive interrupt Transmit interrupt
UARTi Special Mode Register 4 (UiSMR4:Addresses 036416, 02E416, 033416, 032416, 02F416)
Bit 0 is the start condition generate bit (STAREQ). When the SCL, SDA output select bit (bit 3 of
UiSMR4 register) is "1" and this bit is "1", then the start condition is generated.
Bit 1 is the restart condition generate bit (RSTAREQ). When the SCL, SDA output select bit (bit 3 of
UiSMR4 register) is "1" and this bit is "1", then the restart condition is generated.
Bit 2 is the stop condition generate bit (STPREQ). When the SCL, SDA output select bit (bit 3 of
UiSMR4 register) is "1" and this bit is "1", then the stop condition is generated.
Bit 3 is SCL, SDA output select bit (STSPSEL). Functions changed by these bits are shown in table
1.21.4 and figure 1.21.5.
193
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
SCL
SDA
SCL
SDA
STAREQ=1
STPREQ=1
Start condition detection Stop condition detection
interrupt interrupt
Bit 4 is ACK data bit (ACKD). When the SCL, SDA output select bit (bit 3 of UiSMR4 register) is "0"
and the ACK data output enable bit (bit 5 of UiSMR4 register) is "1", then the content of ACK data bit
is output to SDAi pin.
Bit 5 is ACK data output enable bit (ACKC). When the SCL, SDA output select bit (bit 3 of UiSMR4
register) is "0" and this bit is "1", then the content of ACK data bit is output to SDAi pin.
Bit 6 is SCL output stop bit (SCLHI). When this bit is "1", SCLi output is stopped at stop condition
detection. (Hi-impedance status).
Bit 7 is SCL wait output bit 3 (SWC9). When this bit is "1", SCLi output is fixed to "L" at falling edge of
10th bit of clock. When this bit is "0", SCLi output fixed to "L" is released.
194
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
IC1 IC2
P13
P12
P93(SS3) P93(SS3)
P90(CLK3) P90(CLK3)
P91(RxD3) P91(STxD3)
P92(TxD3) P92(SRxD3)
M16C/80 (M) M16C/80 (S)
IC3
P93(SS3)
P90(CLK3)
P91(STxD3)
M :Master
S :Slave P92(SRxD3)
M16C/80 (S)
Figure 1.21.6. Serial bus communication control example using the SS input pins
< Slave Mode (STxDi and SRxDi are selected, DINC = 1) >
_____
When an H level signal is input to an SSi input pin, the STxDi and SRxDi pins both become high
_____
impedance, hence the clock input is ignored. When an "L" level signal is input to an SSi input pin, the
clock input becomes effective and serial communications are enabled.
< Master Mode (TxDi and RxDi are selected, DINC = 0) >
_____ _____
The SSi input pins are used with a multiple master system. When an SSi input pin is H level, transmis-
_____
sion has priority and serial communications are enabled. When an L signal is input to an SSi input pin,
another master exists, and the TxDi, RxDi and CLKi pins all become high impedance. Moreover, the
trouble error interrupt request bit becomes “1”. Communications do not stop even when a trouble error
is generated during communications. To stop communications, set bits 0, 1 and 2 of the UARTi trans-
mission-reception mode register (addresses 036816, 02E816, 033816, 032816 and 02F816) to “0”.
195
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
"H"
Master SS input
"L"
Figure 1.21.7. The transmission and reception timing in master mode (internal clock)
196
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
UARTi Special Mode Register
"H"
SS input
"L"
Note :UART2 output is an N-channel open drain and needs to be pulled-up externally.
Figure 1.21.8. The transmission and reception timing (CKPH=0) in slave mode (external clock)
"H"
SS input
"L"
Note :UART2 output is an N-channel open drain and needs to be pulled-up externally.
Figure 1.21.9. The transmission and reception timing (CKPH=1) in slave mode (external clock)
197
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
CAN Module
The microcomputer incorporates Full-CAN modules compliant with CAN (Controller Area Network) 2.0B
specification.
These Full-CAN modules are outlined below.
198
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Data bus
Sleep control Control register Global Error interrupt Error interrupt Acceptance
register mask register mask register Message status register
slot buffer 0 filter support
Slot interrupt register
Baud rate Configuration Local Slot interrupt status register
BCLK prescaler register mask register A mask register
Status
Expansion ID Local register
register mask register B
Slot buffer Transmit error
count register
Message slot 0 select register
control register Receive error
count register
Message
slot 0
Acceptance
Filter
CANOUT CAN protocol Message box
controller 16 bits timer (slot 0 to 15)
CANIN Time stamp
Ver 2.0B register
Interrupt
Interrupt request
control circuit
CAN0 message slot buffer 0 and 1 can be selected by setting of slot buffer select register. Figure 1.22.2
shows the message slot buffer and 16 bytes of message slots. Figure 1.22.26 to 1.22.30 show related
registers.
CAN0 message slot buffer 0 standard ID0 CAN0 message slot 0 standard ID0
CAN0 message slot buffer 0 standard ID1 CAN0 message slot 0 standard ID1
CAN0 message slot buffer 0 standard ID0
CAN0 message slot buffer 0 extend ID0 CAN0 CAN0
message slot 0 extend
message ID00 standard ID0
slot buffer
CAN0 message slot buffer 0 standard ID1
CAN0 message slot buffer 0 extend ID1 CAN0 CAN0
message slot 0 extend
message ID10 standard ID1
slot buffer
CAN0 message slot buffer 0 extended ID0
CAN0 message slot buffer 0 extend ID2 CAN0 CAN0
message slot 0 extend
message ID20 extended ID0
slot buffer
CAN0 message slot buffer 0 extended ID1
CAN0 message slot buffer 0 data length code CAN0 CAN0
message slot 0 data
message length0code
slot buffer extended ID1
CAN0 message slot buffer 0 extended ID2
CAN0 message slot buffer 0 data 0 CAN0 CAN0
message slot 0 data
message 0
slot buffer 0 extended ID2
CAN0 message slot buffer 0 data length code
CAN0 message slot buffer 0 data 1 CAN0 CAN0
message slot 0 data
message 1
slot buffer 0 data length code
CAN0 message slot buffer 0 data 0
CAN0 message slot buffer 0 data 2 CAN0 CAN0
message slot 0 data
message 2
slot buffer 0 data 0
CAN0 message slot buffer 0 data 1
CAN0 message slot buffer 0 data 3 CAN0 CAN0
message slot 0 data
message 3
slot buffer 0 data 1
CAN0 message slot buffer 0 data 2
CAN0 message slot buffer 0 data 4 CAN0 CAN0
message slot 0 data
message 4
slot buffer 0 data 2
CAN0 message slot buffer 0 data 3
CAN0 message slot buffer 0 data 5 CAN0 CAN0
message slot 0 data
message 5
slot buffer 0 data 3
CAN0 message slot buffer 0 data 4
CAN0 message slot buffer 0 data 6 CAN0 CAN0
message slot 0 data
message 6
slot buffer 0 data 4
CAN0 message slot buffer 0 data 5
CAN0 message slot buffer 0 data 7 CAN0 CAN0
message slot 0 data
message 7
slot buffer 0 data 5
CAN0 message slot buffer 0 data 6
CAN0 message slot buffer 0 time stamp high CAN0 CAN0
message slot 0 time
message stamp0high
slot buffer data 6
CAN0 message slot buffer 0 data 7
CAN0 message slot buffer 0 time stamp low CAN0 CAN0
message slot 0 time
message stamp0low
slot buffer data 7
CAN0 message slot buffer 0 time stamp high
CAN0 message slot buffer 1 time stamp low
CAN0 message slot 15 time stamp low
199
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0: Reset released
Reset 0 CAN reset bit 0
1: Reset requested
Loop back mode 0: Loop back function disabled
Loopback
select bit 1: Loop back function enabled
Nothing is assigned. When write, set to "0".
When read, its contents is indeterminate.
Basic CAN mode 0 : Basic CAN mode function disabled
BasicCAN
select bit 1 : Basic CAN mode function enabled
0 : Reset released
Reset 1 CAN reset bit 1
1 : Reset requested
b9 b8
TSPre0 Time stamp 0 0: CAN bus bit clock is selected
prescaler select bit 0 1: Division by 2 of CAN bus bit clock is selected
1 0: Division by 3 of CAN bus bit clock is selected
TSPre1
1 1: Division by 4 of CAN bus bit clock is selected
Time stamp 0 : Count enabled
TSReset
counter reset bit 1 : Count reset (set 000016) (Note 2)
Error counter 0 : Normal operation mode
ECReset
reset bit 1 : Error counter reset (Note 2)
Note 1: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Note 2: Only writing 1 is accepted. The bit is automatically cleared to 0 in hardware.
200
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
201
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
(4) Set the Message Slot Control Registers for slots 14 and 15 to receive data frames.
Note 1: Do not set or reset the BasicCAN bit while the CAN module is operating (CAN Status Regis-
ter State_Reset bit = 0).
Note 2: Slot 14 is the first slot to become active after clearing the Reset0 bit.
Note 3: Even during BasicCAN mode, slot 0 through slot 13 can be used in the same way as when
operating normally.
202
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
203
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0 : Sleep mode On
Sleep Sleep mode control bit (Note)
1 : Sleep mode Off
Note: After CAN sleep mode is canceled, set up the CAN configuration. While the CAN module is in sleep
mode, no SFR registers for the CAN, except the sleep mode control register, can be accessed for
read or write.
204
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit R W
symbol Bit name Function
b3 b2 b1 b0
MBox0
0 0
0 0 : Slot 0
0 0
1 0 : Slot 1
MBox1 0 0
1 1 : Slot 2
Active slot 0 1
0 0 : Slot 3
determination bit • •
MBox2 • •
1 1 0 1 : Slot 13
1 1 1 0 : Slot 14
MBox3 1 1 1 1 : Slot 15
0: Operating
State_Reset CAN reset status
1: Reset
0: Normal mode
State_LoopBack Loop back status
1: Loop back mode
Nothing is assigned. When write, set to "0".
When read, its content is indeterminate.
0: Normal mode
State_BasicCAN Basic CAN status
1: Basic CAN mode
0: No error occurred
State_BusError CAN bus error
1: Error occurred
0: Not error passive state
State_ErrPas Error passive status
1: Error passive state
0: Not bus-off state
State_BusOff Bus-off status
1: Bus-off state
Nothing is assigned. When write, set to "0".
When read, its content is indeterminate.
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
205
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
206
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
207
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit R W
symbol Bit name Function
0: Standard ID format
IDE15 Expansion ID15 (slot 15)
1: Extended ID format
0: Standard ID format
IDE14 Expansion ID14 (slot 14)
1: Extended ID format
0: Standard ID format
IDE13 Expansion ID13 (slot 13)
1: Extended ID format
0: Standard ID format
IDE12 Expansion ID12 (slot 12)
1: Extended ID format
0: Standard ID format
IDE11 Expansion ID11 (slot 11)
1: Extended ID format
0: Standard ID format
IDE10 Expansion ID10 (slot 10)
1: Extended ID format
0: Standard ID format
IDE9 Expansion ID9 (slot 9)
1: Extended ID format
0: Standard ID format
IDE8 Expansion ID8 (slot 8)
1: Extended ID format
0: Standard ID format
IDE7 Expansion ID7 (slot 7)
1: Extended ID format
0: Standard ID format
IDE6 Expansion ID6 (slot 6)
1: Extended ID format
0: Standard ID format
IDE5 Expansion ID5 (slot 5)
1: Extended ID format
0: Standard ID format
IDE4 Expansion ID4 (slot 4)
1: Extended ID format
0: Standard ID format
IDE3 Expansion ID3 (slot 3)
1: Extended ID format
0: Standard ID format
IDE2 Expansion ID2 (slot 2)
1: Extended ID format
0: Standard ID format
IDE1 Expansion ID1 (slot 1)
1: Extended ID format
0: Standard ID format
IDE0 Expansion ID0 (slot 0)
1: Extended ID format
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
208
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0: Sampled once
SAM Sampling number
1: Sampled three times
b7 b6 b5
PTS0 0 0 0: Propagation Time Segment = 1Tq
0 0 1: Propagation Time Segment = 2Tq
Propagation Time 0 1 0: Propagation Time Segment = 3Tq
PTS1 0 1 1: Propagation Time Segment = 4Tq
Segment 1 0 0: Propagation Time Segment = 5Tq
1 0 1: Propagation Time Segment = 6Tq
PTS2 1 1 0: Propagation Time Segment = 7Tq
1 1 1: Propagation Time Segment = 8Tq
b10 b9 b8
PBS10 0 0 0: Must not be set
0 0 1: Phase Buffer Segment 1 = 2Tq
Phase Buffer 0 1 0: Phase Buffer Segment 1 = 3Tq
PBS11 0 1 1: Phase Buffer Segment 1 = 4Tq
Segment 1 1 0 0: Phase Buffer Segment 1 = 5Tq
1 0 1: Phase Buffer Segment 1 = 6Tq
PBS12 1 1 0: Phase Buffer Segment 1 = 7Tq
1 1 1: Phase Buffer Segment 1 = 8Tq
b13 b12 b11
PBS20 0 0 0: Must not be set
0 0 1: Phase Buffer Segment 2 = 2Tq
Phase Buffer 0 1 0: Phase Buffer Segment 2 = 3Tq
PBS21 0 1 1: Phase Buffer Segment 2 = 4Tq
Segment 2 1 0 0: Phase Buffer Segment 2 = 5Tq
1 0 1: Phase Buffer Segment 2 = 6Tq
PBS22 1 1 0: Phase Buffer Segment 2 = 7Tq
1 1 1: Phase Buffer Segment 2 = 8Tq
b15 b14
SJW0
reSynchronization 0 0: SJW = 1Tq
0 1: SJW = 2Tq
Jump Width 1 0: SJW = 3Tq
SJW1 1 1: SJW = 4Tq
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
209
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Table 1.22.2 Bit Timing Setup Example when the CPU Clock = 30 MHz
Baud rate BRP Tq period (ns) 1 bit's Tq number PTS+PBS1 PBS2 Sample point
1Mbps 1 66.7 15 12 2 87%
1 66.7 15 11 3 80%
1 66.7 15 10 4 73%
2 100 10 7 2 80%
2 100 10 6 3 70%
2 100 10 5 4 60%
500Kbps 2 100 20 16 3 85%
2 100 20 15 4 80%
2 100 20 14 5 75%
3 133.3 15 12 2 87%
3 133.3 15 11 3 80%
3 133.3 15 10 4 73%
4 166.7 12 9 2 83%
4 166.7 12 8 3 75%
4 166.7 12 7 4 67%
5 200 10 7 2 80%
5 200 10 6 3 70%
5 200 10 5 4 60%
210
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Function R W
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
211
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Function R W
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
212
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit R W
symbol Bit name Function
Slot 15 interrupt 0: Interrupt not requested
SIS15 (Note 2)
request status bit 1: Interrupt requested
Slot 14 interrupt 0: Interrupt not requested
SIS14 (Note 2)
request status bit 1: Interrupt requested
Slot 13 interrupt 0: Interrupt not requested
SIS13 (Note 2)
request status bit 1: Interrupt requested
Slot 12 interrupt 0: Interrupt not requested
SIS12 (Note 2)
request status bit 1: Interrupt requested
Slot 11 interrupt 0: Interrupt not requested
SIS11 (Note 2)
request status bit 1: Interrupt requested
Slot 10 interrupt 0: Interrupt not requested
SIS10 (Note 2)
request status bit 1: Interrupt requested
Slot 9 interrupt 0: Interrupt not requested
SIS9 (Note 2)
request status bit 1: Interrupt requested
Slot 8 interrupt 0: Interrupt not requested
SIS8 (Note 2)
request status bit 1: Interrupt requested
Note 1: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Note 2: "0" can be set. When set to "1", the previous value is remained.
213
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Note 1: To clear any bit of the CAN Interrupt Status Register, write 0 to the bit to be cleared and 1 to
all other bits, without using bit clear instructions.
Example : Assembler language mov.w #07FFFh, C0SISTR
C language c0sister = 0x7FFF;
Note 2: For remote frame receive slots whose automatic answering function is enabled, the slot
interrupt status bit is set when the CAN module finished receiving a remote frame and when
it finished transmitting a data frame.
Note 3: For remote frame transmit slots, the slot interrupt status bit is set when the CAN module
finished transmitting a remote frame and when it finished receiving a data frame.
Note 4: If the slot interrupt status bit is set by an interrupt request at the same time it is cleared by
writing in software, the former has priority, i.e., the slot interrupt status bit is set.
214
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit R W
symbol Bit name Function
Slot 15 interrupt 0: Interrupt request masked (disabled)
SIM15
request mask bit 1: Interrupt request enabled
Slot 14 interrupt 0: Interrupt request masked (disabled)
SIM14
request mask bit 1: Interrupt request enabled
Slot 13 interrupt 0: Interrupt request masked (disabled)
SIM13
request mask bit 1: Interrupt request enabled
Slot 12 interrupt 0: Interrupt request masked (disabled)
SIM12
request mask bit 1: Interrupt request enabled
Slot 11 interrupt 0: Interrupt request masked (disabled)
SIM11
request mask bit 1: Interrupt request enabled
Slot 10 interrupt 0: Interrupt request masked (disabled)
SIM10
request mask bit 1: Interrupt request enabled
Slot 9 interrupt 0: Interrupt request masked (disabled)
SIM9
request mask bit 1: Interrupt request enabled
Slot 8 interrupt 0: Interrupt request masked (disabled)
SIM8
request mask bit 1: Interrupt request enabled
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
215
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
216
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
Note 1: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Note 2: "0" can be set. When set to "1", the previous value is remained.
Note 1: To clear any bit of the CAN Error Interrupt Status Register, write 0 to the bit to be cleared and
1 to all other bits, without using bit clear instructions.
Example: Assembler language mov.B #006h, C0EISTR
C language c0eistr = 0x06;
217
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
C0SISTR
C0SIMKR
Slot 15 transmit/receive finished
Data bus 19-source inputs
SIS15
b0 F/F
CAN0 transmit/ receive
SIM15 (Level) error interrupt
b0 F/F
SIS14
b1 F/F
SIM14
b1 F/F
SIS13
b2 F/F
SIM13
b2
F/F
SIS12
b3 F/F
SIM12
b3 F/F
SIS11
b4
F/F
SIM11
b4 F/F
SIS10
b5 F/F
SIM10
b5 F/F
SIS9
b6 F/F
SIM9
b6 F/F
SIS8
b7 F/F
SIM8
b7
F/F
Figure 1.22.17. CAN0 transmit, receive and error interrupt block diagram (1/3)
218
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
C0SISTR
C0SIMKR
Slot 7 transmit/receive finished
SIS6
b9 F/F
SIM6
b9 F/F
SIS5
b10 F/F
SIM5
b10
F/F
SIS4
b11 F/F
SIM4
b11 F/F
SIS3
b12
F/F
SIM3
b12 F/F
SIS2
b13 F/F
SIM2
b13 F/F
SIS1
b14 F/F
SIM1
b14 F/F
SIS0
b15 F/F
SIM0
b15
F/F
Figure 1.22.18. CAN0 transmit, receive and error interrupt block diagram (2/3)
219
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
C0EISTR
C0EIMKR
CAN bus error occur
Data bus 19-source inputs
BEIS
b2 F/F
To the previous page
BEIM (Level)
b2 F/F
EPIS
b1 F/F
EPIM
b1 F/F
BOIS
b0 F/F
BOIM
b0
F/F
Figure 1.22.19. CAN0 transmit, receive and error interrupt block diagram (3/3)
220
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0: ID not checked
SID6M Standard ID6
1: ID checked
0: ID not checked
SID7M Standard ID7
1: ID checked
0: ID not checked
SID8M Standard ID8
1: ID checked
0: ID not checked
SID9M Standard ID9
1: ID checked
0: ID not checked
SID10M Standard ID10
1: ID checked
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Figure 1.22.20. CAN0 global mask register standard ID0 and CAN0 local mask register A, B standard ID0
221
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0: ID not checked
SID0M Standard ID0
1: ID checked
0: ID not checked
SID1M Standard ID1
1: ID checked
0: ID not checked
SID2M Standard ID2
1: ID checked
0: ID not checked
SID3M Standard ID3
1: ID checked
0: ID not checked
SID4M Standard ID4
1: ID checked
0: ID not checked
SID5M Standard ID5
1: ID checked
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Figure 1.22.21. CAN0 global mask register standard ID1 and CAN0 local mask register A, B standard ID1
222
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit R W
symbol Bit name Function
0: ID not checked
EID14M Extend ID14
1: ID checked
0: ID not checked
EID15M Extend ID15
1: ID checked
0: ID not checked
EID16M Extend ID16
1: ID checked
0: ID not checked
EID17M Extend ID17
1: ID checked
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Figure 1.22.22. CAN0 global mask register extend ID0 and CAN0 local mask register A, B extend ID0
223
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0: ID not checked
EID6M Extend ID6
1: ID checked
0: ID not checked
EID7M Extend ID7
1: ID checked
0: ID not checked
EID8M Extend ID8
1: ID checked
0: ID not checked
EID9M Extend ID9
1: ID checked
0: ID not checked
EID10M Extend ID10
1: ID checked
0: ID not checked
EID11M Extend ID11
1: ID checked
0: ID not checked
EID12M Extend ID12
1: ID checked
0: ID not checked
EID13M Extend ID13
1: ID checked
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Figure 1.22.23. CAN0 global mask register extend ID1 and CAN0 local mask register A, B extend ID1
224
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
0: ID not checked
EID0M Extend ID0
1: ID checked
0: ID not checked
EID1M Extend ID1
1: ID checked
0: ID not checked
EID2M Extend ID2
1: ID checked
0: ID not checked
EID3M Extend ID3
1: ID checked
0: ID not checked
EID4M Extend ID4
1: ID checked
0: ID not checked
EID5M Extend ID5
1: ID checked
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Figure 1.22.24. CAN0 global mask register extend ID2 and CAN0 local mask register A, B extend ID2
225
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
When receive, When transmitting When receiving (Note 2)
NewData Transmit/receive
0: Not transmitted yet 0: Not received yet
When transmit, finished flag
SentData 1: Finished transmitting 1: Finished receiving
When receive, When transmitting When receiving
InvalData Transmitting/
0: Stopped transmitting 0: Stopped receiving
When transmit, receiving flag 1: Accepted transmit request 1: Storing received data
TrmActive
0: Over run error not occurred
MsgLost Overwrite flag (Note 2)
1: Over run error occurred
Using BasicCan mode
Remote flame 0: Data flame received (status) (Note 2)
1: Remote flame received (status)
RemActive transmit/receive
Not using BasicCan mode
status flag 0: Data flame
1: Remote flame
Automatic answering 0: Automatic answering of remote flame enable
RspLock
disable bit 1: Automatic answering of remote flame disable
226
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Note 1: Before reading received data from the message slot, be sure to clear the NewData (transmis-
sion/reception finished status) bit. Also, if the NewData bit is set to 1 after readout, it means
that new received data has been stored in the message slot while reading out from the slot,
and that the read data contains an indeterminate value. In this case, discard the read data
and clear the NewData bit before reading out from the slot again.
Note 2: The NewData bit is not set by a completion of remote frame transmission or reception.
227
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
228
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
b3 b2 b1 b0
SBS00 0 0 0 0: slot 0
0 0 1 0: slot 1
0 0 1 1: slot 2
SBS01 CAN0 message 0 1 0 0: slot 3
slot buffer 0 • • (Note 1)
• •
number select bit • •
SBS02 1 1 0 0: slot 12
1 1 0 1: slot 13
1 1 1 0: slot 14
SBS03
1 1 1 1: slot 15
b3 b2 b1 b0
SBS10 0 0 0 0: slot 0
0 0 1 0: slot 1
0 0 1 1: slot 2
SBS11 CAN0 message 0 1 0 0: slot 3
slot buffer 1 • • (Note 1)
• •
number select bit • •
SBS12
1 1 0 0: slot 12
1 1 0 1: slot 13
SBS13 1 1 1 0: slot 14
1 1 1 1: slot 15
Note 1: There is a total of 16 CAN0 message slots for transmission and reception uses, respectively.
Each message slot can be selected for use as a transmit or a receive slot.
Note 2: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
Bits 4-7: CAN0 message slot buffer 1 slot number select bits (SBS1)
The message slot whose number is selected with these bits appears in CAN0 message slot buffer 1.
The selected message slot can be identified by reading the message slot buffer.
A message written to the message slot buffer is stored in the selected message slot.
229
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
Note: CAN0 message slot j standard ID0 (j=0 to 15) is stored in this register. j is selected with the slot
buffer select register.
Bit
symbol Bit name Function R W
Note: CAN0 message slot j standard ID1 (j=0 to 15) is stored in this register. j is selected with the slot
buffer select register.
Figure 1.22.27. CAN0 message slot buffer i standard ID0 and ID1
230
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
Note 1: When receive slot is standard ID format, EID bits are indeterminate when saving received data.
Note 2: CAN0 message slot j extend ID0 (j=0 to 15) is stored in this register. j is selected with the slot
buffer select register.
Bit
symbol Bit name Function R W
Note 1: When receive slot is standard ID format, EID bits are indeterminate when saving received data.
Note 2: CAN0 message slot j extend ID1 (j=0 to 15) is stored in this register. j is selected with the slot
buffer select register.
Figure 1.22.28. CAN0 message slot buffer i extended ID0 and ID1
231
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Bit
symbol Bit name Function R W
Note 1: When receive slot is standard ID format, EID bits are indeterminate when saving received data.
Note 2: CAN0 message slot j extend ID2 (j=0 to 15) is stored in this register. j is selected with the slot
buffer select register.
Bit
symbol Bit name Function R W
DLC0
DLC1
Data length set bit Message slot j (j=0 to 15)
DLC2
DLC3
Note : CAN0 message slot j data length code (j=0 to 15) is stored in this register. j is selected with the
slot buffer select register.
Figure 1.22.29. CAN0 message slot buffer i extended ID2 and CAN0 message slot buffer i data lengthcode
232
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Note : CAN0 message slot j time stamp high (j=0 to 15) is stored in this register. j is selected with the
slot buffer select register.
Note : CAN0 message slot j time stamp low (j=0 to 15) is stored in this register. j is selected with the
slot buffer select register.
Figure 1.22.30. CAN0 message slot buffer i data m and CAN0 message slot buffer i time stamp
233
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CAN Module
Note: This applies when the CAN module is supplied with a clock by setting the sleep mode control bit
(bit 0 at address 024216) to 1 after reset.
b15 b0
Write SID5 SID4 SID3 SID2 SID1 SID0 SID10 SID9 SID8 SID7 SID6
3-8 decode
b15 b8 b7 b0
Read CSID7 CSID6 CSID5 CSID4 CSID3 CSID2 CSID1 CSID0 SID10 SID9 SID8 SID7 SID6 SID5 SID4 SID3
b7 b6 b5 b4 b3 b2 b1 b0
From the receive ID of the standard for- 00716 00616 00516 00416 00316 00216 00116 00016
Top+0016
"0" "0" "0" "0" "0" "0" "1" "0"
mat, this register produces data with 00F16 00E16 00D16 00C16 00B16 00A16 00916 00816
Top+0116
which to search the data table. After "1" "0" "0" "0" "0" "0" "0" "0"
Write to C0AFS 0 0 1 1 0 0 1 1 0 0 0 1 1 0 1 1
SID10 SID0
8 bits 3 bits
b15 b8 b7 b0
234
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Intelligent I/O
Intelligent I/O uses multifunctional I/O ports for time measurement, waveform generation, clock-synchro-
nous/asynchronous (UART) serial I/O, IE bus (Note) communications, HDLC data processing and more. A
single Intelligent I/O group comes with one 16-bit base timer for free running, eight 16-bit registers for time
measurement and waveform generation, and two shift registers for 8-bit and 16-bit communications.
The M32C/83 has four internal Intelligent I/O groups. Table 1.23.1 lists functions by group.
Communication functions
•Bit length 8 bits fixed 8 bits fixed Variable length – –
•Communication mode
1. Clock synchronous serial I/O √ √ √ – –
2. UART √ √ – – –
3. HDLC data processing √ √ – – –
4. IE Bus sub set – – √ – –
Note 1: IE Bus is a trademark of NEC.
Note 2: 100-pin specification are in parentheses.
√ : Present
– : Not present
TM:Time Measurement
WG:Waveform Genaration
235
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
2 x (n+1) 16-bit
f1 Divider Base timer
Base timer carry output
Transmit interrupt
SI/O transmit Transmit data
buffer register SOF generation circuit Transmission
(8-bit) generation circuit
Transmit
buffer Bit insert circuit
Transmit
Transmit CRC
register
Transmit latch
Polarity
reversing
Start bit
Clock wait generation circuit
control Transmit output
Clock
circuit register
selector Parity bit (8-bit)
generation circuit
Transmit HDLC data
Stop bit shift register
transmit interrupt
generation circuit
Transmit
buffer
Clock
Arbitration Reception
selector
Receive Receive data
Receive input register CRC generation circuit
(8bit)
SI/O receive
Receive buffer register
buffer (8bit)
Bit insert
Polarity
check Receive Receive interrupt
Receive shit reversing buffer
register Start bit
Data register check Receive shift
(8-bit) register
Shift Parity bit
register check
Stop bit
Buffer check
register Special Special
HDLC data interrupt communication
process interrupt
4 check interrupt
/
Comparison Comparator
register
Comparison 4 Comparator
(8-bit) 4
(8-bit)
register
Comparison / Comparator
(8-bit) /
Comparison
(8-bit)
register (8-bit)
Comparator
register
(8-bit)
(8-bit) (8-bit) TM: Time Measurement
WG: Waveform Generation
Note 1: These pins aren't connected with external pins in 100-pin version.
Note 2: Each register becomes reset status after supplying a clock by setting of the base timer control register 0.
236
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
2 x (n+1) 16bits
f1 Divider Base timer
WG input from Gr0
(When cascaded)
Ch0 TM/WG OUTC10
TM input from Gr0 register (Note) /IST x D1
(When cascaded) PWM /BE1OUT
output
Digital Edge Ch1 TM/WG OUTC11
INPC11 /ISCLK1
filter DF select register
Ch4 TM/WG
OUTC14
register
PWM
output
Ch5 TM/WG
OUTC15 (Note 2)
register
8 Ch0 to ch7
/ interrupt request signal
Transmit interrupt
Arbitration Reception
Clock
selector Receive Receive data
Receive input register CRC
(8bit) generation circuit
SI/O receive
Receive buffer register
buffer (8bit)
Bit insert
Polarity check Receive
buffer Receive interrupt
Receive shit reversing
register Start bit
Data register check Receive shift
(8-bit) register
Shift Parity bit
register check
Stop bit
Buffer check
register Special Special
HDLC data interrupt communication
process interrupt check interrupt
4
/
Comparison
register
Comparison
Comparator
(8-bit)
register
Comparison 4 Comparator
(8-bit) 4
Comparison / Comparator
(8-bit) /
(8-bit)
register Comparator
register
(8-bit)
(8-bit)
(8-bit) (8-bit)
Note 1: Ch0 TM register can be used in 32-bit cascade connections. TM: Time Measurement
Note 2: These pins aren't connected with external pins in 100-pin version. WG: Waveform Generation
Note 3: Each register becomes reset status after supplying a clock by setting of the base timer control register 0.
237
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit modulation
ch0 WG register PWM
OUTC20
PWM /ISTxD2
IPS6 output
ISCLK20 0 0 control
Digital Bit modulation
ISCLK21
1 filter 1
ch1 WG register PWM
OUTC21
/ISCLK2
DF
ISRxD20 00 0
Digital Bit modulation
ISRxD21
01 filter 1
ch2 WG register PWM
OUTC22
PWM
ISRxD22 10 DF
output
IPS4,5 control
Bit modulation
ch3 WG register PWM
OUTC23
Bit modulation
ch4 WG register PWM
OUTC24
PWM
output
control
Bit modulation
ch5 WG register PWM
OUTC25
(Note 1)
Bit modulation
ch6 WG register PWM
OUTC26
PWM
output
control
Bit modulation
ch7 WG register PWM
OUTC27
8 Waveform
generation
interrupt
Transmit buffer
register(8-bit)
8
Byte counter
Arbitration
lost detect
ACK operation
Start bit
IE start bit interrupt
detect
IE transmit interrupt
Receive parity IE, serial I/O IE receive interrupt
interrupt control Serial I/O transmit interrupt
operation Serial I/O receive interrupt
Input
inverted
Statement
ID detect
length detect
Note 1: These pins aren't connected with external pins in 100-pin version.
Note 2: Each register becomes reset status after supplying a clock by setting of the base timer control register 0.
238
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit modulation
ch0 WG register PWM
OUTC30
PWM
output
control
Bit modulation
ch1 WG register PWM
OUTC31
Bit modulation
ch2 WG register PWM
OUTC32
PWM
output
control
Bit modulation
ch3 WG register PWM
OUTC33
Bit modulation
ch4 WG register PWM
OUTC34
PWM
ch4 mask register output
control
Bit modulation
ch5 WG register PWM
OUTC35
(Note 1)
ch5 mask register
Bit modulation
ch6 WG register PWM
OUTC36
PWM
ch6 mask register output
control
Bit modulation
ch7 WG register PWM
OUTC37
Note 1: These pins aren’t connected with external pins in 100-pin version. WG: Waveform Generation
Note 2: Each register becomes reset status after supplying a clock by setting of the base timer control register 0.
239
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Note : When this register is read while the base timer is being reset, the value is indeterminate.
The counter value is read if the register is output while the timer is running.
Written value while the base timer is being reset is ignored. The count starts from "000016" after
starting the base timer. When writing value while the base timer is operating, the count starts from
the written value immediately after written.
Bit
symbol Bit name Function R W
b1 b0
BCK0 0 0 : Clock stop
Count source
0 1 : Must not be set
select bit
1 0 : Must not be set
BCK1 1 1 : f1
b6 b5 b4 b3 b2
DIV1 (n=0) 0 0 0 0 0 : Division by 2
(n=1) 0 0 0 0 1 : Division by 4
(n=2) 0 0 0 1 0 : Division by 6
Count source
DIV2 :
division ratio (n=30) 1 1 1 1 0 : Division by 62
select bit (n=31) 1 1 1 1 1 : No division
DIV3
DIV4
Note: In cascade connections, set the same value to the base timer control register 0 of groups 0 and 1.
240
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
0: Synchronizes the base timer reset
Base timer reset without resetting the timer
RST0 1: Synchronizes the base timer reset
cause select bit 0
with resetting the timer (Note1)
0: Does not reset the base timer when
Base timer reset it matches WG register ch0
RST1 1: Reset the base timer when it matches
cause select bit 1
WG register ch0 (Note 2)
0: Does not reset the base timer when
Base timer reset input to the INT pin is "L" level
RST2 1: Reset the base timer when input to
cause select bit 2
the INT pin is "L" level (Note 3)
Note 1: With group 0, reset synchronizing with group 1 base timer. With group 1, reset synchronizing with
group 0 base timer.
Note 2: The base timer is reset 2 clock cycles after it matches waveform generation register ch0.
Note 3: With group 0, the base timer is reset when "L" level is input to INT0. With group 1, it resets when
"L" level is input to INT1.
Note 4:Operation of this mode is equal to Timer A two-phase pulse signal processing except count value.
Note 5: In cascade connections, set to "8116" for group 0 base timer control register 1. Set to "1000 0XX02"
for group 1 base timer control register 1.
241
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
0 : Synchronizes the group 1 base timer reset
Base timer
reset cause without resetting the timer
RST0
select bit 0 1 : Synchronizes the group 1 base timer reset
with resetting the timer
Base timer 0 : Does not reset the base timer when it matches WG
RST1 reset cause register ch0
select bit 1 1 : Reset the base timer when it matches WG register ch0 (Note)
Base timer 0 : Does not reset the base timer when a reset is requested
reset cause from the communication additional circuit
RST2
select bit 2 1 : Reset the base timer when a reset is requested from
the communication additional circuit
UD0
Reserve bit Must always set to "0".
UD1
Note : The base timer is reset 2 clock cycles after it matches waveform generation register ch0.
242
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
0 : Synchronizes the base timer 2 reset
Base timer
reset cause without resetting the timer
RST0
select bit 0 1 : Synchronizes the base timer 2 reset
with resetting the timer
Base timer 0 : Does not reset the base timer when it matches WG
RST1 reset cause register ch0
select bit 1 1 : Reset the base timer when it matches WG register ch0 (Note)
Parallel real-time
port function 0 : Not use
PRP
select bit 1 : Use
243
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
Note 1: When starting multiple base timer with this register at the same time (including group 0 and 1
cascaded connection), do the followings. Do not need when starting base timer individually.
* Set the same values to each group’s base timer clock division ratio ( bits 6 to 0 of base timer
control register).
* When changing base timer clock division ratio, start base timer twice with the following
procedure.
(1) Start each group base timer using the base timer start register.
(2) After one clock, stop base timer by setting "0016" to base timer start register.
(3) Further after one clock, restart each group base timer using the base timer start register.
Note 2: This register is enabled after when group 2 base timer control register 0 is set.
244
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Count start condition Writes "1" for the start bit in the base timer start register or base timer control
register 1. (After writing the bit, the base timer resets to "000016" and
counting starts.)
Count stop condition Writes "0" for both the start bit in the base timer start register and base timer
control register 1.
Count reset condition Group 0, 1 (1) Synchronizes and resets the base timer with that of another group.
Group 0: Synchronizes base timer reset with the group 1 base timer.
Group 1: Synchronizes base timer reset with the group 0 base timer.
(2) Matches the value of the base timer to the value of WG register 0.
(3) Input "L" to INT pin
Group 0 : INT 0 pin Group 1 : INT 1 pin
The above 3 factors can be used in conjunction with one another.
Group 2, 3 (1) Synchronizes and resets the base timer with that of another group.
Group 2: Synchronizes base timer reset with the group 1 base timer.
Group 3: Synchronizes base timer reset with the group 2 base timer.
(2) Matches the value of the base timer to the value of WG register 0.
(3) Reset request from communication additional circuit (group 2 only)
Count source
switching select bit
Interrupt timing
select bit
BT0S Base timer i
Reset signal interrupt request
BTS
Overflow signal
RST0
Other base timer reset
RST1
Matched to waveform
generation register 0
RST2
Input "L" to INT pin
(Group 0,1)
245
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
FFFF16
Contents of counter
800016
000016
b14 "1"
(Overflow signal)
"0"
"1"
b15 "0"
246
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
b1 b0
CST0 0 0 : No time measurement
Time measurement
0 1 : Rising edge
trigger select bit
1 0 : Falling edge
CST1
1 1 : Both edges
b3 b2
DF0 0 0 : No digital filter
Digital filter function
0 1 : Must not be set
select bit
1 0 : Base timer clock
DF1
1 1 : f1
247
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Note : This function is only built into time measurement ch6 and 7 of Intelligent I/O groups 0 and 1.
Bit
symbol Bit name Function R W
Note : In group 0, channles 2, 3, 6 and 7 cannot be selected in 16-bit mode. All channel can be selected
in 32-bit mode.
In group 1, channles 0 and 3 to 5 cannot be selected in 16-bit mode. All channel can be selected
in 32-bit mode.
248
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Trigger input polarity select •Rising edge •Falling edge •Both edges
Measurement start condition (Note) Write "1" to the function enable bit
(Set the corresponding pin to input with the function select register)
Select function •Digital filter function
Pulses will pass when they match either f1 or the base timerclock 3 times .
•Prescaler function (only for ch6 and ch7)
Counts trigger inputs and measures time by inputting a trigger of +1 the
value of the time measurement prescale register.
•Gate function (only for ch6 and ch7)
Prohibits the reception of trigger inputs after the time measurement starts
for the first trigger input. Trigger input is newly enabled when the below
conditions are satisfied.
(1) When the base timer i matches the value in WG register j
(2) When “1” is written for the gate function release bit
This bit automatically becomes “0” after the gate function is released.
Note: On channels where both the time measurement function and waveform output function can be used, select the
time measurement function for the function select register (addresses 00E716 and 012716).
Table 1. 23.4. List of time measurement channels with prescaler function and gate function
Group Channel TM register WG register matehes signal to release gate function
249
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
(a) When the rising edge has been selected as the trigger input polarity
Base timer
count source
Base timer n-2 n-1 n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11 n+12 n+13 n+14
value
Trigger input
Time measurement
interrupts request
signal
Delay by 1 clock
(b) When both edges have been selected as the trigger input polarity
Base timer
count source
Base timer n-2 n-1 n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11 n+12 n+13 n+14
value
Trigger input
Time measurement
interrupts request
signal
Trigger input
250
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
(a) When prescaler function is used (the value of time measurement prescaler register is "2".)
Base timer
counter source
Base timer n-2 n-1 n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 n+9 n+10 n+11 n+12 n+13 n+14
Trigger input
Internal time
measurement trigger
Prescaler 2 1 0 2
Time measurement
interrupts request signal
Time measurement
n+1 n+13
register
(b) When gate function is used (gate function released by matching WG register)
Base timer
counter source
FFFF16
WG register value (XXXX16)
Base timer
000016
Function enabled
flag
Trigger input
Waveform generation
register match signal
Gate signal
Time measurement
interrupts request signal
Time measurement
register
Figure 1. 23. 15. Operation timing when gate function and prescaler function is used
251
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
(Note 1)
Masks base timer value 000016 to FFFF16
(Note 2)
Note 1: This function is provided only for the waveform generation functions on ch 4 to 7 of Intelligent I/O group 3.
Note 2: Comparison results are masked in bit positions where a "1" has been set for the register bits.
252
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
b2 b1b0
MOD0 0 0 0 : Single PWM mode
0 0 1 : S-R PWM mode (Note 2)
0 1 0 : Phase delayed PWM mode
Operation mode
0 1 1 : Must not be set
MOD1 select bit 1 0 0 : Must not be set
1 0 1 : Must not be set
1 1 0 : Must not be set (Note 3)
MOD2 1 1 1 : Assigns communication output
to a port (Note 4)
253
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
b2 b1b0
MOD0 0 0 0 : Single PWM mode
0 0 1 : S-R PWM mode (Note 1)
0 1 0 : Phase delayed PWM mode
Operation mode
0 1 1 : Must not be set
MOD1 select bit 1 0 0 : Bit modulation PWM mode
1 0 1 : Must not be set
1 1 0 : Must not be set
MOD2 1 1 1 : Assigns communication output
to a port (Note 2)
Note 1: This setting is valid only on even-numbered channels. When this mode is selected, settings for
corresponding odd-numbered (even number + 1) channels are ignored. Waveforms are output for
even-numbered channels, not output for odd-numbered channels.
Note 2: This setting is valid only for group 2 WG function ch0 and 1. Do not set this value for other channels.
Note 3: Inverted output function is allocated at the final stage of WG circuit. Therefore, when selecting "0"
output by IVL bit and inverted output by INV bit, "1" is output.
Bit
symbol Bit name Function R W
254
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Bit
symbol Bit name Function R W
Note : In group 0, channles 2, 3, 6 and 7 cannot be selected in 16-bit mode. All channel can be selected
in 32-bit mode.
In group 1, channles 0 and 3 to 5 cannot be selected in 16-bit mode. All channel can be selected
in 32-bit mode.
Bit
symbol Bit name Function R W
RTP0 Ch0 RTP output buffer The corresponding port's output
RTP1 value is set
Ch1 RTP output buffer
0 : Output "0"
RTP2 Ch2 RTP output buffer 1 : Output "1"
RTP3 Ch3 RTP output buffer
RTP4 Ch4 RTP output buffer
RTP5 Ch5 RTP output buffer
RTP6 Ch6 RTP output buffer
RTP7 Ch7 RTP output buffer
255
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Waveform output start condition Write "1" to the function enable bit(Note)
Waveform output stop condition Write "0" to the function enable bit
Interrupt generation timing When the base timer value matches the WG register j
OUTC pin Pulse output (Corresponding pins are set with the function select register.)
Note: On channels where both the time measurement function and waveform output function can be used, select the
waveform output function for the function select register (addresses 00E716 and 012716).
Count source
Base timer xxxa xxxb xxxc xxxd xxxe ffff 0000 0001 xxxa xxxb 0000 0001 0002 0003
Output "H"
waveform "L"
Interrupt "1"
request flag "0"
Cleared by software.
Figure 1. 23. 20. Operation timing in single phase waveform output mode
256
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Waveform output start condition Write "1" to the function enable bit (Note)
Waveform output stop condition Write "0" to the function enable bit
Interrupt generation timing When the base timer value matches the WG register j
OUTCij pin Pulse output (Corresponding pins are set with the function select register.)
Note : On channels where both the time measurement function and waveform output function can be used, select the
waveform output function for the function select register (addresses 00E716 and 012716).
Count source
Base timer xxxa xxxb xxxc ffff 0000 0001 xxxa xxxb xxxc xxxd
Output "H"
waveform "L"
Interrupt "1"
request flag "0"
Figure 1. 23. 21. Operation timing in phase delayed waveform output mode
257
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Waveform output start condition Write "1" to the function enable bit (Note 3)
Waveform output stop condition Write "0" to the function enable bit
Interrupt generation timing When the base timer value matches the WG register j
OUTC pin (Note 4) Pulse output (Corresponding pins are set with the function select register.)
Note 1: The SR waveform output function that sets and resets the mode on ch0 and 1 cannot be used when the base
timer is reset by WG register 0 (ch0).
Note 2: Set WG register values for odd-numbered channels that are lower than even-numbered channels.
Note 3: On channels where both the time measurement function and waveform output function can be used, select the
waveform output function for the function select register (addresses 00E716 and 012716).
Note 4: SR waveforms are output for even-numbered channels only.
Note 5: Settings for the WG control register on the odd-numbered channels are ignored.
258
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Count source
Output "H"
waveform "L"
Cleared by software.
Channel j+1 Interrupt "1"
request flag "0"
Cleared by software.
259
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Waveform output start condition Write "1" to the function enable bit
Waveform output stop condition Write "0" to the function enable bit
Interrupt generation timing When the base timer value matches the WG register j
OUTC pin Pulse output (Corresponding pins are set with the function select register.)
Inverts waveform output level and outputs the waveform from the OUTC pin
WG register j
1024 pulses
3F16 Set value k
A
Base timer 6
low-order bits
0016
AA
k
Output waveform
AA
Increases the "L" level width for
1 clock cycle for an m number of
pulses out of 1,024
3F16
Base timer
6 low-order bits Set value k
0016
Base timer
A
count source
Internal signal
k k+1
Output waveform
260
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Waveform output start condition Write "1" to the function enable bit
Waveform output stop condition Write "0" to the function enable bit
Interrupt generation timing When the base timer value matches the WG register j
OUTC pin RTP output (Corresponding pins are set with the function select register.)
Read from the RTP output buffer register The set value is output
Write to the RTP output buffer register Can always write
Select function •Initial value setting function
Sets output level used at waveform output start
•Inverted output function
Inverts waveform output level and outputs the waveform from the
OUTC pin
Base timer
AAA
AAA
RTP output buffer register
RTP output
AAA
bit0 DQ OUTCi0
WG register 0 T
WG register 6
AAA
AAA
bit6 DQ
T
OUTCi6
AAA
bit7 (i=2, 3)
DQ OUTCi7
WG register 7 T
Count source
Base timer xxx5 xxx6 xxx7 xxx8 xxx9 xxxa xxxb xxxc xxxd xxxe xxxf
"H"
Output waveform "L"
Channel i "1"
interrupt request flag "0"
Cleared by software.
Figure 1. 23. 24. Block diagram and operation timing of real-time port output function
261
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
Waveform output start condition Write "1" to the function enable bit
Waveform output stop condition Write "0" to the function enable bit
Interrupt generation timing When the base timer value matches the WG register
OUTC pin RTP output (Corresponding pins are set with the function select
register.)
Read from the WG register The set value is output
Write to the WG register Can always write
Read from the RTP output buffer register The set value is output
262
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O
AA
AA
Real-time port output
buffer register
Real-time port output
AA
Base timer bit0 DQ OUTCi0
T
AA
bit1 DQ OUTCi1
WG register 0 T
AA
WG register 1 bit2 DQ OUTCi2
AA
T
WG register 2
bit3 DQ OUTCi3
WG register 3
AA
T
AA
T
WG register 5
bit5 DQ OUTCi5
AA
WG register 6 T
WG register 7 OUTCi6
AA
bit6 DQ
T
AA
bit7 DQ OUTCi7
T
(i=2, 3)
Count source
Base timer xxx1 xxx2 xxx3 xxx4 xxx5 xxx6 xxx7 xxxc xxxd xxxe xxxf
"H"
Output waveform
OUTCi1 "L"
Channel j "1"
interrupt request flag "0"
Cleared by software.
Channel j+1 "1"
interrupt request flag "0"
Cleared by software.
Channel j+2 "1"
interrupt request flag "0"
Cleared by software.
Figure 1. 23. 25. Block diagram and operation timing of parallel real-time port output function
263
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
264
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
0 : Transmission disabled
TE Transmit enable bit
1 : Transmission enabled
0 : Reception disabled
RE Receive enable bit
1 : Reception enabled
265
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
Nothing is assigned.
When read, their value are indeterminate.
Overrun error flag 0 : No overrun error
OER
(Note) 1 : Overrun error found
Bit
symbol Bit name Function R W
b1 b0
GMD0 0 0 : UART mode
Communication mode
0 1 : Serial I/O mode
select bit
1 0 : Special communication mode
GMD1
1 1 : HDLC data process mode
266
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
Bit
symbol Bit name Function R W
0 : Not use
ABTE Arbitration enable bit
1 : Use
Note : Other than when in the special communication mode or HDLC data processing mode, either
use the reset state as is or write "0016".
267
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
Data compare 0 : Does not compare the received data with
CMP0E function 0 data compare register 0
select bit 1 : Compare the received data with data compare register 0
Data compare 0 : Does not compare the received data with
CMP1E function 1 data compare register 1
select bit 1 : Compare the received data with data compare register 1
Data compare 0 : Does not compare the received data with
CMP2E function 2 data compare register 2
select bit 1 : Compare the received data with data compare register 2
Data compare 0 : Does not compare the received data with
CMP3E function 3 data compare register 3 (Note 2)
select bit 1 : Compare the received data with data compare register 3
Receive CRC 0 : Not enable
RCRCE
enable bit 1 : Enable
Receive shift 0 : Receive shift operation disabled
RSHTE operation
enable bit 1 : Receive shift operation enabled
Receive bit 0 : "1" is not deleted
RBSF0 stuffing "1" delete
select bit 1 : "1" is deleted
Receive bit 0 : "0" is not deleted
RBSF1 stuffing "1" delete
select bit 1 : "0" is deleted
Note 1: Other than when in the special communication mode or HDLC data processing mode, either
use the reset state as is or write "0016".
Note 2: To use the CRC initialization function (when bit 2 of SI/O expansion mode register is set to "1"),
set bit 3 to "1".
Bit
symbol Bit name Function R W
268
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Note : When using the data compare registers 0 and 1, the data mask registers 0 and 1 must be set.
Note : Computed results are initialized when the transmit CRC enable bit (bit 4 of group i expanded
transmit control register) is set to "0".
Note 1: Computed results are initialized when the receive CRC enable bit (bit 4 of group i expanded
reseive control register) is set to "0", or when the CRC initialization bit (bit 2 of group i SI/O
expansion mode register) is set to "1" and values match the data comparison register.
Note 2: Initialize to selected value when starting to receive.
269
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Table 1.23.12. Specifications of clock synchronous serial I/O mode (group 0 and 1)
Item Specification
Transfer data format • Transfer data length: 8 bits fixed
Transfer clock • When internal clock is selected
_ Transfer speed is determined when the base timer is reset by the ch0 WG function
Note: Set the transmission clock to at least 6 divisions of the base timer clock.
Table 1.23.13 lists I/O pin functions for the clock synchronous serial I/O mode of groups 0 and 1.
From when the operating mode is selected until transmission starts, the ISTxDi pin is "H" level. Figure
1.23.31 shows typical transmit/receive timings in clock synchronous serial I/O mode in group 0 and 1.
270
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Table 1.23.13. I/O pin functions in clock synchronous serial I/O mode of group 0, group 1
Pin name Function Selected method
ISTxD Serial data output • Use the ch0 WG function
(P76, P150, P73, P110) • Sets "111" for the operating mode select bit (bits 2, 1 and 0) in
WG control register 0
• Selects ISTxD output for the port using function select registers
A, B and C
ISRxD Serial data input • Selects a using port with input function select register
(P80, P152, P75, P112) • Selects I/O with function select register A
• Sets a selected port to input using the port direction register
ISCLK Transfer clock output • Use the ch1 WG function
(P77, P151, P74, P111) • Sets "111" for the operating mode select bit (bits 2, 1 and 0) in
WG control register 1
• Sets "0" for the internal/external clock select bit (bit 2) of the
SI/O communication mode register
• Selects ISCLK output for the port using function select registers
A, B and C
Transfer clock input • Selects a using port with input function select register
• Sets "1" for the internal/external clock select bit (bit 2) of the
SI/O communication mode register
• Sets a selected port to input using the port direction register
• Selects I/O port with function select register A
T: Transfer rate/2
t : Values set to ch2 WG register
Values set to ch3 WG register
Figure 1.23.31. Typical transmit/receive timings in clock synchronous serial I/O mode in group 0 and 1
271
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
272
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
k+2
Base timer
t
Transmit data Start Bit bit 0 bit 7 Parity Stop Bit (1 bit)
Receive data
(Input to INPCi2/ISRxDi pin
Start Bit bit 0 bit 7 Parity Stop Bit (1 bit)
(i=0,1))
Receive clock using
ch2 WG function
Reception completed
Interrupt request interrupt request
signal
273
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
274
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
b10 b9 b8
SZ0 0 0 0 : 8-bit long
0 0 1 : 1-bit long
0 1 0 : 2-bit long
SZ1 Transfer bit length : 3-bit long
0 1 1
select bit 1 0 0 : 4-bit long
SZ2 1 0 1 : 5-bit long
1 1 0 : 6-bit long
1 1 1 : 7-bit long
Note: When this bit is set to "1", set the parity function select bit to "0".
Bit
symbol Bit name Function R W
275
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
0 : Idle state
IEBBS IE Bus busy flag
1 : Busy state (start condition detected)
Note :When this bit is set to "0", hold "0" for at least 1 cycle of base timer .
Function R W
Address data
Address data
276
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
0 : No error
IEACK ACK error flag
1 : Error found (Note)
0 : No error
IETT Timing error flag
1 : Error found (Note)
0 : No error
IEABL Arbitration lost flag (Note)
1 : Error found
Note : Only "0" can be written for this bit. Also, it is cleared to "0" when "0" is written for bit 0 of the IE Bus
control register. At this time, hold "0" for at least 1 cycle of base timer clock.
Bit
symbol Bit name Function R W
0 : No error
IEPAR Parity error flag
1 : Error found (Note)
0 : No error
IERT Timing error flag
1 : Error found (Note)
Note : Only "0" can be written for this bit. Also, it is cleared to "0" when "0" is written for bit 0 of the IE Bus
control register. At this time, hold "0" for at least 1 cycle of base timer clock.
277
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
Bit
symbol Bit name Function R W
b1 b0
GMD0 0 0 : Communication part is reset
Communication mode (Overrun error flag is cleared)
select bit 0 1 : Serial I/O mode
GMD1 1 0 : Special communication mode
1 1 : HDLC data process mode
Internal/external clock 0 : Internal clock (Note 2)
CKDIR
select bit 1 : External clock (Note 3)
Note 1: Intelligent I/O group 2 has IE bus communication function as special communication function.
Note 2: Select a pin for clock output by setting the waveform generation control register, input function select
register, and function select registers A, B and C. Data transmission pins are the same as clock
output pins.
Note 3: Select which pins will input the clock with the input function select register and set those pins to the
input port using function select register A. Data input pins are the same as with clock input pins.
Bit
symbol Bit name Function R W
0 : Transmission disabled
TE Transmit enable bit
1 : Transmission enabled
0 : Reception disabled
RE Receive enable bit
1 : Reception enabled
278
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
279
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Intelligent I/O (Serial I/O)
k+2
Base timer
t
Writes data to the transmit register Writes data to the transmit register
(8 bits) (4 bits)
Transmit/Receive clock
using ch2 WG function
First writing to
bit 0 bit 1 bit 2 bit 6 bit 7
the transmit buffer
Second writing to
bit 8 bit 9 bit 10 bit 11
the transmit buffer
Receive data bit 0 bit 1 bit 2 bit 5 bit 6 bit 7 bit 8 bit 9 bit 10 bit 11
Figure 1. 23. 38. Typical transmit/receive timings in clock synchronous serial I/O mode in group 2
280
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
A-D Converter
The A-D converter consists of two 10-bit successive approximation A-D converter circuit with a capacitive
coupling amplifier. Pins P100 to P107, P150 to P157, P00 to P07, P20 to P27, P95, and P96 are shared as the
analog signal input pins. Pins P150 to P157, P00 to P07 and P20 to P27 can be used as the analog signal
input pins and switched by analog input port select bit. However, P00 to P07 and P20 to P27 can be used in
single chip mode. Set input to direction register corresponding to a pin doing A-D conversion.
The result of A-D conversion is stored in the A-D registers of the selected pins.
Table 1.24.1 shows the performance of the A-D converter. Figure 1.24.1 shows the block diagram of the
A-D converter, and Figures 1.24.2 to 1.24.7 show the A-D converter-related registers.
281
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
AN20
000
AN21
ADiCON2 : 001
TRG1, TRG0 AN22
010
ADTRG AN23
011
TB2INT EX TRGi P2
AN24
100
IIOG2 ch1 INT (i=0) ADiCON0 :
TRG AN25
or 101
IIOG3 ch1 INT (i=1) AN26
110
AN27
111
000
AN00
001
AN01
010
AN02
AD0CON1 :
OPA0, OPA1 011
AN03
AN04 P0
100
P96 ANEX1 AN05
X1 101
AN0 AN150
000 000
AN1 AD1CON2 : 11 AN151
001 APS1, APS0 10 001
AN2 00 AN152
010 010
01
AN3 AN153
011 011
00
P10 AN4
100
0 1 0 1
100
AN154 P15
AN5 AD0CON2 : ADS AN155
101 101
AN6 AN156
110 110
AD0CON0 : AD1CON0 :
AN7 AN157
111 CH2, CH1, CH0 CH2, CH1, CH0 111
Decoder
1 1
1/3 1 1/3 1
0 0
ØAD0 ØAD1
0 0
1 1
fAD 1/2 1/2 fAD 1/2 1/2
0 0
282
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
283
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Note 1: If the A-D0 control register 0 is rewritten during A-D conversion, the conversion result is indeterminate.
Note 2: When changing A-D operation mode, set analog input pin again.
Note 3: This bit is disabled in single sweep mode, repeat sweep mode 0 and repeat sweep mode 1.
Note 4: External trigger request cause can be selected in external trigger request cause select bit (bit5
and bit 6 of address 039416).
Note 5: When External trigger is selected, set to "1" after selecting the external trigger request cause
using the external trigger request cause select bit.
Note 6: When f(XIN) is over 10 MHz, the AD frequency must be under 10 MHz by dividing.
284
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
b6 b7
OPA0 External op-amp 0 0 : ANEX0 and ANEX1 are not used (Note 5)
connection mode 0 1 : ANEX0 input is A-D converted (Note 6)
bit 1 0 : ANEX1 input is A-D converted (Note 7)
OPA1 (Note 4) 1 1 : External op-amp connection mode (Note 8)
Note 1: If the A-D0 control register 1 is rewritten during A-D conversion, the conversion result is indeterminate.
Note 2: This bit is invalid in One-shot mode and Repeat mode. Channel shown in the parentheses,
becomes valid when repeat sweep mode 1(bit2="1") is selected.
Note 3: When f(XIN) is over 10 MHz, the AD frequency must be under 10 MHz by dividing.
Note 4: In single sweep mode and repeat sweep mode 0, 1, bit 7 and bit 6 cannot be set "01" and "10".
Note 5: When this bit is set, set "00" to bit6 and bit5 of function select register B3.
Note 6: When this bit is set, set "1" to bit5 of function select register B3.
Note 7: When this bit is set, set "1" to bit6 of function select register B3.
Note 8: When this bit is set, set "11" to bit6 and bit5 of function select register B3.
285
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Bit
Symbol Bit name Function R W
Note 1: If the A-D0 control register 2 is rewritten during A-D conversion, the conversion result is indeterminate
Note 2: When the A-D circuit of either of A-D0 and A-D1 are operated, do not write "1" to this bit.
Note 3: This bit is valid when software trigger is selected.
Note 4: When this bit read, the value is indeterminate.
Note 5: This is valid in three-phase PWM mode.
Note 6: Turn every setting of A-D0 and A-D1 into same, and start at the same time in sweep mode.
Function R W
Nothing is assigned.
When write, set "0". When read, their contents are indeterminate.
286
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CH0 0 0 0 : ANj0
0 0 1 : ANj1
0 1 0 : ANj2
Analog input pin 0 1 1 : ANj3
CH1 (Note 2, 3, 4)
select bit 1 0 0 : ANj4
1 0 1 : ANj5
CH2 1 1 0 : ANj6
1 1 1 : ANj7 (j=0, 2, 15)
b4 b3
MD0 0 0 : One-shot mode
A-D operation 0 1 : Repeat mode
mode select bit 0 1 0 : Single sweep mode (Note 2)
MD1 1 1 : Repeat sweep mode 0
Repeat sweep mode 1
0 : Software trigger
TRG Trigger select bit
1 : External trigger (Note 5, 6)
287
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
b1 b0
SCAN0 0 0 : ANj0,ANj1 (ANj0)
A-D sweep pin 0 1 : ANj0 to ANj3 (ANj0,ANj1) (Note 2, 3)
select bit 1 0 : ANj0 to ANj5 (ANj0 to ANj2)
SCAN1
1 1 : ANj0 to ANj7 (ANj0 to ANj3) (j=0, 2, 15)
Nothing is assigned.
When write, set to "0". When read,
their contents are indeterminate.
Note 1: If the A-D1 control register 1 is rewritten during A-D conversion, the conversion result is indeterminate.
Note 2: This bit is invalid in one-shot mode and repeat mode. Channel shown in the parentheses,
becomes valid when repeat sweep mode 1(bit 2 = "1") is selected.
Note 3: j=0, 2, 15 is selected by analog input port select bits (bit1 and bit 2 of address 01D416).
Note 4: When f(XIN) is over 10 MHz, the AD frequency must be under 10 MHz by dividing.
288
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Bit
Symbol Bit name Bit name R W
Nothing is assigned.
When write, set to "0". When read, their contents are
indeterminate.
b6 b5
Nothing is assigned.
When write, set to "0". When read, its content is indeterminate.
Note 1: If the A-D1 control register 2 is rewritten during A-D conversion, the conversion.
Note 2: This is valid in three-phase PWM mode.
Function R W
Nothing is assigned.
When write, set to "0". When read, their contents are indeterminate.
289
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
290
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
291
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
00 01 10
292
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
293
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Bit 7 Bit 6
Resistance ladder
AN0
AN1
AN2
Analog AN3
input AN4
AN5
AN6
AN7
ANEX0
ANEX1
Comparator
External op-amp
294
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Precaution
After A-D conversion is complete, if the CPU reads the A-D register at the same time as the A-D conver-
sion result is being saved to A-D register, wrong A-D conversion value is saved into the A-D register. This
happens when the internal CPU clock is selected from divided main clock or sub-clock.
295
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
D-A Conversion
D-A Converter
This is an 8-bit, R-2R type D-A converter. The microcomputer contains two independent D-A converters of
this type.
D-A conversion is performed when a value is written to the corresponding D-A register. Bits 0 and 1 (D-A
output enable bits) of the D-A control register decide if the result of conversion is to be output. Set the
function select register A3 to I/O port, the related input peripheral function of the function select register B3
to disabled and the direction register to input mode. Do not set the target port to pulled-up when D-A output
is enabled.
Output analog voltage (V) is determined by a set value (n : decimal) in the D-A register.
V = VREF X n/ 256 (n = 0 to 255)
VREF : reference voltage (This is unrelated to bit 5 of A-D control register 1 (addresses 039716, 01D716)
Table 1.25.1 lists the performance of the D-A converter. Figure 1.25.1 shows the block diagram of the D-A
converter. Figure 1.25.2 shows the D-A control register. Figure 1.25.3 shows the D-A converter equivalent
circuit.
When the D-A converter is not used, set the D-A register to "00" and D-A output enable bit to "0".
Table 1.25.1. Performance of D-A converter
Item Performance
Conversion method R-2R method
Resolution 8 bits
Analog output pin 2 channels
A
D-A register i (8) (i = 0, 1) (Address 039816, 039A16)
AAAAAA
P93 / DA0
P94 / DA1
296
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
D-A Conversion
Bit
symbol Bit name Function R W
0 : Output disabled
DA0E D-A0 output enable bit
1 : Output enabled
0 : Output disabled
DA1E D-A1 output enable bit
1 : Output enabled
Nothing is assigned.
When write, set to "0". When read, their contents are "0".
D-A register i
b7 b0 Symbol Address When reset
DAi(i=0,1) 039816, 039A16 Indeterminate
D-A register 0
"0" "1"
AVSS
VREF
297
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CRC
AAAAA AAAAAA
Data bus low-order bits
AAAAAAAAAA
AAAAA AAAAAA
Eight low-order bits Eight high-order bits
AAAAAAAAAA
AAAAAAAAAA
CRC data register (16)
(Addresses 037D16, 037C16)
AAAAAAAAAA
AAAAAAAAAA
CRC code generating circuit
x16 + x12 + x5 + 1
AAAAA
AAAAA
CRC input register (8) (Address 037E16)
298
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CRC
b15 b0
CRC data register CRCD
(1) Setting 000016
[037D16, 037C16]
b7 b0
2 cycles
After CRC calculation is complete
b15 b0
118916 CRC data register CRCD
[037D16, 037C16]
The code resulting from sending 0116 in LSB first mode is (1000 0000). Thus the CRC code in the generating polynomial,
(X16 + X12 + X5 + 1), becomes the remainder resulting from dividing (1000 0000) X16 by (1 0001 0000 0010 0001) in
conformity with the modulo-2 operation.
LSB
MSB Modulo-2 operation is
1000 1000 operation that complies
1 0001 0000 0010 0001 1000 0000 0000 0000 0000 0000 with the law given below.
1000 1000 0001 0000 1 0+0=0
1000 0001 0000 1000 0 0+1=1
1000 1000 0001 0000 1 1+0=1
1001 0001 1000 1000 1+1=0
LSB MSB -1 = 1
9 8 1 1
Thus the CRC code becomes (1001 0001 1000 1000). Since the operation is in LSB first mode, the (1001 0001 1000 1000)
corresponds to 118916 in hexadecimal notation. If the CRC operation in MSB first mode is necessary in the CRC operation
circuit built in the M32C, switch between the LSB side and the MSB side of the input-holding bits, and carry out the CRC
operation. Also switch between the MSB and LSB of the result as stored in CRC data.
b7 b0
CRC input register CRCIN
(3) Setting 2316
[037E16]
b15 b0
299
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
X-Y Converter
X-Y Converter
X-Y conversion rotates the 16 x 16 matrix data by 90 degrees. It can also be used to invert the top and
bottom of the 16-bit data. Figure 1.27.1 shows the XY control register.
The Xi and the Yi registers are 16-bit registers. There are 16 of each (where i= 0 to 15).
The Xi and Yi registers are mapped to the same address. The Xi register is a write-only register, while the
Yi register is a read-only register. Be sure to access the Xi and Yi registers in 16-bit units from an even
address. Operation cannot be guaranteed if you attempt to access these registers in 8-bit units.
XY control register
b7 b6 b5 b4 b3 b2 b1 b0 Symbol Address When reset
XYC 02E016 XXXXXX002
Bit
symbol Bit name Function R W
300
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
X-Y Converter
The reading of the Yi register is controlled by the read-mode set bit (bit 0 at address 02E016).
When the read-mode set bit (bit 0 at address 02E016) is “0”, specific bits in the Xi register can be read at the
same time as the Yi register is read.
For example, when you read the Y0 register, bit 0 is read as bit 0 of the X0 register, bit 1 is read as bit 0 of
the X1 register, ..., bit 14 is read as bit 0 of the X14 register, bit 15 as bit 0 of the X15 register. Similarly,
when you read the Y15 register, bit 0 is bit 15 of the X0 register, bit 1 is bit 15 of the X1 register, ..., bit 14 is
bit 15 of the X14 register, bit 15 is bit 15 of the X15 register.
Figure 1.27.2 shows the conversion table when the read mode set bit = “0”. Figure 1.27.3 shows the X-Y
conversion example.
Read address
Y6 register (0002CC16)
Y7 register (0002CE16)
Y5 register (0002CA16)
Y9 register (0002D216)
Y8 register (0002D016)
Y4 register (0002C816)
Y3 register (0002C616)
Y2 register (0002C416)
Y1 register (0002C216)
Y0 register (0002C016)
AA
AA
A
AA AA
A
AAA
A AAAA
A
AA
A AA
AAA
A
AA
AAA
A AA
A
AA
A
b15
X15 register (0002DE16)
X14 register (0002DC16)
AA
AA
A AA
A AA
A AA
AAA
A AA
A
X13 register (0002DA16)
X12 register (0002D816)
X11 register (0002D616)
AA
AA
A AA
A AA
A AA
AAA
A AA
A
X10 register (0002D416)
X9 register (0002D216)
Bit of Yi register
AA
AA
A AA
A AA
A AA
AAA
A AA
A
Write address X8 register (0002D016)
X7 register (0002CE16)
X6 register (0002CC16)
AA
AA
A AA
A AA
A AA
AAA
A AA
A
X5 register (0002CA16)
X4 register (0002C816)
X3 register (0002C616)
AA
AAA
A AAAA
A AA
AAA
A AA
A
X2 register (0002C416)
X1 register (0002C216)
b0
X0 register (0002C016)
b15 b0
Bit of Xi register
Figure 1.27.2. Conversion table when the read mode set bit = “0”
(X register) (Y register)
b14
b10
b13
b10
b13
b12
b15
b12
b11
b15
b11
b14
b7
b0
b3
b6
b3
b9
b2
b6
b5
b9
b2
b8
b1
b5
b4
b8
b1
b4
b7
b0
AAAAAAAA
X0-Reg Y0-Reg
A AA
X1 Y1
A AA
X2 Y2
X3 Y3
X4
X5
Y4
Y5 A A
AA
A
X6 Y6
AAAA
X7 Y7
AA
X8 Y8
X9 Y9
X10
X11
Y10
Y11 AA
AA
A
A
X12 Y12
A
X13 Y13
X14 Y14
X15 Y15
301
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
X-Y Converter
When the read-mode set bit (bit 0 at address 02E016) is “1”, you can read the value written to the Xi register
by reading the Yi register. Figure 1.27.4 shows the conversion table when the read mode set bit = “1”.
AA
AA
A AA
AAA
AAA
A AA
A AA
A A
AA
AA
A
X15,Y15 register (0002DE16)
AA
AA
A
X14,Y14 register (0002DC16)
X13,Y13 register (0002DA16)
X12,Y12 register (0002D816)
AA
AAA
A
AA
A AA
A
AA
AAA
A AA
A
AA
A AA
A
AA
A A
A
AA
AA
A AA
AAA
AAA
A AA
A AA
A A
X11,Y11 register (0002D616)
X10,Y10 register (0002D416)
X9,Y9 register (0002D216)
AA
AA
A AA
AAA
AAA
A AA
A AA
A A
Write address X8,Y8 register (0002D016)
Read address X7,Y7 register (0002CE16)
AA
AA
A AA
AAA
AAA
A AA
A AA
A A
X6,Y6 register (0002CC16)
X5,Y5 register (0002CA16)
X4,Y4 register (0002C816)
AA
AA
A AA
AAA
AAA
A AA
A AA
A A
X3,Y3 register (0002C616)
X2,Y2 register (0002C416)
X1,Y1 register (0002C216)
X0,Y0 register (0002C016)
b15 b0
Bit of Xi register
Bit of Yi register
Figure 1.27.4. Conversion table when the read mode set bit = “1”
The value written to the Xi register is controlled by the write mode set bit (bit 1 at address 02E016).
When the write mode set bit (bit 1 at address 02E016) is “0” and data is written to the Xi register, the bit
stream is written directly.
When the write mode set bit (bit 1 at address 02E016) is “1” and data is written to the Xi register, the bit
sequence is reversed so that the high becomes low and vice versa. Figure 1.27.5 shows the conversion
table when the write mode set bit = “1”.
b15 b0
Write address
b15 b0
Bit of Xi register
Figure 1.27.5. Conversion table when the write mode set bit = “1”
302
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
DRAM Controller
There is a built in DRAM controller to which it is possible to connect between 512 Kbytes and 8 Mbytes of
DRAM. Table 1.28.1 shows the functions of the DRAM controller.
Table 1.28.1. DRAM Controller Functions
DRAM space 512KB, 1MB, 2MB, 4MB, 8MB
Bus control 2CAS/1W
________ ________
Refresh CAS before RAS refresh, Self refresh-compatible
Function modes EDO-compatible, fast page mode-compatible
Waits 1 wait or 2 waits, programmable
To use the DRAM controller, use the DRAM space select bit of the DRAM control register (address 004016)
to specify the DRAM size. Figure 1.28.1 shows the DRAM control register.
The DRAM controller cannot be used in external memory mode 3 (bits 1 and 2 at address 000516 are “112”).
Always use the DRAM controller in external memory modes 0, 1, or 2.
When the data bus width is 16-bit in DRAM area, set "1" to R/W mode select bit (bit 2 at address 000416).
Set wait time between after DRAM power ON and before memory processing, and processing necessary
for dummy cycle to refresh DRAM by software.
Note 1: After reset, the content of this register is indeterminate. DRAM controller starts operation after
writing to this register.
Note 2: The number of cycles with 2 waits is 3-2-2. With 1 wait, it is 2-1-1.
Note 3: When you set to "1", both RAS and CAS change to "L". When you set to "0", RAS and CAS
change to "H" and then normal operation (read/write, refresh) is resumed. In stop mode, there is
no control.
Note 4: Set the bus width using the external data bus width control register (address 000B16). When
selecting 8-bit bus width, CASH is indeterminate.
303
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
Row address (A20) (A19) A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 –
512KB, 1MB
Row address (A20) A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 –
2MB, 4MB
Row address A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 –
8MB
Row address (A20) (A19) A18 A17 A16 A15 A14 A13 A12 A11 A10 (A9) –
512KB
Row address (A20) A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 (A9) –
Row address A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 (A9) –
Note 1: ( ) invalid bit: bits that change according to selected mode (8-bit/16-bit bus mode, DRAM
space).
Note 2: The figure is for 4Mx1 or 4Mx4 memory configuration. If you are using a 4Mx16 configuration,
use combinations of the following: For row addresses, MA0 to MA12; for column addresses
MA2 to MA8, MA11, and MA12. Or for row addresses MA1 to MA12; for column addresses
MA2 to MA9, MA11, MA12.
Note 3: "–" is indetermimate.
304
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
• Refresh
_______ _______
The refresh method is CAS before RAS. The refresh interval is set by the DRAM refresh interval set
register (address 004116). The refresh signal is not output in HOLD state. Figure 1.28.3 shows the
DRAM refresh interval set register.
Use the following formula to determine the value to set in the refresh interval set register.
Refresh interval set register value (0 to 255) = refresh interval time / (BCLK frequency X 32) - 1
b7 b6 b5 b4 b3 b2 b1 b0
REFCNT0 0 0 0 0 0 0 0 0 : 1.1 µs (Note)
0 0 0 0 0 0 0 1 : 2.1 µs
0 0 0 0 0 0 1 0 : 3.2 µs
REFCNT1
REFCNT2
1 1 1 1 1 1 1 1 : 272.8 µs
REFCNT3
REFCNT5
REFCNT6
REFCNT7
305
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
Example) One wait is selected by the wait select bit and 4MB is selected by the DRAM space select bit
Shifting to self-refresh
•••
mov.b #00000001b,DRAMCONT ;DRAM ignored, one wait is selected
mov.b #10001011b,DRAMCONT ;Set self-refresh, select 4MB and one wait
nop ;Two nops are needed
nop ;
•••
Disable self-refresh
•••
mov.b #00000001b,DRAMCONT ;Disable self-refresh, DRAM ignored, one wait is
;selected
mov.b #00001011b,DRAMCONT ;Select 4MB and one wait
nop ;Inhibit instruction to access DRAM area
nop
•••
Figures 1.28.4 to 1.28.6 show the bus timing during DRAM access.
306
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
BCLK
RAS
CASH
CASL
'H'
DW
D0 to D15
(EDO mode)
BCLK
RAS
CASH
CASL
DW
D0 to D15
307
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
BCLK
RAS
CASH
CASL
'H'
DW
D0 to D15
(EDO mode)
BCLK
RAS
CASH
CASL
DW
D0 to D15
308
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DRAM Controller
BCLK
RAS
CASH
CASL
"H"
DW
BCLK
RAS
CASH
CASL
"H"
DW
309
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
310
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
311
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Pull-up selection
Direction register
B
Input to respective peripheral functions
C
Analog signal
312
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Pull-up selection
Direction register
Port P1 control
register
B
Input to respective peripheral functions
313
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Pull-up selection D
Direction register
B
Input to respective peripheral functions
C
Analog signal
P53 (Note 1)
P60, P61
P63 to P65, P67
P70, P71 (Note 2)
P72 to P77
P80, P81
P82
P90 to P92
P93 to P96
P97
P110
P111, P112
P113
P120
P121, P122
P123 to P127
P130 to P134
(Note 3)
P135, P136
P137
P140, P141
P142, P143
P150, P151
P154, P155
: Present, : Not present
Note 1: P53 is clock output select bit for BCLK.
Note 2: P70 and P71 are N-channel open drain output.
Note 3: These ports exist in 144-pin version.
314
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Input-only port
Data bus
NMI
Bit
Symbol Bit name Function R W
315
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Bit
symbol Bit name Function R W
0 : "L" level
Pi_0 Port Pi0 register
1 : "H" level (Note 4)
0 : "L" level
Pi_1 Port Pi1 register
1 : "H" level (Note 4)
0 : "L" level
Pi_2 Port Pi2 register
1 : "H" level
0 : "L" level
Pi_3 Port Pi3 register
1 : "H" level
0 : "L" level
Pi_4 Port Pi4 register
1 : "H" level
0 : "L" level
Pi_5 Port Pi5 register (Note 5) (Note 6)
1 : "H" level
0 : "L" level
Pi_6 Port Pi6 register (Note 6)
1 : "H" level
0 : "L" level
Pi_7 Port Pi7 register (Note 6)
1 : "H" level
Note 1: Data is input and output to and from each pin by reading and writing to and from each corresponding bit.
Note 2: In memory expansion and microprocessor mode, the contents of corresponding port direction register
of pins A0 to A22, A23, D0 to D15, MA0 to MA12, CS0 to CS3, WRL/WR/CASL, WRH/BHE/CASH,
RD/DW, BCLK/ALE/CLKOUT, HLDA/ALE, HOLD, ALE/RAS, and RDY are not changed.
Note 3: Port 11 to 15 direction registers exist in 144-pin version.
Note 4: Port P70 and P71 output high impedance because of N-channel open drain output.
Note 5: Port P85 is read only (There is not W).
Note 6: Nothing is assigned in bit7 to bit5 of port P11 and bit7 of port P14.
When write, set to "0". When read, its content is indeterminate.
316
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Bit
symbol Bit name Function R W
317
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Bit
symbol Bit name Function R W
318
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
319
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
320
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
321
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
322
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
323
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Note: Although DA0, DA1, ANEX0 and ANEX1 can be used when "0" is set in this bit, the power supply
may be increased.
324
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Note: Since P0 to P5 operate as the bus in memory expansion mode and microprocessor mode,
do not set the pull-up control register. However, it is possible to select pull-up resistance
presence to the usable port as I/O port by setting.
Note: Since P0 to P5 operate as the bus in memory expansion mode and microprocessor mode,
do not set the pull-up control register. However, it is possible to select pull-up resistance
presence to the usable port as I/O port by setting.
325
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
326
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
327
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Bit
symbol Bit name Function R W
Assigns functions of INPC00, INPC01
/ISCLK0 and INPC02/ISRxD0/BE0IN
Group 0 input pin
IPS0 to the following ports.
select bit 0
0 : P76, P77, P80
1 : P150, P151, P152
Assigns functions of INPC11/ISCLK1
and INPC12/ISRxD1/BE1IN to the
Group 1 input pin
IPS1 following ports.
select bit 1
0 : P74, P75
1 : P111, P112
Note: Although AD input pin can be used when "0" is set in this bit,
the power supply may be increased.
Figure 1.29.18. Port control register and input function select register
328
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
Ports P0 to P15 (excluding P85) After setting for input mode, connect every pin to VSS via a resistance
(Note 1) (pull-down); or after setting for output mode, leave these pins open.
XOUT (Note 2) Open
NMI Connect via resistance to VCC (pull-up)
AVCC Connect to VCC
AVSS, VREF, BYTE Connect to VSS
Note 1: Ports P11 to P15 exist in 144-pin version.
Note 2: With external clock input to XIN pin.
Table 1.29.2. Example connection of unused pins in memory expansion mode and microprocessor mode
Pin name Connection
Ports P6 to P15 (excluding P85) After setting for input mode, connect every pin to VSS via a resistance
(Note 1) (pull-down); or after setting for output mode, leave these pins open.
BHE, ALE, HLDA, Open
XOUT(Note 2), BCLK
HOLD, RDY, NMI Connect via resistance to VCC (pull-up)
AVCC Connect to VCC
AVSS, VREF Connect to VSS
Note 1: Ports P11 to P15 exist in 144-pin version.
Note 2: With external clock input to XIN pin.
Microcomputer Microcomputer
Port P0 to P15 (except for P85) Port P6 to P15 (except for P85)
(Note)
(Input mode) (Input mode)
· · · ·
· · · ·
· · · ·
(Input mode) (Input mode)
(Output mode) Open (Output mode) Open
NMI
NMI BHE
HLDA
XOUT Open ALE Open
VCC XOUT
BCLK VCC
AVCC
BYTE HOLD
AVSS RDY
VREF AVCC
AVSS VSS
VSS
VREF
329
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
330
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
331
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
332
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Programmable I/O Port
333
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VDC
VDC
When power-supply voltage is 3.3V or under, set the internal VDC (Voltage Down Converter) unused.
Follow the steps given below to disable the VDC.
(1) Set bit 3 of the protect register to "1".
(2) Set the VDC control register 0 to "0F16".
(3) Set the VDC control register 0 to "8F16".
(4) Set bit 3 of the protect register to "0".
These steps must be performed after reset as immediately as possible with divide-by-8 clock. When the
VDC select bit has been set to "112" once, do not set any other values.
Bit
symbol Bit name Function R W
b1b0
VDC00 1 1: VDC unused
VDC select bit
Do not set any values other than "11".
VDC01
b3 b2
VDC02 1 1: VDC reference voltage Off
VDC reference voltage
select bit Do not set any values other than "11".
VDC03
VDC04
VDC06
0: VDC Off
VDC07 VDC enable bit
(Note 2) 1: VDC On
Note 1: Set bit 3 of the protect register (address 000A16) to "1" before rewriting this register.
Rewriting this register should be performed only when the VDC is to be off.
Note 2: This bit enables the setting of bit 0 to bit 3.
Set bit 7 to "0" first, and then write values to bit 0 to bit 3. After that, write "1" to bit 7.
The state changes at the time "1" is written to bit 7.
334
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
Usage Precaution
Timer A (timer mode)
(1) Reading the timer Ai register while a count is in progress allows reading, with arbitrary timing, the
value of the counter. Reading the timer Ai register while reloading gets “FFFF16”. Reading the timer Ai
register after setting a value in the timer Ai register with a count halted but before the counter starts
counting gets a proper value.
335
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
336
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
A-D Converter
(1) Write to each bit (except bit 6) of A-D i (i=0,1) control register 0, to each bit of A-D i control register 1,
and to each bit of A-D i control register 2 when A-D conversion is stopped (before a trigger occurs).
In particular, when the Vref connection bit is changed from “0” to “1”, start A-D conversion after an
elapse of 1 µs or longer.
(2) When changing A-D operation mode, select analog input pin again.
(3) Using one-shot mode or single sweep mode
Read the correspondence A-D register after confirming A-D conversion is finished. (It is known by A-
D conversion interrupt request bit.)
(4) Using repeat mode, repeat sweep mode 0 or repeat sweep mode 1
Use the undivided main clock as the internal CPU clock.
(5) When f(XIN) is faster than 10 MHz, make the frequency 10 MHz or less by dividing.
(6) Output impedance of sensor at A-D conversion (Reference value)
To carry out A-D conversion properly, charging the internal capacitor C shown in Figure 1.31.1 has to
be completed within a specified period of time T. Let output impedance of sensor equivalent circuit be
R0, microcomputer’s internal resistance be R, precision (error) of the A-D converter be X, and the A-
D converter’s resolution be Y (Y is 1024 in the 10-bit mode, and 256 in the 8-bit mode).
t
–
Vc is generally VC = VIN {1 – e C (R0 + R) }
X X
And when t = T, VC=VIN – VIN=VIN(1 – )
Y Y
T
– X
C (R0 + R)
e =
Y
T X
– =ln
C (R0 +R) Y
T
Hence, R0 = – –R
X
C • ln
Y
With the model shown in Figure 1.31.1 as an example, when the difference between VIN and VC becomes
0.1LSB, we find impedance R0 when voltage between pins VC changes from 0 to VIN-(0.1/1024) VIN in
time T. (0.1/1024) means that A-D precision drop due to insufficient capacitor charge is held to 0.1LSB at
time of A-D conversion in the 10-bit mode. Actual error however is the value of absolute precision added
to 0.1LSB. When f(XIN) = 10 MHz, T = 0.3 µs in the A-D conversion mode with sample & hold. Output
impedance R0 for sufficiently charging capacitor C within time T is determined as follows.
0.3 X 10-6
R0 = – – 7.8 X103 3.0 X 103
0.1
3.0 X 10 –12 • ln
1024
337
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
Thus, the allowable output impedance of the sensor circuit capable of thoroughly driving the A-D con-
verter turns out to be approximately 3.0 kΩ. Tables 1.31.1 and 1.31.2 show output impedance values
based on the LSB values.
R0 R (7.8k Ω)
VIN
C (3.0pF)
VC
(7) After A-D conversion is complete, if the CPU reads the A-D register at the same time as the A-D
conversion result is being saved to A-D register, wrong A-D conversion value is saved into the A-D
register. This happens when the internal CPU clock is selected from divided main clock or sub-clock.
Interrupts
(1) Setting the stack pointer
• The value of the stack pointer is initialized to 00000016 immediately after reset. Accepting an
interrupt before setting a value in the stack pointer may cause runaway. Be sure to set a value in
the stack pointer before accepting an interrupt.
_______
When using the NMI interrupt, initialize the stack pointer at the beginning of a program. Regard-
_______
ing the first instruction immediately after reset, generating any interrupts including the NMI inter-
rupt is prohibited.
Set an even address to the stack pointer so that operating efficiency is increased.
_______
(2) The NMI interrupt
_______
• As for the NMI interrupt pin, an interrupt cannot be prohibited. Connect it to the VCC pin via a
resistance (pulled-up) if unused.
_______
• The NMI pin also serves as P8 5, which is exclusively input. Reading the contents of the P8
register allows reading the pin value. Use the reading of this pin only for establishing the pin level
_______
at the time when the NMI interrupt is input.
_______
• Signal of "L" level width more than 1 clock of CPU operation clock (BCLK) is necessary for NMI
pin.
338
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
Tables 1.31.1. Output impedance values based on the LSB values (10-bit mode) Reference value
f(XIN) Cycle Sampling time R C Resolution R0max
(MHz) (µs) (µs) (kΩ) (pF) (LSB) (kΩ)
10 0.1 0.3 7.8 3.0 0.1 3.0
(3 X cycle, 0.3 4.5
Sample & hold 0.5 5.3
bit is enabled) 0.7 5.9
0.9 6.4
1.1 6.8
1.3 7.2
1.5 7.5
1.7 7.8
1.9 8.1
10 0.1 0.2 7.8 3.0 0.3 0.4
(2 X cycle, 0.5 0.9
Sample & hold 0.7 1.3
bit is disabled) 0.9 1.7
1.1 2.0
1.3 2.2
1.5 2.4
1.7 2.6
1.9 2.8
Tables 1.31.2. Output impedance values based on the LSB values (8-bit mode) Reference value
f(XIN) Cycle Sampling time R C Resolution R0max
(MHz) (µs) (µs) (kΩ) (pF) (LSB) (kΩ)
10 0.1 0.3 7.8 3.0 0.1 4.9
(3 X cycle, 0.3 7.0
Sample & hold 0.5 8.2
bit is enabled) 0.7 9.1
0.9 9.9
1.1 10.5
1.3 11.1
1.5 11.7
1.7 12.1
1.9 12.6
10 0.1 0.2 7.8 3.0 0.1 0.7
(2 X cycle, 0.3 2.1
Sample & hold 0.5 2.9
bit is disabled) 0.7 3.5
0.9 4.0
1.1 4.4
1.3 4.8
1.5 5.2
1.7 5.5
1.9 5.8
339
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
______
Figure 1.31.2. Switching condition of INT interrupt request
(4) Rewrite the interrupt control register
• When a instruction to rewrite the interrupt control register is executed but the interrupt is dis-
abled, the interrupt request bit is not set sometimes even if the interrupt request for that register
has been generated. This will depend on the instructions. If this creates problems, use the below
instructions to change the register.
Instructions : AND, OR, BCLR, BSET
DMAC
(1) Do not clear the DMA request bit of the DMAi request cause select register.
In M32C/83, when a DMA request is generated while the channel is disabled (Note), the DMA trans-
fer is not executed and the DMA request bit is cleared automatically.
Note :The DMA is disabled or the transfer count register is "0".
(2) When DMA transfer is done by a software trigger, set DSR and DRQ of the DMAi request cause
select register to "1" simultaneously using the OR instruction.
e.g.) OR.B #0A0h, DMiSL ; DMiSL is DMAi request cause select register
(3) When changing the DMAi request cause select bit of the DMAi request cause select register, set "1"
to the DMA request bit, simultaneously. In this case, disable the corresponding DMA channel to
disabled before changing the DMAi request cause select bit. To enable DMA at least 8+6xN cycles
(N: enabled channel number) following the instruction to write to the DMAi request cause select
register are needed.
340
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
Example) When DMA request cause is changed to timer A0 and using DMA0 in single transfer
after DMA initial setting
push.w R0 ; Store R0 register
stc DMD0, R0 ; Read DMA mode register 0
and.b #11111100b, R0L ; Clear DMA0 transfer mode select bit to "00"
ldc R0, DMD0 ; DMA0 disabled
mov.b #10000011b, DM0SL ; Select timer A0
; (Write "1" to DMA request bit simultaneously)
nop At least 8 + 6 x N cycles
: (N: enabled channel number)
ldc R0, DMD0 ; DMA0 enabled
pop.w R0 ; Restore R0 register
Noise
(1) A bypass capacitor should be inserted between Vcc-Vss line for reducing noise and latch-up
Connect a bypass capacitor (approx. 0.1µF) between the Vcc and Vss pins using short wiring and
thicker circuit traces.
__________
HOLD signal
__________
When using the HOLD input while P40 to P47 and P50 to P52 are set as output ports in single-chip mode,
you must first set all pins for P40 to P47 and P50 to P52 as input ports, then shift to microprocessor mode
or memory expansion mode.
341
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
(4) When D-A converter is not used, set output disabled with the D-A output enable bit of D-A control
register and set the D-A register to "0016".
(5) When D-A conversion is used, select the input peripheral function disabled with port P93 and P94 input
peripheral function select bit of the function select register B3.
When the input peripheral function disabled is selected, the port cannot be input even if the port
direction register is set to input (the input result becomes undefined).
Also, it is not possible to input a peripheral function.
DRAM controller
The DRAM self-refresh operates in stop mode, etc.
When shifting to self-refresh, select DRAM is ignored by the DRAM space select bit. In the next instruc-
tion, simultaneously set the DRAM space select bit and self-refresh ON by self-refresh mode bit. Also,
insert two NOPs after the instruction that sets the self-refresh mode bit to "1".
Do not access external memory while operating in self-refresh. (All external memory space access is
inhibited. )
When disabling self-refresh, simultaneously select DRAM is ignored by the DRAM space select bit and
self-refresh OFF by self-refresh mode bit. In the next instruction, set the DRAM space select bit.
Do not access the DRAM space immediately after setting the DRAM space select bit.
Example) One wait is selected by the wait select bit and 4MB is selected by the DRAM space select bit
Shifting to self-refresh
•••
mov.b #00000001b,DRAMCONT ;DRAM is ignored, one wait is selected
mov.b #10001011b,DRAMCONT ;Set self-refresh, select 4MB and one wait
nop ;Two nops are needed
nop ;
•••
Disable self-refresh
•••
mov.b #00000001b,DRAMCONT ;Disable self-refresh, DRAM ignored, one wait is
;selected
mov.b #00001011b,DRAMCONT ;Select 4MB and one wait
nop ;Inhibit instruction to access DRAM area
nop
•••
342
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage precaution
Notes on the microprocessor mode and transition after shifting from the micropro-
cessor mode to the memory expansion mode / single-chip mode
In microprocessor mode, the SFR, internal RAM, and external memory space can be accessed.
For that reason, the internal ROM area cannot be accessed.
After the reset has been released and the operation of shifting from the microprocessor mode has started
(“H” applied to the CNVSS pin), the internal ROM area cannot be accessed even if the CPU shifts to the
memory expansion mode or single-chip mode.
343
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Electrical characteristics SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical characteristics
Table 1.32.1. Absolute maximum ratings
Symbol Parameter Condition Rated value Unit
VCC Supply voltage VCC=AVCC -0.3 to 6.0 V
AVCC Analog supply voltage VCC=AVCC -0.3 to 6.0 V
______________
VI Input voltage RESET, CNVss, BYTE, P00-P07, P10-P17, -0.3 to Vcc+0.3 V
P20-P27, P30-P37, P40-P47, P50-P57, P60-
P67, P72-P77, P80-P87, P90-P97, P100-P107,
P110-P114, P120-P127, P130-P137, P140-
P146, P150-P157(Note1), VREF, XIN
P70, P71 -0.3 to 6.0 V
VO Output voltage P00-P07, P10-P17, P20-P27, P30-P37, P40- -0.3 to Vcc+0.3 V
P47, P50-P57, P60-P67, P72-P77, P80-P87,
P90-P97, P100-P107, P110-P114, P120-P127,
P130-P13 7, P14 0-P14 6 , P15 0-P15 7(Note1) ,
VREF, XIN
P70, P71 -0.3 to 6.0 V
Pd Power dissipation Topr=25°C 500 mW
Topr Operating ambient temperature -20 to 85/-40 to 85(Note 2) °C
Tstg Storage temperature -65 to 150 °C
344
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Electrical characteristics SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.32.2. Recommended operating conditions (referenced to VCC = 3.0V to 5.5V at Topr = – 20
to 85oC / – 40 to 85oC(Note3) unless otherwise specified)
Standard
Symbol Parameter Unit
Min. Typ. Max.
VCC Supply voltage(When VDC-ON) 3.0 5.0 5.5 V
Supply voltage(When VDC-pass through) 3.0 3.3 3.6 V
AVCC Analog supply voltage VCC V
VSS Supply voltage 0 V
AVSS Analog supply voltage 0 V
VIH "H" input voltage P20 -P27, P3 0-P3 7, P40-P4 7, P50 -P5 7, P60-P6 7, P7 2- 0.8Vcc Vcc V
P77, P80-P87, P90-P97, P100-P107, P110-P114, P120-
P127, P130-P137, P140-P146, P150-P157(Note5), XIN,
____________
RESET, CNVss, BYTE
P70, P71 0.8Vcc 6.0 V
P00-P07, P10-P17 0.8Vcc Vcc V
(during single-chip mode)
P00-P07, P10-P17 0.5Vcc Vcc V
(during memory-expansion and microprocessor modes)
VIL "L" input voltage P20 -P27, P3 0-P3 7, P40-P4 7, P50 -P5 7, P60-P6 7, P7 0- 0 0.2Vcc V
P77, P80-P87, P90-P97, P100-P107, P110-P114, P120-
P127, P130-P137, P140-P146, P150-P157(Note5), XIN,
____________
RESET, CNVss, BYTE
P00-P07, P10-P17 0 0.2Vcc V
(during single-chip mode)
P00-P07, P10-P17 0 0.16Vcc V
(during memory-expansion and microprocessor modes)
IOH(peak) "H" peak output P00 -P07, P1 0-P1 7, P20-P2 7, P30 -P3 7, P40-P4 7, P5 0- -10.0 mA
current P5 7, P60-P6 7, P70-P7 7, P80-P8 4, P86, P8 7, P90-P9 7,
P100-P107, P110-P114, P120-P127, P130-P137, P140-
P146, P150-P157(Note5)
IOH(avg) "H" average P00 -P07, P1 0-P1 7, P20-P2 7, P30 -P3 7, P40-P4 7, P5 0- -5.0 mA
output current P5 7, P60-P6 7, P70-P7 7, P80-P8 4, P86, P8 7, P90-P9 7,
P100-P107, P110-P114, P120-P127, P130-P137, P140-
P146, P150-P157(Note5)
IOL(peak) "L" peak output P00 -P07, P1 0-P1 7, P20-P2 7, P30 -P3 7, P40-P4 7, P5 0- 10.0 mA
current P5 7, P60-P6 7, P70-P7 7, P80-P8 4, P86, P8 7, P90-P9 7,
P100-P107, P110-P114, P120-P127, P130-P137, P140-
P146, P150-P157(Note5)
IOL(avg) "L" average P00 -P07, P1 0-P1 7, P20-P2 7, P30 -P3 7, P40-P4 7, P5 0- 5.0 mA
output current P5 7, P60-P6 7, P70-P7 7, P80-P8 4, P86, P8 7, P90-P9 7,
P100-P107, P110-P114, P120-P127, P130-P137, P140-
P146, P150-P157(Note5)
f(XIN) Main clock input frequency VDC-ON Vcc=4.2 to 5.5V 0 30 MHz
Vcc=3.0 to 4.2V 0 20 MHz
VDC-pass through Vcc=3.0 to 3.6V 0 20 MHz
f(XCIN) Sub-clock oscillation frequency 32.768 kHz
Note 1: The mean output current is the mean value within 100ms.
Note 2: The total IOL (peak) for ports P0, P1, P2, P86, P87, P9, P10, P11, P14 and P15 must be 80mA max. The total
IOH (peak) for ports P0, P1, P2, P86, P87, P9, P10, P11, P14 and P15 must be -80mA max. The total IOL (peak)
for ports P3, P4, P5, P6, P7,P80 to P84, P12 and P13 must be 80mA max. The total IOH (peak) for ports P3, P4,
P5, P6, P72 to P77, P80 to P84, P12 and P13 must be -80mA max.
Note 3: Specify a product of -40 to 85°C to use it.
Note 4: The specification of VIH and VIL of P87 is not when using as XCIN but when using programmable input port.
Note 5: Port P11 to P15 exist in 144-pin version.
345
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Electrical characteristics (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
346
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Electrical characteristics (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Table 1.32.4. A-D conversion characteristics (referenced to VCC = AVCC = VREF = 5V, Vss = AVSS =
0V at Topr = 25oC, f(XIN) = 30MHZ unless otherwise specified)
Standard
Symbol Parameter Measuring condition Unit
Min. Typ. Max.
Resolution VREF = VCC 10 Bits
INL Integral nonlinearity error AN0 to AN7 LSB
VREF = ±3
ANEX0, ANEX1
VCC = 5V
External op-amp
±7 LSB
connection mode
DNL Differential nonlinearity error ±1 LSB
Offset error ±3 LSB
Gain error ±3 LSB
RLADDER Ladder resistance VREF = VCC 10 40 kΩ
tCONV Conversion time(10bit) 3.3 µs
tCONV Conversion time(8bit) 2.8 µs
tSAMP Sampling time 0.3 µs
VREF Reference voltage 2 VCC V
VIA Analog input voltage 0 VREF V
Note: Divide the frequency if f(XIN) exceeds 10 MHz, and make ØAD equal to or lower than 10 MHz.
Table 1.32.5. D-A conversion characteristics (referenced to VCC = VREF = 5V, VSS = AVSS = 0V
at Topr = 25oC, f(XIN) = 30MHZ unless otherwise specified)
Standard
Symbol Parameter Measuring condition Min. Typ. Max. Unit
Resolution 8 Bits
Absolute accuracy 1.0 %
tsu Setup time 3 µs
RO Output resistance 4 10 20 kΩ
IVREF Reference power supply input current (Note) 1.5 mA
Note: This applies when using one D-A converter, with the D-A register for the unused D-A converter set to
“0016”.
The A-D converter's ladder resistance is not included.
Also, when the Vref is unconnected at the A-D control register 1, IVREF is sent.
347
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Timing requirements (referenced to VCC = 5V, VSS = 0V at Topr = 25oC unless otherwise specified)
10 9X m
tac2(RD – DB) = – 35 [ns] (m=3, 5 and 7 when 1 wait, 2 wait and 3 wait, respectively)
f(BCLK) X 2
9
10 X n
tac2(AD – DB) = – 35 [ns] (n=2, 3 and 4 when 1 wait, 2 wait and 3 wait, respectively)
f(BCLK)
9
10 X m
tac3(RD – DB) = – 35 [ns] (m=3 and 5 when 2 wait and 3 wait, respectively)
f(BCLK) X 2
9
10 X n
tac3(AD – DB) = – 35 [ns] (n=5 and 7 when 2 wait and 3 wait, respectively)
f(BCLK) X 2
9
10 X m
tac4(RAS – DB) = – 35 [ns] (m=3 and 5 when 1 wait and 2 wait, respectively)
f(BCLK) X 2
9
10 X n
tac4(CAS – DB) = – 35 [ns] (n=1 and 3 when 1 wait and 2 wait, respectively)
f(BCLK) X 2
9
10 X l [ns] (l=1 and 2 when 1 wait and 2 wait, respectively)
tac4(CAD – DB) = – 35
f(BCLK)
348
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Timing requirements (referenced to VCC = 5V, VSS = 0V at Topr = 25oC unless otherwise specified)
Table 1.32.10. Timer A input (external trigger input in one-shot timer mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(TA) TAiIN input cycle time 200 ns
tw(TAH) TAiIN input HIGH pulse width 100 ns
tw(TAL) TAiIN input LOW pulse width 100 ns
Table 1.32.11. Timer A input (external trigger input in pulse width modulation mode)
Standard
Symbol Parameter Min. Max. Unit
tw(TAH) TAiIN input HIGH pulse width 100 ns
tw(TAL) TAiIN input LOW pulse width 100 ns
349
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Timing requirements (referenced to VCC = 5V, VSS = 0V at Topr = 25oC unless otherwise specified)
_______
Table 1.32.18. External interrupt INTi inputs
Standard
Symbol Parameter Unit
Min. Max.
tw(INH) INTi input HIGH pulse width 250 ns
tw(INL) INTi input LOW pulse width 250 ns
350
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Switching characteristics (referenced to VCC = 5V, VSS = 0V at Topr = 25oC, CM15 = “1” unless
otherwise specified)
Table 1.32.19. Memory expansion mode and microprocessor mode (no wait)
Standard
Symbol Parameter Measuring condition Unit
Min. Max.
td(BCLK-AD) Address output delay time 18 ns
th(BCLK-AD) Address output hold time (BCLK standard) -3 ns
th(RD-AD) Address output hold time (RD standard) 0 ns
th(WR-AD) Address output hold time (WR standard) (Note) ns
td(BCLK-CS) Chip select output delay time 18 ns
th(BCLK-CS) Chip select output hold time (BCLK standard) -3 ns
th(RD-CS) Chip select output hold time (RD standard) 0 ns
th(WR-CS) Chip select output hold time (WR standard) Figure 1.32.1 (Note) ns
td(BCLK-ALE) ALE signal output delay time 18 ns
th(BCLK-ALE) ALE signal output hold time –2 ns
td(BCLK-RD) RD signal output delay time 18 ns
th(BCLK-RD) RD signal output hold time -5 ns
td(BCLK-WR) WR signal output delay time 18 ns
th(BCLK-WR) WR signal output hold time -3 ns
td(DB-WR) Data output delay time (WR standard) (Note) ns
th(WR-DB) Data output hold time (WR standard) (Note) ns
tw(WR) WR signal width (Note) ns
351
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Switching characteristics (referenced to VCC = 5V, VSS = 0V at Topr = 25oC unless otherwise
specified)
10 9 X n
td(DB – WR) = – 20
f(BCLK) [ns] (n=1, 2 and 3 when 1 wait, 2 wait and 3 wait, respectively)
9
10
th(WR – DB) = – 10
f(BCLK) X 2 [ns]
9
10
th(WR – AD) = – 10
f(BCLK) X 2 [ns]
9
10
th(WR – CS) = – 10
f(BCLK) X 2 [ns]
10 9 X n
tw( WR) = – 15
f(BCLK) X 2 [ns] (n=1, 3 and 5 when 1 wait, 2 wait and 3 wait, respectively)
352
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Switching characteristics (referenced to VCC = 5V, VSS = 0V at Topr = 25oC unless otherwise
specified)
10 9
th(RD – AD) = – 10
f(BCLK) X 2 [ns]
10 9
th(WR – AD) = – 10
f(BCLK) X 2 [ns]
10 9
th(RD – CS) = – 10
f(BCLK) X 2 [ns]
10 9
th(WR – CS) = – 10
f(BCLK) X 2 [ns]
9
10 X m
td(DB – WR) = – 25
f(BCLK) X 2 [ns] (m=3 and 5 when 2 wait and 3 wait, respectively)
9
10
th(WR – DB) = – 10
f(BCLK) X 2 [ns]
9
10
td(AD – ALE) = – 20
f(BCLK) X 2 [ns]
9
10
th(ALE – AD) = – 10
f(BCLK) X 2 [ns]
353
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 5V
Switching characteristics (referenced to VCC = 5V, VSS = 0V at Topr = 25oC unless otherwise
specified)
10 9
th(RAS – RAD) = – 13
f(BCLK) X 2 [ns]
10 9
tRP = X 3 – 20 [ns]
f(BCLK) X 2
10 9
tsu(DB – CAS) = – 20
f(BCLK) [ns]
9
10
tsu(CAS – RAS) = – 13
f(BCLK) X 2 [ns]
354
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 5V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
P0
P1
P2 30pF
P3
P4
P5
P6
P7
P8
P9
P10
P11
P12
P13
P14
P15
355
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
Vcc=5V
Memory Expansion Mode and Microprocessor Mode (without wait)
Read Timing
BCLK
td(BCLK-ALE) th(BCLK-ALE)
18ns.max -2ns.min
ALE
td(BCLK-CS) th(BCLK-CS)
*1 -3ns.min
18ns.max
CSi
tcyc th(RD-CS)
0ns.min
td(BCLK-AD) th(BCLK-AD)
18ns.max*1 -3ns.min
ADi
BHE
td(BCLK-RD) th(RD-AD)
18ns.max 0ns.min
RD
tac1(RD-DB)*2 th(BCLK-RD)
-5ns.min
tac1(AD-DB)*2
Hi-Z
DB
tsu(DB-BCLK) th(RD-DB)
26ns.min*1 0ns.min
*1:It is a guarantee value with being alone. 35ns.max garantees as td(BCLK-AD)+tsu(DB-BCLK).
*2:It depends on operation frequency.
tac1(RD-DB)=(tcyc/2-35)ns.max
tac1(AD-DB)=(tcyc-35)ns.max
td(BCLK-CS) th(BCLK-CS)
18ns.max -3ns.min
CSi
tcyc th(WR-CS)*3
td(BCLK-AD) th(BCLK-AD)
18ns.max -3ns.min
ADi
BHE
td(BCLK-WR) th(WR-AD)*3
tw(WR)*3
18ns.max
WR,WRL,
WRH th(BCLK-WR)
-3ns.min
td(DB-WR)*3 th(WR-DB)*3
DBi
356
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
Vcc=5V
Memory Expansion Mode and Microprocessor Mode (with wait)
Read Timing
BCLK
18ns.max
td(BCLK-ALE) th(BCLK-ALE)
-2ns.min
ALE
td(BCLK-CS) th(BCLK-CS)
18ns.max*1 -3ns.min
CSi
tcyc th(RD-CS)
0ns.min
td(BCLK-AD) th(BCLK-AD)
18ns.max*1 -3ns.min
ADi
BHE
td(BCLK-RD) th(RD-AD)
18ns.max 0ns.min
RD
th(BCLK-RD)
tac2(RD-DB)*2 -5ns.min
tac2(AD-DB)*2
DB
Hi-Z
tsu(DB-BCLK) th(RD-DB)
26ns.min*1 0ns.min
td(BCLK-CS) th(BCLK-CS)
18ns.max -3ns.min
CSi
tcyc th(WR-CS)*3
td(BCLK-AD) th(BCLK-AD)
18ns.max -3ns.min
ADi
BHE
td(BCLK-WR) tw(WR)*3 th(WR-AD)*3
18ns.max
WR,WRL,
WRH th(BCLK-WR)
-3ns.min
td(DB-WR)*3 th(WR-DB)*3
DBi
357
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
CSi
th(RD-CS)*1
td(AD-ALE)*1 th(ALE-AD)*1
ADi Address Data input Address
/DBi tdz(RD-AD) th(RD-DB)
8ns.max
td(BCLK-AD) tsu(DB-BCLK) 0ns.min
26ns.min
th(BCLK-AD)
18ns.max tac3(RD-DB)*1 -3ns.min
ADi
BHE
tac3(AD-DB)*1 td(BCLK-RD) th(BCLK-RD) th(RD-AD)*1
18ns.max -5ns.min
RD
tcyc th(BCLK-CS)
td(BCLK-CS) th(WR-CS)*2 -3ns.min
18ns.max
CSi
td(AD-ALE)*2 th(ALE-AD)*2
ADi Address Data output Address
/DBi
td(DB-WR)*2 th(WR-DB)*2
td(BCLK-AD) th(BCLK-AD)
18ns.max -3ns.min
ADi
BHE
358
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
th(RAS-RAD)*2 tRP*2
RAS
td(BCLK-RAS) th(BCLK-RAS)
td(BCLK-CAS) -3ns.min
18ns.max*1 18ns.max*1
CASL
CASH th(BCLK-CAS)
-3ns.min
DW
tac4(CAS-DB)*2
tac4(CAD-DB)*2
tac4(RAS-DB)*2
Hi-Z
DB
tsu(DB-BCLK) th(CAS-DB)
26ns.min*1 0ns.min
Measuring conditions
• VCC=5V±10%
• Input timing voltage
:Determined with VIH=2.5V, VIL=0.8V
• Output timing voltage
:Determined with VOH=2.0V, VOL=0.8V
359
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
td(BCLK-RAD) td(BCLK-CAD)
th(BCLK-RAD) th(BCLK-CAD)
18ns.max 18ns.max -3ns.min
-3ns.min
MAi Row address String address
th(RAS-RAD)*1 tRP*1
RAS
td(BCLK-RAS) td(BCLK-CAS) th(BCLK-RAS)
18ns.max -3ns.min
18ns.max
CASL
CASH
th(BCLK-CAS)
td(BCLK-DW) -3ns.min
18ns.max
DW
th(BCLK-DW)
-5ns.min
tsu(DB-CAS)*1
Hi-Z
DB
th(BCLK-DB)
-7ns.min
Measuring conditions
• VCC=5V±10%
• Input timing voltage
:Determined with VIH=2.5V, VIL=0.8V
• Output timing voltage
:Determined with VOH=2.0V, VOL=0.8V
360
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
BCLK
tcyc
td(BCLK-RAS)
18ns.max
RAS
th(BCLK-RAS)
tsu(CAS-RAS)*1 -3ns.min
CASL
CASH td(BCLK-CAS) th(BCLK-CAS)
-3ns.min
18ns.max
DW
BCLK
td(BCLK-RAS) tcyc
18ns.max
RAS
th(BCLK-RAS)
tsu(CAS-RAS)*1 -3ns.min
CASL
CASH th(BCLK-CAS)
td(BCLK-CAS) -3ns.min
18ns.max
DW
Measuring conditions
• VCC=5V±10%
• Input timing voltage
:Determined with VIH=2.5V, VIL=0.8V
• Output timing voltage
:Determined with VOH=2.0V, VOL=0.8V
361
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
tc(TA)
tw(TAH)
TAiIN input
tw(TAL)
tc(UP)
tw(UPH)
TAiOUT input
tw(UPL)
TAiOUT input
(Up/down input)
During event counter mode
TAiIN input
(When count on falling th(TIN–UP) tsu(UP–TIN)
edge is selected)
TAiIN input
(When count on rising
edge is selected)
tc(TB)
tw(TBH)
TBiIN input
tw(TBL)
tc(AD)
tw(ADL)
ADTRG input
tc(CK)
tw(CKH)
CLKi
tw(CKL)
th(C–Q)
TxDi
td(C–Q) tsu(D–C)
th(C–D)
RxDi
tw(INL)
INTi input
tw(INH)
362
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 5V)
BCLK
RD
(Separate bus)
RD
(Multiplexed bus)
RDY input
tsu(RDY–BCLK) th(BCLK–RDY)
BCLK
tsu(HOLD–BCLK) th(BCLK–HOLD)
HOLD input
HLDA output
td(BCLK–HLDA) td(BCLK–HLDA)
P0, P1, P2, Hi–Z
P3, P4,
P50 to P52
Note: Regardless of the level of the BYTE pin input and the setting of the port P40 to
P43 function select bit (PM06) of the processor mode register 0, all ports above
become the high-impedance state.
Measuring conditions :
• VCC=5V±10%
• Input timing voltage : Determined with VIH=4.0V, VIL=1.0V
• Output timing voltage : Determined with VOH=2.5V, VOL=2.5V
363
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Electrical characteristics (Vcc = 3V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
364
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical characteristics (Vcc = 3V)
VCC = 3V
Table 1.32.24. A-D conversion characteristics (referenced to VCC = AVCC = VREF = 3V, VSS = AVSS =
0V at Topr = 25oC, f(XIN) = 20MHZ unless otherwise specified)
Standard
Symbol Parameter Measuring condition Unit
Min. Typ. Max
Resolution VREF = VCC 10 Bits
ISL Integral nonlinearity error No S&H function(8-bit) ±2 LSB
DSL Differential nonlinearity error No S&H function(8-bit) ±1 LSB
Offset error No S&H function(8-bit) ±2 LSB
Gain error No S&H function(8-bit) ±2 LSB
RLADDER Ladder resistance VREF = VCC 10 40 kΩ
tCONV Conversion time(8bit) 9.8 µs
VREF Reference voltage 2.7 VCC V
VIA Analog input voltage 0 VREF V
S&H: Sample and hold
Note: Divide the frequency if f(XIN) exceeds 10 MHz, and make ØAD equal to or lower than 10 MHz.
Table 1.32.25. D-A conversion characteristics (referenced to VCC = VREF = 3V, VSS = AVSS = 0V,
at Topr = 25oC, f(XIN) = 20MHZ unless otherwise specified)
Standard
Symbol Parameter Measuring condition Min. Typ. Max Unit
Resolution 8 Bits
Absolute accuracy 1.0 %
tsu Setup time 3 µs
RO Output resistance 4 10 20 kΩ
IVREF Reference power supply input current (Note) 1.0 mA
Note :This applies when using one D-A converter, with the D-A register for the unused D-A converter
set to “0016”. The A-D converter's ladder resistance is not included.
Also, the Vref is unconnected at the A-D control register 1, IVREF is sent.
365
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 3V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 3V
Timing requirements (referenced to VCC = 3V, VSS = 0V at Topr = 25oC unless otherwise specified)
Table 1.32.26. External clock input
Standard
Symbol Parameter Unit
Min. Max.
tc External clock input cycle time 50 ns
tw(H) External clock input HIGH pulse width 22 ns
tw(L) External clock input LOW pulse width 22 ns
tr External clock rise time 5 ns
tf External clock fall time 5 ns
10 9X m
tac2(RD – DB) = – 35 [ns] (m=3, 5 and 7 when 1 wait, 2 wait and 3 wait, respectively)
f(BCLK) X 2
10 9 X n
tac2(AD – DB) = – 35 [ns] (n=2, 3 and 4 when 1 wait, 2 wait and 3 wait, respectively)
f(BCLK)
10 9 X m
tac3(RD – DB) = – 35 [ns] (m=3 and 5 when 2 wait and 3 wait, respectively)
f(BCLK) X 2
9
10 X n
tac3(AD – DB) = – 35 [ns] (n=5 and 7 when 2 wait and 3 wait, respectively)
f(BCLK) X 2
9
10 X m
tac4(RAS – DB) = – 35 [ns] (m=3 and 5 when 1 wait and 2 wait, respectively)
f(BCLK) X 2
9
10 X n
tac4(CAS – DB) = – 35 [ns] (n=1 and 3 when 1 wait and 2 wait, respectively)
f(BCLK) X 2
9
10 X l [ns] (l=1 and 2 when 1 wait and 2 wait, respectively)
tac4(CAD – DB) = – 35
f(BCLK)
366
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
VCC = 3V
Timing requirements (referenced to VCC = 3V, VSS = 0V at Topr = 25oC unless otherwise specified)
Table 1.32.30. Timer A input (external trigger input in one-shot timer mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(TA) TAiIN input cycle time 200 ns
tw(TAH) TAiIN input HIGH pulse width 100 ns
tw(TAL) TAiIN input LOW pulse width 100 ns
Table 1.32.31. Timer A input (external trigger input in pulse width modulation mode)
Standard
Symbol Parameter Unit
Min. Max.
tw(TAH) TAiIN input HIGH pulse width 100 ns
tw(TAL) TAiIN input LOW pulse width 100 ns
367
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 3V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 3V
Timing requirements (referenced to VCC = 3V, VSS = 0V at Topr = 25oC unless otherwise specified)
_______
Table 1.32.38. External interrupt INTi inputs
Standard
Symbol Parameter Unit
Min. Max.
tw(INH) INTi input HIGH pulse width 250 ns
tw(INL) INTi input LOW pulse width 250 ns
368
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
VCC = 3V
Switching characteristics (referenced to VCC = 3V, VSS = 0V at Topr = 25oC, CM15="1" unless
otherwise specified)
369
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 3V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 3V
Switching characteristics (referenced to VCC = 3V, VSS = 0V at Topr = 25oC unless otherwise
specified)
10 9 X n
tw( WR) = – 15
f(BCLK) X 2 [ns] (n=1, 3 and 5 when 1 wait, 2 wait and 3 wait, respectively)
370
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
VCC = 3V
Switching characteristics (referenced to VCC = 3V, VSS = 0V at Topr = 25oC unless otherwise
specified)
10 9
th(WR – DB) = – 10
f(BCLK) X 2 [ns]
10 9
td(AD – ALE) = – 20
f(BCLK) X 2 [ns]
10 9
th(ALE – AD) = – 10
f(BCLK) X 2 [ns]
371
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Timing (Vcc = 3V) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC = 3V
Switching characteristics (referenced to VCC = 3V, VSS = 0V at Topr = 25oC unless otherwise
specified)
10 9
th(RAS – RAD) = – 13
f(BCLK) X 2 [ns]
10 9 X 3
tRP = – 20
f(BCLK) X 2 [ns]
9
10
tsu(DB – CAS) = – 20
f(BCLK) [ns]
9
10
tsu(CAS – RAS) = – 13
f(BCLK) X 2 [ns]
372
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
Vcc=3V
Memory expansion Mode and Microprocessor Mode (without wait)
Read Timing
BCLK
td(BCLK-ALE)
18ns.max th(BCLK-ALE)
-2ns.min
ALE
td(BCLK-CS) th(BCLK-CS)
0ns.min
18ns.max*1
CSi
tcyc th(RD-CS)
0ns.min
td(BCLK-AD) th(BCLK-AD)
18ns.max*1 0ns.min
ADi
BHE
td(BCLK-RD) th(RD-AD)
18ns.max 0ns.min
RD
tac2(RD-DB)*2 th(BCLK-RD)
-3ns.min
tac2(AD-DB)*2
Hi-Z
DB
tsu(DB-BCLK) th(RD-DB)
30ns.min*1 0ns.min
*1:It is a guarantee value with being alone. 35ns.max garantees as td(BCLK-AD)+tsu(DB-BCLK).
*2:It depends on operation frequency.
tac2(RD-DB)=(tcyc/2-35)ns.max
tac2(AD-DB)=(tcyc-35)ns.max
Write Timing
BCLK
td(BCLK-ALE)
18ns.max th(BCLK-ALE)
-2ns.min
ALE
td(BCLK-CS) th(BCLK-CS)
18ns.max 0ns.min
CSi
tcyc th(WR-CS)*3
td(BCLK-AD) th(BCLK-AD)
18ns.max 0ns.min
ADi
BHE
td(BCLK-WR) tw(WR)*3 th(WR-AD)*3
18ns.max
WR,WRL,
WRH th(BCLK-WR)
0ns.min
td(DB-WR)*3 th(WR-DB)*3
DBi
373
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
Vcc=3V
Memory expansion Mode and Microprocessor Mode (with wait)
Read Timing
BCLK
18ns.max
td(BCLK-ALE) th(BCLK-ALE)
-2ns.min
ALE
td(BCLK-CS) th(BCLK-CS)
0ns.min
18ns.max*1
CSi
th(RD-CS)
tcyc
0ns.min
td(BCLK-AD) th(BCLK-AD)
18ns.max*1 0ns.min
ADi
BHE
td(BCLK-RD) th(RD-AD)
18ns.max 0ns.min
RD
th(BCLK-RD)
tac2(RD-DB)*2 -3ns.min
tac2(AD-DB)*2
DB
Hi-Z
tsu(DB-BCLK) th(RD-DB)
30ns.min*1 0ns.min
Write Timing
BCLK 18ns.max
td(BCLK-ALE)
th(BCLK-ALE)
-2ns.min
ALE
td(BCLK-CS) th(BCLK-CS)
18ns.max 0ns.min
CSi
tcyc th(WR-CS)*3
td(BCLK-AD) th(BCLK-AD)
18ns.max 0ns.min
ADi
BHE
td(BCLK-WR) tw(WR)*3 th(WR-AD)*3
18ns.max
WR,WRL,
WRH th(BCLK-WR)
0ns.min
td(DB-WR) *3 th(WR-DB)*3
DBi
374
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
tcyc th(BCLK-CS)
td(BCLK-CS) th(WR-CS)*2 0ns.min
18ns.max
CSi
td(AD-ALE)*2 th(ALE-AD)*2
ADi Address Data output Address
/DBi
td(DB-WR)*2 th(WR-DB)*2
td(BCLK-AD) th(BCLK-AD)
18ns.max 0ns.min
ADi
BHE
375
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
th(RAS-RAD)*2 tRP*2
RAS
td(BCLK-RAS) th(BCLK-RAS)
td(BCLK-CAS) 0ns.min
18ns.max*1 18ns.max*1
CASL
CASH th(BCLK-CAS)
0ns.min
DW
tac4(CAS-DB)*2
tac4(CAD-DB)*2
tac4(RAS-DB)*2
Hi-Z
DB
tsu(DB-BCLK) th(CAS-DB)
30ns.min*1 0ns.min
Measuring conditions
• VCC=3V±10%
• Input timing voltage
:Determined with VIH=1.5V, VIL=0.5V
• Output timing voltage
:Determined with VOH=1.5V, VOL=1.5V
376
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
th(RAS-RAD)*1 tRP*1
RAS
td(BCLK-RAS) td(BCLK-CAS) th(BCLK-RAS)
18ns.max 0ns.min
18ns.max
CASL
CASH
th(BCLK-CAS)
td(BCLK-DW) 0ns.min
18ns.max
DW
th(BCLK-DW)
tsu(DB-CAS)*1 -3ns.min
Hi-Z
DB
th(BCLK-DB)
-7ns.min
Measuring conditions
• VCC=3V±10%
• Input timing voltage
:Determined with VIH=1.5V, VIL=0.5V
• Output timing voltage
:Determined with VOH=1.5V, VOL=1.5V
377
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
BCLK
td(BCLK-RAS) tcyc
18ns.max
RAS
th(BCLK-RAS)
tsu(CAS-RAS)*1 0ns.min
CASL
CASH td(BCLK-CAS) th(BCLK-CAS)
0ns.min
18ns.max
DW
BCLK
td(BCLK-RAS) tcyc
18ns.max
RAS
tsu(CAS-RAS)*1 th(BCLK-RAS)
0ns.min
CASL
CASH th(BCLK-CAS)
td(BCLK-CAS) 0ns.min
18ns.max
DW
Measuring conditions
• VCC=3V±10%
• Input timing voltage
:Determined with VIH=1.5V, VIL=0.5V
• Output timing voltage
:Determined with VOH=1.5V, VOL=1.5V
378
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
tc(TA)
tw(TAH)
TAiIN input
tw(TAL)
tc(UP)
tw(UPH)
TAiOUT input
tw(UPL)
TAiOUT input
(Up/down input)
During event counter mode
TAiIN input
(When count on falling th(TIN–UP) tsu(UP–TIN)
edge is selected)
TAiIN input
(When count on rising
edge is selected)
tc(TB)
tw(TBH)
TBiIN input
tw(TBL)
tc(AD)
tw(ADL)
ADTRG input
tc(CK)
tw(CKH)
CLKi
tw(CKL)
th(C–Q)
TxDi
td(C–Q) tsu(D–C)
th(C–D)
RxDi
tw(INL)
INTi input
tw(INH)
379
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timing (Vcc = 3V)
BCLK
RD
(Separate bus)
RD
(Multiplexed bus)
RDY input
tsu(RDY–BCLK) th(BCLK–RDY)
BCLK
tsu(HOLD–BCLK) th(BCLK–HOLD)
HOLD input
HLDA output
td(BCLK–HLDA) td(BCLK–HLDA)
P0, P1, P2,
P3, P4, Hi–Z
P50 to P52
Measuring conditions :
• VCC=3V±10%
• Input timing voltage : Determined with VIH=2.4V, VIL=0.6V
• Output timing voltage : Determined with VOH=1.5V, VOL=1.5V
380
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description (Flash Memory Version)
Outline Performance
Table 1.33.1 shows the outline performance of the M32C/83 (flash memory version).
Flash memory operation mode Three modes (parallel I/O, standard serial I/O, CPU rewrite)
The following shows Mitsubishi plans to develop a line of M32C/83 products (flash memory version).
(1) ROM capacity
(2) Package 100P6S-A ... Plastic molded QFP
100P6Q-A ... Plastic molded QFP
144P6Q-A ... Plastic molded QFP
ROM size
(Bytes)
External
ROM
M30835FJGP
512K M30833FJFP
M30833FJGP
256K
128K
381
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description (Flash Memory Version)
ROM capacity:
J : 512K bytes
Memory type:
M : Mask ROM version
S : External ROM version
F : Flash memory version
M32C/83 Group
M16C Family
382
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Description (Flash Memory Version)
Flash Memory
The M32C/83 (flash memory version) contains the flash memory that can be rewritten with a single voltage
of 5 V. For this flash memory, three flash memory modes are available in which to read, program, and
erase: parallel I/O and standard serial I/O modes in which the flash memory can be manipulated using a
programmer and a CPU rewrite mode in which the flash memory can be manipulated by the Central Pro-
cessing Unit (CPU). Each mode is detailed in the pages to follow.
The flash memory is divided into several blocks as shown in Figure 1.33.3, so that memory can be erased
one block at a time. Each block has a lock bit to enable or disable execution of an erase or program
operation, allowing for data in each block to be protected.
In addition to the ordinary user ROM area to store a microcomputer operation control program, the flash
memory has a boot ROM area that is used to store a program to control rewriting in CPU rewrite and
standard serial I/O modes. This boot ROM area has had a standard serial I/O mode control program stored
in it when shipped from the factory. However, the user can write a rewrite control program in this area that
suits the user’s application system. This boot ROM area can be rewritten in only parallel I/O mode.
0FD000016
Block 5 : 64K bytes
0FE000016
Block 4 : 64K bytes
Note 1: The boot ROM area can be rewritten in only parallel input/
output mode. (Access to any other areas is inhibited.)
0FF000016 Note 2: To specify a block, use the maximum address in the block
Block 3 : 32K bytes that is an even address.
0FF800016
Block 2 : 8K bytes
0FFA00016
Block 1 : 8K bytes
0FFC00016 0FFE00016
Block 0 : 16K bytes 8K bytes
0FFFFFF16 0FFFFFF16
User ROM area Boot ROM area
383
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Block Address
Block addresses refer to the maximum even address of each block. These addresses are used in the
block erase command, lock bit program command, and read lock status command.
384
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
AA
Bit symbol Bit name Function R WW
R
AA
A
FMR01 CPU rewrite mode 0: Normal mode
select bit (Note 1) (Software commands invalid)
1: CPU rewrite mode
(Software commands acceptable)
AA
A
FMR02 Lock bit disable bit 0: Block lock by lock bit data is
(Note 2) enabled
AA
A
1: Block lock by lock bit data is
disabled
AA
A
FMR03 Flash memory reset bit 0: Normal operation
(Note 3) 1: Reset
385
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Bit 2 of the flash memory control register 0 is a lock bit disable bit. By setting this bit to “1”, it is possible to
disable erase and write protect (block lock) effectuated by the lock bit data. The lock bit disable select bit
only disables the lock bit function; it does not change the lock data bit value. However, if an erase operation
is performed when this bit =“1”, the lock bit data that is “0” (locked) is set to “1” (unlocked) after erasure. To
set this bit to “1”, it is necessary to write “0” and then write “1” in succession. This bit can be manipulated
only when the CPU rewrite mode select bit = “1”.
Bit 3 of the flash memory control register 0 is the flash memory reset bit used to reset the control circuit of
the internal flash memory. This bit is used when exiting CPU rewrite mode and when flash memory access
has failed. When the CPU rewrite mode select bit is “1”, writing “1” for this bit resets the control circuit. To
release the reset, it is necessary to set this bit to “0”.
Bit 5 of the flash memory control register 0 is a user ROM area select bit which is effective in only boot
mode. If this bit is set to “1” in boot mode, the area to be accessed is switched from the boot ROM area to
the user ROM area. When the CPU rewrite mode needs to be used in boot mode, set this bit to “1”. Note
that if the microcomputer is booted from the user ROM area, it is always the user ROM area that can be
accessed and this bit has no effect. When in boot mode, the function of this bit is effective regardless of
whether the CPU rewrite mode is on or off. Use the control program except in the internal flash memory to
rewrite this bit.
Figure 1.34.2 shows a flowchart for setting/releasing the CPU rewrite mode. Always perform operation as
indicated in these flowcharts.
386
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Start *1
Set processor mode register (Note 1) Set CPU rewrite mode select bit to “1” (by
writing “0” and then “1” in succession)(Note 2)
Transfer CPU rewrite mode control Using software command execute erase,
program to internal RAM program, or other operation
(Set lock bit disable bit as required)
*1
End
Note 1: During CPU rewrite mode, set the main clock frequency as shown below using the main clock division
register (address 000C16):
6.25 MHz or less when wait bit (bit 2 at address 000516) = “0” (without internal access wait state)
12.5 MHz or less when wait bit (bit 2 at address 000516) = “1” (with internal access wait state)
Note 2: For CPU rewrite mode select bit to be set to “1”, the user needs to write a “0” and then a “1” to it in
succession. When it is not this procedure, it is not enacted in “1”. This is necessary to ensure that no
interrupt or DMA transfer will be executed during the interval. Use the program except in the internal
flash memory for write to this bit. Also write to this bit when NMI pin is "H" level.
Note 3: Before exiting the CPU rewrite mode after completing erase or program operation, always be sure to
execute a read array command or reset the flash memory.
Note 4: “1” can be set. However, when this bit is “1”, user ROM area is accessed.
387
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
388
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Software Commands
Table 1.34.1 lists the software commands available with the M16C/62A (flash memory version).
After setting the CPU rewrite mode select bit to 1, write a software command to specify an erase or
program operation. Note that when entering a software command, the upper byte (D8 to D15) is ignored.
The content of each software command is explained below.
Note 1: When a software command is input, the high-order byte of data (D8 to D15) is ignored.
Note 2: SRD = Status Register Data
Note 3: WA = Write Address, WD = Write Data
WA and WD must be set sequentially from 0016 to FE16 (byte address; however, an even address). The page size is
256 bytes.
Note 4: BA = Block Address (Enter the maximum address of each block that is an even address.)
Note 5: D6 corresponds to the block lock status. Block not locked when D6 = 1, block locked when D6 = 0.
Note 6: X denotes a given address in the user ROM area (that is an even address).
389
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Start
Write 4116
n=0
NO
n = FE16
YES
RY/BY signal NO
status bit
= 1?
YES
Page program
completed
390
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Start
Write 2016
Write D016
Block address
RY/BY signal NO
status bit
= 1?
YES
Check full status check
Block erase
completed
391
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Start
Write 7716
Write D016
block address
RY/BY signal NO
status bit
= 1?
YES
NO Lock bit program in
SR4 = 0?
error
YES
Lock bit program
completed
392
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Start
Write 7116
NO
D6 = 0?
YES
Blocks locked Blocks not locked
393
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Status Register
The status register indicates the operating status of the flash memory and whether an erase or program
operation has terminated normally or in an error. The content of this register can be read out by only
writing the read status register command (7016). Table 1.34.2 details the status register.
The status register is cleared by writing the Clear Status Register command (5016).
After a reset, the status register is set to “8016.”
Each bit in this register is explained below.
394
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
Also, in one of the following cases, both SR4 and SR5 are set to 1 (command sequence error):
(1) When the valid command is not entered correctly
(2) When the data entered in the second bus cycle of lock bit program (7716/D016), block erase
(2016/D016), or erase all unlock blocks (A716/D016) is not the D016 or FF16. However, if FF16 is
entered, read array is assumed and the command that has been set up in the first bus cycle is
canceled.
395
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode (Flash Memory Version)
YES
SR4=1 and SR5 Command Execute the clear status register command (5016)
=1 ? sequence error to clear the status register. Try performing the
operation one more time after confirming that the
NO
command is entered correctly.
NO Should a block erase error occur, the block in error
SR5=0? Block erase error
cannot be used.
YES
NO
SR4=0? Program error (page Execute the read lock bit status command (7116) to
or lock bit) see if the block is locked. After removing lock,
YES execute write operation in the same way. If the
error still occurs, the page in error cannot be used.
Note: When one of SR5 to SR3 is set to 1, none of the page program, block erase, erase all unlock
blocks and lock bit program commands is accepted. Execute the clear status register command
(5016) before executing these commands.
Figure 1.34.7. Full status check flowchart and remedial procedure for errors
396
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Functions To Inhibit Rewriting Flash Memory (Flash Memory Version)
Note 1: When ROM code protect is turned on, the on-chip flash memory is protected against
readout or modification in parallel input/output mode.
Note 2: When ROM code protect level 2 is turned on, ROM code readout by a shipment
inspection LSI tester, etc. also is inhibited.
Note 3: The ROM code protect reset bits can be used to turn off ROM code protect level 1 and
ROM code protect level 2. However, since these bits cannot be changed in parallel input/
output mode, they need to be rewritten in serial input/output or some other mode.
397
nt
n
U elo
r
de pme Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Functions To Inhibit Rewriting Flash Memory (Flash Memory Version)
Address
0FFFFDC16 to 0FFFFDF16 ID1 Undefined instruction vector
4 bytes
398
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Parallel I/O Mode (Flash Memory Version)
399
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Appendix Standard Serial I/O Mode (Flash Memory Version) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
The standard serial I/O mode is different from the parallel I/O mode in that the CPU controls flash memory
rewrite (uses the CPU's rewrite mode), rewrite data input and so forth. It is started when the reset is re-
_____ ________
leased, which is done when the P50 (CE) pin is "H" level, the P55 (EPM) pin "L" level and the CNVss pin "H"
level. (In the ordinary command mode, set CNVss pin to "L" level.)
This control program is written in the boot ROM area when the product is shipped from Mitsubishi. Accord-
ingly, make note of the fact that the standard serial I/O mode cannot be used if the boot ROM area is
rewritten in the parallel I/O mode. Figures 1.35.1 to 1.35.3 show the pin connections for the standard serial
I/O mode. Serial data I/O uses UART1 and transfers the data serially in 8-bit units. Standard serial I/O
switches between mode 1 (clock synchronized) and mode 2 (clock asynchronized) according to the level of
CLK1 pin when the reset is released.
To use standard serial I/O mode 1 (clock synchronized), set the CLK1 pin to "H" level and the TxD1 pin to "L"
level, and release the reset. The CLK1 pin is connected to Vcc via pull-up resistance and the TxD1 is
connected to Vss via pull-down resistance. The operation uses the four UART1 pins CLK1, RxD1, TxD1 and
RTS1 (BUSY). The CLK1 pin is the transfer clock input pin through which an external transfer clock is input.
The TxD1 pin is for CMOS output. The RTS1 (BUSY) pin outputs an "L" level when ready for reception and
an "H" level when reception starts.
To use standard serial I/O mode 2 (clock asynchronized), set the CLK1 pin to "L" level and release the reset.
The operation uses the two UART1 pins RxD1 and TxD1.
In the standard serial I/O mode, only the user ROM area indicated in Figure 1.35.20 can be rewritten. The
boot ROM cannot.
In the standard serial I/O mode, a 7-byte ID code is used. When there is data in the flash memory, com-
mands sent from the peripheral unit (programmer) are not accepted unless the ID code matches.
400
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Appendix Standard Serial I/O Mode (Flash Memory Version) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC,VSS Power input Apply 4.2V to 5.5V to Vcc pin and 0 V to Vss pin.
RESET Reset input I Reset input pin. While reset is "L" level, a 20 cycle or longer clock
must be input to XIN pin.
XIN Clock input I Connect a ceramic resonator or crystal oscillator between XIN
and XOUT pins. To input an externally generated clock, input it
XOUT Clock output O to XIN pin and open XOUT pin.
AVCC, AVSS Analog power supply input I Connect AVSS to Vss and AVcc to Vcc, respectively.
VREF Reference voltage input I Enter the reference voltage for A-D converter from this pin.
P00 to P07 Input port P0 Input "H" or "L" level signal or open.
I
P10 to P17 Input port P1 Input "H" or "L" level signal or open.
I
P20 to P27 Input port P2 Input "H" or "L" level signal or open.
I
P30 to P37 Input port P3 Input "H" or "L" level signal or open.
I
P40 to P47 Input port P4 Input "H" or "L" level signal or open.
I
P51 to P54, Input port P5 Input "H" or "L" level signal or open.
I
P56, P57
P65 SCLK input Standard serial mode 1: Serial clock input pin
I
Standard serial mode 2: Input "L" level signal.
P66 RxD input Serial data input pin
I
P67 TxD output O Serial data output pin. When using standard serial mode 1, an
"L" level must be input to TxD pin while the RESET pin is “L”.
For this reason, this pin should be pulled down. After being reset,
this pin functions as a data output pin. Thus adjust pull-down
resistance value with the system not to affect data transfer.
P70 to P77 Input port P7 Input "H" or "L" level signal or open.
I
P80 to P84, P86, Input port P8 Input "H" or "L" level signal or open.
I
P87
P85 NMI input I Connect this pin to Vcc.
P90 to P97 Input port P9 Input "H" or "L" level signal or open.
I
P100 to P107 Input port P10 Input "H" or "L" level signal or open.
I
P110 to P114 Input port P11 Input "H" or "L" level signal or open. (Note)
I
P120 to P127 Input port P12 Input "H" or "L" level signal or open. (Note)
I
P130 to P137 Input port P13 Input "H" or "L" level signal or open. (Note)
I
P140 to P146 Input port P14 Input "H" or "L" level signal or open. (Note)
I
P150 to P157 Input port P15 I Input "H" or "L" level signal or open. (Note)
401
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Appendix Standard Serial I/O Mode (Flash Memory Version) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Mode setting
Signal Value
CNVss Vcc
EPM Vss
RESET Vss >> Vcc
CE Vcc
100
87
86
85
84
83
82
81
92
91
90
89
88
99
98
97
96
95
94
93
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
CNVss
RESET
oscillation
Connect
M32C/83(100-pin) Group
circuit
EPM
BUSY
RxD
Vcc
Vss
CE
SCLK
TxD
Figure 1.35.1. Pin connections for standard serial I/O mode (1)
402
nt
n
U el
r
de pme
o
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Appendix Standard Serial I/O Mode (Flash Memory Version) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Mode setting
Signal Value
CNVss Vcc
EPM Vss
RESET Vss >> Vcc
CE Vcc
100
99
87
88
76
89
77
90
78
91
79
92
80
93
81
94
82
95
83
96
84
97
85
98
86
75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
CNVSS
RESET
M32C/83(100-pin) Group
oscillation
Connect
circuit
39
50
26
38
37
49
36
48
35
47
34
46
33
45
32
44
31
43
30
42
29
41
28
40
BUSY
VCC
VSS
CE
RX
D
SCLK
EPM
TX
D
Figure 1.35.2. Pin connections for standard serial I/O mode (2)
403
nt
r
de me
Un elop
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de
Appendix Standard Serial I/O Mode (Flash Memory Version) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Mode setting
Signal Value
CNVss Vcc
EPM Vss
RESET Vss >> Vcc
CE Vcc
109 72
110 71
111 70
112 69
113 68
114 67
115 66
116 65 CE
117 64
118 63
119 62
120 61
121 60
122 59
123 58
124
125
M32C/83(144-pin) Group 57
56
126
127
Flash Memory Version 55
54 EPM
128
129 (144P6Q) 53
52
130 51
131 50
132 49
133 48
134 47
135 46
136 45
137 44
138 43 BUSY
139 42 SCLK
140 41
141 40 RxD
142 39
143 38 TxD
144 37
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
VCC
VSS
Connect
oscillation
circuit
RESET
CNVSS
Figure 1.35.3. Pin connections for standard serial I/O mode (3)
404
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
405
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
Software Commands
Table 1.35.1 lists software commands. In the standard serial I/O mode 1, erase operations, programs and
reading are controlled by transferring software commands via the RxD1 pin. Software commands are
explained here below.
Note 1: Shading indicates transfer from flash memory microcomputer to peripheral unit. All other data is trans-
ferred from the peripheral unit to the flash memory microcomputer.
Note 2: SRD refers to status register data. SRD1 refers to status register data1 .
Note 3: All commands can be accepted when the flash memory is totally blank.
406
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
RTS1(BUSY)
When reception setup for the next 256 bytes ends, the RTS1 (BUSY) signal changes from the “H” to
the “L” level. The result of the page program can be known by reading the status register. For more
information, see the section on the status register.
Each block can be write-protected with the lock bit. For more information, see the section on the data
protection function. Additional writing is not allowed with already programmed pages.
407
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
TxD1
(M32C transmit data)
RTS1(BUSY)
When block erasing ends, the RTS1 (BUSY) signal changes from the “H” to the “L” level. After block
erase ends, the result of the block erase operation can be known by reading the status register. For
more information, see the section on the status register.
Each block can be erase-protected with the lock bit. For more information, see the section on the data
protection function.
CLK1
RxD1 A8 to A16 to
2016 D016
(M32C reception data) A15 A23
TxD1
(M32C transmit data)
RTS1(BUSY)
408
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
RxD1
(M32C reception data) A716 D016
TxD1
(M32C transmit data)
RTS1(BUSY)
CLK1
RxD1 7016
(M32C reception data)
SRD SRD1
TxD1 output output
(M32C transmit data)
RTS1(BUSY)
409
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
RxD1 5016
(M32C reception data)
TxD1
(M32C transmit data)
RTS1(BUSY)
CLK1
TxD1 DQ6
(M32C transmit data)
RTS1(BUSY)
410
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
TxD1
(M32C transmit data)
RTS1(BUSY)
CLK1
RxD1 7A16
(M32C reception data)
TxD1
(M32C transmit data)
RTS1(BUSY)
411
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
RxD1
(M32C reception data) 7516
TxD1
(M32C transmit data)
RTS1(BUSY)
ID Check
This command checks the ID code. Execute the boot ID check command as explained here following.
(1) Transfer the “F516” command code with the 1st byte.
(2) Transfer addresses A0 to A7, A8 to A15 and A16 to A23 of the 1st byte of the ID code with the 2nd,
3rd and 4th bytes respectively.
(3) Transfer the number of data sets of the ID code with the 5th byte.
(4) The ID code is sent with the 6th byte onward, starting with the 1st byte of the code.
CLK1
TxD1
(M32C transmit
data)
RTS1(BUSY)
412
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
Download Command
This command downloads a program to the RAM for execution. Execute the download command as
explained here following.
(1) Transfer the “FA16” command code with the 1st byte.
(2) Transfer the program size with the 2nd and 3rd bytes.
(3) Transfer the check sum with the 4th byte. The check sum is added to all data sent with the 5th
byte onward.
(4) The program to execute is sent with the 5th byte onward.
When all data has been transmitted, if the check sum matches, the downloaded program is executed.
The size of the program will vary according to the internal RAM.
CLK1
RTS1(BUSY)
CLK1
RxD1 FB16
(M32C reception data)
TxD1
(M32C transmit data) 'V' 'E' 'R' 'X'
RTS1(BUSY)
413
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
RxD1 A8 to A16 to
FC16
(M32C reception data) A15 A23
TxD1
(M32C transmit data) data0 data255
RTS1(BUSY)
To use this read check data command, first execute the command and then initialize the check data.
Next, execute the page program command the required number of times. After that, when the read
check command is executed again, the check data for all of the read data that was sent with the page
program command during this time is read. The check data is the result of CRC operation of write
data.
414
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
CLK1
RxD1 FD16
(M32C reception data)
TxD1
(M32C transmit data)
RTS1(BUSY)
ID Code
When the flash memory is not blank, the ID code sent from the peripheral units and the ID code written
in the flash memory are compared to see if they match. If the codes do not match, the command sent
from the peripheral units is not accepted. An ID code contains 8 bits of data. Area is, from the 1st byte,
addresses 0FFFFDF 16, 0FFFFE3 16, 0FFFFEB 16 , 0FFFFEF 16, 0FFFFF3 16 , 0FFFFF7 16 and
0FFFFFB16. Write a program into the flash memory, which already has the ID code set for these
addresses.
Address
0FFFFDC16 to 0FFFFDF16 ID1 Undefined instruction vector
4 bytes
415
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
0FD000016
Block 5 : 64K bytes
0FE000016
Block 4 : 64K bytes
0FF000016
Block 3 : 32K bytes
0FF800016
Block 2 : 8K bytes
0FFA00016
Block 1 : 8K bytes
0FFC00016
Block 0 : 16K bytes
0FFFFFF16
User ROM area
416
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
417
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
418
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 1 (Flash Memory Version)
YES
SR4=1 and SR5 Command Execute the clear status register command (5016)
=1 ? sequence error to clear the status register. Try performing the
operation one more time after confirming that the
NO
command is entered correctly.
NO Should a block erase error occur, the block in error
SR5=0? Block erase error
cannot be used.
YES
NO
SR4=0? Program error (page Execute the read lock bit status command (7116) to
or lock bit) see if the block is locked. After removing lock,
YES execute write operation in the same way. If the
error still occurs, the page in error cannot be used.
Note: When one of SR5 to SR3 is set to 1, none of the page program, block erase, erase all unlock
blocks and lock bit program commands is accepted. Execute the clear status register command
(5016) before executing these commands.
Figure 1.35.21. Full status check flowchart and remedial procedure for errors
M32C/83
Flash memory version
CNVss
BUSY output RTS1(BUSY)
Data input RXD1
P50(CE)
P55(EPM)
NMI
(1) Control pins and external circuitry will vary according to peripheral unit (programmer). For more
information, see the peripheral unit (programmer) manual.
(2) In this example, the microprocessor mode and standard serial I/O mode are switched via a switch.
Figure 1.35.22. Example circuit application for the standard serial I/O mode 1
419
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
*1. If the peripheral unit cannot receive "B016" successfully, change the oscillation frequency of the main
clock.
Reset
15 th "0016"
16th "0016"
"B016" (2) Transfer check code "B016"
420
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
Operation frequency Baud rate Baud rate Baud rate Baud rate Baud rate
(MHZ) 9,600bps 19,200bps 38,400bps 57,600bps 115,200bps
30MHz √ √ √ √ –
20MHz √ √ √ √ √
16MHZ √ √ √ √ –
12MHZ √ √ √ √ –
11MHZ √ √ √ √ –
10MHZ √ √ √ √ –
8MHZ √ √ √ √ –
7.3728MHZ √ √ √ √ –
6MHZ √ √ √ – –
5MHZ √ √ √ – –
4.5MHZ √ √ √ √ –
4.194304MHZ √ √ √ – –
4MHZ √ √ – – –
3.58MHZ √ √ √ √ –
3MHZ √ √ √ – –
2MHZ √ – – – –
√ : Communications possible
– : Communications not possible
421
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
Software Commands
Table 1.35.5 lists software commands. In the standard serial I/O mode 2, erase operations, programs and
reading are controlled by transferring software commands via the RxD1 pin. Standard serial I/O mode 2
adds five transmission speed commands - 9,600, 19,200, 38,400, 57,600 and 115,200 bps - to the soft-
ware commands of standard serial I/O mode 1. Software commands are explained here below.
422
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
The result of the page program can be known by reading the status register. For more information, see
the section on the status register.
Each block can be write-protected with the lock bit. For more information, see the section on the data
protection function. Additional writing is not allowed with already programmed pages.
TxD1
(M32C transmit data)
423
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
Block Erase Command
This command erases the data in the specified block. Execute the block erase command as explained
here following.
(1) Transfer the “2016” command code with the 1st byte.
(2) Transfer addresses A8 to A15 and A16 to A23 with the 2nd and 3rd bytes respectively.
(3) Transfer the verify command code “D016” with the 4th byte. With the verify command code, the
erase operation will start for the specified block in the flash memory. Write the highest address of
the specified block for addresses A16 to A23.
After block erase ends, the result of the block erase operation can be known by reading the status
register. For more information, see the section on the status register.
Each block can be erase-protected with the lock bit. For more information, see the section on the data
protection function.
RxD1 A8 to A16 to
2016 D016
(M32C reception data) A15 A23
TxD1
(M32C transmit data)
RxD1
(M32C reception data) A716 D016
TxD1
(M32C transmit data)
424
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
RxD1 7016
(M32C reception data)
SRD SRD1
TxD1 output output
(M32C transmit data)
RxD1 5016
(M32C reception data)
TxD1
(M32C transmit data)
TxD1 DQ6
(M32C transmit data)
425
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
TxD1
(M32C transmit data)
RxD1 7A16
(M32C reception data)
TxD1
(M32C transmit data)
426
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
RxD1
(M32C reception data) 7516
TxD1
(M32C transmit data)
ID Check
This command checks the ID code. Execute the boot ID check command as explained here following.
(1) Transfer the “F516” command code with the 1st byte.
(2) Transfer addresses A0 to A7, A8 to A15 and A16 to A23 of the 1st byte of the ID code with the 2nd,
3rd and 4th bytes respectively.
(3) Transfer the number of data sets of the ID code with the 5th byte.
(4) The ID code is sent with the 6th byte onward, starting with the 1st byte of the code.
TxD1
(M32C transmit
data)
427
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
Download Command
This command downloads a program to the RAM for execution. Execute the download command as
explained here following.
(1) Transfer the “FA16” command code with the 1st byte.
(2) Transfer the program size with the 2nd and 3rd bytes.
(3) Transfer the check sum with the 4th byte. The check sum is added to all data sent with the 5th
byte onward.
(4) The program to execute is sent with the 5th byte onward.
When all data has been transmitted, if the check sum matches, the downloaded program is executed.
The size of the program will vary according to the internal RAM.
RxD1 FB16
(M32C reception data)
TxD1
(M32C transmit data) 'V' 'E' 'R' 'X'
428
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
CLK1
RxD1 A8 to A16 to
FC16
(M32C reception data) A15 A23
TxD1
(M32C transmit data) data0 data255
RTS1(BUSY)
To use this read check data command, first execute the command and then initialize the check data.
Next, execute the page program command the required number of times. After that, when the read
check command is executed again, the check data for all of the read data that was sent with the page
program command during this time is read. The check data is the result of CRC operation of write
data.
RxD1 FD16
(M32C reception data)
TxD1
(M32C transmit data)
429
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
RxD1 B016
(M32C reception data)
TxD1 B016
(M32C transmit data)
RxD1 B116
(M32C reception data)
TxD1 B116
(M32C transmit data)
RxD1 B216
(M32C reception data)
TxD1 B216
(M32C transmit data)
430
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
RxD1 B316
(M32C reception data)
TxD1 B316
(M32C transmit data)
RxD1 B416
(M32C reception data)
TxD1 B416
(M32C transmit data)
ID Code
When the flash memory is not blank, the ID code sent from the peripheral units and the ID code written
in the flash memory are compared to see if they match. If the codes do not match, the command sent
from the peripheral units is not accepted. An ID code contains 8 bits of data. Area is, from the 1st byte,
addresses 0FFFFDF 16 , 0FFFFE3 16 , 0FFFFEB 16 , 0FFFFEF 16, 0FFFFF3 16 , 0FFFFF7 16 and
0FFFFFB16. Write a program into the flash memory, which already has the ID code set for these
addresses.
431
t
r
de me
Un elop
n
Rev.B2 for proof reading Mitsubishi Microcomputers
M32C/83 group
v
de SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Appendix Standard Serial I/O Mode 2 (Flash Memory Version)
Address
0FFFFDC16 to 0FFFFDF16 ID1 Undefined instruction vector
4 bytes
CLK1
Monitor output RTS1(BUSY)
M32C/80 Flash
memory version
CNVss
NMI
P50(CE)
P55(EPM)
In this example, the microprocessor mode and standard serial I/O mode
are switched via a switch.
Figure 1.35.45. Example circuit application for the standard serial I/O mode 2
432
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
(1/7)
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
the base timer clock. Except this, transfer clock is set
to at least 20 divisions of the base timer clock.
Note 2 Addition
285 Figure 1.23.37 Delay timing of base timer
284 Table1.24.1 A-D conversion start condition
• Timer B2 interrupt • Timer B2 interrupt occurrences frequency counter
overflow
B2 2, 3, 4 Table 1.1.1, 1.1.2
Feb/1/
Clock generating circuit 4 built-in...circuit 3 built-in clock generation circuits
2002
PLL freq. synthe. Delete
Power consumption 29mA 26mA
44mA 38mA
6,10, Fig 1.1.3-1.1.5 Note: P70 and P71 are N-channel...output.-> Add
11
18 Fig 1.1.6 System clock generator
PLL Delete
Oscillation stop detection Ring oscillator
24 7th line Since the value.....due to the interruption. -> Add
27 Fig 1.4.3 (1)
(2) Processor mode register 1 XX00 X000 -> X000 00XX
(3) System clock control register 0 80 -> 0000 X000
(10) Oscillation stop detect register XXXX 0000 -> 00
(17) VDC control register 1 Add
(21) DRAM refresh interval set register XXXX ?000 -> ??
(46) CAN interrupt 1 control register Add
(47) CAN interrupt 2 control register Add
28 Fig 1.4.3 (2)
(70) CAN interrupt 0 control register Add
28-31 Fig 1.4.3(2) (97)-(104), Fig 1.4.3(3) (142)-(149),
Fig 1.4.3(4) (187)-(194), Fig 1.4.3(5) (222)-(229)
Group 0 -3 time measurement/
waveform generation register 0-7 00 -> ??
29, 30 Fig 1.4.3(3) (124), Fig 1.4.3(4) (169)
Group 0,1 SI/O communication buffer register Group 0,1 SI/O receive buffer register
Fig 1.4.3(3) (125), Fig 1.4.3(4) (170)
Group 0,1 receive data register Group 0,1 transmit buffer/receive data register
(129) Group 0 SI/O comm cont register X000 XXX -> 000 X011
(186) Group 1 SI/O expansion trans cont register 0000 00XX -> 0000 0XXX
31 Fig 1.4.3(5) (238)-(241)
Group 3 waveform generate mask register 4-7 00 -> ??
32 Fig 1.4.3(6) (270)-(308) Note added
(270)-(302) Reset value changed
33 Fig 1.4.3(7) (309)-(338) Note added
(314)-(318),(321),(323),(329),(331),(336) Reset values changed
(337) CAN0 clock control register CAN0 sleep control register
36 Fig 1.4.3(10) (461) A-D control register 2 X000 XXX0 -> X000 0000
(2/7)
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
38 Address 007F16 CAN interrupt 1 control register added
Address 008116 CAN interrupt 2 control register added
Address 009D16 CAN interrupt 0 control register added
61 (10) Software wait, 11th line
SFR area is accessed.....with “2 waits”. Add
67 Fig 1.8.2 System clock control register 0
When reset: 0816 0000 X0002
Note 3: When selecting fc,.....as input port. Delete
79 Fig 1.8.9
Note 7: When using PLL.....cannot be used. Delete
90 Fig 1.9.3, Symbol CAN0ICi CANiIC
110 Table 1.11.1, DMA request factors Intelligent I/O interrupt -> add
128 Fig 1.12.4, the number of cycles Change
133 Fig 1.14.3, Timer Ai mode register, MR0
Port output.....registers A and B. Port output.....registers A, B and C.
137, Table 1.14.1, 1.14.2, 1.14,4, 1.14,5
138, TAiOUT pin function Function select register C -> add
142,
144
137 Fig 1.14.7 Timer Ai mode register
bit 2 (MR0) Function select register C -> add
Location of Note 3 (b7, b6): 11 10
139 Fig 1.14.8 Timer Ai mode register
bit 2 (MR0) Function select register C -> add
143, Fig 1.14.11, 1.14.12 Timer Ai mode register
145 bit 2 (MR0) Function select register C -> add
Location of Note 3 (b7, b6): 11 10
159 Fig 1.16.5 Timer Ai mode register
bit 2 (MR0) Function select register C -> add
161 Fig 1.16.6 Reload register Reload register
n = 1 to 255
172 Fig 1.17.4 UARTi transmit/receive control register 0
Note 2 Function select register C -> add
173 Fig 1.17.5 UARTi transmit/receive control register 1
Function of bit 7: Error signal output enable bit Set to “0”
199 Fig 1.22.1 Clock control register Sleep control register
Time stamp count register Time stamp register
200 Fig 1.22.3 Bit 4 0: Forced reset 0: Reset requested
Bit 10 Time stamp count reset bit Time stamp counter reset bit
201 5th line: In no case will the CAN module be ..... In no case will the CAN be.....
Bit 3: BasicCAN mode bit Bit 3: BasicCAN mode select bit
202 Bit 8,9: Timestamp prescaler bits Bit 8, 9: Timestamp prescaler select bits
Bit 11, 1st line: Receive Error Counter Receive Error Counter Register
Transmit Error Counter Transmit Error Counter Register
209 Fig 1.22.8 bit 4: Reserved bit Sampling number
210 6. CAN0 configuration register Explanation of Bit 4 -> add
(3/7)
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
211 Note:1 Setting the C0CTLR0 register’s Reset0 bit Note 1: Setting the C0CTLR0 register’s Reset0 and
to 1 resets the CAN protocol control unit, with the Reset1 bits to 1 resets the CAN, and the C0TSR
C0TSR register thereby initialized to 000016. Also, register is thereby initialized to 000016. Also, setting
setting the TSReset (timestamp count reset) bit to the TSReset (timestamp counter reset) bit to 1 ini-
1 initializes the C0TSR register to 000016 on-the- tializes the C0TSR register to 000016 on-the-fly (while
fly (while the CAN protocol control unit remains the CAN remains operating; CAN0 status register’s
operating). State_Reset bit is “0”).
(4/7)
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
270 Select function
This.....TxD pin output and RxD pin input. This.....ISTxD pin output and ISRxD pin input.
271 Table 1.23.13, Transfer clock input
•Selects I/O with function..... •Select I/O port with function.....
271 Fig 1.23.31
Write to communication buffer Write to receive buffer
(Input to INPC2/ISRxD0 pin) (Input to INPCi2/ISRxDi pin (i=0, 1))
272 Table 1.23.14
Transmission start condition
• Write data to transmit buffer register • Write data to transmit buffer
Interrupt request generation timing
•When transmitting
- When SI/O transmit buffer register is..... - When transmit buffer is .....
•When receiving
When....to SI/O communication buffer register When.....to SI/O receive buffer register
Error detection
• Overrun error:
.....before contents of receive buffer register.... .....before contents o SI/O receive buffer register.....
273 Fig 1.23.32
Write to communication buffer Write to receive buffer
273 Fig 1.23.33
(Input to INPC2/ISRxD0 pin) (Input to INPCi2/ISRxDi pin (i=0, 1))
279 Table 1.23.17
Transmission start condition
• Write data to transmit buffer register • Write data to SI/O transmit buffer register
Reception start condition
• Write data to transmit buffer register • Write data to SI/O transmit buffer register
Interrupt request generation timing
•When receiving
When....to SI/O communication buffer register When.....to SI/O receive buffer register
Select function
This.....TxD pin output and RxD pin input. This.....ISTxD pin output and ISRxD pin input.
286 Fig 1.24.4, A-D control register 2
When reset: X000 XXX02 X000 00002
287, Fig 1.24.5, Note 4 and Fig 1.24.6, Note 3
288 ..... by A-D sweep pin select bits..... .....by analog input port select bits.....
292 (e) Replace function of input pin
2nd line: .....of A-D0 and A-D2. .....of A-D0 and A-D1.
293 (f) , at the end of 2nd line as AN0.....respectively. -> add
(g) 3rd line: ....., input via AN00 to AN07 is..... , input via AN0 to AN7 is.....
294 Table 1.24.9 P00 analog input P95 analog input
P01 analog input P96 analog input
312 Fig 1.29.1, P00 to P07, P20 to P27: -
(5/7)
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
313 Fig 1.29.2 Delete
Pull-up selection
Pull-up selection
Direction register
Direction register
Port P1 control
register Port P1 control
register
(6/7)
REVISION HISTORY M32C/83 GROUP DATA SHEET
Rev. Description
Date Page Errror Correct
344- Electric characteristics Add
380
385 Fig 1.34.1, Address 037716 Address 005716
_____ _____
Bit 0: RY/BY status bit RY/BY signal status bit
385 Flash memory control register (address 005716)
_____ _____
1st line: .....the RY/BY status flag..... .....the RY/BY signal status bit.....
390 13th line of Page Program Command (4116) and
_____ _____
Fig 1.34.3: RY/BY status flag RY/BY signal status bit
391 11th line of Block Erase Command (2016/D016)
_____ _____
and Fig 1.34.4: RY/BY status flag RY/BY signal status bit
_____ _____
392 Fig 1.34.5: RY/BY status flag RY/BY signal status bit
400 3rd paragraph, 1st line
....., set the CLK1 pin to “H” level and.... ....., set the CLK1 pin to “H” level and the TxD1 pin to
“L” level, and.....
400 3rd paragraph, 2nd line
The CLK1 pin is connected to Vcc.....resistance. Add
401 P67 When using standard.....transfer. Add
419 Fig 1.35.22, Data output Pulled down
421 How frequency is identified, 2nd line: (2 - 20MHz) (2 - 30MHz)
(7/7)
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.
Editioned by
Committee of editing of Mitsubishi Semiconductor DATA SHEET
Published by
Mitsubishi Electric Corp., Kitaitami Works
This book, or parts thereof, may not be reproduced in any form without
permission of Mitsubishi Electric Corporation.
©2002 MITSUBISHI ELECTRIC CORPORATION