M16C62 Hardware Manual Rev1.20
M16C62 Hardware Manual Rev1.20
Before using this material, please visit the our website to confirm that this is the most
current document available.
Rev. 1.20
Revision date: Sep. 11, 2003 www.renesas.com
Keep safety first in your circuit designs!
• Renesas Technology Corporation puts the maximum effort into making semiconductor prod-
ucts 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 ap-
propriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of non-
flammable material or (iii) prevention against any malfunction or mishap.
This hardware manual provides detailed information on features in the M16C/62 Group
(M16C/62P) microcomputer.
Users are expected to have basic knowledge of electric circuits, logical circuits and micro-
computer.
Each register diagram contains bit functions with the following symbols and descriptions.
*1
XXX register
b7 b6 b5 b4 b3 b2 b1 b0 Symbol Address After reset
0 XXX XXX 0016
Nothing is assigned.
(b2) When write, should set to "0". When read, its content is indeterminate.
XXX5 WO
XXX6 RW
0: XXX
XXX7 XXX bit RO
1: XXX
*1
Blank:Set to "0" or "1" according to your intended use
0: Set to "0"
1: Set to "1"
X: Nothing is assigned
*2
RW: Read and write
RO: Read only
WO: Write only
–: Nothing is assigned
*3
Terms to use here are explained as follows.
• Nothing is assigned
Nothing is assigned to the bit concerned. When write, set to "0" for new function
in future plan.
• Reserved bit
Reserved bit. Set the specified value.
• Avoid this setting
The operation at having selected is not guaranteed.
• Function varies depending on each operation mode
Bit function varies depending on peripheral function mode.
Refer to register diagrams in each mode.
M16C Family Documents
Document Contents
Overview ________________________________________________ 1
Applications........................................................................................................................................... 1
Block Diagram....................................................................................................................................... 3
Memory ________________________________________________ 11
SFR ___________________________________________________ 14
Reset __________________________________________________ 20
Hardware Reset .................................................................................................................................. 20
Bus ___________________________________________________ 33
Bus Mode ............................................................................................................................................ 33
(2) Peripheral Function Clock(f1, f2, f8, f32, f1SIO, f2SIO, f8SIO, f32SIO, fAD, fC32) .............................. 62
Protection ______________________________________________ 74
Interrupts ______________________________________________ 75
Type of Interrupts ............................................................................................................................ 75
DMAC _________________________________________________ 95
A-2
1. Transfer Cycles ............................................................................................................................. 100
(3) Pull-up Control Register 0 to Pull-up Control Register 2 (PUR0 to PUR2 Registers) ................. 207
A-4
Quick Reference to Pages Classified by Address
000016 004016
000116 004116
000216 004216
000316 004316
000416 Processor mode register 0 PM0 30 004416 INT3 interrupt control register INT3IC 81
000516 Processor mode register 1 PM1 31 004516 Timer B5 interrupt control register TB5IC 81
000616 System clock control register 0 CM0 53 004616 Timer B4 interrupt control register, TB4IC,
81
000716 System clock control register 1 CM1 54 UART1 BUS collision detection interrupt control register U1BCNIC
000816 Chip select control register CSR 34 004716 Timer B3 interrupt control register, TB3IC, 81
000916 Address match interrupt enable register AIER 92 UART0 BUS collision detection interrupt control register U0BCNIC
000A16 Protect register PRCR 74 004816 SI/O4 interrupt control register S4IC, 81
000B16 Data bank register DBR 44 INT5 interrupt control register INT5IC
000C16 Oscillation stop detection register CM2 55 004916 SI/O3 interrupt control register, S3IC, 81
000D16 INT4 interrupt control register INT4IC
000E16 Watchdog timer start register WDTS 94 004A16 UART2 Bus collision detection interrupt control register BCNIC 81
000F16 Watchdog timer control register WDC 24, 94 004B16 DMA0 interrupt control register DM0IC 81
001016 004C16 DMA1 interrupt control register DM1IC 81
001116 Address match interrupt register 0 RMAD0 92 004D16 Key input interrupt control register KUPIC 81
001216 004E16 A-D conversion interrupt control register ADIC 81
001316 004F16 UART2 transmit interrupt control register S2TIC 81
001416 005016 UART2 receive interrupt control register S2RIC 81
001516 Address match interrupt register 1 RMAD1 92 005116 UART0 transmit interrupt control register S0TIC 81
001616 005216 UART0 receive interrupt control register S0RIC 81
001716 005316 UART1 transmit interrupt control register S1TIC 81
001816 005416 UART1 receive interrupt control register S1RIC 81
001916 Voltage detection register 1 VCR1 25 005516 Timer A0 interrupt control register TA0IC 81
001A16 Voltage detection register 2 VCR2 25 005616 Timer A1 interrupt control register TA1IC 81
001B16 Chip select expansion control register CSE 40 005716 Timer A2 interrupt control register TA2IC 81
001C16 PLL control register 0 PLC0 57 005816 Timer A3 interrupt control register TA3IC 81
001D16 005916 Timer A4 interrupt control register TA4IC 81
001E16 Processor mode register 2 PM2 56 005A16 Timer B0 interrupt control register TB0IC 81
001F16 Voltage down detection interrupt register D4INT 25 005B16 Timer B1 interrupt control register TB1IC 81
002016 005C16 Timer B2 interrupt control register TB2IC 81
002116 DMA0 source pointer SAR0 99 005D16 INT0 interrupt control register INT0IC 81
002216 005E16 INT1 interrupt control register INT1IC 81
002316 005F16 INT2 interrupt control register INT2IC 81
002416 006016
002516 DMA0 destination pointer DAR0 99 006116
002616 006216
002716 006316
002816 006416
DMA0 transfer counter TCR0 99
002916 006516
002A16 006616
002B16 006716
002C16 DMA0 control register DM0CON 98 006816
002D16 006916
002E16 006A16
002F16 006B16
003016 006C16
003116 DMA1 source pointer SAR1 99 006D16
003216 006E16
003316 006F16
003416 007016
003516 DMA1 destination pointer DAR1 99 007116
003616 007216
003716 007316
003816 007416
DMA1 transfer counter TCR1 99
003916 007516
003A16 007616
003B16 007716
003C16 DMA1 control register DM1CON 98 007816
003D16 007916
003E16 007A16
003F16 007B16
007C16
Note: The blank areas are reserved and cannot be accessed by users.
007D16
007E16
007F16
B-1
Quick Reference to Pages Classified by Address
Note 1: The blank areas are reserved and cannot be accessed by users.
Note 2: This register is included in the flash memory version.
B-2
Quick Reference to Pages Classified by Address
Note : The blank areas are reserved and cannot be accessed by users.
B-3
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Overview
The M16C/62 group (M16C/62P) of single-chip microcomputers are built using the high-performance sili-
con gate CMOS process using a M16C/60 Series CPU core and are packaged in a 100-pin and 128-pin
plastic molded QFP. These single-chip microcomputers operate using sophisticated instructions featuring
a high level of instruction efficiency. With 1M bytes of address space, they are capable of executing instruc-
tions at high speed. In addition, this microcomputer contains a multiplier and DMAC which combined with
fast instruction processing capability, makes it suitable for control of various OA, communication, and in-
dustrial equipment which requires high-speed arithmetic/logic operations.
Applications
Audio, cameras, office/communications/portable/industrial equipment, etc
1
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Performance Outline
Table 1.1.1 lists performance outline of M16C/62P group.
Table 1.1.1. Performance outline of M16C/62P group
Item Performance
Number of basic instructions 91 instructions
Shortest instruction execution time 41.7 ns (f(BCLK)= 24MHZ, VCC1= 3.0V to 5.5V)
100 ns (f(BCLK)= 10MHZ, VCC1= 2.7V to 5.5V)
Memory ROM (See the product list)
capacity RAM (See the product list)
I/O port 100-pin version 8 bits x 10, 7 bits x 1 P0 to P5: VCC2 ports
P0 to P10 (except P85) P6 to P10: VCC1 ports
128-pin version 8 bits x 13, 7 bits x 1, P0 to P5, P12, P13: VCC2 ports
P0 to P14 (except P85) 2 bits x 1 _______ P6 to P10, P11, P14: VCC1 ports
Input port P85 1 bit x 1 (NMI pin level judgment): VCC1 ports
Multifunction timer
Output 16 bits x 5 channels (TA0, TA1, TA2, TA3, TA4)
Input 16 bits x 6 channels (TB0, TB1, TB2, TB3, TB4, TB5)
Serial I/O 3 channels (UART0, UART1, UART2)
UART, clock synchronous, I2C bus1 (option4), or IEBus2 (option4)
2 channels (SI/O3, SI/O4)
Clock synchronous
A-D converter 10 bits x (8 x 3 + 2) channels
D-A converter 8 bits x 2
DMAC 2 channels (trigger: 25 sources)
CRC calculation circuit CRC-CCITT
Watchdog timer 15 bits x 1 (with prescaler)
Interrupt 29 internal and 8 external sources, 4 software sources, 7 levels
Clock generation circuit 4 circuits
• Main clock (These circuits contain a built-in feedback
• Sub-clock resistor and external ceramic/quartz oscillator)
• Ring oscillator(main-clock oscillation stop detect function)
• PLL frequency synthesizer
Voltage detection circuit Present (option4)
Power supply voltage VCC1=3.0V to 5.5V, VCC2=3.0V to VCC1(f(BCLK)=24MHZ)
VCC1=VCC2=2.7V to 5.5V (f(BCLK)=10MHZ)
Flash memory Program/erase voltage 3.3V ± 0.3V or 5.0V ± 0.5V
Number of program/erase 100 times, 10000 times3 (option4)
Power consumption 14mA (VCC1=VCC2=5V, f(BCLK)=24MHZ)
8mA (VCC1=VCC2=3V, f(BCLK)=10MHZ)
1.8µA (VCC1=VCC2=3V, f(XCIN)=32kHZ, when wait mode)
I/O I/O withstand voltage 5.0V
characteristics Output current 5mA
Memory expansion Available (to 4M bytes)
Operating ambient temperature -20 to 85°C
-40 to 85°C (option4)
Device configuration CMOS high performance silicon gate
Package 100-pin and 128-pin plastic mold QFP
Notes:
1. I2C bus is a registered trademark of Koninklijke Philips Electronics N. V.
2. IEBus is a registered trademark of NEC Electronics Corporation.
3. Block 1 and block A are a 10,000 times of programming and erasure. All other blocks are guaranteed of 1,000 times
of programming and erasure. (Under development; mass production scheduled to start in the 3rd quarter of 2003)
4. If you desire this option, please so specify.
2
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Block Diagram
Figure 1.1.1 is a block diagram of the M16C/62P group.
8 8 8 8 8 8 8
Port P7
8
Internal peripheral functions A-D converter System clock generator
(10 bits X 8 channels XIN-XOUT
Timer (16-bit)
Expandable up to 26 channels)
Port P8
Output (timer A): 5 XCIN-XCOUT
Input (timer B): 6 PLL frequency synthesizer
UART or Ring oscillator
7
clock synchronous serial I/O
<VCC1 ports>
Three-phase motor (8 bits X 3 channels) Clock synchronous serial I/O
control circuit (8 bits X 2 channels)
Port P85
CRC arithmetic circuit (CCITT )
(Polynomial : X16+X12+X5+1)
8
R3 ISP RAM
(2 channels) (Note 2)
INTB
A0
PC
D-A converter A1
Port P10
3
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Product List
Tables 1.1.2 and 1.1.3 list the M16C/62P group products and Figure 1.1.2 shows the type numbers,
memory sizes and packages.
4
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
M30620SPFP 100P6S-A
10K bytes
M30620SPGP 100P6Q-A
External ROM version
M30622SPFP 100P6S-A
4K bytes
M30622SPGP 100P6Q-A
: Under development
: Under planning
Type No. M 3 0 6 2 6 M H P– X X X F P
Package type:
FP : Package 100P6S-A
GP : Package 100P6Q-A, 128P6Q-A
ROM No.
Omitted for flash memory version and
external ROM version
ROM capacity:
6: 48K bytes G: 256K bytes
8: 64K bytes W: 320K bytes
A: 96K bytes H: 384K bytes
C: 128K bytes J: 512K bytes
E: 192K bytes
Memory type:
M: Mask ROM version
F: Flash memory version
S: External ROM version
M16C/62 Group
M16C Family
Figure 1.1.2. Type No., Memory Size, and Package
5
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pin Configuration
Figures 1.1.3 to 1.1.5 show the pin configurations (top view).
P27/AN27/A7(/D7/D6)
P25/AN25/A5(/D5/D4)
P26/AN26/A6(/D6/D5)
P21/AN21/A1(/D1/D0)
P24/AN24/A4(/D4/D3)
P22/AN22/A2(/D2/D1)
P23/AN23/A3(/D3/D2)
P20/AN20/A0(/D0/-)
P17/D15/INT5
P16/D14/INT4
P15/D13/INT3
P30/A8(/-/D7)
P12/D10
P36/A14
P13/D11
P37/A15
P14/D12
P40/A16
P41/A17
P32/A10
P42/A18
P33/A11
P43/A19
P34/A12
P35/A13
P10/D8
P11/D9
P31/A9
VCC2
VSS
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
P07/AN07/D7 81 50 P44/CS0
P06/AN06/D6 82 49 P45/CS1
P05/AN05/D5 83 48 P46/CS2
P04/AN04/D4 84 47 P47/CS3
P03/AN03/D3 85 46 P50/WRL/WR
P02/AN02/D2 86 45 P51/WRH/BHE
P01/AN01/D1 87 44 P52/RD
P00/AN00/D0 88 43 P53/BCLK
P107/AN7/KI3 89 42 P54/HLDA
P106/AN6/KI2 90 M16C/62P Group 41 P55/HOLD
P105/AN5/KI1 91 40 P56/ALE
P104/AN4/KI0 92 39 P57/RDY/CLKOUT
P103/AN3 93 38 P60/CTS0/RTS0
P102/AN2 94 37 P61/CLK0
P101/AN1 95 36 P62/RxD0/SCL0
AVSS 96 35 P63/TXD0/SDA0
P100/AN0 97 34 P64/CTS1/RTS1/CTS0/CLKS1
VREF 98 33 P65/CLK1
AVCC 99 32 P66/RxD1/SCL1
P97/ADTRG/SIN4 100 31 P67/TXD1/SDA1
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
P83/INT1
P73/CTS2/RTS2/TA1IN/V
VSS
BYTE
P81/TA4IN/U
XOUT
P74/TA2OUT/W
P90/TB0IN/CLK3
P82/INT0
P72/CLK2/TA1OUT/V
XIN
P91/TB1IN/SIN3
CNVss
P80/TA4OUT/U
P87/XCIN
P71/RxD2/SCL2/TA0IN/TB5IN(Note)
P76/TA3OUT
P92/TB2IN/SOUT3
P95/ANEX0/CLK4
P86/XCOUT
VCC1
P84/INT2
P70/TXD2/SDA2/TA0OUT(Note)
P77/TA3IN
P93/DA0/TB3IN
P96/ANEX1/SOUT4
P75/TA2IN/W
P94/DA1/TB4IN
RESET
P85/NMI
Package: 100P6S-A
Note: P70 and P71 are N channel open-drain output pins.
6
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
P30/A8(/-/D7)
P13/D11
P14/D12
P37/A15
P40/A16
P41/A17
P32/A10
P33/A11
P34/A12
P35/A13
P36/A14
P31/A9
VCC2
VSS
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
P12/D10 76 50 P42/A18
P11/D9 77 49 P43/A19
P10/D8 78 48 P44/CS0
P07/AN07/D7 79 47 P45/CS1
P06/AN06/D6 80 46 P46/CS2
P05/AN05/D5 81 45 P47/CS3
P04/AN04/D4 82 44 P50/WRL/WR
P03/AN03/D3 83 43 P51/WRH/BHE
P02/AN02/D2 84 42 P52/RD
P01/AN01/D1 85 41 P53/BCLK
P00/AN00/D0 86 40 P54/HLDA
P107/AN7/KI3 87 M16C/62P Group 39 P55/HOLD
P106/AN6/KI2 88 38 P56/ALE
P105/AN5/KI1 89 37 P57/RDY/CLKOUT
P104/AN4/KI0 90 36 P60/CTS0/RTS0
P103/AN3 91 35 P61/CLK0
P102/AN2 92 34 P62/RxD0/SCL0
P101/AN1 93 33 P63/TXD0/SDA0
AVSS 94 32 P64/CTS1/RTS1/CTS0/CLKS1
P100/AN0 95 31 P65/CLK1
VREF 96 30 P66/RxD1/SCL1
AVcc 97 29 P67/TXD1/SDA1
P97/ADTRG/SIN4 98 28 P70/TXD2/SDA2/TA0OUT(Note)
99 27 P71/RxD2/SCL2/TA0IN/TB5IN(Note)
P96/ANEX1/SOUT4
P95/ANEX0/CLK4 100 26 P72/CLK2/TA1OUT/V
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
XOUT
P94/DA1/TB4IN
P80/TA4OUT/U
P86/XCOUT
XIN
CNVss
P81/TA4IN/U
VCC1
P91/TB1IN/SIN3
P90/TB0IN/CLK3
P82/INT0
BYTE
P73/CTS2/RTS2/TA1IN/V
P87/XCIN
P92/TB2IN/SOUT3
P74/TA2OUT/W
P83/INT1
RESET
P93/DA0/TB3IN
P75/TA2IN/W
P84/INT2
P85/NMI
VSS
P76/TA3OUT
P77/TA3IN
Package: 100P6Q-A
Note: P70 and P71 are N channel open-drain output pins.
7
Renesas microcomputers
M16C / 62P Group
Overview SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
P24/AN24/A4(/D4/D3)
P22/AN22/A2(/D2/D1)
P23/AN23/A3(/D3/D2)
P20/AN20/A0(/D0/-)
P17/D15/INT5
P16/D14/INT4
P15/D13/INT3
P30/A8(/-/D7)
P47/CS3
P44/CS0
P45/CS1
P46/CS2
P13/D11
P14/D12
P32/A10
P33/A11
P40/A16
P34/A12
P41/A17
P35/A13
P42/A18
P36/A14
P43/A19
P37/A15
P12/D10
P31/A9
P11/D9
P123
P124
P121
P122
VCC2
P120
VSS
P71/RxD2/SCL2/TA0IN/TB5IN(Note)
VREF
P74/TA2OUT/W
P91/TB1IN/SIN3
P86/XCOUT
VCC1
P84/INT2
P92/TB2IN/SOUT3
P95/ANEX0/CLK4
P70/TXD2/SDA2/TA0OUT(Note)
P73/CTS2/RTS2/TA1IN/V
P83/INT1
VCC1
P66/RxD1/SCL1
P93/DA0/TB3IN
P87/XCIN
VSS
P96/ANEX1/SOUT4
BYTE
P81/TA4IN/U
P94/DA1/TB4IN
XOUT
P140
P76/TA3OUT
P82/INT0
P75/TA2IN/W
XIN
CNVss
P80/TA4OUT/U
RESET
P67/TXD1/SDA1
P77/TA3IN
P90/TB0IN/CLK3
P72/CLK2/TA1OUT/V
P141
P85/NMI
Package: 128P6Q-A
Note: P70 and P71 are N channel open-drain output pins.
8
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Overview
Pin Description
Table 1.1.4 Pin Description (100-pin and 128-pin Packages)
Pin name Signal name I/O type Power supply Function
VCC1, VCC2, Power supply Apply 2.7V to 5.5 V to the VCC1 and VCC2 pins and 0 V to the VSS
VSS input pin. The Vcc apply condition is that VCC2 ≤ VCC1 (Note)
CNVSS CNVSS Input VCC1 This pin switches between processor modes. Connect this pin to
VSS pin when after a reset you want to start operation in single-
chip mode (memory expansion mode) or the VCC1 pin when
starting operation in microprocessor mode.
RESET Reset input Input VCC1 “L” on this input resets the microcomputer.
XIN Clock input Input VCC1 These pins are provided for the main clock generating circuit input/
output. Connect a ceramic resonator or crystal between the XIN
XOUT Clock output Output and the XOUT pins. To use an externally derived clock, input it to
the XIN pin and leave the XOUT pin open.
BYTE External data Input This pin selects the width of an external data bus. A 16-bit width is
bus width selected when this input is “L”; an 8-bit width is selected when this
select input input is “H”. This input must be fixed to either “H” or “L”. Connect
this pin to the VSS pin when operating in single-chip mode.
AVCC Analog power This pin is a power supply input for the A-D converter. Connect
supply input this pin to VCC1.
AVSS Analog power This pin is a power supply input for the A-D converter. Connect
supply input this pin to VSS.
VREF Reference Input This pin is a reference voltage input for the A-D converter.
voltage input
P00 to P07 I/O port P0 Input/output VCC2 This is an 8-bit CMOS I/O port. This port has an input/output select
direction register, allowing each pin in that port to be directed for
input or output individually.
If any port is set for input, selection can be made for it in a program
whether or not to have a pull-up resistor in 4 bit units. This selection
is unavailable in memory extension and microprocessor modes.
This port can function as input pins for the A-D converter when so
selected in a program.
D0 to D7 Input/output When set as a separate bus, these pins input and output data (D0
–D7).
P10 to P17 I/O port P1 Input/output VCC2 This is an 8-bit I/O port equivalent to P0. P15 to P17 also function
as INT interrupt input pins as selected by a program.
D8 to D15 Input/output When set as a separate bus, these pins input and output data (D8
–D15).
P20 to P27 I/O port P2 Input/output VCC2 This is an 8-bit I/O port equivalent to P0. This port can function as
input pins for the A-D converter when so selected in a program.
A0 to A7 Output These pins output 8 low-order address bits (A0 to A7).
A0/D0 to Input/output If the external bus is set as an 8-bit wide multiplexed bus, these
A7/D7 pins input and output data (D0 to D7) and output 8 low-order
address bits (A0 to A7) separated in time by multiplexing.
A0 Output If the external bus is set as a 16-bit wide multiplexed bus, these
A1/D0 to Input/output pins input and output data (D0 to D6) and output address (A1 to A7)
A7/D6 separated in time by multiplexing. They also output address (A0).
P30 to P37 I/O port P3 Input/output VCC2 This is an 8-bit I/O port equivalent to P0.
A8 to A15 Output These pins output 8 middle-order address bits (A8 to A15).
A8/D7, Input/output If the external bus is set as a 16-bit wide multiplexed bus, these
A9 to A15 Output pins input and output data (D7) and output address (A8)
separated in time by multiplexing. They also output address (A9
to A15).
P40 to P47 I/O port P4 Input/output VCC2 This is an 8-bit I/O port equivalent to P0.
A16 to A19, Output These pins output A16 to A19 and CS0 to CS3 signals. A16 to A19
CS0 to CS3 Output are 4 high- order address bits. CS0 to CS3 are chip select signals
used to specify an access space.
Note: In this manual, hereafter, VCC refers to VCC1 unless otherwise noted.
9
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Overview
P50 to P57 I/O port P5 Input/output VCC2 This is an 8-bit I/O port equivalent to P0. In single-chip mode, P57
in this port outputs a divide-by-8 or divide-by-32 clock of XIN or a
clock of the same frequency as XCIN as selected by program.
WRL / WR, Output Output WRL/WR, WRH/BHE, RD, BCLK, HLDA, and ALE signals.
WRH / BHE, Output WRL/WR and WRH/BHE are switchable in a program. Note that
RD, Output WRL and WRH are always used as a pair, so as WR and BHE.
BCLK, Output WRL, WRH, and RD selected
HLDA, Output If the external data bus is 16 bits wide, data are written to even
HOLD, Input addresses when the WRL signal is low, and written to odd
ALE, Output addresses when the WRH signal is low. Data are read out when the
RDY Input RD signal is low.
WR, BHE, and RD selected
Data are written when the WR signal is low, or read out when the
RD signal is low. Odd addresses are accessed when the BHE
signal is low. Use this mode when the external data bus is 8 bits
wide.
The microcomputer goes to a hold state when input to the HOLD
pin is held low. While in the hold state, HLDA outputs a low
level. ALE is used to latch the address. While the input level of the
RDY pin is low, the bus of the microcomputer goes to a wait state.
P60 to P67 I/O port P6 Input/output VCC1 This is an 8-bit I/O port equivalent to P0. Pins in this port also
function as UART0 and UART1 I/O pins as selected by program.
P70 to P77 I/O port P7 Input/output VCC1 This is an 8-bit I/O port equivalent to P0 (P70 and P71 are N
channel open-drain output). This port can function as input/output
pins for timers A0 to A3 when so selected in a program.
Furthermore, P70 to P75, P71, and P72 to P75 can also function as
input/output pins for UART2, an input pin for timer B5, and output
pins for the three-phase motor control timer, respectively.
P80 to P84, I/O port P8 Input/output VCC1 P80 to P84, P86, and P87 are I/O ports with the same functions as
P86, P0. When so selected in a program, P80 to P81 and P82 to P84 can
Input/output
function as input/output pins for timer A4 or output pins for the
P87, Input/output three-phase motor control timer and INT interrupt input pins,
P85 I/O port P85 Input respectively. P86 and P87, when so selected in a program, both
can function as input/output pins for the subclock oscillator circuit.
In that case, connect a crystal resonator between P86 (XCOUT pin)
and P87 (XCIN pin).
P85 is an input-only port shared with NMI. An NMI interrupt request
is generated when input on this pin changes state from high to low.
The NMI function cannot be disabled in a program.
A pull-up cannot be set for this pin.
P90 to P97 I/O port P9 Input/output VCC1 This is an 8-bit I/O port equivalent to P0. Pins in this port also
function as SI/O3 and SI/O4 I/O pins, Timer B0 to B4 input pins, D-
A converter output pins, A-D converter input pins, or A-D trigger
input pins as selected by program.
P100 to I/O port P10 Input/output VCC1 This is an 8-bit I/O port equivalent to P0. Pins in this port also
P107 function as A-D converter input pins as selected by program.
Furthermore, P104 to P107 also function as input pins for the key
input interrupt function.
10
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Memory
Memory
Figure 1.2.1 is a memory map of the M16C/62P group. The address space extends the 1M bytes from
address 0000016 to FFFFF16.
The internal ROM is allocated in a lower address direction beginning with address FFFFF16. For example,
a 64-Kbyte internal ROM is allocated to the addresses from F000016 to FFFFF16.
The fixed interrupt vector table is allocated to the addresses from FFFDC16 to FFFFF16. Therefore, store
the start address of each interrupt routine here.
The internal RAM is allocated in an upper address direction beginning with address 0040016. For example,
a 10-Kbytes internal RAM is allocated to the addresses from 0040016 to 02BFF16. In addition to storing
data, the internal RAM also stores the stack used when calling subroutines and when interrupts are gener-
ated.
The SRF is allocated to the addresses from 0000016 to 003FF16. Peripheral function control registers are
located here. Of the SFR, any area which has no functions allocated is reserved for future use and cannot
be used by users.
The special page vector table is allocated to the addresses from FFE0016 to FFFDB16. This vector is used
by the JMPS or JSRS instruction. For details, refer to the “M16C/60 and M16C/20 Series Software Manual.”
In memory expansion and microprocessor modes, some areas are reserved for future use and cannot be
used by users.
0000016
SFR
FFE0016
0040016
Internal RAM
AAAAAA
Reserved area vector table
1000016 (Note 1)
AAAAAA
Internal RAM Internal ROM
External area
Size Address XXXXX16 Size Address YYYYY16
AAAAAA
2700016
4K bytes 013FF16 48K bytes F400016
Reserved area FFFDC16 Undefined instruction
AAAAAA
5K bytes 017FF16 64K bytes F000016
2800016
10K bytes 02BFF16 96K bytes E800016 Overflow
External area
12K bytes 033FF16 128K bytes E000016
BRK instruction
8000016 Address match
16K bytes 043FF16 192K bytes D000016 Reserved area Single step
20K bytes 053FF16 (Note 2)
256K bytes C000016 YYYYY16 Watchdog timer
24K bytes 063FF16 320K bytes B000016
DBC
31K bytes 07FFF16 384K bytes A000016 Internal ROM
NMI
512K bytes 8000016
FFFFF16 Reset
FFFFF16
Note 1: During memory expansion and microprocessor modes, can not be used.
Note 2: In memory expansion mode, can not be used.
Note 3: Shown here is a memory map for the case where the PM10 bit in the PM1
register is “1” and the PM13 bit in the PM1 register is “1”.
11
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Central Processing Unit (CPU)
b19 b15 b0
PC Program counter
b15 b0
b15 b0
FLG Flag register
AA
AAAAAAA
AA AA
A
b15
AAAAAAA AAAA
A
AA
AAAAAAA AA
AA
AAAAA
AA
IPL
b8 b7
U I O B S Z D C
b0
Carry flag
Debug flag
Zero flag
Sign flag
Register bank select flag
Overflow flag
Interrupt enable flag
Stack pointer select flag
Reserved area
Processor interrupt priority level
Reserved area
Note: These registers comprise a register bank. There are two register banks.
12
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Central Processing Unit (CPU)
13
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
SFR
Address Register Symbol After reset
000016
000116
000216
000316
000416 Processor mode register 0 (Note 2) PM0 000000002(CNVSS pin is “L”)
000000112(CNVSS pin is “H”)
000516 Processor mode register 1 PM1 000010002
000616 System clock control register 0 CM0 010010002
000716 System clock control register 1 CM1 001000002
000816 Chip select control register CSR 000000012
000916 Address match interrupt enable register AIER XXXXXX002
000A16 Protect register PRCR XX0000002
000B16 Data bank register DBR 0016
000C16 Oscillation stop detection register (Note 3) CM2 0000X0002
000D16
000E16 Watchdog timer start register WDTS XX16
000F16 Watchdog timer control register WDC 00XXXXXX2(Note 4)
001016 Address match interrupt register 0 RMAD0 0016
001116 0016
001216 X016
001316
001416 Address match interrupt register 1 RMAD1 0016
001516 0016
001616 X016
001716
001816
001916 Voltage detection register 1 (Note 5) VCR1 000010002
001A16 Voltage detection register 2 (Note 5) VCR2 0016
001B16 Chip select expansion control register CSE 0016
001C16 PLL control register 0 PLC0 0001X0102
001D16
001E16 Processor mode register 2 PM2 XXX000002
001F16 Voltage down detection interrupt register D4INT 0016
002016 DMA0 source pointer SAR0 XX16
002116 XX16
002216 XX16
002316
002416 DMA0 destination pointer DAR0 XX16
002516 XX16
002616 XX16
002716
002816 DMA0 transfer counter TCR0 XX16
002916 XX16
002A16
002B16
002C16 DMA0 control register DM0CON 00000X002
002D16
002E16
002F16
003016
DMA1 source pointer SAR1 XX16
003116
XX16
003216
XX16
003316
003416 DMA1 destination pointer DAR1 XX16
003516 XX16
003616 XX16
003716
003816 DMA1 transfer counter TCR1 XX16
003916 XX16
003A16
003B16
003C16 DMA1 control register DM1CON 00000X002
003D16
003E16
003F16
Note 1: The blank areas are reserved and cannot be accessed by users.
Note 2: The PM00 and PM01 bits do not change at software reset, watchdog timer reset and oscillation stop detection reset.
Note 3: The CM20, CM21, and CM27 bits do not change at oscillation stop detection reset.
Note 4: The WDC5 bit is “0” (cold start) immediately after power-on. It can only be set to “1” in a program. It is set to “0” when the input voltage
at the VCC1 pin drops to Vdet2 or less while the VC25 bit in the VCR2 register is set to “1” (RAM retention limit detection circuit enable
Note 5: This register does not change at software reset, watchdog timer reset and oscillation stop detection reset.
X : Nothing is mapped to this bit
14
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
Note :The blank areas are reserved and cannot be accessed by users.
15
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
~ ~
01B016
01B116
01B216
01B316
01B416 Flash identification register (Note 2) FIDR XXXXXX002
01B516 Flash memory control register 1 (Note 2) FMR1 0X00XX0X2
01B616
01B716 Flash memory control register 0 (Note 2) FMR0 XX0000012
01B816 Address match interrupt register 2 RMAD2 0016
01B916 0016
01BA16 X016
01BB16 Address match interrupt enable register 2 AIER2 XXXXXX002
01BC16 Address match interrupt register 3 RMAD3 0016
01BD16 0016
01BE16 X016
01BF16
~ ~
025016
025116
025216
025316
025416
025516
025616
025716
025816
025916
025A16
025B16
025C16
025D16
025E16 Peripheral clock select register PCLKR 000000112
025F16
~ ~
033016
033116
033216
033316
033416
033516
033616
033716
033816
033916
033A16
033B16
033C16
033D16
033E16
033F16
Note 1: The blank areas are reserved and cannot be accessed by users.
Note 2: This register is included in the flash memory version.
16
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
17
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
18
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SFR
19
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
Reset
There are four types of resets: a hardware reset, a software reset, an watchdog timer reset, and an oscilla-
tion stop detection reset.
Hardware Reset
There are two types of hardware resets: a hardware reset 1 and a hardware reset 2.
Hardware Reset 1
____________ _____________
A reset is applied using the RESET pin. When an “L” signal is applied to the RESET pin while the
power supply voltage is within the recommended operating condition, the pins are initialized (see
____________
Table 1.5.1. Pin Status When RESET Pin Level is “L”). The oscillation circuit is initialized and the main
____________
clock starts oscillating. When the input level at the RESET pin is released from “L” to “H”, the CPU and
SFR are initialized, and the program is executed starting from the address indicated by the reset
____________
vector. The internal RAM is not initialized. If the RESET pin is pulled “L” while writing to the internal
RAM, the internal RAM becomes indeterminate.
Figure 1.5.1 shows the example reset circuit. Figure 1.5.2 shows the reset sequence. Table 1.5.1
____________
shows the status of the other pins while the RESET pin is “L”. Figure 1.5.3 shows the CPU register
status after reset. Refer to “SFR” for SFR status after reset.
2. Power on
____________
(1) Apply an “L” signal to the RESET pin.
(2) Let the power supply voltage increase until it meets the recommended operating condition.
(3) Wait td(P-R) or more until the internal power supply stabilizes.
(4) Supply a clock for 20 cycles or more to the XIN pin.
____________
(5) Apply an “H” signal to the RESET pin.
Hardware Reset 2
This reset is generated by the microcomputer’s internal voltage detection circuit. The voltage detec-
tion circuit monitors the voltage supplied to the VCC1 pin.
If the VC26 bit in the VCR2 register is set to “1” (reset level detection circuit enabled), the microcom-
puter is reset when the voltage at the VCC1 input pin drops below Vdet3.
Similarly, if the VC25 bit in the VCR2 register is set to “1” (RAM retention limit detection circuit en-
abled), the microcomputer is reset when the voltage at the VCC1 input pin drops below Vdet2.
Conversely, when the input voltage at the VCC1 pin rises to Vdet3 or more, the pins and the CPU and
SFR are initialized, and the program is executed starting from the address indicated by the reset
vector. It takes about td(S-R) before the program starts running after Vdet3 is detected. The initialized
pins and registers and the status thereof are the same as in hardware reset 1.
Set the CM10 bit in the CM1 register to “1” (stop mode) after setting the VC25 bit to “1” (RAM retention
limit detection circuit enabled), and the microcomputer will be reset when the voltage at the VCC1 input
pin drops below Vdet2 and comes out of reset when the voltage at the VCC1 input pin rises above
Vdet3. During stop mode, the value set in the VC26 bit has no effect. Therefore, no reset is generated
even when the input voltage at the VCC1 pin drops to Vdet3 or less.
20
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
Recommended
operating
voltage
VCC1
0V
RESET VCC1
RESET
Equal to or less Equal to or less
than 0.2VCC1 than 0.2VCC1
0V
More than 20 cycles of XIN + td(P-R)
are needed.
Note : When the microcomputer is used under the condition VCC1 ≥ VCC2, make sure the VCC2 voltage does not
exceed the VCC1 voltage when powering up, or powering down the microcomputer.
Software Reset
When the PM03 bit in the PM0 register is set to “1” (microcomputer reset), the microcomputer has its pins,
CPU, and SFR initialized. Then the program is executed starting from the address indicated by the reset
vector.
Select the main clock for the CPU clock source, and set the PM03 bit to “1” with main clock oscillation
satisfactorily stable.
At software reset, some SFR’s are not initialized. Refer to “SFR”. Also, since the PM01 to PM00 bits in the
PM0 register are not initialized, the processor mode remains unchanged.
21
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
VCC1, VCC2
XIN
Microprocessor
mode BYTE = “H”
BCLK
Content of reset vector
RD
WR
CS0
Microprocessor
mode BYTE = “L” Content of reset vector
RD
WR
CS0
Address FFFFE16
22
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
____________
Table 1.5.1. Pin Status When RESET Pin Level is “L”
Status
Pin name CNVSS = VCC1 (Note 1)
CNVSS = VSS
BYTE = VSS BYTE = VCC
HLDA output (The output value HLDA output (The output value
P54 Input port depends on the input to the depends on the input to the
HOLD pin) HOLD pin)
P6, P7, P80 to P84, Input port Input port Input port
P86, P87, P9, P10
P11, P12, P13, Input port Input port Input port
P140, P141 (Note 2)
Note 1: Shown here is the valid pin state when the internal power supply voltage has stabilized after power-on.
When CNVSS = VCC1, the pin state is indeterminate until the internal power supply voltage stabilizes.
Note 2: P11, P12, P13, P140, P141 pins exist in 128-pin version.
b15 b0
b19 b0
0000016 Interrupt table register(INTB)
Content of addresses FFFFE16 to FFFFC16 Program counter(PC)
b15 b0
b15 b0
AA
AAAAAA
AA
AAAAAAA
AA
b15 b8 b7 b0
IPL U I O B S Z D C
23
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
WDC5 bit
T +
Vdet3 Internal reset signal
(“L” active)
E
CM10 bit=1
(stop mode)
VCC1 +
Vdet4 Voltage down
Noise rejection
E detection signal
VCR1 register
b3
VC13 bit
Note 1: Writing to the WDC register causes the WDC5 bit to be set to “1” (warm start).
Note 2: The WDC5 bit is “0” (cold start) immediately after power-on. It can only be set to “1” in a program. It is set
to “0” when the input voltage at the VCC1 pin drops to Vdet2 or less while the VC25 bit in the VCR2 register
is set to “1” (RAM retention limit detection circuit enable).
24
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
Note 1: The VC13 bit is useful when the VC27 bit of VCR2 register is set to “1” (voltage down detection circuit
enable). The VC13 bit is always “1” (VCC1≥ 4 V) when the VC27 bit in the VCR2 register is set to “0” (voltage
down detection circuit disable).
Note 2: This register does not change at software reset, watchdog timer reset and oscillation stop detection reset.
Note 1: Write to this register after setting the PRC3 bit in the PRCR register to “1” (write enable).
Note 2: To use hardware reset 2, set the VC26 bit to “1” (reset level detection circuit enable).
Note 3: To use hardware reset 2 in stop mode, set the VC25 bit to “1” (RAM retention limit detection circuit enable).
VC26 bit is disabled in stop mode. (The microcomputer is not reset even if the voltage input to Vcc1 pin
becomes lower than Vdet3.)
Note 4: To use the WDC5 bit in the WDC register, set the VC25 bit to “1” (RAM retention limit detection circuit enable).
Note 5: Where the VC13 bit in the VCR1 register and D42 bit in the D4INT register are used or the D40 bit is set to “1”
(voltage down detection interrupt enable), set the VC27 bit to “1” (voltage down detection circuit enable).
Note 6: This register does not change at software reset, watchdog timer reset and oscillation stop detection reset.
Note 7: The detection circuit does not start operation until td(E-A) elapses after the VC25 bit, VC26 bit, or VC27 bit is
set to “1”.
25
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
RESET
26
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
Precautions
1. Limitations on Stop Mode
Before setting the CM10 bit in the CM1 register to “1” (stop mode), be sure to clear the CM02 bit in the
CM0 register to “0” (do not stop the peripheral function clock).
If the CM10 bit in the CM1 register is set to “1” (stop mode) when the VC13 bit in the VCR1 register is “1”
(VCC1 ≥ Vdet4) while the VC27 bit in the VCR2 register is “1” (voltage down detection circuit enable) and
the D40 bit in the D4INT register is “1” (voltage down detection interrupt enable) and D41 bit in the D4INT
register is “1” (voltage down detection interrupt is used to get out of stop mode), a voltage down detection
interrupt request is immediately generated, causing the microcomputer to exit stop mode.
In systems where the microcomputer enters stop mode when the input voltage at the VCC1 pin drops
below Vdet4 and exits stop mode when the input voltage rises to Vdet4 or more, make sure the CM10 bit
is set to “1” when VC13 bit is “0” (VCC1 < Vdet4).
27
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Reset
DF1, DF0
002
012 D42 bit is set to “0”(not detected) by
writing a “0” in a program. VC27 bit
Voltage down detection circuit 102
is set to “0” (voltage down detection
D4INT clock(the 112 circuit disabled), the D42 bit is set to
1/8 1/2 1/2 1/2
VC27 clock with which it “0”.
operates also in
wait mode) D42
VC13 Watchdog
timer interrupt
VCC1 + Noise signal
Noise rejection Digital
VREF rejection Voltage down circuit filter
-
detection signal
(Rejection wide:200 ns)
D40
Watchdog timer
underflow signal This bit is set to “0”(not detected) by writing a “0” in a program.
VCC1
VC13 bit
D42 bit
Figure 1.5.9. Power Supply Down Detection Interrupt Generation Circuit Operation Example
28
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Processor Mode
Processor Mode
(1) Types of Processor Mode
Three processor modes are available to choose from: single-chip mode, memory expansion mode, and
microprocessor mode. Table 1.6.1 shows the features of these processor modes.
Table 1.6.3. PM01 to PM00 Bits Set Values and Processor Modes
PM01 to PM00 bits Processor modes
002 Single-chip mode
012 Memory expansion mode
102 Must not be set
112 Microprocessor mode
Rewriting the PM01 to PM00 bits places the microcomputer in the corresponding processor mode regard-
less of whether the input level on the CNVSS pin is “H” or “L”. Note, however, that the PM01 to PM00 bits
cannot be rewritten to “012” (memory expansion mode) or “112” (microprocessor mode) at the same time
the PM07 to PM02 bits are rewritten. Note also that these bits cannot be rewritten to enter microprocessor
mode in the internal ROM, nor can they be rewritten to exit microprocessor mode in areas overlapping the
internal ROM.
If the microcomputer is reset in hardware by applying VCC1 to the CNVSS pin (hardware reset 1 or hard-
ware reset 2), the internal ROM cannot be accessed regardless of PM01 to PM00 bits.
Figures 1.6.1 and 1.6.2 show the registers associated with processor modes. Figure 1.6.3 show the
memory map in single chip mode.
29
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Processor Mode
PM03 Software reset bit Setting this bit to “1” resets the
microcomputer. When read, its content RW
is “0”.
b5 b4
PM04 Multiplexed bus space
0 0 : Multiplexed bus is unused
select bit (Note 2) (Separate bus in the entire CS RW
space)
PM05 0 1 : Allocated to CS2 space
1 0 : Allocated to CS1 space
1 1 : Allocated to the entire CS space RW
(Note 3)
PM06 Port P40 to P43 function 0 : Address output
select bit (Note 2) 1 : Port function RW
(Address is not output)
PM07 BCLK output disable bit 0 : BCLK is output
(Note 2) 1 : BCLK is not output RW
(Pin is left high-impedance)
Note 1: Write to this register after setting the PRC1 bit in the PRCR register to "1" (write enable).
Note 2: Effective when the PM01 to PM00 bits are set to “012” (memory expansion mode) or “112” (microprocessor
mode).
Note 3: To set the PM01 to PM00 bits are “012” and the PM05 to PM04 bits are “112” (multiplexed bus assigned to
the entire CS space), apply an “H” signal to the BYTE pin (external data bus is 8 bits wide). While the
CNVSS pin is held “H” (= VCC1), do not rewrite the PM05 to PM04 bits to “112” after reset.
If the PM05 to PM04 bits are set to “112” during memory expansion mode, P31 to P37 and P40 to P43
become I/O ports, in which case the accessible area for each CS is 256 bytes.
Note 4: The PM01 to PM00 bits do not change at software reset, watchdog timer reset and oscillation stop
detection reset.
30
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Processor Mode
Note 1: Write to this register after setting the PRC1 bit in the PRCR register to “1” (write enable).
Note 2: For the mask ROM version, this bit must be set to “0” . For the flash memory version, the PM10 bit also
controls block A by enabling or disabling it. However, the PM10 bit is automatically set to “1” when the FMR0
1 bit in the FMR0 register is “1” (CPU rewrite mode).
Note 3: Effective when the PM01 to PM00 bits are set to “012” (memory expansion mode) or “112” (microprocessor
mode).
Note 4: PM12 bit is set to “1” by writing a “1” in a program. (Writing a “0” has no effect.)
Note 5: When PM17 bit is set to “1” (with wait state), one wait state is inserted when accessing the internal RAM,
internal ROM, or an external area. If the CSiW bit (i = 0 to 3) in the CSR register is “0” (with wait state), the
CSi area is always accessed with one or more wait states regardless of whether the PM17 bit is set or not.
Where the RDY signal is used or multiplex bus is used, set the CSiW bit to “0” (with wait state).
Note 6: The PM13 bit is automatically set to “1” when the FMR01 bit in the FMR0 register is “1” (CPU rewrite mode).
Note 7: The access area is changed by the PM13 bit as listed in the table below.
31
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Processor Mode
32
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
Bus
During memory expansion or microprocessor mode, some pins serve as the bus control pins to perform
_______
data input/output to and from external devices. These bus control pins include A0 to A19, D0 to D15, CS0
_______ _____ ________ ______ ________ ________ ________ __________ _________
to CS3, RD, WRL/WR, WRH/BHE, ALE, RDY, HOLD, HLDA and BCLK.
Bus Mode
The bus mode, either multiplexed or separate, can be selected using the PM05 to PM04 bits in the PM0
register.
Separate Bus
In this bus mode, data and address are separate.
Multiplexed Bus
In this bus mode, data and address are multiplexed.
• When the input level on BYTE pin is high (8-bit data bus)
D0 to D7 and A0 to A7 are multiplexed.
• When the input level on BYTE pin is low (16-bit data bus)
D0 to D7 and A1 to A8 are multiplexed. D8 to D15 are not multiplexed. Do not use D8 to D15.
External buses connecting to a multiplexed bus are allocated to only the even addresses of the micro-
computer. Odd addresses cannot be accessed.
33
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
Bus Control
The following describes the signals needed for accessing external devices and the functionality of software
wait.
(1) Address Bus
The address bus consists of 20 lines, A0 to A19. The address bus width can be chosen to be 12, 16 or
20 bits by using the PM06 bit in the PM0 register and the PM11 bit in the PM1 register. Table 1.7.1
shows the PM06 and PM11 bit set values and address bus widths.
Table 1.7.1. PM06 and PM11 Bits Set Value and Address Bus Width
Set value(Note) Pin function Address bus wide
PM11=1 P34 to P37
12 bits
PM06=1 P40 to P43
PM11=0 A12 to A15
16 bits
PM06=1 P40 to P43
PM11=0 A12 to A15
20 bits
PM06=0 A16 to A19
Note 1: No values other than those shown above can be set.
When processor mode is changed from single-chip mode to memory extension mode, the address
bus is indeterminate until any external area is accessed.
Note 1: Where the RDY signal is used in the area indicated by CSi (i = 0 to 3) or the multiplex bus is used, set
the CSiW bit to “0” (Wait state).
Note 2: If the PM17 bit in the PM1 register is set to “1” (with wait state), the external area indicated by CS0 to
CS3 is always accessed with one wait state even when the CSiW bit is “1” (without wait state).
Note 3: When the CSiW bit = “0” (with wait state), the number of wait states (interms of clock cycles) can be
selected using the CSEi1W to CSEi0W bits in the CSE register.
34
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
Example 1 Example 2
To access the external area indicated by CSj in the next cycle after To access the internal ROM or internal RAM in the next cycle after
accessing the external area indicated by CSi accessing the external area indicated by CSi
The address bus and the chip select signal both change state between The chip select signal changes state but the address bus does not
these two cycles. change state
Access to the external Access to the external Access to the external Access to the internal
area indicated by CSi area indicated by CSj area indicated by CSi ROM or internal RAM
BCLK BCLK
CSi CSi
CSj
Example 3 Example 4
To access the external area indicated by CSi in the next cycle after Not to access any area (nor instruction prefetch generated) in the next cycle after
accessing the external area indicated by the same CSi accessing the external area indicated by CSi
The address bus changes state but the chip select signal does not Neither the address bus nor the chip select signal changes state between
change state these two cycles
Access to the external Access to the same Access to the external No access
area indicated by CSi external area area indicated by CSi
BCLK BCLK
CSi CSi
Note : These examples show the address bus and chip select signal when accessing areas in two successive cycles. The chip select bus cycle
may be extended more than two cycles depending on a combination of these examples.
Shown above is the case where separate bus is selected and the area is accessed for read without wait states. i = 0 to 3, j = 0 to 3
(not including i, however)
______
Figure 1.7.2. Example of Address Bus and CSi Signal Output in 1 Mbyte Mode
35
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
When BYTE pin input = “H” When BYTE pin input = “L”
ALE ALE
A0/D0 to A7/D7
A0 Address
Address Data
A9 to A19 Address
Note : If the entire CS space is assigned a multiplexed bus, these pins function as I/O ports.
36
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
________
(6) The RDY Signal
This signal is provided for accessing external devices which need to be accessed at low speed. If input on
________
the RDY pin is asserted low at the last falling edge of BCLK of the bus cycle, one wait state is inserted in
________
the bus cycle. While in a wait state, the following signals retain the state in which they were when the RDY
signal was acknowledged.
________
Then, when the input on the RDY pin is detected high at the falling edge of BCLK, the remaining bus cycle
is executed. Figure 1.7.4 shows example in which the wait state was inserted into the read cycle by the
________ ________
RDY signal. To use the RDY signal, set the corresponding bit (CS3W to CS0W bits) in the CSR register
________ ________
to “0” (with wait state). When not using the RDY signal, process the RDY pin as an unused pin.
BCLK
RD
CSi
(i=0 to 3)
AAAAA
RDY
tsu(RDY - BCLK)
BCLK
RD
CSi
(i=0 to 3)
AAAAAA
RDY
tsu(RDY - BCLK)
AA
AA
: Wait using RDY signal
Shown above is the case where CSEiW to CSEi1W (i = 0 to 3) bits in the CSE register are “002” (one wait state).
________
Figure 1.7.4. Example in which Wait State was Inserted into Read Cycle by RDY Signal
37
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
__________
HOLD > DMAC > CPU
Figure 1.7.5. Bus-using Priorities
38
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
39
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
RD, WR, WRL, WRH RD, WR, WRL, WRH output Output “H”
40
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
41
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
BCLK
Write signal
Read signal
CS
BCLK
Write signal
Read signal
Output Input
Data bus
CS
BCLK
Write signal
Read signal
Output Input
Data bus
CS
Note : These example timing charts indicate bus cycle length. After this bus cycle sometimes come read and write cycles in
succession.
42
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Bus
BCLK
Write signal
Read signal
CS
BCLK
Write signal
Read signal
ALE
CS
BCLK
Write signal
Read signal
ALE
CS
Note : These example timing charts indicate bus cycle length. After this bus cycle sometimes come read and write cycles in
succession.
43
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Memory Space Expansion Function
Table 1.8.1. The Way of Setting Memory Space Expansion Function, Memory Space
Memory space expansion function How to set (PM15 to PM14) Memory space
1 Mbytes mode 002 1 Mbytes (no expansion)
4 Mbytes mode 112 4 Mbytes
______
In 4 Mbyte mode, the CSi (i=0 to 3) pin functions differently for each area to be accessed.
Addresses 0400016 to 3FFFF16, C000016 to FFFFF16
______ ______
• The CSi signal is output from the CSi pin (same operation as 1 Mbyte mode. However the last address
_______
of CS1 area is 3FFFF16)
Addresses 4000016 to BFFFF16
______
• The CS0 pin outputs “L”
______ ______
• The CS1 to CS3 pins output the value ofsetting as the BSR2 to BSR0 bits (bank number)
______
Figures 1.8.4 to 1.8.5 show the memory mapping and CS area in 4 Mbyte mode. Note that banks 0 to 6
______
are data-only areas. Locate the program in bank 7 or the CSi area.
Note : Effective when the PM01 to PM00 bits are set to “012” (memory expansion mode) or “112” (microprocessor
mode).
44
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Memory Space Expansion Function
0000016
AAAA AAAA
SFR SFR
0040016
Internal RAM Internal RAM
AAAA AAAA
XXXXX16
Reserved area Reserved area
0400016
AAAA AAAA
CS3(16 Kbytes)
0800016 Reserved, External area Reserved, external area CS2(PM10=0: 124 Kbytes)
AAAA AAAA
1000016 CS2 (PM10=1: 92 Kbytes)
2700016 Reserved area Reserved area
2800016
AAAA AAAA
CS1(32 Kbytes)
3000016
External area External area
AAAA AAAA
CS0(Memory expansion mode:640 Kbytes )
AAAA
D000016
Reserved area CS0(Microprocessor mode:832 Kbytes)
AAAA
YYYYY16
Internal ROM
FFFFF16
PM13=0
Internal RAM Internal ROM External area
Capacity Address XXXXX16 Capacity Address YYYYY16 CS0 CS1 CS2 CS3
4 Kbytes 013FF16 48 Kbytes F400016 Memory expansion mode 2800016– When PM10=0 0400016–
5 Kbytes 017FF16 64 Kbytes F000016 3000016–CFFFF16 2FFFF16 0800016–26FFF16 07FFF16
10 Kbytes 02BFF16 96 Kbytes E800016 Microprocessor mode When PM10=1
12 Kbytes 033FF16 128 Kbytes E000016 3000016–FFFFF16 1000016–26FFF16
16 Kbytes 03FFF16(Note) 192 Kbytes D000016
20 Kbytes 03FFF16(Note) 256 Kbytes D000016(Note)
24 Kbytes 03FFF16(Note) 320 Kbytes D000016(Note)
31 Kbytes 03FFF16(Note) 384 Kbytes D000016(Note)
512 Kbytes D000016(Note)
Note : If PM13 bit is set to “0”, 15 Kbytes of the internal RAM and 192 Kbytes of the internal ROM can be used.
______
Figure 1.8.2. Memory Mapping and CS Area in 1 Mbyte Mode (PM13=0)
0000016
SFR SFR
0040016
Internal RAM Internal RAM
XXXXX16
AAAAA AAAAA
Reserved area
AAAAA AAAAA
0800016 Reserved, external area Reserved, external area CS2(PM10=0: 124 Kbytes)
1000016 CS2 (PM10=1: 92 Kbytes)
AAAAA AAAAA
2700016 Reserved area Reserved area
2800016
AAAAA AAAAA
CS1(32 Kbytes)
3000016
External
AAAAA AAAAA
area
External area CS0(Memory expansion mode:320 Kbytes )
8000016
YYYYY16
FFFFF16
Reserved area
Internal ROM
AAAAA
AAAAA
CS0(Microprocessor mode:832 Kbytes)
PM13=1
Internal RAM Internal ROM External area
Capacity Address XXXXX16 Capacity Address YYYYY16 CS0 CS1 CS2 CS3
4 Kbytes 013FF16 48 Kbytes F400016 Memory expansion mode 2800016– When PM10=0 No area
5 Kbytes 017FF16 64 Kbytes F000016 3000016–7FFFF16 2FFFF16 0800016–26FFF16
10 Kbytes 02BFF16 96 Kbytes E800016 Microprocessor mode When PM10=1
12 Kbytes 033FF16 128 Kbytes E000016 3000016–FFFFF16 1000016–26FFF16
16 Kbytes 043FF16 192 Kbytes D000016
20 Kbytes 053FF16 256 Kbytes C000016
24 Kbytes 063FF16 320 Kbytes B000016
31 Kbytes 07FFF16 384 Kbytes A000016
512 Kbytes 8000016
______
Figure 1.8.3. Memory Mapping and CS Area in 1 Mbyte Mode (PM13=1)
45
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Memory Space Expansion Function
0000016
SFR SFR
0040016
AAAAA AAAAA
Internal RAM Internal RAM
XXXXX16
Reserved area Reserved area
AAAAA AAAAAA
0400016
CS3(16 Kbytes)
0800016 Reserved, external area
AAAAA AAAAAA
Reserved, external area CS2(PM10=0: 124 Kbytes)
1000016 CS2 (PM10=1: 92 Kbytes)
2700016
AAAAA AAAAAA
Reserved area Reserved area
2800016
CS1(96 Kbytes)
AAAAA AAAAAA
4000016
External area External area Other than the CS area (512 Kbytes X 8 banks)
AAAAA AAAAAA
C000016
CS0(Memory expansion mode:64 Kbytes )
AAAAAA
D000016
Reserved area CS0(Microprocessor mode:256 Kbytes)
YYYYY16
AAAAAA
Internal ROM
FFFFF16
PM13=0
Internal RAM Internal ROM External area
Capacity Address XXXXX16 Capacity Address YYYYY16 CS0 CS1 CS2 CS3 Other than the CS area (Note 1)
4 Kbytes 013FF16 48 Kbytes F400016 Memory expansion mode 2800016– When PM10=0
5 Kbytes 017FF16 64 Kbytes F000016 C000016–CFFFF16 3FFFF16 0800016–26FFF16 0400016– 4000016–BFFFF16
10 Kbytes 02BFF16 96 Kbytes E800016 Microprocessor mode When PM10=1 07FFF16
12 Kbytes 033FF16 128 Kbytes E000016 C000016–FFFFF16 1000016–26FFF16
16 Kbytes 03FFF16(Note2) 192 Kbytes D000016
20 Kbytes 03FFF16(Note2) 256 Kbytes D000016(Note2)
24 Kbytes 03FFF16(Note2) 320 Kbytes D000016(Note2)
31 Kbytes 03FFF16(Note2) 384 Kbytes D000016(Note2)
512 Kbytes D000016(Note2)
Note 1: The CS0 pin outputs a low signal, and the CS1–CS3 pins output a bank number.
Note 2: If PM13 bit is set to “0”, 15 Kbytes of the internal RAM and 192 Kbytes of the internal ROM can be used.
______
Figure 1.8.4. Memory Mapping and CS Area in 4 Mbyte Mode (PM13=0)
0000016
SFR SFR
0040016
Internal RAM Internal RAM
XXXXX16
0800016
AAAAA
Reserved, external area
AAAAA AAAAA
1000016 CS2 (PM10=1: 92 Kbytes)
2700016 Reserved area Reserved area
AAAAA AAAAA
2800016
CS1(96 Kbytes)
4000016
AAAAA AAAAA
External area External area
Other than the CS area (Memory expansion mode:256 Kbytes X 8 banks)*
*Two 256 Kbytes X 8 banks can be used by changing the offset.
AAAAA
8000016 Other than the CS area(Microprocessor mode:512 Kbytes X 8 banks)
C000016
AAAAA
Reserved area
PM13=1
Internal RAM Internal ROM External area
Capacity Address XXXXX16 Capacity Address YYYYY16 CS0 CS1 CS2 CS3 Other than the CS area (Note)
4 Kbytes 013FF16 48 Kbytes F400016 Microprocessor mode 2800016– When PM10=0 No area Memory expansion mode
5 Kbytes 017FF16 64 Kbytes F000016 C000016–FFFFF16 3FFFF16 0800016–26FFF16 4000016–7FFFF16
10 Kbytes 02BFF16 96 Kbytes E800016 When PM10=1 Microprocessor mode
12 Kbytes 033FF16 128 Kbytes E000016 1000016–26FFF16 4000016–BFFFF16
16 Kbytes 043FF16 192 Kbytes D000016
20 Kbytes 053FF16 256 Kbytes C000016
24 Kbytes 063FF16 320 Kbytes B000016
31 Kbytes 07FFF16 384 Kbytes A000016
512 Kbytes 8000016
Note : The CS0 pin outputs a low signal, and the CS1–CS3 pins output a bank number.
______
Figure 1.8.5. Memory Mapping and CS Area in 4 Mbyte Mode (PM13=1)
46
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Memory Space Expansion Function
Figure 1.8.6 shows the external memory connect example in 4 Mbyte mode.
_____ _______
In this example, the CS pin of 4-Mbyte ROM is connected to the CS0 pin of microcomputer. The 4 Mbyte
_______ _______ _______
ROM address input AD21, AD20 and AD19 pins are connected to the CS3, CS2 and CS1 pins of micro-
computer, respectively. The address input AD18 pin is connected to the A19 pin of microcomputer. Fig-
ures 1.8.7 to 1.8.9 show the relationship of addresses between the 4-Mbyte ROM and the microcomputer
for the case of a connection example in Figure 1.8.6.
In microprocessor mode, or in memory expansion mode where the PM13 bit in the PM1 register is “0”,
banks are located every 512 Kbytes. Setting the OFS bit in the DBR register to “1”(offset) allows the
accessed address to be offset by 4000016, so that even the data overlapping a bank boundary can be
accessed in succession.
In memory expansion mode where the PM13 bit is “1”, each 512-Kbyte bank can be accessed in 256
Kbyte units by switching them over with the OFS bit.
____ _______
Because the SRAM can be accessed on condition that the chip select signals S2 = “H” and S1 =“L”, CS0
_______ _____ ____
and CS2 can be connected to S2 and S1, respectively. If the SRAM does not have the input pins to accept
____ _______ _______
“H” active and “L” active chip select signals(S1, S2), CS0 and CS2 should be decoded external to the
chip.
8
D0 to D7 DQ0 to DQ7
17
A0 to A16 AD0 to AD16
A17 AD17
4M bytes ROM
A19 AD18
Microcomputer
CS1 AD19
CS2 AD20
CS3 AD21
RD OE
CS0 CS
WR DQ0 to DQ7
128K bytes SRAM
AD0 to AD16
OE
S2
(Note)
S1
W
47
48
AAAA
ROM address Microcomputer address
AAAA
OFS bit of the DBR register=0 OFS bit of the DBR register=1
00000016 4000016
AAAA
Output from the microcomputer pins
Bank Access
OFS CS output Address output bank 0
AAAA
number area
CS3 CS2 CS1 A19 A18 A17 A16 A15–A0
04000016 (512 Kbytes) 4000016
4000016
AAAA
0 0 0 0 1 0 0 000016 00000016
0
BFFFF16 0 0 0 1 0 1 1 FFFF16 07FFFF16 BFFFF16 bank 0
AAAA
0
4000016 0 0 0 1 0 0 0 000016 04000016 08000016 4000016 (512 Kbytes)
1 0 0 1 0 1 1 1 FFFF16
AAAA
BFFFF16 0BFFFF16
0 0 1 0 1 0 0 bank 1 BFFFF16
4000016 000016 08000016
AAAA
0 (512 Kbytes) 4000016
BFFFF16 0 0 1 1 0 1 1 FFFF16 0FFFFF16 0C000016
1
4000016
AAAA
0 0 1 1 0 0 0 0C000016
1
000016 BFFFF16 bank 1
BFFFF16 0 1 0 0 1 1 1 FFFF16 13FFFF16 (512 Kbytes)
10000016 4000016
AAAA
4000016 0 1 0 0 1 0 0
000016 10000016
0 bank 2 BFFFF16
AAAA
BFFFF16 0 1 0 1 0 1 1 FFFF16 17FFFF16
2
4000016 0 1 0 1 0 0 0 000016 14000016 14000016 (512 Kbytes) 4000016
AAAA
1
BFFFF16 0 1 1 0 1 1 1 FFFF16 1BFFFF16
BFFFF16 bank 2
AAAA
4000016 0 1 1 0 1 0 0 000016 18000016
0 18000016 4000016 (512 Kbytes)
BFFFF16 0 1 1 1 0 1 1 FFFF16 1FFFFF16
AAAA
3 0 1 1 1 0 0 0
4000016 000016 1C000016 Data bank 3 BFFFF16
1
AAAA
BFFFF16 1 0 0 0 1 1 1 FFFF16 23FFFF16 1C000016 (512 Kbytes) 4000016
4000016 1 0 0 0 1 0 0 000016 20000016
AAAA
0
BFFFF16 1 0 0 1 0 1 1 FFFF16 27FFFF16 BFFFF16 bank 3
4
AAAA
4000016 1 0 0 1 0 0 0 000016 24000016 20000016 4000016 (512 Kbytes)
1 1 0 1 0 1 1 1 FFFF16
BFFFF16 2BFFFF16
AAAA
bank 4 BFFFF16
4000016 1 0 1 0 1 0 0 000016 28000016 (512 Kbytes)
0 24000016 4000016
AAAA
BFFFF16 1 0 1 1 0 1 1 FFFF16 2FFFFF16
5
4000016 1 0 1 1 0 0 0 000016 2C000016 BFFFF16 bank 4
AAAA
1
BFFFF16 1 1 0 0 1 1 1 FFFF16 33FFFF16 28000016 4000016 (512 Kbytes)
AAAA
AAAA
6
4000016 1 1 0 1 0 0 0 2C000016 (512 Kbytes) 4000016
000016 34000016
1
AAAA
BFFFF16 1 1 1 0 1 1 1 FFFF16 3BFFFF16 BFFFF16 bank 5
1 1 1 0 1 0 0 38000016
AAAA
4000016 000016 30000016 4000016 (512 Kbytes)
7FFFF16 1 1 1 0 1 1 1 FFFF16 3BFFFF16
AAAA
8000016 1 1 1 1 0 0 0 000016 3C000016 bank 6 BFFFF16
BFFFF16 1 1 1 1 0 1 1 FFFF16 34000016 (512 Kbytes)
AAAA
3FFFFF16 4000016
7 0
1 1 1 1 1 0 0 000016 3C000016
Renesas microcomputers
38000016 4000016 (512 Kbytes)
D000016 Internal ROM access Program or data bank 7
DFFFF16 Internal ROM access (512 Kbytes) BFFFF16
D000016 Internal ROM access 3C000016
DFFFF16 Internal ROM access Program or data
A21 A20 A19 A18 N.C. A17 A16 A15–A0 Address input for 4- 3FFFFF16 BFFFF16
Address input for 4-Mbyte ROM Mbyte ROM
N.C.: No connected
Memory Space Expansion Function
Figure 1.8.8. Relationship Between Addresses on 4-M Byte ROM and Those on Microcomputer (2)
AAA
ROM address Microcomputer address
AAA
OFS bit of the DBR register=0 OFS bit of the DBR register=1
AAA
Bank Access bank 0
OFS CS output Address output (256 Kbytes)
number area
7FFFF16
AAA
CS3 CS2 CS1 A19 A18 A17 A16 A15–A0
4000016 04000016 4000016
0 0 0 0 1 0 0 000016 00000016 bank 0
AAA
0
7FFFF16 0 0 0 0 1 1 1 FFFF16 03FFFF16 (256 Kbytes)
0 7FFFF16
AAA
4000016 0 0 0 1 0 0 0 000016 04000016 08000016
1 4000016
7FFFF16 0 0 0 1 0 1 1 FFFF16 bank 1
07FFFF16
AAA
(256 Kbytes)
4000016 0 0 1 0 1 0 0 000016 08000016 7FFFF16
0
AAA
7FFFF16 0 0 1 0 1 1 1 FFFF16 0BFFFF16 0C000016 bank 1
4000016
1
4000016 (256 Kbytes)
AAA
0 0 1 1 0 0 0 000016 0C000016
1 7FFFF16
7FFFF16 0 0 1 1 0 1 1 FFFF16 0FFFFF16 4000016
10000016
AAA
bank 2
4000016 0 1 0 0 1 0 0 000016 10000016
0 (256 Kbytes)
AAA
7FFFF16 0 1 0 0 1 1 1 FFFF16 13FFFF16 7FFFF16
2 14000016
4000016 0 1 0 1 0 0 0 000016 14000016 4000016
AAA
1 bank 2
7FFFF16 0 1 0 1 0 1 1 FFFF16 17FFFF16 (256 Kbytes)
7FFFF16
AAA
4000016 0 1 1 0 1 0 0 000016 18000016 18000016 4000016
0 bank 3
7FFFF16
AAA
0 1 1 0 1 1 1 FFFF16 1BFFFF16
3 (256 Kbytes)
4000016 0 1 1 1 0 0 0 000016 1C000016 Data 7FFFF16
AAA
1 1C000016 4000016
7FFFF16 0 1 1 1 0 1 1 FFFF16 1FFFFF16 bank 3
(256 Kbytes
AAA
4000016 1 0 0 0 1 0 0 000016 20000016
0 7FFFF16
7FFFF16 1 0 0 0 1 1 1 FFFF16 23FFFF16 4000016
AAA
4 20000016 bank 4
4000016 1 0 0 1 0 0 0 000016 24000016 (256 Kbytes)
1
AAA
7FFFF16 1 0 0 1 0 1 1 FFFF16
27FFFF16 7FFFF16
4000016 24000016 4000016
AAA
1 0 1 0 1 0 0 000016 28000016 bank 4
0 (256 Kbytes)
7FFFF16 1 0 1 0 1 1 1 FFFF16 2BFFFF16 7FFFF16
AAA
5
4000016 1 0 1 1 0 0 0 000016 2C000016 28000016 4000016
1 bank 5
AAA
7FFFF16 1 0 1 1 0 1 1 FFFF16 2FFFFF16 (256 Kbytes)
AAA
1 1 0 0 1 0 0 000016
0 1 1 0 0 1 1 1 FFFF16 2C000016 4000016
7FFFF16 33FFFF16 bank 5
6
AAA
4000016 (256 Kbytes)
1 1 0 1 0 0 0 000016 34000016 7FFFF16
1
7FFFF16 1 1 0 1 0 1 1 FFFF16
AAA
37FFFF16 30000016 4000016
bank 6
4000016 1 1 1 0 1 0 0 000016 38000016 (256 Kbytes)
AAA
7FFFF16 1 1 1 0 1 1 1 FFFF16 3BFFFF16 7FFFF16
7 0 34000016 4000016
AAA
8000016 Internal ROM access bank 6
(256 Kbytes)
FFFFF16 Internal ROM access
7FFFF16
Renesas microcomputers
bank 7
7FFFF16 1 1 1 1 0 1 1 FFFF16 3FFFFF16 Program or data
(256 Kbytes)
7 1
8000016 Internal ROM access 7FFFF16
3C000016 4000016
FFFFF16 Internal ROM access bank 7
Program or data
A21 A20 A19 A18 N.C. A17 A16 A15–A0 Address input for 4- (256 Kbytes)
Mbyte ROM
3FFFFF16 7FFFF16
Address input for 4-Mbyte ROM
N.C.: No connected
49
50
Microprocessor mode
AAA
ROM address Microcomputer address
AAA
OFS bit of the DBR register=0 OFS bit of the DBR register=1
00000016 4000016
AAA
Output from the microcomputer pins
Bank Access
number OFS area
CS output Address output bank 0
AAA
CS3 CS2 CS1 A19 A18 A17 A16 A15–A0 (512 Kbytes)
04000016 4000016
AAA
4000016 0 0 0 0 1 0 0 000016 00000016
0 BFFFF16 bank 0
BFFFF16 0 0 0 1 0 1 1 FFFF16 07FFFF16
AAA
0 08000016 (512 Kbytes)
4000016 0 0 0 1 0 0 0 000016 04000016 4000016
1
AAA
BFFFF16 0 0 1 0 1 1 1 FFFF16 0BFFFF16 bank 1 BFFFF16
AAA
4000016 0 0 1 0 1 0 0 000016 08000016 0C000016 (512 Kbytes) 4000016
0
BFFFF16 0 0 1 1 0 1 1 FFFF16 0FFFFF16
AAA
1 BFFFF16 bank 1
4000016 0 0 1 1 0 0 0 000016 0C000016
1 10000016 4000016 (512 Kbytes)
AAA
BFFFF16 0 1 0 0 1 1 1 FFFF16 13FFFF16
bank 2 BFFFF16
AAA
4000016 0 1 0 0 1 0 0 000016 10000016
0
BFFFF16 0 1 0 1 0 1 1 FFFF16 17FFFF16 14000016 (512 Kbytes) 4000016
2
AAA
4000016 0 1 0 1 0 0 0 000016 14000016
1 BFFFF16 bank 2
AAA
BFFFF16 0 1 1 0 1 1 1 FFFF16 1BFFFF16
18000016 4000016 (512 Kbytes)
4000016 18000016
AAA
0 1 1 0 1 0 0 000016
0 bank 3
BFFFF16 0 1 1 1 0 1 1 FFFF16 1FFFFF16 Data BFFFF16
3
AAA
1C000016 (512 Kbytes) 4000016
4000016 0 1 1 1 0 0 0 000016 1C000016
1
BFFFF16
AAA
1 0 0 0 1 1 1 FFFF16 23FFFF16
BFFFF16 bank 3
4000016 1 0 0 0 1 0 0 000016 20000016 (512 Kbytes)
AAA
0 20000016 4000016
BFFFF16 1 0 0 1 0 1 1 FFFF16 27FFFF16
4
AAA
bank 4 BFFFF16
4000016 1 0 0 1 0 0 0 000016 24000016
1 24000016 (512 Kbytes)
BFFFF16 1 0 1 0 1 1 1 FFFF16 4000016
AAA
2BFFFF16
4000016 1 0 1 0 1 0 0 000016 28000016 BFFFF16 bank 4
AAA
0
BFFFF16 1 0 1 1 0 1 1 FFFF16 2FFFFF16 28000016 4000016 (512 Kbytes)
5
AAA
2C000016
AAA
33FFFF16 (512 Kbytes)
2C000016 4000016
4000016 1 1 0 0 1 0 0 000016 30000016
AAA
0
BFFFF16 1 1 0 1 0 1 1 FFFF16
37FFFF16 BFFFF16 bank 5
6 (512 Kbytes)
AAA
4000016 1 1 0 1 0 0 0 000016 34000016 30000016 4000016
1
BFFFF16 1 1 1 0 1 1 1 FFFF16 3BFFFF16
AAA
bank 6 BFFFF16
4000016 1 1 1 0 1 0 0 000016 38000016 (512 Kbytes)
34000016
AAA
4000016
7FFFF16 1 1 1 0 1 1 1 FFFF16 3BFFFF16
bank 6
Renesas microcomputers
BFFFF16 1 1 1 1 0 1 1 FFFF16 38000016 4000016
3FFFFF16 Program or data bank 7
C000016 1 1 1 1 1 0 0 000016 3C000016 (512 Kbytes) 7FFFF16 BFFFF16
FFFFF16 1 1 1 1 1 1 1 FFFF16 3FFFFF16 3C000016 C000016
A21 A20 A19 A18 N.C. A17 A16 A15–A0 Address input for 4- Program or data
Address input for 4-Mbyte ROM Mbyte ROM FFFFF16
3FFFFF16
N.C.: No connected
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Table 1.9.1 lists the clock generation circuit specifications. Figure 1.9.1 shows the clock generation circuit.
Figures 1.9.2 to 1.9.6 show the clock-related registers.
51
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
CM01–CM00=002
A
AAA
Sub-clock I/O ports
generating circuit PM01–PM00=002, CM01–CM00=012
CLKOUT
XCIN XCOUT PM01–PM00=002, CM01–CM00=102
PM01–PM00=002,
fC32 CM01–CM00=112
CM04 1/32
AA
AAA
f1
PCLK0=1
Sub-clock
f2
PCLK0=0
AAAA
fC
f8
AAAA
Ring
CM21 Ring oscillator
oscillator f32
clock
fAD
AA
Oscillation f1SIO
stop, re- PCLK1=1
oscillation
detection f2SIO
PCLK1=0
circuit
f8SIO
AAAA
CM10=1(stop mode) S Q PLL
XIN XOUT frequency f32SIO
AAA
A AA
AAAA AAAA
R
synthesizer e b c
CM07=0 D4INT clock
a d
AAAA
PLL CM21=1
clock
Divider CPU clock
Main 1
clock
Main clock 0 CM21=0 fC BCLK
generating circuit CM11
CM05 CM07=1
CM02
S Q
WAIT instruction R
e b c
a 1/2 1/2 1/2 1/2 1/2
1/32
RESET 1/2 1/4 1/8 1/16
Software reset CM06=0
CM17–CM16=112
NMI CM06=1
CM06=0
Interrupt request level judgment output CM17–CM16=102
d
CM02, CM04, CM05, CM06, CM07: CM0 register bits CM06=0
CM10, CM11, CM16, CM17: CM1 register bits CM17–CM16=012
PCLK0, PCLK1: PCLK register bits
CM21, CM27 : CM2 register bits CM06=0
CM17–CM16=002 Details of divider
Reset
Pulse generation CM27=0 generating Oscillation stop
circuit for clock Charge, circuit detection reset
Main edge detection discharge
clock and charge, circuit
Oscillation stop, Oscillation stop,
discharge control re-oscillation re-oscillation
CM27=1
detection interrupt detection signal
generating circuit
Programmable
Voltage 1/2 PLL clock
counter
Phase Charge control
comparator pump oscillator
(VCO)
Main clock
Internal low-
pass filter
52
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
CM07 System clock select bit 0 : Main clock, PLL clock, or ring oscillator clock
(Notes 6, 10, 11, 12) 1 : Sub-clock
RW
Note 1: Write to this register after setting the PRC0 bit of PRCR register to “1” (write enable).
Note 2: The CM03 bit is set to “1” (high) when the CM04 bit is set to “0” (I/O port) or the microcomputer goes to a stop mode.
Note 3: This bit is provided to stop the main clock when the low power dissipation mode or ring oscillator low power dissipation mode
is selected. This bit cannot be used for detection as to whether the main clock stopped or not. To stop the main clock, the
following setting is required:
(1) Set the CM07 bit to “1” (Sub-clock select) or the CM21 bit of CM2 register to “1” (Ring oscillator select) with the sub-clock
stably oscillating.
(2) Set the CM20 bit of CM2 register to “0” (Oscillation stop, re-oscillation detection function disabled).
(3) Set the CM05 bit to “1” (Stop).
Note 4: During external clock input, only the clock oscillation buffer is turned off and clock input is accepted if the sub clock is not
chosen as a CPU clock.
Note 5: When CM05 bit is set to “1, the XOUT pin goes “H”. Furthermore, because the internal feedback resistor remains connected,
the XIN pin is pulled “H” to the same level as XOUT via the feedback resistor.
Note 6: After setting the CM04 bit to “1” (XCIN-XCOUT oscillator function), wait until the sub-clock oscillates stably before switching
the CM07 bit from “0” to “1” (sub-clock).
Note 7: When entering stop mode from high or middle speed mode, ring oscillator mode or ring oscillator low power mode, the CM06
bit is set to “1” (divide-by-8 mode).
Note 8: The fC32 clock does not stop. During low speed or low power dissipation mode, do not set this bit to “1” (peripheral clock
turned off when in wait mode).
Note 9: To use a sub-clock, set this bit to “1”. Also make sure ports P86 and P87 are directed for input, with no pull-ups.
Note 10: When the PM21 bit of PM2 register is set to “1” (clock modification disable), writing to the CM02, CM05, and CM07 bits has
no effect.
Note 11: If the PM21 bit needs to be set to “1”, set the CM07 bit to “0”(main clock) before setting it.
Note 12: To use the main clock as the clock source for the CPU clock, follow the procedure below.
(1) Set the CM05 bit to “0” (oscillate).
(2) Wait until td(M-L) elapses or the main clock oscillation stabilizes, whichever is longer.
(3) Set the CM11, CM21 and CM07 bits all to “0”.
Note 13: When the CM21 bit = 0 (ring oscillator turned off) and the CM05 bit = 1 (main clock turned off), the CM06 bit is fixed to “1”
(divide-by-8 mode) and the CM15 bit is fixed to “1” (drive capability High).
Note 14: To return from ring oscillator mode to high-speed or middle-speed mode, set the CM06 and CM15 bits both to “1”.
53
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Note 1: Write to this register after setting the PRC0 bit of PRCR register to “1” (write enable).
Note 2: When entering stop mode from high or middle speed mode, or when the CM05 bit is set to “1” (main clock turned off) in low
speed mode, the CM15 bit is set to “1” (drive capability high).
Note 3: Effective when the CM06 bit is “0” (CM16 and CM17 bits enable).
Note 4: If the CM10 bit is “1” (stop mode), XOUT goes “H” and the internal feedback resistor is disconnected. The XCIN and XCOUT
pins are placed in the high-impedance state. When the CM11 bit is set to “1” (PLL clock), or the CM20 bit of CM2 register is
set to “1” (oscillation stop, re-oscillation detection function enabled), do not set the CM10 bit to “1”.
Note 5: After setting the PLC07 bit in PLC0 register to “1” (PLL operation), wait until Tsu (PLL) elapses before setting the CM11 bit to
“1” (PLL clock).
Note 6: When the PM21 bit of PM2 register is set to “1” (clock modification disable), writing to the CM10, CM011 bits has no effect.
When the PM22 bit of PM2 register is set to “1” (watchdog timer count source is ring oscillator clock), writing to the CM10 bit
has no effect.
Note 7: Effective when CM07 bit is “0” and CM21 bit is “0” .
54
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
b7 b6 b5 b4 b3 b2 b1 b0
Symbol Address After reset
0 0 000C16
CM2 0X0000002(Note 11)
55
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Note 1: Write to this register after setting the PRC1 bit of PRCR register to “1” (write enable).
Note 2: This bit can only be rewritten while the PLC07 bit is “0” (PLL turned off). Also, to select a 16 MHz or higher PLL
clock, set this bit to “0” (2 waits). Note that if the clock source for the CPU clock is to be changed from the PLL
clock to another, the PLC07 bit must be set to “0” before setting the PM20 bit.
Note 3: Once this bit is set to “1”, it cannot be cleared to “0” in a program.
Note 4: If the PM21 bit is set to “1”, writing to the following bits has no effect:
CM02 bit of CM0 register
CM05 bit in the CM0 register (main clock does not stop)
CM07 bit in the CM0 register (clock source for the CPU clock does not change)
CM10 bit of CM1 register (stop mode is not entered)
CM11 bit in the CM1 register (clock source for the CPU clock does not change)
CM20 bit of CM2 register (oscillation stop, re-oscillation detection function settings do not change)
All bits of PLC0 register (PLL frequency synthesizer settings do not change)
Be aware that the WAIT instruction cannot be executed when the PM21 bit = 1.
Note 5: Setting the PM22 bit to “1” results in the following conditions:
• The ring oscillator starts oscillating, and the ring oscillator clock becomes the watchdog timer count source.
• The CM10 bit of CM1 register is disabled against write. (Writing a “1” has no effect, nor is stop mode
entered.)
• The watchdog timer does not stop when in wait mode or hold state.
56
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Bit
symbol Bit name Function RW
57
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
The following describes the clocks generated by the clock generation circuit.
(1) Main Clock
This clock is used as the clock source for the CPU and peripheral function clocks. This clock is used as
the clock source for the CPU and peripheral function clocks. The main clock oscillator circuit is configured
by connecting a resonator between the XIN and XOUT pins. The main clock oscillator circuit contains a
feedback resistor, which is disconnected from the oscillator circuit during stop mode in order to reduce the
amount of power consumed in the chip. The main clock oscillator circuit may also be configured by
feeding an externally generated clock to the XIN pin. Figure 1.9.7 shows the examples of main clock
connection circuit.
After reset, the main clock divided by 8 is selected for the CPU clock.
The power consumption in the chip can be reduced by setting the CM05 bit of CM0 register to “1” (main
clock oscillator circuit turned off) after switching the clock source for the CPU clock to a sub clock or ring
oscillator clock. In this case, XOUT goes “H”. Furthermore, because the internal feedback resistor remains
on, XIN is pulled “H” to XOUT via the feedback resistor. Note that if an externally generated clock is fed into
the XIN pin, the main clock cannot be turned off by setting the CM05 bit to “1”, unless the sub clock is
chosen as a CPU clock. If necessary, use an external circuit to turn off the clock.
During stop mode, all clocks including the main clock are turned off. Refer to “power control”.
Microcomputer Microcomputer
(Built-in feedback resistor) (Built-in feedback resistor)
XIN XOUT XIN XOUT
Open
(Note)
Rd
Externally derived clock
CIN VCC1
COUT
Vss
Note: Insert a damping resistor 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. Also, if the oscillator manufacturer's
data sheet specifies that a feedback resistor be added external to the chip, insert a feedback resistor between XIN
and XOUT following the instruction.
58
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Microcomputer Microcomputer
(Built-in feedback resistor) (Built-in feedback resistor)
XCIN XCOUT XCIN XCOUT
Open
(Note)
RCd
Externally derived clock
Note: Insert a damping resistor 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. Also, if the oscillator manufacturer's
data sheet specifies that a feedback resistor be added external to the chip, insert a feedback resistor between XCIN
and XCOUT following the instruction.
59
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
60
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Using the PLL clock as the clock source for the CPU
Set the CM07 bit to “0” (main clock), the CM17 to CM16
bits to “002”(main clock undivided), and the CM06 bit to “0”
(CM16 and CM17 bits enabled). (Note)
Set the CM11 bit to “1” (PLL clock for the CPU clock source).
END
Note : PLL operation mode can be entered from high speed mode.
61
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
62
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Power Control
There are three power control modes. For convenience’ sake, all modes other than wait and stop modes
are referred to as normal operation mode here.
63
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
64
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
mode. If CM02 bit is “1” (peripheral function clocks turned off during wait mode), the peripheral func-
tions using the peripheral function clocks stop operating, so that only the peripheral functions clocked
by external signals can be used to exit wait mode.
65
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
66
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
67
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Figure 1.9.10 shows the state transition from normal operation mode to stop mode and wait mode. Figure
1.9.11 shows the state transition in normal operation mode.
Table 1.9.7 shows a state transition matrix describing allowed transition and setting. The vertical line
shows current state and horizontal line shows state after transition.
Reset
WAIT
All oscillators stopped CM10=1 instruction CPU operation stopped
(Note 3)
Medium-speed mode
Stop mode (divided-by-8 mode) Wait mode
Interrupt Interrupt
Interrupt WAIT
CM07=0 instruction
CM06=1 (Note 3)
CM05=0 High-speed, medium-
CM11=0
Stop mode Wait mode
speed mode Interrupt
CM10=1 CM10=1
(Note 5)
When Notes 1, 2
low power When
dissipation low-
mode speed PLL operation
mode mode WAIT
CM10=1 instruction
(Note 3)
Stop mode Low-speed, low power
dissipation mode
Wait mode
Interrupt
Interrupt
WAIT
instruction
CM10=1 Ring oscillator, Ring oscillator (Note 3)
Stop mode dissipation mode Interrupt
Wait mode
Interrupt
(Note 4)
Normal mode
Note 1: Do not go directly from PLL operation mode to wait or stop mode.
Note 2: PLL operation mode can be entered from high speed mode. Similarly, PLL operation mode can be changed back to high speed mode.
Note 3: When the PM21 bit = 0 (system clock protective function unused).
Note 4: The ring oscillator clock divided by 8 provides the CPU clock.
Note 5: Write to the CM0 register and CM1 register simultaneously by accessing in word units while CM21=0 (ring oscillator turned off).
Note 6: Before entering stop mode, be sure to clear the CM20 bit in the CM2 register to “0” (oscillation stop and oscillation restart detection
function disabled).
68
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Ring oscillator
PLL operation Ring oscillator low power
Middle-speed mode Middle-speed mode Middle-speed mode Middle-speed mode
mode mode dissipation mode
PLC07=1 High-speed mode (divide by 2) (divide by 4) (divide by 8) (divide by 16)
CPU clock: f(PLL) CM11=1 CM21=0 CPU clock CPU clock
(Note 6) CPU clock: f(XIN) CPU clock: f(XIN)/2 CPU clock: f(XIN)/4 CPU clock: f(XIN)/8 CPU clock: f(XIN)/16 (Note 8) CM05=0
M
M0
CM07=0 f(Ring) f(Ring)
CM07=0 CM07=0 CM07=0 CM07=0 f(Ring)/2 f(Ring)/2
CM06=0 CM07=0
CM06=0 CM06=0 CM06=0 CM06=0 f(Ring)/4 f(Ring)/4
CM17=0 PLC07=0 f(Ring)/8 f(Ring)/8
CM17=0 CM17=0 CM17=1 CM17=1
CM16=0 CM11=0 CM06=1 CM21=1 f(Ring)/16 f(Ring)/16
(Note 7) CM16=0 CM16=1 CM16=0 CM16=1
CM05=1
(Note 1)
CM07=1 CM07=0
(Note 3) (Note 2, Note 4)
CM05=1 CM05=0
(Note 1, Note 9)
Notes:
1: Avoid making a transition when the CM20 bit is set to “1” (oscillation stop, re-oscillation detection function enabled).
Set the CM20 bit to “0” (oscillation stop, re-oscillation detection function disabled) before transiting.
2: Wait for td(M-L) or the main clock oscillation stabilization time whichever is longer before switching over.
3: Switch clock after oscillation of sub-clock is sufficiently stable.
4: Change CM17 and CM16 before changing CM06.
5: Transit in accordance with arrow.
6: PLL operation mode can only be entered from high speed mode. Also, wait until the PLL clock is sufficiently stable before changing operation modes.
To select a 16 MHz or higher PLL clock, set the PM20 bit to “0” (SFR accessed with two wait states) before setting PLC07 to “1” (PLL operation).
7: PLL operation mode can only be changed to high speed mode. If the PM20 bit = 0 (SFR accessed with two wait states), set PLC07 to “0” (PLL turned off)
before setting the PM20 bit to “1” (SFR accessed with one wait state).
8: Set the CM06 bit to “1” (division by 8 mode) before changing back the operation mode from ring oscillator mode to high- or middle-speed mode.
9: When the CM21 bit = 0 (ring oscillator turned off) and the CM05 bit = 1 (main clock turned off), the CM06 bit is fixed to “1” (divide-by-8 mode) and the CM15 bit is fixed to “1” (drive capability High).
69
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Setting Operation
70
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Before the system clock protective function can be used, the following register settings must be made while
the CM05 bit of CM0 register is “0” (main clock oscillating) and CM07 bit is “0” (main clock selected for the
CPU clock source):
(1) Set the PRC1 bit of PRCR register to “1” (enable writes to PM2 register).
(2) Set the PM21 bit of PM2 register to “1” (disable clock modification).
(3) Set the PRC1 bit of PRCR register to “0” (disable writes to PM2 register).
Do not execute the WAIT instruction when the PM21 bit is “1”.
Table 1.9.8. Specification Overview of Oscillation Stop and Re-oscillation Detect Function
Item Specification
Oscillation stop detectable clock and f(XIN) ≥ 2 MHz
frequency bandwidth
Enabling condition for oscillation stop, Set CM20 bit to “1”(enable)
re-oscillation detection function
Operation at oscillation stop, •Reset occurs (when CM27 bit =0)
re-oscillation detection •Oscillation stop, re-oscillation detection interrupt occurs(when CM27 bit =1)
71
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Where the PLL clock corresponds to the CPU clock source and the CM20 bit is “1”, the system is placed
in the following state if the main clock comes to a halt: Since the CM21 bit remains unchanged, set it to “1”
(ring oscillator clock) inside the interrupt routine.
• Oscillation stop and re-oscillation detect interrupt request occurs.
• CM22 bit = 1 (main clock stop detected)
• CM23 bit = 1 (main clock stopped)
• CM21 bit remains unchanged
Where the CM20 bit is “1”, the system is placed in the following state if the main clock re-oscillates from
the stop condition:
• Oscillation stop and re-oscillation detect interrupt request occurs.
• CM22 bit = 1 (main clock re-oscillation detected)
• CM23 bit = 0 (main clock oscillation)
• CM21 bit remains unchanged
72
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Clock Generation Circuit
Note: If the clock source for CPU clock is to be changed to PLL clock, set to PLL operation
mode after set to high-speed mode.
Figure 1.9.12. Procedure to Switch Clock Source From Ring Oscillator to Main Clock
73
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Protection
Protection
In the event that a program runs out of control, this function protects the important registers so that they will
not be rewritten easily. Figure 1.10.1 shows the PRCR register. The following lists the registers protected
by the PRCR register.
• Registers protected by PRC0 bit: CM0, CM1, CM2, PLC0 and PCLKR registers
• Registers protected by PRC1 bit: PM0, PM1, PM2, TB2SC, INVC0 and INVC1 registers
• Registers protected by PRC2 bit: PD9, S3C and S4C registers
• Registers protected by PRC3 bit: VCR2 and D4INT registers
Set the PRC2 bit to “1” (write enabled) and then write to any address, and the PRC2 bit will be cleared to “0”
(write protected). The registers protected by the PRC2 bit should be changed in the next instruction after
setting the PRC2 bit to “1”. Make sure no interrupts or DMA transfers will occur between the instruction in
which the PRC2 bit is set to “1” and the next instruction. The PRC0, PRC1 and PRC3 bits are not automati-
cally cleared to “0” by writing to any address. They can only be cleared in a program.
Protect register
b7 b6 b5 b4 b3 b2 b1 b0
Symbol Address After reset
0 0 PRCR 000A16 XX0000002
Note: The PRC2 bit is set to “0” by writing to any address after setting it to “1”. Other bits are not set to “0”
by writing to any address, and must therefore be set in a program.
74
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupts
Type of Interrupts
Figure 1.11.1 shows types of interrupts.
Undefined instruction (UND instruction)
Software Overflow (INTO instruction)
(Non-maskable interrupt)
BRK instruction
INT instruction
_______
NMI
________
Interrupt DBC (Note 2)
Watchdog timer
Special
Oscillation stop and re-oscillation
(Non-maskable interrupt)
detection
Hardware
Single step (Note 2)
Address match
Peripheral function (Note 1)
(Maskable interrupt)
Note 1: Peripheral function interrupts are generated by the microcomputer's internal functions.
Note 2: Do not normally use this interrupt because it is provided exclusively for use by development
support tools.
75
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Software Interrupts
A software interrupt occurs when executing certain instructions. Software interrupts are non-maskable
interrupts.
76
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Hardware Interrupts
Hardware interrupts are classified into two types — special interrupts and peripheral function interrupts.
(1) Special Interrupts
Special interrupts are non-maskable interrupts.
_______
• NMI Interrupt
_______ _______
An NMI interrupt is generated when input on the NMI pin changes state from high to low. For details
_______
about the NMI interrupt, refer to the section "NMI interrupt".
________
• DBC Interrupt
Do not normally use this interrupt because it is provided exclusively for use by development support
tools.
• Watchdog Timer Interrupt
Generated by the watchdog timer. Once a watchdog timer interrupt is generated, be sure to initialize
the watchdog timer. For details about the watchdog timer, refer to the section "watchdog timer".
• Oscillation Stop and Re-oscillation Detection Interrupt
Generated by the oscillation stop and re-oscillation detection function. For details about the oscilla-
tion stop and re-oscillation detection function, refer to the section "clock generating circuit".
• Voltage Down Detection Interrupt
Generated by the voltage detection circuit. For details about the voltage detection circuit, refer to the
section "voltage detection circuit".
• Single-step Interrupt
Do not normally use this interrupt because it is provided exclusively for use by development support
tools.
• Address Match Interrupt
An address match interrupt is generated immediately before executing the instruction at the address
indicated by the RMAD0 to RMAD3 register that corresponds to one of the AIER register’s AIER0 or
AIER1 bit or the AIER2 register’s AIER20 or AIER21 bit which is "1" (address match interrupt en-
abled). For details about the address match interrupt, refer to the section "address match interrupt".
77
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AAAAAAAAA
AAAAAAAAA 0000
Mid address
High address
78
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
79
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupt Control
The following describes how to enable/disable the maskable interrupts, and how to set the priority in which
order they are accepted. What is explained here does not apply to nonmaskable interrupts.
Use the FLG register’s I flag, IPL, and each interrupt control register’s ILVL2 to ILVL0 bits to enable/disable
the maskable interrupts. Whether an interrupt is requested is indicated by the IR bit in each interrupt control
register.
Figure 1.11.3 shows the interrupt control registers.
80
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AAA
A
AA
ADIC 004E16 XXXXX0002
S0TIC to S2TIC 005116, 005316, 004F16 XXXXX0002
b7 b6 b5 b4 b3 b2 b1 b0 S0RIC to S2RIC 005216, 005416, 005016 XXXXX0002
AAA
AA
A
TA0IC to TA4IC 005516 to 005916 XXXXX0002
TB0IC to TB2IC 005A16 to 005C16 XXXXX0002
A
AA
INT3IC (Note 4) 004416 XX00X0002
b7 b6 b5 b4 b3 b2 b1 b0 S4IC/INT5IC 004816 XX00X0002
0 S3IC/INT4IC 004916 XX00X0002
INT0IC to INT2IC 005D16 to 005F16 XX00X0002
Note 1: This bit can only be reset by writing “0” (Do not write “1”).
Note 2: To rewrite the interrupt control register, do so at a point that does not generate the interrupt request for that
register. For details, see the “precautions for interrupts” of the Usage Notes Reference Book.
Note 3: If the IFSR register’s IFSRi bit (i = 0 to 5) is “1” (both edges), set the INTiIC register’s POL bit to “0” (falling edge).
Note 4: When the BYTE pin is low and the processor mode is memory expansion or microprocessor mode, set the
LVL2 to ILVL0 bits in the INT5IC to INT3IC registers to “0002” (interrupts disabled).
Note 5: Set the S3IC or S4IC register’s POL bit to “0” (falling edge) when the IFSR register’s IFSR6 bit = 0 (SI/O3
selected) or IFSR7 bit = 0 (SI/O4 selected), respectively.
81
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
I Flag
The I flag enables or disables the maskable interrupt. Setting the I flag to “1” (= enabled) enables the
maskable interrupt. Setting the I flag to “0” (= disabled) disables all maskable interrupts.
IR Bit
The IR bit is set to “1” (= interrupt requested) when an interrupt request is generated. Then, when the
interrupt request is accepted and the CPU branches to the corresponding interrupt vector, the IR bit is
cleared to “0” (= interrupt not requested).
The IR bit can be cleared to “0” in a program. Note that do not write “1” to this bit.
The I flag, IR bit, ILVL2 to ILVL0 bits and IPL are independent of each other. In no case do they affect one
another.
Table 1.11.3. Settings of Interrupt Priority Table 1.11.4. Interrupt Priority Levels
Levels Enabled by IPL
0002 Level 0 (interrupt disabled) 0002 Interrupt levels 1 and above are enabled
0012 Level 1 Low 0012 Interrupt levels 2 and above are enabled
82
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
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 SMOVB, SMOVF, SSTR or RMPA instruction,
the processor temporarily suspends the instruction being executed, and transfers control to the interrupt
sequence.
The CPU behavior during the interrupt sequence is described below. Figure 1.11.4 shows time required for
executing the interrupt sequence.
(1) The CPU gets interrupt information (interrupt number and interrupt request priority level) by reading the
address 0000016. Then it clears the IR bit for the corresponding interrupt to “0” (interrupt not re-
quested).
(2) The FLG register immediately before entering the interrupt sequence is saved to the CPU’s internal
temporary register(Note 1).
(3) The I, D and U flags in the FLG register become as follows:
The I flag is cleared to “0” (interrupts disabled).
The D flag is cleared to “0” (single-step interrupt disabled).
The U flag is cleared to “0” (ISP selected).
However, the U flag does not change state if an INT instruction for software interrupt Nos. 32 to 63 is
executed.
(4) The CPU’s internal temporary register (Note 1) is saved to the stack.
(5) The PC is saved to the stack.
(6) The interrupt priority level of the accepted interrupt is set in the IPL.
(7) The start address of the relevant interrupt routine set in the interrupt vector is stored in the PC.
After the interrupt sequence is completed, the processor resumes executing instructions from the start
address of the interrupt routine.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
CPU clock
RD Indeterminate (Note 1)
WR
(Note 2)
Note 1 : The indeterminate state depends on the instruction queue buffer. A read cycle occurs when
the instruction queue buffer is ready to accept instructions.
Note 2 : The WR signal timing shown here is for the case where the stack is located in the internal RAM.
83
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Time
(a) A time from when an interrupt request is generated till when the instruction then
executing is completed. The length of this time varies with the instruction being
executed. The DIVX instruction requires the longest time, which is equal to 30 cycles
(without wait state, the divisor being a register).
(b) A time during which the interrupt sequence is executed. For details, see the table
below. Note, however, that the values in this table must be increased 2 cycles for the
DBC interrupt and 1 cycle for the address match and single-step interrupts.
Interrupt vector address SP value 16-Bit bus, without wait 8-Bit bus, without wait
Even Even 18 cycles 20 cycles
Even Odd 19 cycles 20 cycles
Odd Even 19 cycles 20 cycles
Odd Odd 20 cycles 20 cycles
84
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Saving Registers
In the interrupt sequence, the FLG register and PC are saved to the stack.
At this time, the 4 high-order bits of the PC and the 4 high-order (IPL) and 8 low-order bits of the FLG
register, 16 bits in total, are saved to the stack first. Next, the 16 low-order bits of the PC are saved. Figure
1.11.6 shows the stack status before and after an interrupt request is accepted.
The other necessary registers must be saved in a program at the beginning of the interrupt routine. Use
the PUSHM instruction, and all registers except SP can be saved with a single instruction.
[SP]
m–4 m–4 PC New SP value
L
m–3 m–3 PC
M
Stack status before interrupt request Stack status after interrupt request
is acknowledged is acknowledged
Figure 1.11.6. Stack Status Before and After Acceptance of Interrupt Request
85
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
The operation of saving registers carried out in the interrupt sequence is dependent on whether the
SP(Note), at the time of acceptance of an interrupt request, is even or odd. If the stack pointer (Note) is
even, the FLG register and the PC are saved, 16 bits at a time. If odd, they are saved in two steps, 8 bits
at a time. Figure 1.11.7 shows the operation of the saving registers.
Note: When any INT instruction in software numbers 32 to 63 has been executed, this is the SP indicated
by the U flag. Otherwise, it is the ISP.
[SP] – 5 (Odd)
[SP] (Even)
Finished saving registers
in two operations.
[SP] – 5 (Even)
[SP] (Odd)
Finished saving registers
in four operations.
Note: [SP] denotes the initial value of the SP when interrupt request is acknowledged.
After registers are saved, the SP content is [SP] minus 4.
86
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Interrupt Priority
If two or more interrupt requests are generated while executing one instruction, the interrupt request that
has the highest priority is accepted.
For maskable interrupts (peripheral functions), any desired priority level can be selected using the ILVL2 to
ILVL0 bits. However, if two or more maskable interrupts have the same priority level, their interrupt priority
is resolved by hardware, with the highest priority interrupt accepted.
The watchdog timer and other special interrupts have their priority levels set in hardware. Figure 1.11.8
shows the priorities of hardware interrupts.
Software interrupts are not affected by the interrupt priority. If an instruction is executed, control branches
invariably to the interrupt routine.
Reset High
NMI
DBC
Peripheral function
Single step
Low
Address match
87
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B0
Timer A3
Timer A1
INT3
INT2
INT0
Timer B1
Timer A4
Timer A2
Timer B5
A-D conversion
DMA1
SI/O4, INT5
Timer A0
DMA0
Lowest
SI/O3, INT4
I flag Interrupt
request
Address match accepted
Watchdog timer
Oscillation stop and
re-oscillation detection
Voltage down detection
DBC
NMI
88
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
______
INT Interrupt
_______
INTi interrupt (i=0 to 5) is triggered by the edges of external inputs. The edge polarity is selected using the
IFSR register's IFSRi bit.
_______ _______
INT4 and INT5 share the interrupt vector and interrupt control register with SI/O3 and SI/O4, respectively.
_______ _______ _______
To use the INT4 interrupt, set the IFSR register’s IFSR6 bit to “1” (= INT4). To use the INT5 interrupt, set the
_______
IFSR register’s IFSR7 bit to “1” (= INT5).
After modifying the IFSR6 or IFSR7 bit, clear the corresponding IR bit to “0” (= interrupt not requested)
before enabling the interrupt.
Figure 1.11.10 shows the IFSR and IFSR2A registers.
AAA
AAAA
Interrupt request cause select register
AAAA
AAA
b7 b6 b5 b4 b3 b2 b1 b0
Note 1: When setting this bit to “1” (= both edges), make sure the INT0IC to INT5IC register’s POL bit
is set to “0” (= falling edge).
Note 2: During memory expansion and microprocessor modes, set this bit to “0” (= SI/O3, SI/O4)
Note 3: When setting this bit to “0” (= SI/O3, SI/O4), make sure the S3IC and S4IC registers’ POL bit is
set to “0” (= falling edge).
AAA
AAAA
Interrupt request cause select register 2
AAAA
AAA
b7 b6 b5 b4 b3 b2 b1 b0
89
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
______
NMI Interrupt
_______ _______ ______
An NMI interrupt request is generated when input on the NMI pin changes state from high to low. The NMI
interrupt is a non-maskable interrupt.
_______
The input level of this NMI interrupt input pin can be read by accessing the P8 register’s P8_5 bit.
This pin cannot be used as an input port.
KI3
Pull-up
transistor PD10 register's
PD10_5 bit
KI1
KI0
90
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.11.6. Value of the PC that is saved to the stack area when an address match interrupt
request is accepted.
Value of the PC that is
Instruction at the address indicated by the RMADi register saved to the stack area
The address
Instructions other than the above indicated by the
RMADi register +1
Value of the PC that is saved to the stack area : Refer to “Saving Registers”.
Table 1.11.7. Relationship Between Address Match Interrupt Sources and Associated Registers
Address match interrupt sources Address match interrupt enable bit Address match interrupt register
Address match interrupt 0 AIER0 RMAD0
Address match interrupt 1 AIER1 RMAD1
Address match interrupt 2 AIER20 RMAD2
Address match interrupt 3 AIER21 RMAD3
91
Renesas microcomputers
M16C / 62P Group
Interrupts SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AAAAAAAAAAAAAA
Bit symbol Bit name Function RW
AAAAAAAAAAAAAA
AIER0 Address match interrupt 0 0 : Interrupt disabled
enable bit 1 : Interrupt enabled RW
AAAAAAAAAAAAAA
AIER1 Address match interrupt 1 0 : Interrupt disabled
enable bit RW
1 : Interrupt enabled
Nothing is assigned.
(b7-b2) When write, set to “0”.
When read, their contents are indeterminate.
AAAAAAAAAAAAAA
AIER2 01BB16 XXXXXX002
AAAAAAAAAAAAAA
Bit symbol Bit name Function RW
AIER20 Address match interrupt 2 0 : Interrupt disabled RW
AAAAAAAAAAAAAA
enable bit 1 : Interrupt enabled
AAAAAAAAAAAAAA
enable bit 1 : Interrupt enabled RW
Nothing is assigned.
(b7-b2) When write, set to “0”.
When read, their contents are indeterminate.
Figure 1.11.12. AIER Register, AIER2 Register and RMAD0 to RMAD3 Registers
92
Renesas microcomputers
M16C / 62P Group
Watchdog Timer SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Watchdog Timer
The watchdog timer is the function of detecting when the program is out of control. Therefore, we recom-
mend using the watchdog timer to improve reliability of a system. The watchdog timer contains a 15-bit
counter which counts down the clock derived by dividing the CPU clock using the prescaler. Whether to
generate a watchdog timer interrupt request or apply a watchdog timer reset as an operation to be per-
formed when the watchdog timer underflows after reaching the terminal count can be selected using the
PM12 bit of PM1 register. The PM12 bit can only be set to “1” (reset). Once this bit is set to “1”, it cannot be
set to “0” (watchdog timer interrupt) in a program. Refer to “Watchdog Timer Reset” for the details of
watchdog timer reset.
When the main clock source is selected for CPU clock, ring oscillator clock, PLL clock, the divide-by-N
value for the prescaler can be chosen to be 16 or 128. If a sub-clock is selected for CPU clock, the divide-
by-N value for the prescaler is always 2 no matter how the WDC7 bit is set. The period of watchdog timer
can be calculated as given below. The period of watchdog timer is, however, subject to an error due to the
prescaler.
With main clock source chosen for CPU clock, ring oscillator clock, PLL clock
For example, when CPU clock = 16 MHz and the divide-by-N value for the prescaler= 16, the watchdog
timer period is approx. 32.8 ms.
The watchdog timer is initialized by writing to the WDTS register. The prescaler is initialized after reset.
Note that the watchdog timer and the prescaler both are inactive after reset, so that the watchdog timer is
activated to start counting by writing to the WDTS register.
In stop mode, wait mode and hold state, the watchdog timer and prescaler are stopped. Counting is re-
sumed from the held value when the modes or state are released.
Figure 1.12.1 shows the block diagram of the watchdog timer. Figure 1.12.2 shows the watchdog timer-
related registers.
93
Renesas microcomputers
M16C / 62P Group
Watchdog Timer SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Prescaler
CM07 = 0
WDC7 = 0
1/16
PM12 = 0
CPU CM07 = 0 Watchdog timer
WDC7 = 1 PM22 = 0 interrupt request
clock
1/128
HOLD
Watchdog timer
CM07 = 1 PM22 = 1
1/2
PM12 = 1
Reset
RESET
Note 1: Writing to the WDC register causes the WDC5 bit to be set to “1” (warm start).
Note 2: The WDC5 bit is “0” (cold start) immediately after power-on. It can only be set to “1” in a program. It is set
to “0” when the input voltage at the VCC1 pin drops to Vdet2 or less while the VC25 bit in the VCR2 register
is set to “1” (RAM retention limit detection circuit enable).
b7 b0
Symbol Address After reset
WDTS 000E16 Indeterminate
Function RW
The watchdog timer is initialized and starts counting after a write instruction to
this register. The watchdog timer value is always initialized to “7FFF16” WO
regardless of whatever value is written.
Note : Write to the WDTS register after the watchdog timer interrupt occurs.
94
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DMAC
The DMAC (Direct Memory Access Controller) allows data to be transferred without the CPU intervention.
Two DMAC channels are included. Each time a DMA request occurs, the DMAC transfers one (8 or 16-bit)
data from the source address to the destination address. The DMAC uses the same data bus as used by
the CPU. Because the DMAC has higher priority of bus control than the CPU and because it makes use of
a cycle steal method, it can transfer one word (16 bits) or one byte (8 bits) of data within a very short time
after a DMA request is generated. Figure 1.13.1 shows the block diagram of the DMAC. Table 1.13.1
shows the DMAC specifications. Figures 1.13.2 to 1.13.4 show the DMAC-related registers.
AAAAAAAAAAAAAAAAAAAAAAAAAAAA
A
AAA AAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAA AA
AAA
A
Address bus
AAA A AAA
AAA A AA
DMA0 source pointer SAR0(20)
(addresses 002216 to 002016)
AAA A AA AA
AA
DMA0 destination pointer DAR0 (20)
(addresses 002616 to 002416)
AA
A A AA
A AA
DMA0 forward address pointer (20) (Note)
AA
A A AAAA A AA
DMA0 transfer counter reload register TCR0 (16) DMA1 source pointer SAR1 (20)
AAAA AA AA AA
(addresses 002916, 002816) (addresses 003216 to 003016)
AA
A A AA AA
DMA0 transfer counter TCR0 (16) DMA1 destination pointer DAR1 (20)
(addresses 003616 to 003416)
AA
A A A AA
DMA1 transfer counter reload register TCR1 (16) DMA1 forward address pointer (20) (Note)
A A AA
(addresses 003916, 003816)
AA
DMA1 transfer counter TCR1 (16) DMA latch high-order bits DMA latch low-order bits
A DMA request is generated by a write to the DMiSL register (i = 0–1)’s DSR bit, as well as by an interrupt
request which is generated by any function specified by the DMiSL register’s DMS and DSEL3–DSEL0 bits.
However, unlike in the case of interrupt requests, DMA requests are not affected by the I flag and the
interrupt control register, so that even when interrupt requests are disabled and no interrupt request can be
accepted, DMA requests are always accepted. Furthermore, because the DMAC does not affect interrupts,
the interrupt control register’s IR bit does not change state due to a DMA transfer.
A data transfer is initiated each time a DMA request is generated when the DMiCON register’s DMAE bit =
“1” (DMA enabled). However, if the cycle in which a DMA request is generated is faster than the DMA
transfer cycle, the number of transfer requests generated and the number of times data is transferred may
not match. For details, refer to “DMA Requests”.
95
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
96
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DSEL2 RW
DSEL3 RW
Nothing is assigned. When write, set to “0”.
(b5-b4) When read, its content is “0”.
Note: The causes of DMA0 requests can be selected by a combination of DMS bit and DSEL3 to DSEL0 bits in the
manner described below.
DSEL3 to DSEL0 DMS=0(basic cause of request) DMS=1(extended cause of request)
0 0 0 02 Falling edge of INT0 pin –
0 0 0 12 Software trigger –
0 0 1 02 Timer A0 –
0 0 1 12 Timer A1 –
0 1 0 02 Timer A2 –
0 1 0 12 Timer A3 –
0 1 1 02 Timer A4 Two edges of INT0 pin
0 1 1 12 Timer B0 Timer B3
1 0 0 02 Timer B1 Timer B4
1 0 0 12 Timer B2 Timer B5
1 0 1 02 UART0 transmit –
1 0 1 12 UART0 receive –
1 1 0 02 UART2 transmit –
1 1 0 12 UART2 receive –
1 1 1 02 A-D conversion –
1 1 1 12 UART1 transmit –
97
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note: The causes of DMA1 requests can be selected by a combination of DMS bit and DSEL3 to DSEL0 bits in the
manner described below.
DSEL3 to DSEL0 DMS=0(basic cause of request) DMS=1(extended cause of request)
0 0 0 02 Falling edge of INT1 pin –
0 0 0 12 Software trigger –
0 0 1 02 Timer A0 –
0 0 1 12 Timer A1 –
0 1 0 02 Timer A2 –
0 1 0 12 Timer A3 SI/O3
0 1 1 02 Timer A4 SI/O4
0 1 1 12 Timer B0 Two edges of INT1
1 0 0 02 Timer B1 –
1 0 0 12 Timer B2 –
1 0 1 02 UART0 transmit –
1 0 1 12 UART0 receive/ACK0 –
1 1 0 02 UART2 transmit –
1 1 0 12 UART2 receive/ACK2 –
1 1 1 02 A-D conversion –
1 1 1 12 UART1 receive/ACK1 –
98
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note: If the DSD bit of DMiCON register is “0” (fixed), this register can only be written to when the DMAE bit of
DMiCON register is “0” (DMA disabled).
If the DSD bit is “1” (forward direction), this register can be written to at any time.
If the DSD bit is “1” and the DMAE bit is “1” (DMA enabled), the DMAi forward address pointer can be read from
this register. Otherwise, the value written to it can be read.
Nothing is assigned. When write, set “0”. When read, these contents
are “0”.
Note: If the DAD bit of DMiCON register is “0” (fixed), this register can only be written to when the DMAE bit of
DMiCON register is “0”(DMA disabled).
If the DAD bit is “1” (forward direction), this register can be written to at any time.
If the DAD bit is “1” and the DMAE bit is “1” (DMA enabled), the DMAi forward address pointer can be read from
this register. Otherwise, the value written to it can be read.
Figure 1.13.4. SAR0, SAR1, DAR0, DAR1, TCR0, and TCR1 Registers
99
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1. Transfer Cycles
The transfer cycle consists of a memory or SFR read (source read) bus cycle and a write (destination
write) bus cycle. The number of read and write bus cycles is affected by the source and destination
addresses of transfer. During memory extension and microprocessor modes, it is also affected by the
________
BYTE pin level. Furthermore, the bus cycle itself is extended by a software wait or RDY signal.
_______
(d) Effect of RDY Signal
During memory extension and microprocessor modes, DMA transfers to and from an external area
________ ________
are affected by the RDY signal. Refer to “RDY signal”.
Figure 1.13.5 shows the example of the cycles for a source read. For convenience, the destination write
cycle is shown as one cycle and the source read cycles for the different conditions are shown. In reality,
the destination write cycle is subject to the same conditions as the source read cycle, with the transfer
cycle changing accordingly. When calculating transfer cycles, take into consideration each condition for
the source read and the destination write cycle, respectively. For example, when data is transferred in 16
bit units using an 8-bit bus ((2) in Figure 1.13.5), two source read bus cycles and two destination write bus
cycles are required.
100
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
(1) When the transfer unit is 8 or 16 bits and the source of transfer is an even address
BCLK
Address Dummy
CPU use Source Destination CPU use
bus cycle
RD signal
WR signal
Data Dummy
CPU use Source Destination CPU use
bus cycle
(2) When the transfer unit is 16 bits and the source address of transfer is an odd address, or when the
transfer unit is 16 bits and an 8-bit bus is used
BCLK
Address Dummy
CPU use Source Source + 1 Destination CPU use
bus cycle
RD signal
WR signal
(3) When the source read cycle under condition (1) has one wait state inserted
BCLK
Address Destination
Dummy
CPU use Source cycle CPU use
bus
RD signal
WR signal
Data Dummy
CPU use Source Destination CPU use
bus cycle
(4) When the source read cycle under condition (2) has one wait state inserted
BCLK
Address Dummy
CPU use Source Source + 1 Destination cycle CPU use
bus
RD signal
WR signal
Data Dummy
CPU use Source Source + 1 Destination CPU use
bus cycle
Note: The same timing changes occur with the respective conditions at the destination as at the source.
Figure 1.13.5. Transfer Cycles for Source Read
101
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
No. of transfer cycles per transfer unit = No. of read cycles x j + No. of write cycles x k
102
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
3. DMA Enable
When a data transfer starts after setting the DMAE bit in DMiCON register (i = 0, 1) to “1” (enabled), the
DMAC operates as follows:
(1) Reload the forward address pointer with the SARi register value when the DSD bit in DMiCON register
is “1” (forward) or the DARi register value when the DAD bit of DMiCON register is “1” (forward).
(2) Reload the DMAi transfer counter with the DMAi transfer counter reload register value.
If the DMAE bit is set to “1” again while it remains set, the DMAC performs the above operation. However,
if a DMA request may occur simultaneously when the DMAE bit is being written, follow the steps below.
Step 1: Write “1” to the DMAE bit and DMAS bit in DMiCON register simultaneously.
Step 2: Make sure that the DMAi is in an initial state as described above (1) and (2) in a program.
If the DMAi is not in an initial state, the above steps should be repeated.
4. DMA Request
The DMAC can generate a DMA request as triggered by the cause of request that is selected with the
DMS and DSEL3 to DSEL0 bits of DMiSL register (i = 0, 1) on either channel. Table 1.13.4 shows the
timing at which the DMAS bit changes state.
Whenever a DMA request is generated, the DMAS bit is set to “1” (DMA requested) regardless of whether
or not the DMAE bit is set. If the DMAE bit was set to “1” (enabled) when this occurred, the DMAS bit is
set to “0” (DMA not requested) immediately before a data transfer starts. This bit cannot be set to “1” in
a program (it can only be set to “0”).
The DMAS bit may be set to “1” when the DMS or the DSEL3 to DSEL0 bits change state. Therefore,
always be sure to set the DMAS bit to “0” after changing the DMS or the DSEL3 to DSEL0 bits.
Because if the DMAE bit is “1”, a data transfer starts immediately after a DMA request is generated, the
DMAS bit in almost all cases is “0” when read in a program. Read the DMAE bit to determine whether the
DMAC is enabled.
103
Renesas microcomputers
M16C / 62P Group
DMAC SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
An example where DMA requests for external causes are detected active at the same
AAAA
BCLK
DMA0
AAAAAAAA
AAAAAA
AA AA AAAAA
AA
DMA1 Bus
arbitration
AAAAAA AA AAAAA
AA AA
CPU
INT0
DMA0
request bit
INT1
DMA1
request bit
104
Renesas microcomputers
M16C / 62P Group
Timers SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timers
Eleven 16-bit timers, each capable of operating independently of the others, can be classified by function
as either timer A (five) and timer B (six). The count source for each timer acts as a clock, to control such
timer operations as counting, reloading, etc. Figures 1.14.1 and 1.14.2 show block diagrams of timer A and
timer B configuration, respectively.
f2 PCLK0 bit = 0
1/2 Clock prescaler
• Main clock f1 f1 or f2
• PLL clock XCIN 1/32 fC32
• Ring oscillator PCLK0 bit = 1
1/8 f8 Reset
clock Set the CPSR bit of CPSRF
1/4 f32 register to “1” (= prescaler
reset)
f1 or f2 f8 f32 fC32
• Timer mode
• One-shot timer mode
• Pulse Width Measuring (PWM) mode
Timer A0 interrupt
Timer A0
TA0IN Noise
filter • Event counter mode
• Timer mode
• One-shot timer mode
• PWM mode
Timer A1 interrupt
Timer A1
Noise
TA1IN filter
• Event counter mode
• Timer mode
• One-shot timer mode
• PWM mode
Timer A2 interrupt
Noise
Timer A2
TA2IN filter • Event counter mode
• Timer mode
• One-shot timer mode
• PWM mode
Timer A3 interrupt
Timer A3
Noise
TA3IN filter • Event counter mode
• Timer mode
• One-shot timer mode
• PWM mode
Timer A4 interrupt
Timer A4
Noise
TA4IN filter
• Event counter mode
Note: Be aware that TA0IN shares the pin with RxD2 and TB5IN.
105
Renesas microcomputers
M16C / 62P Group
Timers SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
f2 PCLK0 bit = 0
1/2 Clock prescaler
• Main clock f1 f1 or f2
• PLL clock XCIN 1/32 fC32
• Ring oscillator PCLK0 bit = 1
1/8 f8 Reset
clock Set the CPSR bit of CPSRF
1/4 f32 register to “1” (= prescaler
reset)
f1 or f2 f8 f32 fC32
Timer B2 overflow or underflow ( to Timer A count source)
• Timer mode
• Pulse width measuring mode,
pulse period measuring mode
Timer B0 interrupt
Noise Timer B0
TB0IN filter
• Event counter mode
• Timer mode
• Pulse width measuring mode,
pulse period measuring mode
Timer B1 interrupt
TB1IN Noise
filter Timer B1
• Event counter mode
• Timer mode
• Pulse width measuring mode,
pulse period measuring mode Timer B2 interrupt
Noise
TB2IN filter Timer B2
• Event counter mode
• Timer mode
• Pulse width measuring mode,
pulse period measuring mode Timer B3 interrupt
Noise
TB3IN filter Timer B3
• Event counter mode
• Timer mode
• Pulse width measuring mode,
pulse period measuring mode Timer B4 interrupt
TB4IN Noise
filter Timer B4
• Event counter mode
• Timer mode
• Pulse width measuring mode,
pulse period measuring mode Timer B5 interrupt
Noise
TB5IN filter Timer B5
• Event counter mode
Note: Be aware that TB5IN shares the pin with RxD2 and TA0IN.
106
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A
Figure 1.14.3 shows a block diagram of the timer A. Figures 1.14.4 to 1.14.6 show registers related to the
timer A.
The timer A supports the following four modes. Except in event counter mode, timers A0 to A4 all have the
same function. Use the TMOD1 to TMOD0 bits of TAiMR register (i = 0 to 4) to select the desired mode.
• Timer mode: The timer counts an internal count source.
• Event counter mode: The timer counts pulses from an external device or overflows and underflows of
other timers.
• One-shot timer mode: The timer outputs a pulse only once before it reaches the minimum count
“000016.”
• Pulse width modulation (PWM) mode: The timer outputs pulses in a given width successively.
AAAA
Clock source Data bus low-order bits
selection • Timer
f1 or f2 • One shot Low-order High-order
A
• PWM
f8 8 bits 8 bits
f32 • Timer Reload register
A
(gate function)
fC32
Clock selection
• Event counter
Polarity Counter
selection Up-count/down-count
TAiIN
(i = 0 to 4) Always counts down except
TABSR register
Clock selection in event counter mode
107
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AAAAAAAAAAAAAA
TA4S Timer A4 count start flag RW
AAAAAAAAAAAAAA
TB0S Timer B0 count start flag RW
AAAAAAAAAAAAAA
TB2S Timer B2 count start flag RW
Figure 1.14.5. TA0 to TA4 Registers, TABSR Register, and UDF Register
108
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note : Make sure the port direction bits for the TA1IN to TA4IN pins are set to “0” (= input mode).
AAAAAAAAAAAAAAA
When write, set to “0”. When read, their contents are
(b6-b0) indeterminate.
AAAAAAAAAAAAAAA
CPSR Clock prescaler reset flag Setting this bit to “1” initializes the
prescaler for the timekeeping clock. ( RW
When read, its content is “0”.)
109
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1. Timer Mode
In timer mode, the timer counts a count source generated internally (see Table 1.14.1). Figure 1.14.7
shows TAiMR register in timer mode.
110
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.14.2. Specifications in Event Counter Mode (when not processing two-phase pulse signal)
Item Specification
Count source • External signals input to TAiIN pin (i=0 to 4) (effective edge can be selected
in program)
• Timer B2 overflows or underflows,
timer Aj (j=i-1, except j=4 if i=0) overflows or underflows,
timer Ak (k=i+1, except k=0 if i=4) overflows or underflows
Count operation • Up-count or down-count can be selected by external signal or program
• When the timer overflows or underflows, it reloads the reload register con-
tents and continues counting. When operating in free-running mode, the
timer continues counting without reloading.
Divided ratio 1/ (FFFF16 - n + 1) for up-count
1/ (n + 1) for down-count n : set value of TAi register 000016 to FFFF16
Count start condition Set TAiS bit of TABSR register to “1” (= start counting)
Count stop condition Set TAiS bit to “0” (= stop counting)
Interrupt request generation timing Timer overflow or underflow
TAiIN pin function I/O port or count source input
TAiOUT pin function I/O port, pulse output, or up/down-count select input
Read from timer Count value can be read by reading TAi register
Write to timer • When not counting and until the 1st count source is input after counting start
Value written to TAi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to TAi register is written to only reload register
(Transferred to counter when reloaded next)
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
Whenever the timer underflows or underflows, the output polarity of TAiOUT
pin is inverted . When not counting, the pin outputs a low.
111
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
TCK1 Can be “0” or “1” when not using two-phase pulse signal
RW
processing
Note 1: During event counter mode, the count source can be selected using the ONSF and TRGSR registers.
Note 2: TA0OUT pin is N-channel open drain output.
Note 3: Effective when the TAiTGH and TAiTGL bits of ONSF or TRGSR register are ‘002’ (TAiIN pin input).
Note 4: Count down when input on TAiOUT pin is low or count up when input on that pin is high. The port
direction bit for TAiOUT pin must be set to “0” (= input mode).
Figure 1.14.8. TAiMR Register in Event Counter Mode (when not using two-phase pulse signal
processing)
112
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.14.3. Specifications in Event Counter Mode (when processing two-phase pulse signal with timers A2, A3 and A4)
Item Specification
Count source • Two-phase pulse signals input to TAiIN or TAiOUT pins (i = 2 to 4)
Count operation • Up-count or down-count can be selected by two-phase pulse signal
• When the timer overflows or underflows, it reloads the reload register con-
tents and continues counting. When operating in free-running mode, the
timer continues counting without reloading.
Divide ratio 1/ (FFFF16 - n + 1) for up-count
1/ (n + 1) for down-count n : set value of TAi register 000016 to FFFF16
Count start condition Set TAiS bit of TABSR register to “1” (= start counting)
Count stop condition Set TAiS bit to “0” (= stop counting)
Interrupt request generation timing Timer overflow or underflow
TAiIN pin function Two-phase pulse input
TAiOUT pin function Two-phase pulse input
Read from timer Count value can be read by reading timer A2, A3 or A4 register
Write to timer • When not counting and until the 1st count source is input after counting start
Value written to TAi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to TAi register is written to reload register
(Transferred to counter when reloaded next)
Select function (Note) • Normal processing operation (timer A2 and timer A3)
The timer counts up rising edges or counts down falling edges on TAjIN pin
when input signals on TAjOUT pin is “H”.
TAjOUT
TAjIN
(j=2,3) Up- Up- Up- Down- Down- Down-
count count count count count count
TAkOUT
TAkIN
(k=3,4)
113
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
MR1 RW
To use two-phase pulse signal processing, set this bit to “0”.
MR2 To use two-phase pulse signal processing, set this bit to “1”. RW
MR3 To use two-phase pulse signal processing, set this bit to “0”. RW
TCK0 Count operation type 0 : Reload type
select bit RW
1 : Free-run type
Note 1: TCK1 bit is valid for timer A3 mode register. No matter how this bit is set, timers A2 and A4 always operate in
normal processing mode and x4 processing mode, respectively.
Note 2: If two-phase pulse signal processing is desired, following register settings are required:
• Set the UDF register’s TAiP bit to “1” (two-phase pulse signal processing function enabled).
• Set the TRGSR register’s TAiTGH and TAiTGL bits to ‘002’ (TAiIN pin input).
• Set the port direction bits for TAiIN and TAiOUT to “0” (input mode).
Figure 1.14.9. TA2MR to TA4MR Registers in Event Counter Mode (when using two-phase
pulse signal processing with timer A2, A3 or A4)
114
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
This function can only be used in timer A3 event counter mode during two-phase pulse signal process-
_______
ing, free-running type, x4 processing, with Z-phase entered from the INT2 pin.
Counter initialization by Z-phase input is enabled by writing “000016” to the TA3 register and setting
the TAZIE bit in ONSF register to “1” (= Z-phase input enabled).
Counter initialization is accomplished by detecting Z-phase input edge. The active edge can be cho-
sen to be the rising or falling edge by using the POL bit of INT2IC register. The Z-phase pulse width
_______
applied to the INT2 pin must be equal to or greater than one clock cycle of the timer A3 count source.
The counter is initialized at the next count timing after recognizing Z-phase input. Figure 1.14.10
shows the relationship between the two-phase pulse (A phase and B phase) and the Z phase.
If timer A3 overflow or underflow coincides with the counter initialization by Z-phase input, a timer A3
interrupt request is generated twice in succession. Do not use the timer A3 interrupt when using this
function.
TA3OUT
(A phase)
TA3IN
(B phase)
Count source
INT2 (Note)
(Z phase)
Input equal to or greater than one clock cycle
of count source
Timer A3 m m+1 1 2 3 4 5
Note: This timing diagram is for the case where the POL bit of INT2IC register = “1” (= rising edge).
Figure 1.14.10. Two-phase Pulse (A phase and B phase) and the Z Phase
115
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
116
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
117
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Item Specification
Count source f1, f2, f8, f32, fC32
Count operation • Down-count (operating as an 8-bit or a 16-bit pulse width modulator)
• The timer reloads a new value at a rising edge of PWM pulse and continues counting
• The timer is not affected by a trigger that occurs during counting
16-bit PWM • High level width n / fj n : set value of TAi register (i=o to 4)
• Cycle time (216-1) / fj fixed fj: count source frequency (f1, f2, f8, f32, fC32)
8-bit PWM • High level width n x (m+1) / fj n : set value of TAiMR register high-order address
• Cycle time (28-1) x (m+1) / fj m : set value of TAiMR register low-order address
Count start condition • TAiS bit of TABSR register is set to “1” (= start counting)
• The TAiS bit = 1 and external trigger input from the TAiIN pin
• The TAiS bit = 1 and one of the following external triggers occurs
• Timer B2 overflow or underflow,
timer Aj (j=i-1, except j=4 if i=0) overflow or underflow,
timer Ak (k=i+1, except k=0 if i=4) overflow or underflow
Count stop condition TAiS bit is set to “0” (= stop counting)
Interrupt request generation timing PWM pulse goes “L”
TAiIN pin function I/O port or trigger input
TAiOUT pin function Pulse output
Read from timer An indeterminate value is read by reading TAi register
Write to timer • When not counting and until the 1st count source is input after counting start
Value written to TAi register is written to both reload register and counter
• When counting (after 1st count source input)
Value written to TAi register is written to only reload register
(Transferred to counter when reloaded next)
118
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
MR2 Trigger select bit 0 : Write “1” to TAiS bit in the TASF register RW
1 : Selected by TAiTGH to TAiTGL bits
119
Renesas microcomputers
M16C / 62P Group
Timers (Timer A) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
16
1 / fi X (2 – 1)
Count source
“H”
Input signal to
TAiIN pin “L”
Trigger is not generated by this signal
1 / fj X n
PWM pulse output “H”
from TAiOUT pin “L”
1 / fj X (m + 1) X (2 8 – 1)
AAAAAAAAAAAAAAAAA
“L”
1 / fj X (m + 1)
AAAAAAAAAAAAAAAAA
Underflow signal of “H”
8-bit prescaler (Note2) “L”
1 / fj X (m + 1) X n
“1”
IR bit of TAiIC
register “0”
120
Renesas microcomputers
M16C / 62P Group
Timers (Timer B) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer B
Figure 1.15.1 shows a block diagram of the timer B. Figures 1.15.2 and 1.15.3 show registers related to the
timer B.
Timer B supports the following three modes. Use the TMOD1 and TMOD0 bits of TBiMR register (i = 0 to 5)
to select the desired mode.
• Timer mode: The timer counts an internal count source.
• Event counter mode: The timer counts pulses from an external device or overflows or underflows of
other timers.
• Pulse period/pulse width measuring mode: The timer measures an external signal's pulse period or
pulse width.
(Note 2)
MR3 RO
TCK0 Count source select bit Function varies with each operation RW
TCK1 mode RW
Note 1: Timer B0, timer B3.
Note 2: Timer B1, timer B2, timer B4, timer B5.
121
Renesas microcomputers
M16C / 62P Group
Timers (Timer B) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AAAAAAAAAAAAAAA
Bit symbol
AAAAAAAAAAAAAAA
TA0S
Bit name
Timer A0 count start flag
Function
0 : Stops counting
RW
RW
AAAAAAAAAAAAAAA
TA1S Timer A1 count start flag 1 : Starts counting RW
TA2S Timer A2 count start flag RW
AAAAAAAAAAAAAAA
TA3S Timer A3 count start flag RW
AAAAAAAAAAAAAAA
TA4S Timer A4 count start flag RW
TB0S Timer B0 count start flag RW
AAAAAAAAAAAAAAA
TB1S Timer B1 count start flag RW
TB2S Timer B2 count start flag RW
AAAAAAAAAAAAAAA
AAAAAAAAAAAAAAA
Bit symbol Bit name Function
Nothing is assigned. When write, set to “0”. When read, their
RW
AAAAAAAAAAAAAAA
(b4-b0) contents are indeterminate.
TB3S Timer B3 count start flag 0 : Stops counting RW
AAAAAAAAAAAAAAA
1 : Starts counting
TB4S Timer B4 count start flag RW
TB5S Timer B5 count start flag RW
AAAAAAAAAAAAAAA
Nothing is assigned. When write, set to “0”. When read, their
(b6-b0) contents are indeterminate.
AAAAAAAAAAAAAAA
CPSR Clock prescaler reset flag Setting this bit to “1” initializes the
prescaler for the timekeeping clock. RW
(When read, the value of this bit is “0”.)
Figure 1.15.3. TB0 to TB5 Registers, TABSR Register, TBSR Register, CPSRF Register
122
Renesas microcomputers
M16C / 62P Group
Timers (Timer B) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1. Timer Mode
In timer mode, the timer counts a count source generated internally (see Table 1.15.1). Figure 1.15.4
shows TBiMR register in timer mode.
AAA
Timer Bi mode register (i= 0 to 5)
Symbol Address After reset
AAA
b7 b6 b5 b4 b3 b2 b1 b0
TB0MR to TB2MR 039B16 to 039D16 00XX00002
0 0
TB3MR to TB5MR 035B16 to 035D16 00XX00002
b7 b6
TCK0 Count source select bit
0 0 : f1 or f2 RW
0 1 : f8
TCK1 1 0 : f32 RW
1 1 : fC32
123
Renesas microcomputers
M16C / 62P Group
Timers (Timer B) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
AA
Timer Bi mode register (i=0 to 5)
b7 b6 b5 b4 b3 b2 b1 b0 Symbol Address After reset
0 1 TB0MR to TB2MR 039B16 to 039D16 00XX00002
TB3MR to TB5MR 035B16 to 035D16 00XX00002
124
Renesas microcomputers
M16C / 62P Group
Timers (Timer B) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note: This flag is indeterminate after reset. When the TBiS bit = 1 (start counting), the MR3 bit is cleared to “0” (no overflow) by writing
to the TBiMR register at the next count timing or later after the MR3 bit was set to “1” (overflowed). The MR3 bit cannot be set to
“1” in a program. The TB0S to TB2S bits are assigned to the TABSR register's bit 5 to bit 7, and the TB3S to TB5S bits are
assigned to the TBSR register's bit 5 to bit 7.
Figure 1.15.6. TBiMR Register in Pulse Period and Pulse Width Measurement Mode
125
Renesas microcomputers
M16C / 62P Group
Timers (Timer B) SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Count source
“H”
Measurement pulse
“L”
Transfer Transfer
(indeterminate value) (measured value)
“1”
TBiS bit
“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”
TBiIC register's
IR bit “0”
126
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
127
128
U phase output
Timer Ai(i = 1, 2, 4) start trigger signal control circuit
DU1 DU0
Transfer trigger
(Note 1) bit bit
Timer A4 reload control signal U phase output signal
D Q D
Q
TA4 register Reload TA41 register T T
Trigger
Timer A4 counter Three-phase output
Timer A4
(One-shot timer mode) shift register
one-shot pulse DUB1 DUB0 (U phase)
INV11 bit bit
T Q
U phase output signal
Set to 0 when TA4S bit = 0 D Q D Reverse
Q D Q control
U
T T
T
Reverse
Trigger
D Q control V
Trigger Dead time timer
Renesas microcomputers
W phase output
Trigger
control circuit Wphase output signal Reverse
Timer A 2 counter W
D Q control
(One-shot timer mode) T
INV11
T Q Diagram for switching to P80, P81 and P72 - P75 is not shown.
Set to 0 when TA2S bit = 0
Note : If the INV06 bit = 0 (triangular wave modulation mode), a transfer trigger is generated at only the first occurrence of a timer B2 underflow after writing to the IDB0 and IDB1 registers.
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
INV07 Software trigger select bit Setting this bit to “1” generates a transfer
trigger. If the INV06 bit is “1”, a trigger for
the dead time timer is also generated. RW
The value of this bit when read is “0”.
Note 1: Write to this register after setting the PRC1 bit of PRCR register to “1” (write enable). Note also that INV00 to INV02,
INV04 and INV06 bits can only be rewritten when timers A1, A2, A4 and B2 are idle.
Note 2: If this bit needs to be set to “1”, set any value in the ICTB2 register before writing to it.
Note 3: Effective when the INV11 bit is “1” (three-phase mode 1). If INV11 is “0” (three-phase mode 0), the ICTB2 counter is
incremented by “1” each time the timer B2 underflows, regardless of whether the INV00 and INV01 bits are set.
Note 4: Setting the INV02 bit to “1” activates the dead time timer, U/V/W-phase output control circuits and ICTB2 counter.
Note 5: All of the U, U, V, V, W and W pins are placed in the high-impedance state by setting the INV02 bit to 1 (three-phase
motor control timer function) and setting the INV03 bit to “0” (three-phase motor control timer output disable).
Note 6: The INV03 bit is set to “0” in the following cases:
• When reset
• When positive and negative go active simultaneously while INV04 bit is “1”
• When set to “0” in a program
• When input on the NMI pin changes state from “H” to “L” (The INV03 bit cannot be set to “1” when NMI input is
“L”.)
Note 7: Can only be set by writing “0” in a program, and cannot be set to “1”.
Note 8: The effects of the INV06 bit are described in the table below.
129
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note 1: Write to this register after setting the PRC1 bit of PRCR register to “1” (write enable). Note also that this
register can only be rewritten when timers A1, A2, A4 and B2 are idle.
Note 2: The effects of the INV11 bit are described in the table below.
Item INV11=0 INV11=1
Mode Three-phase mode 0 Three-phase mode 1
TA11, TA21, TA41 registers Not used Used
INV00 bit, INV01 bit Has no effect. ICTB2 counted every time Effect
timer B2 underflows regardless of
whether the INV00 to INV01 bits are set.
INV13 bit Has no effect Effective when INV11 bit is “1” and
INV06 bit is “0”
Note 3: If the INV06 bit is “1” (sawtooth wave modulation mode), set this bit to “0” (three-phase mode 0). Also, if the
INV11 bit is “0”, set the PWCON bit to “0” (timer B2 reloaded by a timer B2 underflow).
Note 4: The INV13 bit is effective only when the INV06 bit is “0” (triangular wave modulation mode) and the INV11 bit
is “1” (three-phase mode 1).
Note 5: If all of the following conditions hold true, set the INV16 bit to “1” (dead time timer triggered by the rising edge
of three-phase output shift register output)
• The INV15 bit is “0” (dead time timer enabled)
• When the INV03 bit is set to “1” (three-phase motor control timer output enabled), the Dij bit and DiBj bit (i:U,
V, or W, j: 0 to 1) have always different values (the positive-phase and negative-phase always output
different levels during the period other than dead time).
Conversely, if either one of the above conditions holds false, set the INV16 bit to “0” (dead time timer triggered
130
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
DVi V phase output buffer i When read, these bits show the RW
three-phase output shift register
DVBi V phase output buffer i value. RW
DWi W phase output buffer i RW
DWBi W phase output buffer i RW
Nothing is assigned. When write, set to “0”. When read, its
(b7-b6) content is “0”.
Note: The IDB0 and IDB1 register values are transferred to the three-phase shift register by a transfer trigger. The
value written to the IDB0 register after a transfer trigger generates the output signal of each phase, and the
next value written to the IDB1 register at the falling edge of the timer A1, A2 or A4 one-shot pulse represents
the output signal of each phase.
131
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer Ai, Ai-1 register (i=1, 2, 4) (Note 1, Note 2, Note 3, Note 4, Note 5, Note 6)
Symbol Address After reset
TA1 038916-038816 Indeterminate
TA2 038B16-038A16 Indeterminate
(b15) (b8) b0
b7 b0 b7 TA4 038F16-038E16 Indeterminate
TA11 034316-034216 Indeterminate
TA21 034516-034416 Indeterminate
TA41 034716-034616 Indeterminate
Function Setting range RW
Assuming the set value = n, upon a start trigger the timer 000016 to FFFF16
starts counting the count source and stops after counting WO
it n times. The positive and negative phases change at
the same time timer A, A2 or A4 stops.
Note 1: Write to this register after setting the PRC1 bit of PRCR register to “1” (write enable).
Note 2: If the INV11 bit is “0” (three-phase mode 0) or the INV06 bit is “1” (triangular wave modulation mode), set
this bit to “0” (timer B2 underflow).
Note 3: Related pins are U(P80), U(P81), V(P72), V(P73), W(P74) and W(P75). If a low-level signal is applied to
the NMI pin when the IVPCR1 bit = 1, the target pins go to a high-impedance state regardless of which
functions of those pins are being used. After forced interrupt (cutoff), input “H” to the NMI pin and set
IVPCR1 bit to “0”: this forced cutoff will be reset.
Figure 1.16.5. ICTB2 Register, TA1, TA2, TA4, TA11, TA21 and TA41 Registers, and TB2SC Registers
132
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Timer A3 event/trigger b5 b4
TA3TGL
0 0 : Input on TA3IN is selected (Note 1) RW
select bit
0 1 : TB2 overflow is selected (Note 2)
TA3TGH 1 0 : TA2 overflow is selected (Note 2)
RW
1 1 : TA4 overflow is selected (Note 2)
Note 1: Set the corresponding port direction bit to “0” (input mode).
Note 2: Overflow or underflow.
AAAAAAAAAAAAAAAA
TA3S Timer A3 count start flag RW
TA4S Timer A4 count start flag RW
AAAAAAAAAAAAAAAA
TB0S
AAAAAAAAAAAAAAAA
TB1S
TB2S
Timer B0 count start flag
Timer B1 count start flag
Timer B2 count start flag
RW
RW
RW
133
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
MR1 External trigger select Has no effect for the three-phase motor
control timer function RW
bit
MR2 Trigger select bit Must set to “1” (selected by TRGSR register)
RW
for the three-phase motor control timer
function
MR3 Must set to “0” for the three-phase motor control timer function RW
TCK0 b7 b6
Count source select bit RW
0 0 : f1 or f2
0 1 : f8
TCK1 1 0 : f32 RW
1 1 : fC32
AAA
Timer B2 mode register
A
AA
b7 b6 b5 b4 b3 b2 b1 b0
Symbol Address After reset
0 0 0 TB2MR 039D16 00XX00002
MR2 Must set to “0” for the three-phase motor control timer function RW
MR3 When write in three-phase motor control timer function, write “0”.
RO
When read, its content is indeterminate.
134
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
The three-phase motor control timer function is enabled by setting the INV02 bit of INVC0 register to “1”.
When this function is on, timer B2 is used to control the carrier wave, and timers A4, A1 and A2 are used
__ ___ ___
to control three-phase PWM outputs (U, U, V, V, W and W). The dead time is controlled by a dedicated
dead time timer. Figure 1.16.8 shows the example of triangular modulation waveform and Figure 1.16.9
shows the example of sawtooth modulation waveform.
Carrier wave
Signal wave
Timer B2
Timer A4 m m n n p p
one-shot pulse*
Rewriting IDB0, IDB1 registers
U phase
output signal * Transfer to three-phase
output shift register
U phase
output signal *
U phase
INV14 = 0
(“L” active)
U phase
Dead time
U phase
INV14 = 1
(“H” active)
Dead time
U phase
INV13
(INV11=1(three-phase
mode 1))
* Internal signals. See the block diagram of the three-phase motor control timer function.
Shown here is a typical waveform for the case where INVC0 = 00XX11XX2 (X = set as suitable for the system) and INVC1 = 010XXXX02.
An example for changing PWM outputs is shown below.
(1)When INV11=1(three-phase mode 1) (2)When INV11=0(three-phase mode 0)
· INV01=0, ICTB2=216(timer B2 interrupt is generated at every 2’th · INV01=0, ICTB2=116(timer B2 interrupt is generated at every
occurrence of a timer B2 underflow), or INV01=1, INV00=1, occurrence of a timer B2 underflow)
ICTB2=116(timer B2 interrupt is generated at even-numbered · Initial timer value: TA4 = m. The TA4 register is modified each time
occurrences of a timer B2 underflow). a timer B2 interrupt occurs. First time, TA4 = m. Second time, TA4 = n.
· Initial timer value: TA41=m, TA4=m. The TA4 and TA41 registers Third time, TA4 = n. Fourth time, TA4 = p. Fifth time, TA4 = p.
are modified every time a timer B2 interrupt occurs. First time, · Initial values of IDB0 and IDB1 registers: DU0=1, DUB0=0, DU1=0,
TA41= n, TA4 = n. Second time, TA41 = p, TA4 = p. DUB1=1.The register values are changed to DU0 = 1, DUB0 = 0, DU1=
· Initial values of IDB0 and IDB1 registers: DU0 = 1, DUB0 = 0, 1 and DUB1 = 0 the sixth time a timer B2 interrupt occurs.
DU1 = 0, DUB1 = 1.The register values are changed to DU0 = 1,
DUB0 = 0, DU1= 1 and DUB1 = 0 the third time a timer B2
interrupt occurs.
The value written to the TA4 register and TA41 register are inverted at odd-numbered timer A outputs.
135
Renesas microcomputers
M16C / 62P Group
Three-phase Motor Control Timer Functions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Signal wave
Timer B2
Timer A4
one-shot pulse*
U phase
output signal *
U phase
INV14 = 0
(“L” active) Dead time
U phase
U phase
INV14 = 1
(“H” active) Dead time
U phase
* Internal signals. See the block diagram of the three-phase motor control timer function.
Shown here is a typical waveform for the case where INVC0= 01XX110X2 (X = set as suitable for the
system) and INVC1 = 010XXX002. An example for changing PWM outputs is shown below.
• ICTB2=n (timer B2 interrupt is generated at every n’th occurrence of a timer B2 underflow)
• Initial values of IDB0 and IDB1 registers: DU0=0, DUB0=1, DU1=1, DUB1=1. The register values are
changed to DU0=1, DUB0=0, DU1=1, DUB1=1 a timer B2 interrupt occurs.
136
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Serial I/O
Serial I/O is configured with five channels: UART0 to UART2, SI/O3 and SI/O4.
UARTi (i=0 to 2)
UARTi 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. Figures 1.17.2 shows the block diagram of the UARTi
transmit/receive.
137
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
PCLK1=0
1/2 f2SIO
f1SIO f1SIO or f2SIO
Main clock, PLL clock, or ring oscillator clock
PCLK1=1
1/8 f8SIO
1/4 f32SIO
(UART0) TxD
RxD polarity polarity
RxD0 reversing circuit reversing TxD0
circuit
Clock source selection UART reception Receive
1/16
Reception clock
CLK1 to CLK0 Clock synchronous
002 control circuit
f1SIO or f2SIO U0BRG type Transmit/
012 Internal CKDIR=0 register receive
f8SIO unit
102 UART transmission Transmit
f32SIO 1 / (n0+1) 1/16
Transmission control clock
External Clock synchronous circuit
CKDIR=1 type
Clock synchronous type
(when internal clock is selected)
1/2
CKDIR=0
Clock synchronous type
CKPOL (when external clock is selected) CKDIR=1
Clock synchronous type
(when internal clock is selected)
CLK
polarity
CLK0 reversing
circuit
CTS/RTS selected CTS/RTS disabled
CRS=1 RTS0
CTS0 / RTS0 “H”
CRS=0
CTS/RTS disabled
RCSP=0 CRD=1 CTS0
CTS0 from UART1 CRD=0
RCSP=1
(UART1) TxD
RxD polarity polarity
RxD1 reversing circuit reversing TxD1
circuit
Clock source selection UART reception
1/16 Receive
CLK1 to CLK0 Reception clock
Clock synchronous control circuit
002 Transmit/
f1SIO or f2SIO U1BRG type
receive
012 Internal CKDIR=0 register
f8SIO unit
102 UART transmission Transmit
f32SIO 1 / (n1+1) 1/16 Transmission clock
Clock synchronous control circuit
External CKDIR=1 type
Clock synchronous type
1/2 (when internal clock is selected)
CKDIR=0
Clock synchronous type
CKPOL (when external clock is selected)
CKDIR=1
CLK Clock synchronous type
polarity (when internal clock is selected)
CLK1 CLKMD0=0
reversing
circuit
CLKMD0=1
Clock output
pin select CTS/RTS selected CTS/RTS disabled
CTS1 / RTS1/ CLKMD1=1 CRS=1 RTS1
CTS0/ CLKS1 CLKMD1=0 CRS=0
“H”
CTS/RTS disabled
RCSP=0 CTS1
CRD=1
138
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
No reverse
IOPOL=0
RxD data
RxDi reverse circuit
Reverse IOPOL=1
Clock
synchronous type
UART
1SP PAR (7 bits)
disabled
Clock UART
UART(7 bits) UARTi receive register
synchronous (8 bits)
STPS= 0 PRYE=0 type
SP SP PAR
2SP PRYE=1
STPS= 1 Clock
PAR UART UART
enabled synchronous type
(9 bits)
UART
(8 bits)
UART
(9 bits)
UiRB register
0 0 0 0 0 0 0 D8 D7 D6 D5 D4 D3 D2 D1 D0
D8 D7 D6 D5 D4 D3 D2 D1 D0 UiTB register
UART
(9 bits) UART
(8 bits)
UART
(9 bits)
Clock
PAR synchronous type
2SP STPS= 1 enabled PRYE=1 UART
SP SP PAR
STPS PRYE=0
=0 UART UARTi transmit register
Clock
(7 bits)
1SP PAR UART UART(7 bits)
synchronous
disabled type (8 bits)
“0”
Clock
synchronous type
i=0 to 2 Error signal output
disable No reverse
SP: Stop bit UiERE=0 IOPOL=0
PAR: Parity bit
SMD2 to SMD0, STPS, PRYE, IOPOL, CKDIR: UiMR register's bits
Error signal TxD data TxDi
output circuit reverse circuit
UiERE=1 IOPOL=1
UiERE: UiC1 register's bit Error signal output Reverse
enable
139
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Function RW
Transmit data WO
Nothing is assigned.
In an attempt to write to these bits, write “0”. The value, if read, turns out to be indeterminate.
Bit Function
Bit name RW
symbol
Nothing is assigned.
(b10-b9) In an attempt to write to these bits, write “0”. The value, if read, turns out to be “0”.
Note 1: When the UiMR register’s SMD2 to SMD0 bits = “0002” (serial I/O disabled) or the UiC1 register’s RE bit = “0” (reception disabled), all of the SUM,
PER, FER and OER bits are set to “0” (no error). The SUM bit is set to “0” (no error) when all of the PER, FER and OER bits = “0” (no error).
Also, the PER and FER bits are set to “0” by reading the lower byte of the UiRB register.
Note 2: The ABT bit is set to “0” by writing “0” in a program. (Writing “1” has no effect.)
Note 1: Write to this register while serial I/O is neither transmitting nor receiving.
Note 2: Use MOV instruction to write to this register.
Figure 1.17.3. U0TB to U2TB Register, U0RB to U2RB Register, and U0BRG to U2BRG Register
140
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit
Bit name Function RW
symbol
b2 b1 b0
SMD0 Serial I/O mode select bit 0 0 0 : Serial I/O disabled RW
(Note 2) 0 0 1 : Clock synchronous serial I/O mode
SMD1 0 1 0 : I2C mode (Note 3)
1 0 0 : UART mode transfer data 7 bits long RW
1 0 1 : UART mode transfer data 8 bits long
SMD2 1 1 0 : UART mode transfer data 9 bits long
Must not be set except above RW
Note 1: Set the corresponding port direction bit for each CLKi pin to “0” (input mode).
Note 2: To receive data, set the corresponding port direction bit for each RxDi pin to “0” (input mode).
Note 3: Set the corresponding port direction bit for SCL and SDA pins to “0” (input mode).
Bit
Bit name Function RW
symbol
b1 b0
CLK0 BRG count source 0 0 : f1SIO or f2SIO is selected RW
select bit 0 1 : f8SIO is selected
CLK1 1 0 : f32SIO is selected RW
1 1 : Must not be set
TXEPT Transmit register empty 0 : Data present in transmit register (during transmission)
flag 1 : No data present in transmit register RO
(transmission completed)
Data output select bit 0 : TxDi/SDAi and SCLi pins are CMOS output
NCH 1 : TxDi/SDAi and SCLi pins are N-channel open-drain output RW
(Note 2)
CKPOL CLK polarity select bit 0 : Transmit data is output at falling edge of transfer clock
and receive data is input at rising edge RW
1 : Transmit data is output at rising edge of transfer clock
and receive data is input at falling edge
UFORM Transfer format select bit 0 : LSB first RW
(Note 3) 1 : MSB first
Note 1: Set the corresponding port direction bit for each CTSi pin to “0” (input mode).
Note 2: TXD2/SDA2 and SCL2 are N-channel open-drain output. Cannot be set to the CMOS output. Set the NCH bit of the U2C0
register to “0”.
Note 3: Effective for clock synchronous serial I/O mode and UART mode transfer data 8 bits long.
Note 4: CTS1/RTS1 can be used when the UCON register’s CLKMD1 bit = “0” (only CLK1 output) and the UCON register’s RCSP bit =
“0” (CTS0/RTS0 not separated).
141
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit Function
Bit name RW
symbol
Nothing is assigned.
(b5-b4) When write, set “0”. When read, these contents are “0”.
UiLCH Data logic select bit 0 : No reverse
1 : Reverse RW
Bit Function
Bit name RW
symbol
142
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit Function
Bit RW
symbol
name
U0IRS UART0 transmit 0 : Transmit buffer empty (Tl = 1)
interrupt cause select bit 1 : Transmission completed (TXEPT = 1) RW
Note: When using multiple transfer clock output pins, make sure the following conditions are met:
U1MR register’s CKDIR bit = “0” (internal clock)
Bit Function
Bit RW
symbol
name
IICM I2C mode select bit 0 : Other than I2C mode RW
1 : I2C mode
Nothing is assigned. When write, set “0”. When read, its content is indeterminate.
(b7)
Note 1: The BBS bit is set to “0” by writing “0” in a program. (Writing “1” has no effect.).
Note 2: Underflow signal of timer A3 in UART0, underflow signal of timer A4 in UART1, underflow signal of timer A0 in UART2.
Note 3: When a transfer begins, the SSS bit is set to “0” (Not synchronized to RXDi).
143
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit
Bit name Function RW
symbol
IICM2 I 2C mode select bit 2 Refer to “Table 1.20.4. I2C Mode Functions”
RW
Bit
Bit name Function RW
symbol
Nothing is assigned.
(b0) When write, set “0”. When read, its content is indeterminate.
CKPH Clock phase set bit 0 : Without clock delay
RW
1 : With clock delay
Nothing is assigned.
(b2) When write, set “0”. When read, its content is indeterminate.
NODC Clock output select bit 0 : CLKi is CMOS output
1 : CLKi is N-channel open drain output RW
Nothing is assigned.
(b4) When write, set “0”. When read, its content is indeterminate.
DL0 SDAi digital delay b7 b6 b5
RW
setup bit 0 0 0 : Without delay
(Note 1, Note 2) 0 0 1 : 1 to 2 cycle(s) of UiBRG count source
DL1 0 1 0 : 2 to 3 cycles of UiBRG count source
0 1 1 : 3 to 4 cycles of UiBRG count source RW
1 0 0 : 4 to 5 cycles of UiBRG count source
1 0 1 : 5 to 6 cycles of UiBRG count source
DL2 1 1 0 : 6 to 7 cycles of UiBRG count source RW
1 1 1 : 7 to 8 cycles of UiBRG count source
Note 1 : The DL2 to DL0 bits are used to generate a delay in SDAi output by digital means during I2C mode. In other than I2C
mode, set these bits to “0002” (no delay).
Note 2 : The amount of delay varies with the load on SCLi and SDAi pins. Also, when using an external clock, the amount of
delay increases by about 100 ns.
144
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O
Bit
Bit name Function RW
symbol
145
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
146
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
Table 1. 18. 2. Registers to Be Used and Settings in Clock Synchronous Serial I/O Mode
Register Bit Function
UiTB(Note3) 0 to 7 Set transmission data
UiRB(Note3) 0 to 7 Reception data can be read
OER Overrun error flag
UiBRG 0 to 7 Set a transfer rate
UiMR(Note3) SMD2 to SMD0 Set to “0012”
CKDIR Select the internal clock or external clock
IOPOL Set to “0”
UiC0 CLK1 to CLK0 Select the count source for the UiBRG register
_______ _______
CRS Select CTS or RTS to use
TXEPT Transmit register empty flag
_______ _______
CRD Enable or disable the CTS or RTS function
NCH Select TxDi pin output mode (Note 2)
CKPOL Select the transfer clock polarity
UFORM Select the LSB first or MSB first
UiC1 TE Set this bit to “1” to enable transmission/reception
TI Transmit buffer empty flag
RE Set this bit to “1” to enable reception
RI Reception complete flag
U2IRS (Note 1) Select the source of UART2 transmit interrupt
U2RRM (Note 1) Set this bit to “1” to use continuous receive mode
UiLCH Set this bit to “1” to use inverted data logic
UiERE Set to “0”
UiSMR 0 to 7 Set to “0”
UiSMR2 0 to 7 Set to “0”
UiSMR3 0 to 2 Set to “0”
NODC Select clock output mode
4 to 7 Set to “0”
UiSMR4 0 to 7 Set to “0”
UCON U0IRS, U1IRS Select the source of UART0/UART1 transmit interrupt
U0RRM, U1RRM Set this bit to “1” to use continuous receive mode
CLKMD0 Select the transfer clock output pin when CLKMD1 = 1
CLKMD1 Set this bit to “1” to output UART1 transfer clock from two pins
_________
RCSP Set this bit to “1” to accept as input the UART0 CTS0 signal from the P64 pin
7 Set to “0”
Note 1: Set the U0C1 and U1C1 register bit 4 and bit 5 to “0”. The U0IRS, U1IRS, U0RRM and U1RRM bits
are in the UCON register.
Note 2: TxD2 pin is N channel open-drain output. Set the U2C0 register's NCH bit to “0”.
Note 3: Not all register bits are described above. Set those bits to “0” when writing to the registers in clock
synchronous serial I/O mode.
i=0 to 2
147
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
Table 1.18.3 lists the functions of the input/output pins during clock synchronous serial I/O mode. Table
1.18.3 shows pin functions for the case where the multiple transfer clock output pin select function is
deselected. Table 1.18.4 lists the P64 pin functions 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
an “H”. (If the N-channel open-drain output is selected, this pin is in a high-impedance state.)
Table 1.18.3. Pin Functions (When Not Select Multiple Transfer Clock Output Pin Function)
Pin name Function Method of selection
TxDi (i = 0 to 2) Serial data output (Outputs dummy data when performing reception only)
(P63, P67, P70)
RxDi Serial data input PD6 register’s PD6_2 bit=0, PD6_6 bit=0, PD7 register’s PD7_1 bit=0
(P62, P66, P71) (Can be used as an input port when performing transmission only)
CLKi Transfer clock output UiMR register’s CKDIR bit=0
(P61, P65, P72)
Transfer clock input UiMR register’s CKDIR bit=1
PD6 register’s PD6_1 bit=0, PD6_5 bit=0, PD7 register’s PD7_2 bit=0
CTSi/RTSi CTS input UiC0 register’s CRD bit=0
(P60, P64, P73) UiC0 register’s CRS bit=0
PD6 register’s PD6_0 bit=0, PD6_4 bit=0, PD7 register’s PD7_3 bit=0
RTS output UiC0 register’s CRD bit=0
UiC0 register’s CRS bit=1
148
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
Transfer clock
“1”
UiC1 register
TE bit “0” Write data to the UiTB 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
“1”
UiC1 register
RE bit “0”
“1”
UiC1 register
TE bit “0” Write dummy data to UiTB register
“1”
UiC1 register
TI bit “0”
Transferred from UiTB register to UARTi transmit register
“H”
RTSi Even if the reception is completed, the RTS
“L” does not change. The RTS becomes “L”
1 / fEXT when the RI bit changes to “0” from “1”.
CLKi
Receive data is taken in
RxDi D 0 D1 D 2 D3 D 4 D5 D6 D 7 D0 D 1 D 2 D3 D4 D5
Transferred from UARTi receive register Read out from UiRB register
“1” to UiRB register
UiC1 register
RI bit “0”
149
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
(1) When the UiC0 register’s CKPOL bit = 0 (transmit data output at the falling
edge and the receive data taken in at the rising edge of the transfer clock)
CLKi (Note 2)
TXDi D0 D1 D2 D3 D4 D5 D6 D7
RXDi D0 D1 D2 D3 D4 D5 D6 D7
(2) When the UiC0 register’s CKPOL bit = 1 (transmit data output at the rising
edge and the receive data taken in at the falling edge of the transfer clock)
CLKi (Note 3)
TXDi D0 D1 D2 D3 D4 D5 D6 D7
R XD i D0 D1 D2 D3 D4 D5 D6 D7
Note 1: This applies to the case where the UiC0 register’s UFORM bit = 0
(LSB first) and UiC1 register's UiLCH bit = 0 (no reverse).
Note 2: When not transferring, the CLKi pin outputs a high signal.
Note 3: When not transferring, the CLKi pin outputs a low signal.
i = 0 to 2
CLKi
TXDi D0 D1 D2 D3 D4 D5 D6 D7
R XD i D0 D1 D2 D3 D4 D5 D6 D7
CLKi
TXDi D7 D6 D5 D4 D3 D2 D1 D0
R XD i D7 D6 D5 D4 D3 D2 D1 D0
Note: This applies to the case where the UiC0 register’s CKPOL bit = 0 (
transmit data output at the falling edge and the receive data taken
in at the rising edge of the transfer clock) and the UiC1 register’s
UiLCH bit = 0 (no reverse).
i = 0 to 2
150
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
TxDi “H”
D0 D1 D2 D3 D4 D5 D6 D7
(no reverse) “L”
TxDi “H”
(reverse) D0 D1 D2 D3 D4 D5 D6 D7
“L”
Note: This applies to the case where the UiC0 register’s CKPOL bit = 0
(transmit data output at the falling edge and the receive data
taken in at the rising edge of the transfer clock) and the UFORM
bit = 0 (LSB first).
i = 0 to 2
Figure 1.18.4. Serial Data Logic Switching
Microcomputer
TXD1 (P67)
CLKS1 (P64)
CLK1 (P65) IN IN
CLK CLK
151
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Clock Synchronous Serial I/O)
_______ _______
(f) CTS/RTS Separate Function (UART0)
_______ _______ _______ _______
This function separates CTS0/RTS0, outputs RTS0 from the P60 pin, and accepts as input the CTS0
from the P64 pin. To use this function, set the register bits as shown below.
_______ _______
• U0C0 register's CRD bit = 0 (enables UART0 CTS/RTS)
_______
• U0C0 register's CRS bit = 1 (outputs UART0 RTS)
_______ _______
• U1C0 register's CRD bit = 0 (enables UART1 CTS/RTS)
_______
• U1C0 register's CRS bit = 0 (inputs UART1 CTS)
_______
• UCON register's RCSP bit = 1 (inputs CTS0 from the P64 pin)
• UCON register's CLKMD1 bit = 0 (CLKS1 not used)
_______ _______ _______ _______
Note that when using the CTS/RTS separate function, UART1 CTS/RTS separate function cannot be
used.
Microcomputer IC
TXD0 (P63) IN
RXD0 (P62) OUT
CLK0 (P61) CLK
_______ _______
Figure 1.18.6. CTS/RTS Separat Function
152
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
Reception start condition • Before reception can start, the following requirements must be met
_ The RE bit of UiC1 register= 1 (reception enabled)
_ Start bit detection
Interrupt request • For transmission, one of the following conditions can be selected
_ The UiIRS bit (Note 2) = 0 (transmit buffer empty): when transferring data from the
generation timing
UiTB register to the UARTi transmit register (at start of transmission)
_ The UiIRS bit =1 (transfer completed): when the serial I/O finished sending data from
153
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
154
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
Table 1.19.3 lists the functions of the input/output pins during UART mode. Table 1.19.4 lists the P64 pin
functions during UART mode. Note that for a period from when the UARTi operation mode is selected to
when transfer starts, the TxDi pin outputs an “H”. (If the N-channel open-drain output is selected, this pin
is in a high-impedance state.)
RxDi Serial data input PD6 register’s PD6_2 bit=0, PD6_6 bit=0, PD7 register’s PD7_1 bit=0
(P62, P66, P71) (Can be used as an input port when performing transmission only)
CLKi Input/output port UiMR register’s CKDIR bit=0
(P61, P65, P72)
Transfer clock input UiMR register’s CKDIR bit=1
PD6 register’s PD6_1 bit=0, PD6_5 bit=0, PD7 register’s PD7_2 bit=0
CTSi/RTSi CTS input UiC0 register’s CRD bit=0
(P60, P64, P73) UiC0 register’s CRS bit=0
PD6 register’s PD6_0 bit=0, PD6_4 bit=0, PD7 register’s PD7_3 bit=0
RTS output UiC0 register’s CRD bit=0
UiC0 register’s CRS bit=1
155
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
(1) Example of transmit timing when transfer data is 8 bits long (parity enabled, one stop bit)
The transfer clock stops momentarily as CTSi is “H” when the stop bit is checked.
The transfer clock starts as the transfer starts immediately CTSi changes to “L”.
Tc
Transfer clock
UiC1 register “1”
TE bit
“0” Write data to the UiTB register
UiC1 register
TI bit “1”
“0”
Transferred from UiTB register to UARTi transmit register
“H”
CTSi
“L”
Stopped pulsing
Start Parity Stop because the TE bit
bit bit bit = “0”
TxDi ST D0 D1 D2 D3 D4 D5 D6 D7 P SP ST D0 D1 D2 D3 D4 D5 D6 D7 P SP ST D0 D1
The above timing diagram applies to the case where the register bits are set Tc = 16 (n + 1) / fj or 16 (n + 1) / fEXT
as follows: fj : frequency of UiBRG count source (f1SIO, f2SIO, f8SIO, f32SIO)
• UiMR register PRYE bit = 1 (parity enabled) fEXT : frequency of UiBRG count source (external clock)
• UiMR register STPS bit = 0 (1 stop bit) n : value set to UiBRG
• UiC0 register CRD bit = 0 (CTS/RTS enabled), CRS bit = 0 (CTS selected)
i: 0 to 2
• UiIRS bit = 1 (an interrupt request occurs when transmit completed):
U0IRS bit is the UCON register bit 0, U1IRS bit is the UCON
register bit 1, and U2IRS bit is the U2C1 register bit 4
(2) Example of transmit timing when transfer data is 9 bits long (parity disabled, two stop bits)
Tc
Transfer clock
“1”
UiC1 register
TE bit “0” Write data to the UiTB register
The above timing diagram applies to the case where the register bits are set Tc = 16 (n + 1) / fj or 16 (n + 1) / fEXT
as follows: fj : frequency of UiBRG count source (f1SIO, f2SIO, f8SIO, f32SIO)
• UiMR register PRYE bit = 0 (parity disabled) fEXT : frequency of UiBRG count source (external clock)
• UiMR register STPS bit = 1 (2 stop bits) n : value set to UiBRG
• UiC0 register CRD bit = 1 (CTS/RTS disabled) i: 0 to 2
• UiIRS bit = 0 (an interrupt request occurs when transmit buffer becomes empty):
U0IRS bit is the UCON register bit 0, U1IRS bit is the UCON
register bit 1, and U2IRS bit is the U2C1 register bit 4
156
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
• Example of receive timing when transfer data is 8 bits long (parity disabled, one stop bit)
UiBRG count
source
UiC1 register “1”
RE 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
UiC1 register “1” is generated by falling edge of start bit register to UiRB register
RI bit “0”
“H”
RTSi
“L”
SiRIC register “1”
IR bit “0”
CLKi
TXDi ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
RXDi ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
TXDi ST D7 D6 D5 D4 D3 D2 D1 D0 P SP
RXDi ST D7 D6 D5 D4 D3 D2 D1 D0 P SP
Note: This applies to the case where the UiC0 register’s CKPOL bit = 0 ( ST : Start bit
transmit data output at the falling edge and the receive data taken P : Parity bit
in at the rising edge of the transfer clock), the UiC1 register’s UiLCH SP : Stop bit
bit = 0 (no reverse), UiMR register's STPS bit = 0 (1 stop bit) and i = 0 to 2
UiMR register's PRYE bit = 1 (parity enabled).
157
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
“H”
Transfer clock
“L”
TxDi “H”
ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
(no reverse) “L”
TxDi “H”
(reverse)
ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
“L”
Note: This applies to the case where the UiC0 register’s CKPOL bit = 0 ( ST : Start bit
transmit data output at the falling edge of the transfer clock), the P : Parity bit
UiC0 register's UFORM bit = 0 (LSB first), the UiMR register's SP : Stop bit
STPS bit = 0 (1 stop bit) and UiMR register's PRYE bit = 1 (parity i = 0 to 2
enabled).
TxDi “H”
ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
(no reverse) “L”
RxDi “H” ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
(no reverse) “L”
TxDi “H”
(reverse) “L”
ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
“H”
RxDi “L”
ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
(reverse)
Note: This applies to the case where the UiC0 register's UFORM bit = 0 ST : Start bit
(LSB first), the UiMR register's STPS bit = 0 (1 stop bit) and the P : Parity bit
SP : Stop bit
UiMR register's PRYE bit = 1 (parity enabled). i = 0 to 2
158
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (UART)
_______ _______
(d) CTS/RTS Separate Function (UART0)
_______ _______ _______ _______
This function separates CTS0/RTS0, outputs RTS0 from the P60 pin, and accepts as input the CTS0
from the P64 pin. To use this function, set the register bits as shown below.
_______ _______
• U0C0 register's CRD bit = 0 (enables UART0 CTS/RTS)
_______
• U0C0 register's CRS bit = 1 (outputs UART0 RTS)
_______ _______
• U1C0 register's CRD bit = 0 (enables UART1 CTS/RTS)
_______
• U1C0 register's CRS bit = 0 (inputs UART1 CTS)
_______
• UCON register's RCSP bit = 1 (inputs CTS0 from the P64 pin)
• UCON register's CLKMD1 bit = 0 (CLKS1 not used)
_______ _______ _______ _______
Note that when using the CTS/RTS separate function, UART1 CTS/RTS separate function cannot be
used.
Microcomputer IC
TXD0 (P63) IN
RXD0 (P62) OUT
_______ _______
Figure 1.19.6. CTS/RTS Separate Function
159
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
As shown in Table 1.20.3, the microcomputer is placed in I2C mode by setting the SMD2 to SMD0 bits to
‘0102’ and the IICM bit to “1”. Because SDAi transmit output has a delay circuit attached, SDAi output
does not change state until SCLi goes low and remains stably low.
160
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
D Q DMA0
Arbitration
(UART0, UART2)
Noise T
Filter
IICM2=1
Reception register UARTi receive,
ACK interrupt request,
UARTi
IICM=1 and DMA1 request
IICM2=0
Start condition
detection
S
Q Bus
R busy
D Q
T
Falling edge
detection
SCLi D Q
T ACK
IICM=0 R Port register
I/O port Q (Note) 9th bit
STSPSEL=0 Internal clock
Start/stop condition detection
IICM=1 UARTi SWC2 CLK
interrupt request
STSPSEL=1 External control
Noise clock
Filter UARTi
This diagram applies to the case where the UiMR register's SMD2 to SMD0 bits = 0102 and the UiSMR register's IICM bit = 1.
IICM : UiSMR register bit
IICM2, SWC, ALS, SWC2, SDHI : UiSMR2 register bit
STSPSEL, ACKD, ACKC : UiSMR4 register bit
i=0 to 2
Note: If the IICM bit = 1, the pin can be read even when the PD6_2, PD6_6 or PD7_1 bit = 1 (output mode).
161
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Table 1. 20. 2. Registers to Be Used and Settings in I2C Mode (1) (Continued)
Register Bit Function
Master Slave
UiTB3 0 to 7 Set transmission data Set transmission data
UiRB3 0 to 7 Reception data can be read Reception data can be read
8 ACK or NACK is set in this bit ACK or NACK is set in this bit
ABT Arbitration lost detection flag Invalid
OER Overrun error flag Overrun error flag
UiBRG 0 to 7 Set a transfer rate Invalid
UiMR3 SMD2 to SMD0 Set to ‘0102’ Set to ‘0102’
CKDIR Set to “0” Set to “1”
IOPOL Set to “0” Set to “0”
UiC0 CLK1, CLK0 Select the count source for the UiBRG Invalid
register
CRS Invalid because CRD = 1 Invalid because CRD = 1
TXEPT Transmit buffer empty flag Transmit buffer empty flag
CRD Set to “1” Set to “1”
NCH Set to “1”2 Set to “1”2
CKPOL Set to “0” Set to “0”
UFORM Set to “1” Set to “1”
UiC1 TE Set this bit to “1” to enable transmission Set this bit to “1” to enable transmission
TI Transmit buffer empty flag Transmit buffer empty flag
RE Set this bit to “1” to enable reception Set this bit to “1” to enable reception
RI Reception complete flag Reception complete flag
U2IRS1 Invalid Invalid
U2RRM1, Set to “0” Set to “0”
UiLCH, UiERE
UiSMR IICM Set to “1” Set to “1”
ABC Select the timing at which arbitration-lost Invalid
is detected
BBS Bus busy flag Bus busy flag
3 to 7 Set to “0” Set to “0”
UiSMR2 IICM2 Refer to “Table 1.20.4. I2C Mode Functions” Refer to “Table 1.20.4. I2C Mode Functions”
CSC Set this bit to “1” to enable clock Set to “0”
synchronization
SWC Set this bit to “1” to have SCLi output Set this bit to “1” to have SCLi output
fixed to “L” at the falling edge of the 9th fixed to “L” at the falling edge of the 9th
bit of clock bit of clock
ALS Set this bit to “1” to have SDAi output Set to “0”
stopped when arbitration-lost is detected
STAC Set to “0” Set this bit to “1” to initialize UARTi at
start condition detection
SWC2 Set this bit to “1” to have SCLi output Set this bit to “1” to have SCLi output
forcibly pulled low forcibly pulled low
SDHI Set this bit to “1” to disable SDAi output Set this bit to “1” to disable SDAi output
7 Set to “0” Set to “0”
UiSMR3 0, 2, 4 and NODC Set to “0” Set to “0”
CKPH Refer to “Table 1.20.4. I2C Mode Functions” Refer to “Table 1.20.4. I2C Mode Functions”
DL2 to DL0 Set the amount of SDAi digital delay Set the amount of SDAi digital delay
i=0 to 2
Notes:
1. Set the U0C1 and U1C1 register bit 4 and bit 5 to “0”. The U0IRS, U1IRS, U0RRM and U1RRM bits are
in the UCON register.
2. TxD2 pin is N channel open-drain output. Set the NCH bit in the U2C0 register to “0”.
3. Not all register bits are described above. Set those bits to “0” when writing to the registers in I2C mode.
162
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Table 1. 20. 3. Registers to Be Used and Settings in I2C Mode (2) (Continued)
Register Bit Function
Master Slave
UiSMR4 STAREQ Set this bit to “1” to generate start Set to “0”
condition
RSTAREQ Set this bit to “1” to generate restart Set to “0”
condition
STPREQ Set this bit to “1” to generate stop Set to “0”
condition
STSPSEL Set this bit to “1” to output each condition Set to “0”
ACKD Select ACK or NACK Select ACK or NACK
ACKC Set this bit to “1” to output ACK data Set this bit to “1” to output ACK data
SCLHI Set this bit to “1” to have SCLi output Set to “0”
stopped when stop condition is detected
SWC9 Set to “0” Set this bit to “1” to set the SCLi to “L”
hold at the falling edge of the 9th bit of
clock
IFSR2A IFSR26, ISFR27 Set to “1” Set to “1”
UCON U0IRS, U1IRS Invalid Invalid
2 to 7 Set to “0” Set to “0”
i=0 to 2
163
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Factor of interrupt number UARTi transmission No acknowledgment UARTi transmission UARTi transmission
15, 17 and 19 (Note 1, 6) Transmission started or detection (NACK) Rising edge of Falling edge of SCLi
completed (selected by UiIRS) Rising edge of SCLi 9th bit SCLi 9th bit next to the 9th bit
Factor of interrupt number UARTi reception Acknowledgment detection UARTi reception
16, 18 and 20 (Note 1, 6) When 8th bit received (ACK) Falling edge of SCLi 9th bit
CKPOL = 0 (rising edge) Rising edge of SCLi 9th bit
CKPOL = 1 (falling edge)
Timing for transferring data CKPOL = 0 (rising edge) Rising edge of SCLi 9th bit Falling edge of Falling and rising
from the UART reception CKPOL = 1 (falling edge) SCLi 9th bit edges of SCLi 9th
shift register to the UiRB bit
register
UARTi transmission output Not delayed Delayed
delay
Functions of P63, P67 and TxDi output SDAi input/output
P70 pins
Functions of P62, P66 and RxDi input SCLi input/output
P71 pins
Functions of P61, P65 and CLKi input or output selected (Cannot be used in I2C mode)
P72 pins
Noise filter width 15ns 200ns
Read RxDi and SCLi pin Possible when the Always possible no matter how the corresponding port direction bit is set
levels corresponding port direction bit
=0
Initial value of TxDi and CKPOL = 0 (H) The value set in the port register before setting I2C mode (Note 2)
SDAi outputs CKPOL = 1 (L)
Initial and end values of H L H L
SCLi
DMA1 factor (Refer to Fig UARTi reception Acknowledgment detection UARTi reception
1.20.2) (ACK) Falling edge of SCLi 9th bit
Store received data 1st to 8th bits are stored in 1st to 8th bits are stored in 1st to 7th bits are stored in UiRB register
UiRB register bit 0 to bit 7 UiRB register bit 7 to bit 0 bit 6 to bit 0, with 8th bit stored in UiRB
register bit 8
i = 0 to 2
Note 1: If the source or cause of any interrupt is changed, the IR bit in the interrupt control register for the changed interrupt may
inadvertently be set to “1” (interrupt requested). (Refer to “precautions for interrupts” of the Usage Notes Reference Book.)
If one of the bits shown below is changed, the interrupt source, the interrupt timing, etc. change. Therefore, always be sure to
clear the IR bit to “0” (interrupt not requested) after changing those bits.
SMD2 to SMD0 bits in the UiMR register, IICM bit in the UiSMR register, IICM2 bit in the UiSMR2 register, CKPH bit in the
UiSMR3 register
Note 2: Set the initial value of SDAi output while the UiMR register’s SMD2 to SMD0 bits = ‘0002’ (serial I/O disabled).
Note 3: Second data transfer to UiRB register (Rising edge of SCLi 9th bit)
Note 4: First data transfer to UiRB register (Falling edge of SCLi 9th bit)
Note 5: Refer to “Figure 1.20.4. STSPSEL Bit Functions”.
Note 6: Refer to “Figure 1.20.2. Transfer to UiRB Register and Interrupt Timing”.
Note 7: When using UART0, be sure to set the IFSR26 bit in the IFSR2A register to “1” (cause of interrupt: UART0 bus collision).
When using UART1, be sure to set the IFSR26 bit in the IFSR2A register to “1” (cause of interrupt: UART1 bus collision).
164
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
(1) IICM2= 0 (ACK and NACK interrupts), CKPH= 0 (no clock delay)
1st bit 2nd bit 3rd bit 4th bit 5th bit 6th bit 7th bit 8th bit 9th bit
SCLi
••• D8 D7 D6 D5 D4 D3 D2 D1 D0
UiRB register
SCLi
••• D8 D7 D6 D5 D4 D3 D2 D1 D0
UiRB register
SCLi
••• D0 D7 D6 D5 D4 D3 D2 D1
UiRB register
SCLi
••• D0 D7 D6 D5 D4 D3 D2 D1 ••• D8 D7 D6 D5 D4 D3 D2 D1 D0
165
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
SDAi
(Start condition)
SDA i
(Stop condition)
i = 0 to 2
Note: When the PCLKR register's PCLK1 bit = 1, this is the cycle number of
f1SIO, and the PCLK1 bit = 0, this is the cycle number of f2SIO.
166
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
SDAi
SDAi
• Arbitration
Unmatching of the transmit data and SDAi pin input data is checked synchronously with the rising
edge of SCLi. Use the UiSMR register’s ABC bit to select the timing at which the UiRB register’s ABT
bit is updated. If the ABC bit = 0 (updated bitwise), the ABT bit is set to “1” at the same time
unmatching is detected during check, and is cleared to “0” when not detected. In cases when the ABC
bit is set to “1”, if unmatching is detected even once during check, the ABT bit is set to “1” (unmatching
detected) at the falling edge of the clock pulse of 9th bit. If the ABT bit needs to be updated bytewise,
clear the ABT bit to “0” (undetected) after detecting acknowledge in the first byte, before transferring
the next byte.
Setting the UiSMR2 register’s ALS bit to “1” (SDA output stop enabled) causes arbitration-lost to
occur, in which case the SDAi pin is placed in the high-impedance state at the same time the ABT bit
is set to “1” (unmatching detected).
167
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
• Transfer Clock
Data is transmitted/received using a transfer clock like the one shown in Figure 1.20.4.
The UiSMR2 register’s CSC bit is used to synchronize the internally generated clock (internal SCLi)
and an external clock supplied to the SCLi pin. In cases when the CSC bit is set to “1” (clock synchro-
nization enabled), if a falling edge on the SCLi pin is detected while the internal SCLi is high, the
internal SCLi goes low, at which time the UiBRG register value is reloaded with and starts counting in
the low-level interval. If the internal SCLi changes state from low to high while the SCLi pin is low,
counting stops, and when the SCLi pin goes high, counting restarts.
In this way, the UARTi transfer clock is comprised of the logical product of the internal SCLi and SCLi
pin signal. The transfer clock works from a half period before the falling edge of the internal SCLi 1st
bit to the rising edge of the 9th bit. To use this function, select an internal clock for the transfer clock.
The UiSMR2 register’s SWC bit allows to select whether the SCLi pin should be fixed to or freed from
low-level output at the falling edge of the 9th clock pulse.
If the UiSMR4 register’s SCLHI bit is set to “1” (enabled), SCLi output is turned off (placed in the high-
impedance state) when a stop condition is detected.
Setting the UiSMR2 register’s SWC2 bit = 1 (0 output) makes it possible to forcibly output a low-level
signal from the SCLi pin even while sending or receiving data. Clearing the SWC2 bit to “0” (transfer
clock) allows the transfer clock to be output from or supplied to the SCLi pin, instead of outputting a
low-level signal.
If the UiSMR4 register’s SWC9 bit is set to “1” (SCL hold low enabled) when the UiSMR3 register’s
CKPH bit = 1, the SCLi pin is fixed to low-level output at the falling edge of the clock pulse next to the
ninth. Setting the SWC9 bit = 0 (SCL hold low disabled) frees the SCLi pin from low-level output.
• SDA Output
The data written to the UiTB register bit 7 to bit 0 (D7 to D0) is sequentially output beginning with D7.
The ninth bit (D8) is ACK or NACK.
The initial value of SDAi transmit output can only be set when IICM = 1 (I2C mode) and the UiMR
register’s SMD2 to SMD0 bits = ‘0002’ (serial I/O disabled).
The UiSMR3 register’s DL2 to DL0 bits allow to add no delays or a delay of 2 to 8 UiBRG count source
clock cycles to SDAi output.
Setting the UiSMR2 register’s SDHI bit = 1 (SDA output disabled) forcibly places the SDAi pin in the
high-impedance state. Do not write to the SDHI bit synchronously with the rising edge of the UARTi
transfer clock. This is because the ABT bit may inadvertently be set to “1” (detected).
• SDA Input
When the IICM2 bit = 0, the 1st to 8th bits (D7 to D0) of received data are stored in the UiRB register bit
7 to bit 0. The 9th bit (D8) is ACK or NACK.
When the IICM2 bit = 1, the 1st to 7th bits (D7 to D1) of received data are stored in the UiRB register bit
6 to bit 0 and the 8th bit (D0) is stored in the UiRB register bit 8. Even when the IICM2 bit = 1, providing
the CKPH bit = 1, the same data as when the IICM2 bit = 0 can be read out by reading the UiRB
register after the rising edge of the corresponding clock pulse of 9th bit.
168
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
• Initialization of Transmission/Reception
If a start condition is detected while the STAC bit = 1 (UARTi initialization enabled), the serial I/O
operates as described below.
- The transmit shift register is initialized, and the content of the UiTB register is transferred to the
transmit shift register. In this way, the serial I/O starts sending data synchronously with the next
clock pulse applied. However, the UARTi output value does not change state and remains the same
as when a start condition was detected until the first bit of data is output synchronously with the input
clock.
- The receive shift register is initialized, and the serial I/O starts receiving data synchronously with the
next clock pulse applied.
- The SWC bit is set to “1” (SCL wait output enabled). Consequently, the SCLi pin is pulled low at the
falling edge of the ninth clock pulse.
Note that when UARTi transmission/reception is started using this function, the TI does not change
state. Note also that when using this function, the selected transfer clock should be an external clock.
169
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Special Mode 2
Multiple slaves can be serially communicated from one master. Transfer clock polarity and phase are
selectable. Table 1.20.6 lists the specifications of Special Mode 2. Table 1.20.7 lists the registers used in
Special Mode 2 and the register values set. Figure 1.20.5 shows communication control example for
Special Mode 2.
from the UiTB register to the UARTi transmit register (at start of transmission)
_ The UiIRS bit =1 (transfer completed): when the serial I/O finished sending data from
170
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
P13
P12
P93
P72(CLK2) P72(CLK2)
P71(RxD2) P71(RxD2)
P70(TxD2) P70(TxD2)
Microcomputer Microcomputer
(Master) (Slave)
P93
P72(CLK2)
P71(RxD2)
P70(TxD2)
Microcomputer
(Slave)
171
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
172
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Figure 1.20.6. Transmission and Reception Timing in Master Mode (Internal Clock)
173
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
"H"
Slave control input
"L"
Note :UART2 output is an N-channel open drain and must be pulled-up externally.
Figure 1.20.7. Transmission and Reception Timing (CKPH=0) in Slave Mode (External Clock)
"H"
Slave control input
"L"
Note :UART2 output is an N-channel open drain and must be pulled-up externally.
Figure 1.20.8. Transmission and Reception Timing (CKPH=1) in Slave Mode (External Clock)
174
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
175
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
(1) UiSMR register ABSCS bit (bus collision detect sampling clock select) (i=0 to 2)
If ABSCS=0, bus collision is determined at the rising edge of the transfer clock
Transfer clock
ST D0 D1 D2 D3 D4 D5 D6 D7 D8 SP
TxDi
RxDi
Input to TAjIN
Timer Aj
If ABSCS=1, bus collision is determined when timer
Aj (one-shot timer mode) underflows.
Timer Aj: timer A3 when UART0; timer A4 when UART1; timer A0 when UART2
(2) UiSMR register ACSE bit (auto clear of transmit enable bit)
Transfer clock
ST D0 D1 D2 D3 D4 D5 D6 D7 D8 SP
TxDi
RxDi
Transfer clock
ST D0 D1 D2 D3 D4 D5 D6 D7 D8 SP
TxDi
If SSS bit = 1, the serial I/O starts sending data at the rising edge (Note 1) of RxDi
CLKi
ST D0 D1 D2 D3 D4 D5 D6 D7 D8 SP
TxDi (Note 2)
RxDi
Note 1: The falling edge of RxDi when IOPOL=0; the rising edge of RxDi when IOPOL =1.
Note 2: The transmit condition must be met before the falling edge (Note 1) of RxD.
This diagram applies to the case where IOPOL=1 (reversed).
176
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Reception start condition • Before reception can start, the following requirements must be met
_ The RE bit of U2C1 register= 1 (reception enabled)
_ Start bit detection
177
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
178
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
(1) Transmission
Tc
Transfer clock
The above timing diagram applies to the case where data is Cleared to “0” when interrupt request is accepted, or cleared to “0” in a program
transferred in the direct format.
• U2MR register STPS bit = 0 (1 stop bit) Tc = 16 (n + 1) / fi or 16 (n + 1) / fEXT
• U2MR register PRY bit = 1 (even) fi : frequency of U2BRG count source (f1SIO, f2SIO, f8SIO, f32SIO)
• U2C0 register UFORM bit = 0 (LSB first) fEXT : frequency of U2BRG count source (external clock)
• U2C1 register U2LCH bit = 0 (no reverse) n : value set to U2BRG
• U2C1 register U2IRSCH bit = 1 (transmit is completed)
Note : Because TxD2 and RxD2 are connected, this is composite waveform consisting of the TxD2 output and the parity error signal
sent back from receiver.
(1) Reception
Tc
Transfer clock
TxD2
An “L” level is output from TxD2 due to
the occurrence of a parity error
RxD2 pin level
(Note) ST D0 D1 D2 D3 D4 D5 D6 D7 P SP ST D0 D1 D2 D3 D4 D5 D6 D7 P
SP
The above timing diagram applies to the case where data is Cleared to “0” when interrupt request is accepted, or cleared to “0” in a program
transferred in the direct format.
• U2MR register STPS bit = 0 (1 stop bit) Tc = 16 (n + 1) / fi or 16 (n + 1) / fEXT
• U2MR register PRY bit = 1 (even)
fi : frequency of U2BRG count source (f1SIO, f2SIO, f8SIO, f32SIO)
• U2C0 register UFORM bit = 0 (LSB first)
• U2C1 register U2LCH bit = 0 (no reverse) fEXT : frequency of U2BRG count source (external clock)
• U2C1 register U2IRSCH bit = 1 (transmit is completed) n : value set to U2BRG
Note : Because TxD2 and RxD2 are connected, this is composite waveform consisting of the transmitter's transmit waveform and the
parity error signal received.
179
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
Figure 1.20.11 shows the example of connecting the SIM interface. Connect TXD2 and RXD2 and apply
pull-up.
Microcomputer
SIM card
TxD2
RxD2
Transfer “H”
clock “L”
“H”
RxD2 ST D0 D1 D2 D3 D4 D5 D6 D7 P SP
“L”
“H”
TxD2 (Note)
“L”
180
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Serial I/O (Special Modes)
(b) Format
• Direct Format
Set the U2MR register's PRY bit to “1”, U2C0 register's UFORM bit to “0” and U2C1 register's U2LCH
bit to “0”.
• Inverse Format
Set the PRY bit to “0”, UFORM bit to “1” and U2LCH bit to “1”.
Figure 1.20.13 shows the SIM interface format.
“H”
Transfer
clcck “L”
TxD2 “H”
D0 D1 D2 D3 D4 D5 D6 D7 P
“L”
P : Even parity
“H”
TxD2
“L” D7 D6 D5 D4 D3 D2 D1 D0 P
P : Odd parity
181
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SI/O3, SI/O4
SMi2
SMi3
SMi5 LSB MSB
SOUTi
Note: i = 3, 4.
n = A value set in the SiBRG register.
182
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SI/O3, SI/O4
Description RW
Transmission/reception starts by writing transmit data to this register. After
RW
transmission/reception finishes, reception data can be read by reading this register.
Note 1: Write to this register while serial I/O is neither transmitting nor receiving.
Note 2: To receive data, set the corresponding port direction bit for SINi to “0” (input mode).
Figure 1.21.2. S3C and S4C Registers, S3BRG and S4BRG Registers, and S3TRR and S4TRR Registers
183
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SI/O3, SI/O4
184
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SI/O3, SI/O4
"H"
SI/Oi internal clock "L"
(Note 2)
SOUTi output "H"
"L"
D0 D1 D2 D3 D4 D5 D6 D7
"H"
SINi input
"L"
i= 3, 4
Note 1: This diagram applies to the case where the SiC register bits are set as follows:
SMi2=0 (SOUTi output), SMi3=1 (SOUTi output, CLKi function), SMi4=0 (transmit data output at the falling edge and receive data input at the
rising edge of the transfer clock), SMi5=0 (LSB first) and SMi6=1 (internal clock)
Note 2: When the SMi6 bit = 1 (internal clock), the SOUTi pin is placed in the high-impedance state after the transfer finishes.
Note 3: If the SMi6 bit=0 (internal clock), the serial I/O starts sending or receiving data a maximum of 1.5 transfer clock cycles after writing to the
SiTRR register.
CLKi (Note 2)
SINi D0 D1 D2 D3 D4 D5 D6 D7
SOUTi D0 D1 D2 D3 D4 D5 D6 D7
CLKi (Note 3)
SINi D0 D1 D2 D3 D4 D5 D6 D7
SOUTi D0 D1 D2 D3 D4 D5 D6 D7
i=3 and 4
Note 1: This diagram applies to the case where the SiC register bits are set as follows:
SMi5=0 (LSB first) and SMi6=1 (internal clock)
Note 2: When the SMi6 bit=1 (internal clock), a high level is output from the CLKi
pin if not transferring data.
Note 3: When the SMi6 bit=1 (internal clock), a low level is output from the CLKi
pin if not transferring data.
185
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
SI/O3, SI/O4
SMi7 bit
Set the SMi3 bit to “0”
(SOUTi pin functions as an I/O port)
SMi3 bit
Note 1: This diagram applies to the case where the SiC register bits are set as follows:
Serial transmit/reception starts
SMi2=0 (SOUTi output), SMi5=0 (LSB first) and SMi6=0 (external clock)
Note 2: SOUTi can only be initialized when input on the CLKi pin is in the high state if the SiC
register’s SMi4 bit = 0 (transmit data output at the falling edge of the transfer clock) or
in the low state if the SMi4 bit = 1 (transmit data output at the rising edge of the
transfer clock).
Note 3: If the SMi6 bit = 1 (internal clock) or if the SMi2 bit = 1 (SOUT output disabled),
this output goes to the high-impedance state.
186
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
A-D Converter
The microcomputer contains one A-D converter circuit based on 10-bit successive approximation method
configured with a capacitive-coupling amplifier. The analog inputs share the pins with P100 to P107, P95,
___________
P96, P00 to P07, and P20 to P27. Similarly, ADTRG input shares the pin with P97. Therefore, when using
these inputs, make sure the corresponding port direction bits are set to “0” (= input mode).
When not using the A-D converter, set the VCUT bit to “0” (= Vref unconnected), so that no current will flow
from the VREF pin into the resistor ladder, helping to reduce the power consumption of the chip.
The A-D conversion result is stored in the ADi register bits for ANi, AN0i, and AN2i pins (i = 0 to 7).
Table 1.22.1 shows the performance of the A-D converter. Figure 1.22.1 shows the block diagram of the
A-D converter, and Figures 1.22.2 and 1.22.3 show the A-D converter-related registers.
Table 1.22.1. Performance of A-D Converter
Item Performance
Method of A-D conversion Successive approximation (capacitive coupling amplifier)
Analog input voltage (Note 1) 0V to AVCC (VCC1)
Operating clock φAD (Note 2) fAD/divide-by-2 of fAD/divide-by-3 of fAD/divide-by-4 of fAD/divide-by-6 of
fAD/divide-by-12 of fAD
Resolution 8-bit or 10-bit (selectable)
Integral nonlinearity error When AVCC = VREF = 5V
• With 8-bit resolution: ±2LSB
• With 10-bit resolution
- AN0 to AN7 input : ±3LSB
- AN00 to AN07 input and AN20 to AN27 input : ±7LSB
- ANEX0 and ANEX1 input (including mode in which external operation
amp is connected) : ±7LSB
When AVCC = VREF = 3.3V
• With 8-bit resolution: ±2LSB
• With 10-bit resolution
- AN0 to AN7 input : ±5LSB
- AN00 to AN07 input and AN20 to AN27 input : ±7LSB
- ANEX0 and ANEX1 input (including mode in which external operation
amp is connected) : ±7LSB
Operating modes One-shot mode, repeat mode, single sweep mode, repeat sweep mode 0,
and repeat sweep mode 1
Analog input pins 8 pins (AN0 to AN7) + 2 pins (ANEX0 and ANEX1) + 8 pins (AN00 to AN07)
+ 8 pins (AN20 to AN27)
A-D conversion start condition • Software trigger
The ADCON0 register's ADST bit is set to “1” (A-D conversion starts)
• External trigger___________
(retriggerable)
Input on the ADTRG pin changes state from high to low after the ADST bit is
set to “1” (A-D conversion starts)
Conversion speed per pin • Without sample and hold function
8-bit resolution: 49 φAD cycles, 10-bit resolution: 59 φAD cycles
• With sample and hold function
8-bit resolution: 28 φAD cycles, 10-bit resolution: 33 φAD cycles
Note 1: Does not depend on use of sample and hold function.
Note 2: Operation clock frequency (φAD frequency) must be 10 MHz or less.
A case without sample and hold function turn (φAD frequency) into 250kHz or more .
A case with the sample and hold function turn (φAD frequency) into 1MHz or more.
Note 3: If VCC2 < VCC1, do not use AN00 to AN07 and AN20 to AN27 as analog input pins.
187
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
TRG=0
Software trigger
A-D trigger
ADTRG
TRG=1
VREF
VCUT=0 Resistor ladder
AVSS
VCUT=1
ADCON0 register
PM01 to PM00=002
ADGSEL1 to ADGSEL0=112
OPA1 to OPA0=112 OPA1 to OPA0
ANEX0 OPA0=1 =012
OPA1=1 OPA1=1
ANEX1
Note: Port P0 group (AN00 to AN07) can be used as analog input pins even when PM01
to PM00 bits are set to “012” (memory expansion mode) and PM05 to PM04 bits are
set to “112” (multiplex bus allocated to the entire CS space).
188
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CH0 Analog input pin select bit Function varies with each operation mode RW
CH1 RW
CH2 RW
b4 b3
A-D operation mode 0 0 : One-shot mode
MD0 RW
select bit 0 0 1 : Repeat mode
1 0 : Single sweep mode
MD1 1 1 : Repeat sweep mode 0 or RW
Repeat sweep mode 1
TRG Trigger select bit 0 : Software trigger
1 : ADTRG trigger RW
CKS0 Frequency select bit 0 See Note 3 for the ADCON2 register RW
Note: If the ADCON0 register is rewritten during A-D conversion, the conversion result will be indeterminate.
SCAN1
RW
CKS1 Frequency select bit 1 See Note 3 for the ADCON2 register RW
OPA1 RW
Note 1: If the ADCON1 register is rewritten during A-D conversion, the conversion result will be indeterminate.
Note 2: If the VCUT bit is reset from “0” (Vref unconnected) to “1” (Vref connected), wait for 1 µs or more before starting
A-D conversion.
189
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Function
When the ADCON1 register's When the ADCON1 register's RW
BITS bit is “1” (10-bit mode) BITS bit is “0” (8-bit mode)
Eight low-order bits of A-D conversion result
A-D conversion result RO
190
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
191
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CKS1 Frequency select bit1 See Note 3 for the ADCON2 register RW
192
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
193
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CKS0 Frequency select bit 0 See Note 3 for the ADCON2 register RW
Note 1: If the ADCON0 register is rewritten during A-D conversion, the conversion result will be indeterminate.
Note 2: AN00 to AN07, and AN20 to AN27 can be used in the same way as AN0 to AN7. Use the ADCON2 register’s
ADGSEL1 to ADGSEL0 bits to select the desired pin. However, if VCC2 < VCC1, do not use AN00 to AN07 and
AN20 to AN27 as analog input pins.
Note 3: After rewriting the MD1 to MD0 bits, set the CH2 to CH0 bits over again using another instruction.
CKS1 Frequency select bit 1 See Note 3 for the ADCON2 register RW
194
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
195
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CH2 RW
b4 b3
MD0 A-D operation mode RW
1 0 : Single sweep mode
select bit 0
MD1 RW
Figure 1.22.6. ADCON0 Register and ADCON1 Register (Single Sweep Mode)
196
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
197
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CH2 RW
b4 b3
MD0 A-D operation mode RW
1 1 : Repeat sweep mode 0 or
select bit 0 Repeat sweep mode 1
MD1 RW
CKS0 Frequency select bit 0 See Note 3 for the ADCON2 register RW
Note: If the ADCON0 register is rewritten during A-D conversion, the conversion result will be indeterminate.
CKS1 Frequency select bit 1 See Note 3 for the ADCON2 register RW
Figure 1.22.7. ADCON0 Register and ADCON1 Registers (Repeat Sweep Mode 0)
198
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
199
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
CH2 RW
b4 b3
MD0 A-D operation mode 1 1 : Repeat sweep mode 0 or RW
select bit 0 Repeat sweep mode 1
MD1 RW
TRG Trigger select bit 0 : Software trigger RW
1 : ADTRG trigger
A-D conversion start flag 0 : A-D conversion disabled
ADST RW
1 : A-D conversion started
CKS0 Frequency select bit 0 See Note 3 for the ADCON2 register RW
Note: If the ADCON0 register is rewritten during A-D conversion, the conversion result will be indeterminate.
SCAN0 A-D sweep pin select bit When repeat sweep mode 1 is selected
b1 b0 RW
0 0 : AN0 (1 pin)
0 1 : AN0, AN1 (2 pins)
SCAN1 1 0 : AN0 to AN2 (3 pins) RW
1 1 : AN0 to AN3 (4 pins) (Note 2)
A-D operation mode Set to “1” when repeat sweep mode 1 is
MD2 select bit 1 RW
selected
CKS1 Frequency select bit 1 See Note 3 for the ADCON2 register RW
Figure 1.22.8. ADCON0 Register and ADCON1 Register (Repeat Sweep Mode 1)
200
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Note: AN0i and AN2i can be used the same as ANi. However, if VCC2 < VCC1, do not use AN0i and AN2i as
analog input pins.
Microcomputer
ADCON2 register's ADGSEL1 to ADGSEL0 bits=002
AN0
AN1 Resistor ladder
AN2
AN3
AN4
AN5 Successive conversion
AN6 register
AN7
ADGSEL1 to ADGSEL0 bits=102
AN00
AN01
AN02
AN03
AN04
AN05
AN06
AN07
ADGSEL1 to ADGSEL0 bits=112
AN20
AN21
AN22
AN23
AN24
AN25
AN26
AN27
ANEX0
ANEX1
Comparator
External op-
amp
201
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
A-D Converter
Microcomputer
Sensor equivalent
circuit
R0 R (7.8kΩ)
VIN
C (1.5pF) Sampling time
3
VC Sample-and-hold function enabled:
fAD
2
Sample-and-hold function disabled:
fAD
Figure 1.22.10. Analog Input Pin and External Sensor Equivalent Circuit
202
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
D-A Converter
D-A Converter
This is an 8-bit, R-2R type D-A converter. These are two independent D-A converters.
D-A conversion is performed by writing to the DAi register (i = 0 to 1). To output the result of conversion, set
the DACON register’s DAiE bit to “1” (output enabled). Before D-A conversion can be used, the correspond-
ing port direction bit must be cleared to “0” (input mode). Setting the DAiE bit to “1” removes a pull-up from
the corresponding port.
Output analog voltage (V) is determined by a set value (n : decimal) in the DAi register.
V = VREF X n/ 256 (n = 0 to 255)
VREF : reference voltage
Table 1.23.1 lists the performance of the D-A converter. Figure 1.23.1 shows the block diagram of the D-A
converter. Figure 1.23.2 shows the D-A converter related registers. Figure 1.23.3 shows the D-A converter
equivalent circuit.
DA0 register
DA1 register
203
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
D-A Converter
Function RW
R W
Output value of D-A conversion RW
Note: When not using the D-A converter, clear the DAiE bit (i = 0 to 1) to “0” (output disabled) to reduce the
unnecessary current consumption in the chip and set the DAi register to ‘0016’ to prevent current from
flowing into the R-2R resistor ladder.
DAiE bit
“0”
R R R R R R R R 2R
DAi
“1”
2R 2R 2R 2R 2R 2R 2R 2R
MSB LSB
DAi register
“0” “1”
AVSS
VREF
Note: The above diagram shows an instance in which the DA0 register is assigned “2A16”.
204
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CRC Calculation
CRC Calculation
The Cyclic Redundancy Check (CRC) operation detects an error in data blocks. The microcomputer uses
a generator polynomial of CRC_CCITT (X16 + X12 + X5 + 1) to generate CRC code.
The CRC code consists of 16 bits which are generated for each data block in given length, separated in 8
bit units. After the initial value is set in the CRCD register, the CRC code is set in that register each time one
byte of data is written to the CRCIN register. CRC code generation for one-byte data is finished in two
cycles.
Figure 1.24.1 shows the block diagram of the CRC circuit. Figure 1.24.2 shows the CRC-related registers.
Figure 1.24.3 shows the calculation example using the CRC operation.
AAAAA AAAAAAA
Data bus low-order
AAAAAAAAAAA
Eight low-order bits Eight high-order bits
AAAAAAAAAAA
AAAAAAAAAAA
CRCD register
AAAAAAAAAAA
x16 + x12 + x5 + 1
AAAAAA
AAAAAA CRCIN register
205
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CRC Calculation
Setup procedure and CRC operation when generating CRC code “80C416”
b15 b0
(2) Write 000016 (initial value) CRCD register
b7 b0
(3) Write 0116 CRCIN register
Two cycles later, the CRC code for “8016,” i.e.,
918816, has its bit positions reversed to become
“118916” which is stored in the CRCD register.
b15 b0
b7 b0
b15 b0
0A4116 CRCD register
CRC code
The value “0001 0001 1000 10012 (118916)” derived from the remainder “1001 0001 1000 10002 (918816)” by
reversing its bit positions may be read from the CRCD register.
If operation (4) above is performed subsequently, the value written to the CRCIN register “2316 (001000112)” has its bit
positions reversed to become “110001002. The value “1100 0100 0000 0000 0000 00002” derived from that by adding
16 digits and the remainder in (3) “1001 0001 1000 10002” which is left in the CRCD register are added, the result of
which is divided by the generator polynomial using modulo-2 arithmetic.
The value “0000 1010 0100 00012 (0A4116)” derived from the remainder by reversing its bit positions may be read
from the CRCD register.
206
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
207
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pull-up selection
Direction register
P00 to P07, P20 to P27 (inside dotted-line
included)
Analog input
Pull-up selection
(Note 1)
Pull-up selection
Direction register
P15 to P17
(Note 1)
Pull-up selection
Direction
P57, P60, P64, P73 to P76, register
"1"
P80, P81, P90, P92
Output
Data bus Port latch
(Note 1)
208
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pull-up selection
Direction
P61, P65, P72 register
"1"
Output
Data bus Port latch
Switching (Note 1)
between
CMOS and
Nch
Pull-up selection
P82 to P84
Direction register
(Note 1)
Pull-up selection
Direction register
P55, P77, P91, P97
(Note 1)
209
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pull-up selection
Direction register
P62, P66
(Note 1)
Switching
between
CMOS and Nch
Pull-up selection
Direction register
P63, P67
“1”
Output
Data bus Port latch
(Note 1)
P85
Data bus
Direction register
P70, P71
“1”
Output
Data bus Port latch
(Note 2)
210
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pull-up selection
P100 to P103
(inside dotted-line
Direction register
not included)
P104 to P107
(inside dotted-line
included)
Data bus Port latch
(Note)
Analog input
Input to respective peripheral functions
Pull-up selection
D-A output enabled
Direction register
P93, P94
Analog output
D-A output enabled
Pull-up selection
Output
Data bus Port latch
(Note)
Analog input
Pull-up selection
Direction register
P95 “1”
Output
Data bus Port latch
(Note)
Analog input
211
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pull-up selection
Direction register
P87
fc
Rf
Pull-up selection
Rd
Direction register
P86
"1"
Output
Data bus Port latch
(Note)
BYTE (Note 2)
BYTE signal input
(Note 1)
CNVSS (Note 2)
CNVSS signal input
(Note 1)
RESET
RESET signal input
(Note 1)
212
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
213
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Port P8 register
b7 b6 b5 b4 b3 b2 b1 b0
Symbol Address After reset
P8 03F016 Indeterminate
214
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note 1: The pin for which this bit is “1” (pulled high) and the direction bit is “0” (input mode) is pulled high.
Note 2: If the PU37 bit is set to “0” (unusable), the P11 to P14 pins are placed in the high-impedance state and
the P11 to P14 registers are cleared to “0”.
215
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
216
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
217
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Ports P0 to P7, P80 to P84, After setting for input mode, connect every pin to VSS via a resistor(pull-down);
P86 to P87, P9 to P14 or after setting for output mode, leave these pins open. (Note 1, 2 ,3)
Table 1.25.2. Unassigned Pin Handling in Memory Expansion Mode and Microprocessor Mode
Pin name Connection
Ports P0 to P7, P80 to P84, After setting for input mode, connect every pin to VSS via a resistor (pull-down);
P86 to P87, P9 to P14 or after setting for output mode, leave these pins open. (Note 1, 2, 3, 4)
P45 / CS1 to P47 / CS3 Connect to VCC via a resistor (pulled high) by setting the PD4 register’s
corresponding direction bit for CSi (i=1 to 3) to “0” (input mode) and the CSR
register’s CSi bit to “0” (chip select disabled).
Note 1: When setting the port for output mode and leave it open, be aware that the port remains in input mode until
it is switched to output mode in a program after reset. For this reason, the voltage level on the pin becomes
indeterminate, causing the power supply current to increase while the port remains in input mode.
Furthermore, by considering a possibility that the contents of the direction registers could be changed by
noise or noise-induced runaway, it is recommended that the contents of the direction registers be
periodically reset in software, for the increased reliability of the program.
Note 2: Make sure the unused pins are processed with the shortest possible wiring from the microcomputer pins
(within 2 cm).
Note 3: If the CNVSS pin has the VSS level applied to it, these pins are set for input ports until the processor mode
is switched over in a program after reset. For this reason, the voltage levels on these pins become
indeterminate, causing the power supply current to increase while they remain set for input ports.
Note 4: When the ports P70 and P71 are set for output mode, make sure a low-level signal is output from the pins.
The ports P70 and P71 are N-channel open-drain outputs.
Note 5: With external clock input to XIN pin.
Note 6: If the PM07 bit in the PM0 register is set to “1” (BCLK not output), connect this pin to VCC2 via a resistor
(pulled high).
Note 7: When not using all of the P11 to P14, the P11 to P14 pins may be left open by setting the PUR3 register’s
PU37 bit to “0” (P11 to P14 unusable) without causing any problem.
218
Renesas microcomputers
M16C / 62P Group
Programmable I/O Ports SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Microcomputer Microcomputer
Port P0 to P14 (except for P85) Port P6 to P14 (except for P85)
(Note 2) (Note 2)
(Input mode) (Input mode)
· ·· · ··
· ·
· · · ·
(Input mode) (Input mode)
(Output mode) Open (Output mode) Open VCC1
VCC1 VCC2
NMI
NMI Port P45 / CS1 BHE
XOUT Open to P47 / CS3 HLDA
ALE Open
VCC1
XOUT VCC2
AVCC BCLK (Note)
BYTE HOLD VCC1
AVSS RDY
VREF AVCC
AVSS
VREF
VSS VSS
In single-chip mode In memory expansion mode or
in microprocessor mode
Note 1: If the PM0 register’s PM07 bit is set to “1” (BCLK not output), connect this pin to VCC2 via a resistor
(pulled high).
Note 2: When not using all of the P11 to P14, the P11 to P14 pins may be left open by setting the PUR3
register’s PU37 bit to “0” (P11 to P14 unusable) without causing any problem.
219
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics
Electrical Characteristics
Table 1.26.1. Absolute Maximum Ratings
Symbol Parameter Condition Rated value Unit
VCC1, VCC2 Supply voltage VCC1=AVCC -0.3 to 6.5 V
VCC2 Supply voltage VCC2 -0.3 to VCC1+0.1 V
AVCC Analog supply voltage VCC1=AVCC -0.3 to 6.5 V
Input RESET, CNVSS, BYTE,
voltage P60 to P67, P72 to P77, P80 to P87,
P90 to P97, P100 to P107, P110 to P117, -0.3 to VCC1+0.3 V
P140, P141,
VI VREF, XIN
P00 to P07, P10 to P17, P20 to P27,
P30 to P37, P40 to P47, P50 to P57, -0.3 to VCC2+0.3 V
P120 to P127, P130 to P137
P70, P71 -0.3 to 6.5 V
Output P60 to P67, P72 to P77, P80 to P84,
voltage P86, P87, P90 to P97, P100 to P107,
-0.3 to VCC1+0.3 V
P110 to P117, P140, P141,
XOUT
VO
P00 to P07, P10 to P17, P20 to P27,
P30 to P37, P40 to P47, P50 to P57, -0.3 to VCC2+0.3 V
P120 to P127, P130 to P137
P70, P71 -0.3 to 6.5 V
Pd Power dissipation Topr=25 C 300 mW
Topr Operating ambient temperature -20 to 85 / -40 to 85 C
Tstg Storage temperature -65 to 150 C
220
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics
P60 to P67, P70 to P77, P80 to P87, P90 to P97, P100 to P107,
V
P110 to P117, P140, P141, 0 0.2VCC1
XIN, RESET, CNVSS, BYTE
HIGH peak output P00 to P07, P10 to P17, P20 to P27,P30 to P37,
I OH (peak) current P40 to P47, P50 to P57, P60 to P67,P72 to P77, -10.0 mA
P80 to P84,P86,P87,P90 to P97,P100 to P107,
P110 to P117, P120 to P127, P130 to P137, P140, P141
HIGH average P00 to P07, P10 to P17, P20 to P27,P30 to P37,
I OH (avg) output current P40 to P47, P50 to P57, P60 to P67,P72 to P77, -5.0 mA
P80 to P84,P86,P87,P90 to P97,P100 to P107,
P110 to P117, P120 to P127, P130 to P137, P140, P141
LOW peak output P00 to P07, P10 to P17, P20 to P27,P30 to P37,
I OL (peak) current P40 to P47, P50 to P57, P60 to P67,P70 to P77, 10.0 mA
P80 to P84,P86,P87,P90 to P97,P100 to P107,
P110 to P117, P120 to P127, P130 to P137, P140, P141
LOW average P00 to P07, P10 to P17, P20 to P27,P30 to P37,
I OL (avg) output current P40 to P47, P50 to P57, P60 to P67,P70 to P77, 5.0 mA
P80 to P84,P86,P87,P90 to P97,P100 to P107,
P110 to P117, P120 to P127, P130 to P137, P140, P141
Main clock input oscillation frequency VCC1=3.0 to 5.5V 0 16 MHz
f (XIN)
(Note 4) VCC1=2.7 to 3.0V 0 20 X VCC1-44 MHz
f (XCIN) Sub-clock oscillation frequency 32.768 50 kHz
f (Ring) Ring oscillation frequency 1 MHz
f (PLL) PLL clock oscillation frequency (Note 4) VCC1=3.0 to 5.5V 10 24 MHz
VCC1=2.7 to 3.0V 10 46.67 X VCC1- MHz
116
f (BCLK) CPU operation clock 0 24 MHz
TSU(PLL) PLL frequency synthesizer stabilization wait time VCC1=5.0V 20 ms
VCC1=3.0V 50 ms
Note 1: Referenced to VCC = VCC1 = VCC2 = 2.7 to 5.5V at Topr = -20 to 85 °C / -40 to 85 °C unless otherwise specified.
Note 2: The mean output current is the mean value within 100ms.
Note 3: The total IOL (peak) for ports P0, P1, P2, P86, P87, P9, P10, P11, P140 and P141 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 P0, P1, and P2
must be -40mA max. The total IOH (peak) for ports P3, P4, P5, P12, and P13 must be -40mA max. The total IOH (peak) for
ports P6, P7, and P80 to P84 must be -40mA max. The total IOH (peak) for ports P86, P87, P9, P10, P11, P140, and P141
must be -40mA max.
Note 4: Relationship between main clock oscillation frequency, PLL clock oscillation frequency and supply voltage.
f(XIN) operating maximum frequency [MHZ]
AAAAAA
Main clock input oscillation frequency PLL clock oscillation frequency
46.67 x VCC1-116MHZ
AAAAAA
20 x VCC1-44MHZ 24.0
16.0
AAAAAA
AAAAAA
AAAAAA
AAAAAA
10.0
AAAAAA
AAAAAA
10.0
AAAAAA
0.0
AAAAAA
AAAAAA
2.7 3.0 5.5
0.0
2.7 3.0 5.5
VCC1[V] (main clock: no division) VCC1[V] (PLL clock oscillation)
221
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics
222
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics
Table 1.26.5. Flash Memory Version Electrical Characteristics (Note 1) 100 times guarantee article
Symbol Standard
Parameter Measuring condition Unit
Min. Typ. Max
– Word program time 30 200 µs
– Block erase time 1 4 s
– Erase all unlocked blocks time 1Xn 4Xn s
– Lock bit program time 30 200 µs
tPS Flash memory circuit stabilization wait time 15 µs
Note 1: Referenced to VCC1=4.5 to 5.5V, 3.0 to 3.6V at Topr = 0 to 60 °C unless otherwise specified.
Note 2: n denotes the number of block erases.
Table 1.26.6. Flash Memory Version Electrical Characteristics (Note 1) 10000 times guarantee article
(block1 and block A(Note 3))
Symbol Standard
Parameter Measuring condition Unit
Min. Typ. Max
– Word program time 30 T.B.D µs
– Block erase time 1 T.B.D s
– Erase all unlocked blocks time 1Xn T.B.D s
– Lock bit program time 30 T.B.D µs
tPS Flash memory circuit stabilization wait time 15 µs
Note 1: Referenced to VCC1=4.5 to 5.5V, 3.0 to 3.6V at Topr = 0 to 60 °C unless otherwise specified.
Note 2: n denotes the number of block erases.
Note 3: Shown here are the rated values for block 1 and block A when they have been programmed and erased more
than 1,000 times. The rated values up to 1,000 times of programming and erasure are the same for all blocks
as those products that are guaranteed of 100 times of programming and erasure.
Table 1.26.7. Flash Memory Version Program/Erase Voltage and Read Operation Voltage Characteristics
(at Topr = 0 to 60oC)
Flash program, erase voltage Flash read operation voltage
VCC1 = 3.3 V ± 0.3 V or 5.0 V ± 0.5 V VCC1=2.7 to 5.5 V
223
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics
VCC1 Vdet3r
td(S-R)
Interrupt for
stop mode
release
CPU clock
td(R-S)
224
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Table 1.26.10. Electrical Characteristics (Note 1)
Symbol Parameter Measuring condition Standard
Unit
Min. Typ. Max.
HIGH output P60 to P67,P72 to P77,P80 to P84,P86,P87,P90 to P97,
voltage IOH=-5mA VCC1-2.0 VCC1
P100 to P107,P110 to P117,P140,P141
VOH V
P00 to P07,P10 to P17,P20 to P27,P30 to P37,
IOH=-5mA(Note 2) VCC2-2.0 VCC2
P40 to P47,P50 to P57,P120 to P127,P130 to P137
HIGH output P60 to P67,P72 to P77,P80 to P84,P86,P87,P90 to P97, VCC1-0.3
IOH=-200µA VCC1
voltage P100 to P107,P110 to P117,P140,P141
VOH V
P00 to P07,P10 to P17,P20 to P27,P30 to P37,
IOH=-200µA(Note 2) VCC2-0.3
P40 to P47,P50 to P57,P120 to P127,P130 to P137 VCC2
HIGHPOWER IOH=-1mA VCC1-2.0 VCC1
HIGH output voltage XOUT V
VOH
LOWPOWER IOH=-0.5mA VCC1-2.0 VCC1
HIGH output voltage XCOUT HIGHPOWER With no load applied 2.5 V
LOWPOWER With no load applied 1 .6
LOW output P60 to P67,P70 to P77,P80 to P84,P86,P87,P90 to P97,
IOL=5mA 2 .0
voltage P100 to P107,P110 to P117,P140,P141
VOL V
P00 to P07,P10 to P17,P20 to P27,P30 to P37,
IOL=5mA(Note 2) 2 .0
P40 to P47,P50 to P57,P120 to P127,P130 to P137
LOW output P6 0 t o P6 7,P 7 0 t o P 7 7, P8 0 t o P8 4 ,P8 6 ,P 8 7,P9 0 t o P9 7 ,
IOL=200µA 0.45
voltage P100 to P107,P110 to P117,P140,P141
VOL V
P00 to P07,P10 to P17,P20 to P27,P30 to P37,
IOL=200µA(Note 2) 0.45
P40 to P47,P50 to P57,P120 to P127,P130 to P137
HIGHPOWER IOL=1mA 2 .0
VOL LOW output voltage XOUT V
LOWPOWER IOL=0.5mA 2 .0
HIGHPOWER With no load applied 0
LOW output voltage XCOUT V
LOWPOWER With no load applied 0
Hysteresis HOLD, RDY, TA0IN to TA4IN,
TB0IN to TB5IN, INT0 to INT5, NMI,
VT+-VT-
ADTRG, CTS0 to CTS2, SCL, SDA, 0.2 1.0 V
CLK0 to CLK4,TA2OUT to TA4OUT,
KI0 to KI3, RxD0 to RxD2, SIN3, SIN4
VT+-VT- Hysteresis RESET 0.2 2.2 V
HIGH input P00 to P07,P10 to P17,P20 to P27,P30 to P37,
current P40 to P47,P50 to P57,P60 to P67,P70 to P77,
II H P80 to P87,P90 to P97,P100 to P107,P110 to P117, VI=5V 5 .0 µA
P120 to P127,P130 to P137,P140,P141,
XIN, RESET, CNVss, BYTE
Note 1: Referenced to VCC=VCC1=VCC2=4.2 to 5.5V, VSS=0V at Topr = -20 to 85 °C / -40 to 85 °C, f(BCLK)=24MHz unless otherwise specified.
Note 2: Where the product is used at VCC1 = 5 V and VCC2 = 3 V, refer to the 3 V version value for the pin specified value on the VCC2 port side.
225
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Table 1.26.11. Electrical Characteristics (2) (Note 1)
Symbol Parameter Measuring condition Standard
Unit
Min. Typ. Max.
In single-chip mode, the output Mask ROM f(BCLK)=24MHz,
14 20 mA
pins are open and other pins are No division, PLL operation
VSS No division, Ring oscillation
1 mA
Note 1: Referenced to VCC=VCC1=VCC2=4.2 to 5.5V, VSS=0V at Topr = -20 to 85 °C / -40 to 85 °C, f(BCLK)=24MHz unless otherwise specified.
Note 2: With one timer operated using fC32.
Note 3: This indicates the memory in which the program to be executed exists.
Note 4: Idet is dissipation current when the following bit is set to “1” (detection circuit enabled).
Idet4: VC27 bit of VCR2 register
Idet3: VC26 bit of VCR2 register
Idet2: VC25 bit of VCR2 register
226
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Timing Requirements
(VCC1 = VCC2 = 5V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
227
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Timing Requirements
(VCC1 = VCC2 = 5V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
Table 1.26.16. 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.26.17. 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
Table 1.26.18. Timer A Input (Counter Increment/decrement Input in Event Counter Mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(UP) TAiOUT input cycle time 2000 ns
tw(UPH) TAiOUT input HIGH pulse width 1000 ns
tw(UPL) TAiOUT input LOW pulse width 1000 ns
tsu(UP-TIN) TAiOUT input setup time 400 ns
th(TIN-UP) TAiOUT input hold time 400 ns
Table 1.26.19. Timer A Input (Two-phase Pulse Input in Event Counter Mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(TA) TAiIN input cycle time 800 ns
tsu(TAIN-TAOUT) TAiOUT input setup time 200 ns
tsu(TAOUT-TAIN) TAiIN input setup time 200 ns
228
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Timing Requirements
(VCC1 = VCC2 = 5V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
_______
Table 1.26.25. External Interrupt INTi Input
Standard
Symbol Parameter Unit
Min. Max.
tw(INH) INTi input HIGH pulse width 250 ns
tw(INL) INTi input LOW pulse width 250 ns
229
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Switching Characteristics
(VCC1 = VCC2 = 5V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
Table 1.26.26. Memory Expansion and Microprocessor Modes (for setting with no wait)
Measuring condition
Standard
Symbol Parameter Min. Max. Unit
td(BCLK-AD) Address output delay time 25 ns
th(BCLK-AD) Address output hold time (refers to BCLK) 4 ns
th(RD-AD) Address output hold time (refers to RD) 0 ns
th(WR-AD) Address output hold time (refers to WR) (Note 2) ns
td(BCLK-CS) Chip select output delay time 25 ns
th(BCLK-CS) Chip select output hold time (refers to BCLK) 4 ns
td(BCLK-ALE) ALE signal output delay time 25 ns
th(BCLK-ALE) ALE signal output hold time –4 ns
Figure 1.26.1
td(BCLK-RD) RD signal output delay time 25 ns
th(BCLK-RD) RD signal output hold time 0 ns
td(BCLK-WR) WR signal output delay time 25 ns
th(BCLK-WR) WR signal output hold time 0 ns
td(BCLK-DB) Data output delay time (refers to BCLK) 40 ns
th(BCLK-DB) Data output hold time (refers to BCLK)(Note 3) 4 ns
td(DB-WR) Data output delay time (refers to WR) (Note 1) ns
th(WR-DB) Data output hold time (refers to WR)(Note 3) (Note 2) ns
Note 1: Calculated according to the BCLK frequency as follows:
0.5 X 109
– 40
f(BCLK) [ns] f(BCLK) is 12.5MHZ or less.
Note 2: Calculated according to the BCLK frequency as follows:
0.5 X 109
– 10
f(BCLK) [ns]
Note 3: This standard value shows the timing when the output is off,
and does not show hold time of data bus.
Hold time of data bus varies with capacitor volume and pull-up
R
(pull-down) resistance value.
Hold time of data bus is expressed in DBi
t = –CR X ln (1 – VOL / VCC2) C
by a circuit of the right figure.
For example, when VOL = 0.2VCC2, C = 30pF, R = 1kΩ, hold time
of output “L” level is
t = – 30pF X 1kΩ X ln (1 – 0.2VCC2 / VCC2)
= 6.7ns.
P0
P1
P2 30pF
P3
P4
P5
P6
P7
P8
P9
P10
230
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Switching Characteristics
(VCC1 = VCC2 = 5V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
Measuring condition
Standard
Symbol Parameter Min. Max. Unit
td(BCLK-AD) Address output delay time 25 ns
th(BCLK-AD) Address output hold time (refers to BCLK) 4 ns
th(RD-AD) Address output hold time (refers to RD) 0 ns
th(WR-AD) Address output hold time (refers to WR) (Note 2) ns
td(BCLK-CS) Chip select output delay time 25 ns
th(BCLK-CS) Chip select output hold time (refers to BCLK) 4 ns
td(BCLK-ALE) ALE signal output delay time 25 ns
th(BCLK-ALE) ALE signal output hold time Figure 1.26.1 –4 ns
td(BCLK-RD) RD signal output delay time 25 ns
th(BCLK-RD) RD signal output hold time 0 ns
td(BCLK-WR) WR signal output delay time 25 ns
th(BCLK-WR) WR signal output hold time 0 ns
td(BCLK-DB) Data output delay time (refers to BCLK) 40 ns
th(BCLK-DB) Data output hold time (refers to BCLK)(Note 3) 4 ns
td(DB-WR) Data output delay time (refers to WR) (Note 1) ns
th(WR-DB) Data output hold time (refers to WR)(Note 3) (Note 2) ns
Note 1: Calculated according to the BCLK frequency as follows:
(n–0.5) X 109 n is “1” for 1-wait setting, “2” for 2-wait
– 40
f(BCLK) [ns] setting and “3” for 3-wait setting.
When n=1, f(BCLK) is 12.5MHZ or less.
Note 3: This standard value shows the timing when the output is off,
and does not show hold time of data bus.
Hold time of data bus varies with capacitor volume and pull-up
R
(pull-down) resistance value.
Hold time of data bus is expressed in DBi
t = –CR X ln (1 – VOL / VCC2) C
by a circuit of the right figure.
For example, when VOL = 0.2VCC2, C = 30pF, R = 1kΩ, hold time
of output “L” level is
t = – 30pF X 1kΩ X ln (1 – 0.2VCC2 / VCC2)
= 6.7ns.
231
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Switching Characteristics
(VCC1 = VCC2 = 5V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
232
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
tc(TA)
tw(TAH)
TAiIN input
tw(TAL)
tc(UP)
tw(UPH)
TAiOUT input
tw(UPL)
TAiOUT input
(Up/down input)
TAiIN input
(When count on rising
edge is selected)
TAiIN input
tsu(TAIN-TAOUT) tsu(TAIN-TAOUT)
tsu(TAOUT-TAIN)
TAiOUT input
tsu(TAOUT-TAIN)
tc(TB)
tw(TBH)
TBiIN input
tw(TBL)
tc(AD)
tw(ADL)
ADTRG input
233
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
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)
234
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(Effective for setting with wait)
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: The above pins are set to high-impedance regardless of the input level of the
BYTE pin, PM06 bit in PM0 register and PM11 bit in PM1 register.
Measuring conditions :
• VCC1=VCC2=5V
• Input timing voltage : Determined with VIL=1.0V, VIH=4.0V
• Output timing voltage : Determined with VOL=2.5V, VOH=2.5V
235
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(For setting with no wait)
Read timing
BCLK
td(BCLK-CS) th(BCLK-CS)
25ns.max 4ns.min
CSi
tcyc
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(RD-AD)
25ns.max -4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
25ns.max 0ns.min
RD
tac1(RD-DB)
(0.5 X tcyc-45)ns.max
Hi-Z
DB
tSU(DB-RD) th(RD-DB)
40ns.min 0ns.min
Write timing
BCLK
td(BCLK-CS) th(BCLK-CS)
25ns.max 4ns.min
CSi
tcyc
td(BCLK-AD) th(BCLK-AD)
25ns.max
4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(WR-AD)
25ns.max -4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
25ns.max 0ns.min
WR,WRL,
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
Hi-Z
DBi
td(DB-WR) th(WR-DB)
(0.5 X tcyc-40)ns.min (0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=5V
• Input timing voltage : VIL=0.8V, VIH=2.0V
• Output timing voltage : VOL=0.4V, VOH=2.4V
236
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(for 1-wait setting and external area access)
Read timing
BCLK
td(BCLK-CS) th(BCLK-CS)
25ns.max 4ns.min
CSi
tcyc
td(BCLK-AD)
25ns.max
th(BCLK-AD)
4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(RD-AD)
25ns.max -4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
25ns.max 0ns.min
RD
tac2(RD-DB)
(1.5 X tcyc-45)ns.max
Hi-Z
DB
th(RD-DB)
tSU(DB-RD) 0ns.min
40ns.min
Write timing
BCLK
td(BCLK-CS) th(BCLK-CS)
25ns.max 4ns.min
CSi
tcyc
td(BCLK-AD) th(BCLK-AD)
25ns.max
4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(WR-AD)
25ns.max -4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
25ns.max 0ns.min
WR,WRL,
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
Hi-Z
DBi
td(DB-WR) th(WR-DB)
(0.5 X tcyc-40)ns.min (0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=5V
• Input timing voltage : VIL=0.8V, VIH=2.0V
• Output timing voltage : VOL=0.4V, VOH=2.4V
237
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(for 2-wait setting and external area access )
Read timing
tcyc
BCLK
th(BCLK-CS)
td(BCLK-CS) 4ns.min
25ns.max
CSi
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(RD-AD)
25ns.max th(BCLK-ALE)
-4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
25ns.max 0ns.min
RD
tac2(RD-DB)
(2.5 X tcyc-45)ns.max
DBi Hi-Z
tSU(DB-RD) th(RD-DB)
40ns.min 0ns.min
Write timing
tcyc
BCLK
td(BCLK-CS) th(BCLK-CS)
4ns.min
25ns.max
CSi
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(WR-AD)
25ns.max th(BCLK-ALE) (0.5 X tcyc-10)ns.min
-4ns.min
ALE
th(BCLK-WR)
td(BCLK-WR) 0ns.min
25ns.max
WR, WRL
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
DB Hi-Z
td(DB-WR) th(WR-DB)
(1.5 X tcyc-40)ns.min (0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=5V
• Input timing voltage : VIL=0.8V, V IH=2.0V
• Output timing voltage : VOL=0.4V, V OH=2.4V
238
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(for 3-wait setting and external area access)
Read timing
tcyc
BCLK
th(BCLK-CS)
td(BCLK-CS) 4ns.min
25ns.max
CSi
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE)
25ns.max th(BCLK-ALE) th(RD-AD)
-4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
25ns.max 0ns.min
RD
tac2(RD-DB)
(3.5 X tcyc-45)ns.max
DBi Hi-Z
tSU(DB-RD) th(RD-DB)
40ns.min 0ns.min
Write timing
tcyc
BCLK
td(BCLK-CS) th(BCLK-CS)
25ns.max 4ns.min
CSi
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(WR-AD)
25ns.max th(BCLK-ALE) (0.5 X tcyc-10)ns.min
-4ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
25ns.max 0ns.min
WR, WRL
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
DB Hi-Z
td(DB-WR) th(WR-DB)
(2.5 X tcyc-40)ns.min
(0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=5V
• Input timing voltage : VIL=0.8V, VIH=2.0V
• Output timing voltage : VOL=0.4V, VOH=2.4V
239
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(For 1- or 2-wait setting, external area access and multiplex bus selection)
Read timing
BCLK
th(BCLK-CS)
td(BCLK-CS) th(RD-CS) 4ns.min
tcyc
25ns.max (0.5 X tcyc-10)ns.min
CSi
td(AD-ALE)
(0.5 X tcyc-25)ns.min th(ALE-AD)
(0.5 X tcyc-15)ns.min
ADi Address Data input Address
/DBi tdZ(RD-AD)
8ns.max th(RD-DB)
tac3(RD-DB) tSU(DB-RD) 0ns.min
(1.5 X tcyc-45)ns.max
40ns.min
td(AD-RD)
0ns.min
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(RD-AD)
25ns.max -4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
25ns.max 0ns.min
RD
Write timing
BCLK
td(BCLK-CS) th(BCLK-CS)
tcyc th(WR-CS) 4ns.min
25ns.max (0.5 X tcyc-10)ns.min
CSi
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) td(AD-WR) th(WR-AD)
25ns.max -4ns.min 0ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
25ns.max 0ns.min
WR,WRL,
WRH
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=5V
• Input timing voltage : VIL=0.8V, VIH=2.0V
• Output timing voltage : VOL=0.4V, VOH=2.4V
240
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 5V)
VCC1 = VCC2 = 5V
Memory Expansion Mode, Microprocessor Mode
(For 3-wait setting, external area access and multiplex bus selection)
Read timing
tcyc
BCLK
th(RD-CS)
(0.5 X tcyc-10)ns.min th(BCLK-CS)
td(BCLK-CS) 4ns.min
25ns.max
CSi
td(AD-ALE)
(0.5 X tcyc-25)ns.min
th(ALE-AD)
(0.5 X tcyc-15)ns.min
ADi
/DB Address Data input
tdZ(RD-AD) th(RD-DB)
td(BCLK-AD) td(AD-RD) 8ns.max tac3(RD-DB) tSU(DB-RD) 0ns.min
th(BCLK-AD)
25ns.max (2.5 X tcyc-45)ns.max 40ns.min 4ns.min
0ns.min
ADi
BHE
(no multiplex)
td(BCLK-ALE)
25ns.max th(RD-AD)
th(BCLK-ALE) (0.5 X tcyc-10)ns.min
-4ns.min
ALE
th(BCLK-RD)
td(BCLK-RD) 0ns.min
25ns.max
RD
Write timing
tcyc
AAAA
BCLK
th(WR-CS) th(BCLK-CS)
td(BCLK-CS) (0.5 X tcyc-10)ns.min
4ns.min
25ns.max
CSi
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
ADi
Address Data output
/DB
td(AD-ALE)
td(DB-WR) th(WR-DB)
(0.5 X tcyc-25)ns.min
(0.5 X tcyc-10)ns.min
(2.5 X tcyc-40)ns.min
td(BCLK-AD) th(BCLK-AD)
25ns.max 4ns.min
ADi
BHE
(no multiplex)
td(BCLK-ALE) th(BCLK-ALE)
25ns.max -4ns.min
th(WR-AD)
(0.5 X tcyc-10)ns.min
td(AD-WR)
0ns.min
ALE
th(BCLK-WR)
td(BCLK-WR) 0ns.min
25ns.max
WR, WRL
WRH
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=5V
• Input timing voltage : VIL=0.8V, VIH=2.0V
• Output timing voltage : VOL=0.4V, VOH=2.4V
241
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
Table 1.26.29. Electrical Characteristics (Note)
Measuring condition Standard
Symbol Parameter Unit
Min. Typ. Max.
HIGH output P00 to P07,P10 to P17,P20 to P27,P30 to P37,
VOH voltage P40 to P47,P50 to P57,P60 to P67,P72 to P77,
IOH=-1mA VCC-0.5 VC C V
P80 to P84,P86,P87,P90 to P97,P100 to P107,
P110 to P117,P120 to P127,P130 to P137,P140,P141
HIGHPOWER IOH=-0.1mA VCC-0.5 VC C
HIGH output voltage XOUT V
VOH LOWPOWER IOH=-50µA VCC-0.5 VC C
Note 1 : Referenced to VCC=VCC1=VCC2=2.7 to 3.3V, VSS=0V at Topr = -20 to 85 °C / -40 to 85 °C, f(BCLK)=10MHz unless otherwise specified.
Note 2 : VCC1 for the port P6 to P11 and P14, and VCC2 for the port P0 to P5 and P12 to P13.
242
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
Table 1.26.30. Electrical Characteristics (2) (Note 1)
Symbol Parameter Measuring condition Standard
Min. Typ. Max. Unit
In single-chip mode, the output Mask ROM f(BCLK)=10MHz,
8 11 mA
pins are open and other pins are No division
VSS No division, Ring oscillation 1 mA
Note 1: Referenced to VCC=VCC1=VCC2=2.7 to 3.3V, VSS=0V at Topr = -20 to 85 °C / -40 to 85 °C, f(BCLK)=10MHz unless otherwise specified.
Note 2: With one timer operated using fC32.
Note 3: This indicates the memory in which the program to be executed exists.
Note 4: Idet is dissipation current when the following bit is set to “1” (detection circuit enabled).
Idet4: VC27 bit of VCR2 register
Idet3: VC26 bit of VCR2 register
Idet2: VC25 bit of VCR2 register
243
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
Timing Requirements
(VCC1 = VCC2 = 3V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
244
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
Timing Requirements
(VCC1 = VCC2 = 3V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
Table 1.26.35. Timer A Input (External Trigger Input in One-shot Timer Mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(TA) TAiIN input cycle time 300 ns
tw(TAH) TAiIN input HIGH pulse width 150 ns
tw(TAL) TAiIN input LOW pulse width 150 ns
Table 1.26.36. Timer A Input (External Trigger Input in Pulse Width Modulation Mode)
Standard
Symbol Parameter Unit
Min. Max.
tw(TAH) TAiIN input HIGH pulse width 150 ns
tw(TAL) TAiIN input LOW pulse width 150 ns
Table 1.26.37. Timer A Input (Counter Increment/decrement Input in Event Counter Mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(UP) TAiOUT input cycle time 3000 ns
tw(UPH) TAiOUT input HIGH pulse width 1500 ns
tw(UPL) TAiOUT input LOW pulse width 1500 ns
tsu(UP-TIN) TAiOUT input setup time 600 ns
th(TIN-UP) TAiOUT input hold time 600 ns
Table 1.26.38. Timer A Input (Two-phase Pulse Input in Event Counter Mode)
Standard
Symbol Parameter Unit
Min. Max.
tc(TA) TAiIN input cycle time 2 µs
tsu(TAIN -TAOUT ) TAiOUT input setup time 500 ns
tsu(TAOUT -TAIN) TAiIN input setup time 500 ns
245
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
Timing Requirements
(VCC1 = VCC2 = 3V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
_______
Table 1.26.44. External Interrupt INTi Input
Standard
Symbol Parameter Unit
Min. Max.
tw(INH) INTi input HIGH pulse width 380 ns
tw(INL) INTi input LOW pulse width 380 ns
246
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
VCC1 ≥ VCC2 = 3V
Switching Characteristics
(VCC1 = VCC2 = 3V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
Table 1.26.45. Memory Expansion, Microprocessor Modes (for setting with no wait)
Measuring condition
Standard
Symbol Parameter Min. Max. Unit
td(BCLK-AD) Address output delay time 30 ns
th(BCLK-AD) Address output hold time (refers to BCLK) 4 ns
th(RD-AD) Address output hold time (refers to RD) 0 ns
th(WR-AD) Address output hold time (refers to WR) (Note 2) ns
td(BCLK-CS) Chip select output delay time 30 ns
th(BCLK-CS) Chip select output hold time (refers to BCLK) 4 ns
td(BCLK-ALE) ALE signal output delay time 30 ns
th(BCLK-ALE) ALE signal output hold time Figure 1.26.11 –4 ns
td(BCLK-RD) RD signal output delay time 30 ns
th(BCLK-RD) RD signal output hold time 0 ns
td(BCLK-WR) WR signal output delay time 30 ns
th(BCLK-WR) WR signal output hold time 0 ns
td(BCLK-DB) Data output delay time (refers to BCLK) 40 ns
th(BCLK-DB) Data output hold time (refers to BCLK)(Note 3) 4 ns
td(DB-WR) Data output delay time (refers to WR) (Note 1) ns
th(WR-DB) Data output hold time (refers to WR)(Note 3) (Note 2) ns
Note 1: Calculated according to the BCLK frequency as follows:
0.5 X 109
– 40
f(BCLK) [ns]
f(BCLK) is 12.5MHZ or less.
Note 3: This standard value shows the timing when the output is off,
and does not show hold time of data bus.
Hold time of data bus varies with capacitor volume and pull-up
R
(pull-down) resistance value.
Hold time of data bus is expressed in DBi
t = –CR X ln (1 – VOL / VCC2) C
by a circuit of the right figure.
For example, when VOL = 0.2VCC2, C = 30pF, R = 1kΩ, hold time
of output “L” level is
t = – 30pF X 1kΩ X ln (1 – 0.2VCC2 / VCC2)
= 6.7ns.
P0
P1
P2 30pF
P3
P4
P5
P6
P7
P8
P9
P10
247
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
VCC1 ≥ VCC2 = 3V
Switching Characteristics
(VCC1 = VCC2 = 3V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC unless otherwise specified)
Measuring condition
Standard
Symbol Parameter Min. Max. Unit
td(BCLK-AD) Address output delay time 30 ns
th(BCLK-AD) Address output hold time (refers to BCLK) 4 ns
th(RD-AD) Address output hold time (refers to RD) 0 ns
th(WR-AD) Address output hold time (refers to WR) (Note 2) ns
td(BCLK-CS) Chip select output delay time 30 ns
th(BCLK-CS) Chip select output hold time (refers to BCLK) 4 ns
td(BCLK-ALE) ALE signal output delay time Figure 1.26.11 30 ns
th(BCLK-ALE) ALE signal output hold time –4 ns
td(BCLK-RD) RD signal output delay time 30 ns
th(BCLK-RD) RD signal output hold time 0 ns
td(BCLK-WR) WR signal output delay time 30 ns
th(BCLK-WR) WR signal output hold time 0 ns
td(BCLK-DB) Data output delay time (refers to BCLK) 40 ns
th(BCLK-DB) Data output hold time (refers to BCLK)(Note 3) 4 ns
td(DB-WR) Data output delay time (refers to WR) (Note 1) ns
th(WR-DB) Data output hold time (refers to WR)(Note 3) (Note 2) ns
Note 1: Calculated according to the BCLK frequency as follows:
(n–0.5) X 109 n is “1” for 1-wait setting, “2” for 2-wait setting
– 40
f(BCLK) [ns] and “3” for 3-wait setting.
When n=1, f(BCLK) is 12.5MHZ or less.
Note 3: This standard value shows the timing when the output is off,
and does not show hold time of data bus.
Hold time of data bus varies with capacitor volume and pull-up
R
(pull-down) resistance value.
Hold time of data bus is expressed in DBi
t = –CR X ln (1 – VOL / VCC2) C
by a circuit of the right figure.
For example, when VOL = 0.2VCC2, C = 30pF, R = 1kΩ, hold time
of output “L” level is
t = – 30pF X 1kΩ X ln (1 – 0.2VCC2 / VCC2)
= 6.7ns.
248
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
VCC1 ≥ VCC2 = 3V
Switching Characteristics
(VCC1 = VCC2 = 3V, VSS = 0V, at Topr = – 20 to 85oC / – 40 to 85oC, unless otherwise specified)
249
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
tc(TA)
tw(TAH)
TAiIN input
tw(TAL)
tc(UP)
tw(UPH)
TAiOUT input
tw(UPL)
TAiOUT input
(Up/down input)
TAiIN input
(When count on rising
edge is selected)
TAiIN input
tsu(TAIN-TAOUT) tsu(TAIN-TAOUT)
tsu(TAOUT-TAIN)
TAiOUT input
tsu(TAOUT-TAIN)
tc(TB)
tw(TBH)
TBiIN input
tw(TBL)
tc(AD)
tw(ADL)
ADTRG input
250
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
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)
251
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 = Vcc2 = 3V)
VCC1 = VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(Effective for setting with wait)
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: The above pins are set to high-impedance regardless of the input level of the
BYTE pin, PM06 bit of PM0 register and PM11 bit of PM1 register.
Measuring conditions :
• VCC1=VCC2=3V
• Input timing voltage : Determined with VIL=0.6V, VIH=2.4V
• Output timing voltage : Determined with VOL=1.5V, VOH=1.5V
Figure 1.26.14. Timing Diagram (3)
252
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
VCC1 ≥ VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(For setting with no wait)
Read timing
BCLK
td(BCLK-CS) th(BCLK-CS)
30ns.max 4ns.min
CSi
tcyc
td(BCLK-AD) th(BCLK-AD)
30ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(RD-AD)
30ns.max -4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
30ns.max 0ns.min
RD
tac1(RD-DB)
(0.5 X tcyc-60)ns.max
Hi-Z
DB
tSU(DB-RD) th(RD-DB)
50ns.min 0ns.min
Write timing
BCLK
td(BCLK-CS) th(BCLK-CS)
30ns.max 4ns.min
CSi
tcyc
td(BCLK-AD) th(BCLK-AD)
30ns.max
4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(WR-AD)
30ns.max -4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
30ns.max 0ns.min
WR,WRL,
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
Hi-Z
DBi
td(DB-WR) th(WR-DB)
(0.5 X tcyc-40)ns.min (0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=3V
• Input timing voltage : VIL=0.6V, VIH=2.4V
• Output timing voltage : VOL=1.5V, VOH=1.5V
253
Renesas microcomputers
M16C / 62P Group
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC1 ≥ VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(for 1-wait setting and external area access)
Read timing
BCLK
td(BCLK-CS) th(BCLK-CS)
30ns.max 4ns.min
CSi
tcyc
td(BCLK-AD)
30ns.max
th(BCLK-AD)
4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(RD-AD)
30ns.max -4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
30ns.max 0ns.min
RD
tac2(RD-DB)
(1.5 X tcyc-60)ns.max
Hi-Z
DB
th(RD-DB)
tSU(DB-RD) 0ns.min
50ns.min
Write timing
BCLK
td(BCLK-CS) th(BCLK-CS)
30ns.max 4ns.min
CSi
tcyc
td(BCLK-AD) th(BCLK-AD)
30ns.max
4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(WR-AD)
30ns.max -4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
30ns.max 0ns.min
WR,WRL,
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
Hi-Z
DBi
td(DB-WR) th(WR-DB)
(0.5 X tcyc-40)ns.min (0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=3V
• Input timing voltage : VIL=0.6V, VIH=2.4V
• Output timing voltage : VOL=1.5V, VOH=1.5V
254
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
VCC1 ≥ VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(for 2-wait setting and external area access)
Read timing
tcyc
BCLK
th(BCLK-CS)
td(BCLK-CS) 4ns.min
30ns.max
CSi
td(BCLK-AD) th(BCLK-AD)
30ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(RD-AD)
30ns.max th(BCLK-ALE)
-4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
30ns.max 0ns.min
RD
tac2(RD-DB)
(2.5 X tcyc-60)ns.max
DBi Hi-Z
tSU(DB-RD) th(RD-DB)
50ns.min 0ns.min
Write timing
tcyc
BCLK
td(BCLK-CS) th(BCLK-CS)
4ns.min
30ns.max
CSi
td(BCLK-AD) th(BCLK-AD)
30ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(WR-AD)
30ns.max th(BCLK-ALE) (0.5 X tcyc-10)ns.min
-4ns.min
ALE
th(BCLK-WR)
td(BCLK-WR) 0ns.min
30ns.max
WR, WRL
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
DB Hi-Z
td(DB-WR) th(WR-DB)
(1.5 X tcyc-40)ns.min (0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=3V
• Input timing voltage : VIL=0.6V, VIH=2.4V
• Output timing voltage : VOL=1.5V, VOH=1.5V
255
Renesas microcomputers
M16C / 62P Group
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC1 ≥ VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(for 3-wait setting and external area access)
Read timing
tcyc
BCLK
th(BCLK-CS)
td(BCLK-CS) 4ns.min
30ns.max
CSi
td(BCLK-AD) th(BCLK-AD)
30ns.max 4ns.min
ADi
BHE
td(BCLK-ALE)
30ns.max th(BCLK-ALE) th(RD-AD)
-4ns.min 0ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
30ns.max 0ns.min
RD
tac2(RD-DB)
(3.5 X tcyc-60)ns.max
DBi Hi-Z
tSU(DB-RD) th(RD-DB)
50ns.min 0ns.min
Write timing
tcyc
BCLK
td(BCLK-CS) th(BCLK-CS)
30ns.max 4ns.min
CSi
td(BCLK-AD) th(BCLK-AD)
30ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(WR-AD)
30ns.max th(BCLK-ALE)
-4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
30ns.max 0ns.min
WR, WRL
WRH
td(BCLK-DB) th(BCLK-DB)
40ns.max 4ns.min
DB Hi-Z
td(DB-WR) th(WR-DB)
(2.5 X tcyc-40)ns.min
(0.5 X tcyc-10)ns.min
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=3V
• Input timing voltage : VIL=0.6V, VIH=2.4V
• Output timing voltage : VOL=1.5V, VOH=1.5V
256
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
VCC1 ≥ VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(For 2-wait setting, external area access and multiplex bus selection)
Read timing
BCLK
th(BCLK-CS)
td(BCLK-CS) th(RD-CS) 4ns.min
tcyc
40ns.max (0.5 X tcyc-10)ns.min
CSi
td(AD-ALE)
(0.5 X tcyc-40)ns.min th(ALE-AD)
(0.5 X tcyc-15)ns.min
ADi Address Data input Address
/DBi tdZ(RD-AD)
8ns.max th(RD-DB)
tac3(RD-DB) tSU(DB-RD) 0ns.min
(1.5 X tcyc-60)ns.max 50ns.min
td(AD-RD)
td(BCLK-AD) 0ns.min th(BCLK-AD)
40ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(RD-AD)
40ns.max -4ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-RD) th(BCLK-RD)
40ns.max 0ns.min
RD
Write timing
BCLK
td(BCLK-CS) tcyc th(BCLK-CS)
th(WR-CS)
4ns.min
40ns.max (0.5 X tcyc-10)ns.min
CSi
td(BCLK-DB) th(BCLK-DB)
50ns.max 4ns.min
td(BCLK-AD) th(BCLK-AD)
40ns.max 4ns.min
ADi
BHE
td(BCLK-ALE) th(BCLK-ALE) th(WR-AD)
td(AD-WR)
40ns.max -4ns.min 0ns.min (0.5 X tcyc-10)ns.min
ALE
td(BCLK-WR) th(BCLK-WR)
40ns.max 0ns.min
WR,WRL,
WRH
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=3V
• Input timing voltage : VIL=0.6V, VIH=2.4V
• Output timing voltage : VOL=1.5V, VOH=1.5V
257
Renesas microcomputers
M16C / 62P Group
Electrical Characteristics (Vcc1 ≥ Vcc2 = 3V)
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC1 ≥ VCC2 = 3V
Memory Expansion Mode, Microprocessor Mode
(For 3-wait setting, external area access and multiplex bus selection)
Read timing
tcyc
BCLK
th(RD-CS)
(0.5 X tcyc-10)ns.min th(BCLK-CS)
td(BCLK-CS) 6ns.min
40ns.max
CSi
td(AD-ALE)
(0.5 X tcyc-40)ns.min th(ALE-AD)
(0.5 X tcyc-15)ns.min
ADi Address Data input
/DB th(RD-DB)
tdZ(RD-AD)
td(BCLK-AD) td(AD-RD) 8ns.max tac3(RD-DB) tSU(DB-RD)
0ns.min
th(BCLK-AD)
40ns.max 0ns.min (2.5 X tcyc-60)ns.max 50ns.min 4ns.min
ADi
BHE
(No multiplex)
td(BCLK-ALE)
40ns.max th(RD-AD)
th(BCLK-ALE) (0.5 X tcyc-10)ns.min
-4ns.min
ALE
th(BCLK-RD)
td(BCLK-RD) 0ns.min
40ns.max
RD
Write timing
tcyc
BCLK
th(WR-CS)
th(BCLK-CS)
td(BCLK-CS) (0.5 X tcyc-10)ns.min 4ns.min
40ns.max
CSi
td(BCLK-DB) th(BCLK-DB)
50ns.max 4ns.min
ADi
Address Data output
/DB
td(AD-ALE) td(DB-WR)
(0.5 X tcyc-40)ns.min th(WR-DB)
(2.5 X tcyc-50)ns.min (0.5 X tcyc-10)ns.min
td(BCLK-AD)
40ns.max
th(BCLK-AD)
4ns.min
ADi
BHE
(No multiplex)
td(BCLK-ALE) th(BCLK-ALE)
40ns.max -4ns.min th(WR-AD)
(0.5 X tcyc-10)ns.min
td(AD-WR)
0ns.min
ALE
th(BCLK-WR)
td(BCLK-WR) 0ns.min
40ns.max
WR, WRL
WRH
1
tcyc=
f(BCLK)
Measuring conditions
• VCC1=VCC2=3V
• Input timing voltage : VIL=0.6V, VIH=2.4V
• Output timing voltage : VOL=1.5V, VOH=1.5V
258
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory Version
Flash memory operating mode 3 modes (CPU rewrite, standard serial I/O, parallel I/O)
User ROM area Refer to “Figure 1.27.1. Flash Memory Block Diagram”
Erase block
Boot ROM area 1 block (4 Kbytes) (Note 1)
Method for program In units of word, in units of byte (Note 2)
Method for erasure Collective erase, block erase
Program, erase control method Program and erase controlled by software command
Protect method Protected for each block by lock bit
Number of commands 8 commands
Number of program and erasure 100 times, 1,000 times/10,000 times (option) (Note 3, 4)
Data Retention 10 years
ROM code protection Parallel I/O and standard serial I/O modes are supported.
Note 1: The boot ROM area contains a standard serial I/O mode rewrite control program which is stored in it when
shipped from the factory. This area can only be rewritten in parallel input/output mode.
Note 2: Can be programmed in byte units in only parallel input/output mode.
Note 3: Block 1 and block A are guaranteed of 10,000 times of programming and erasure. All other blocks are
guaranteed of 1,000 times of programming and erasure. (Under development; mass production scheduled to
start in the 3rd quarter of 2003)
Note 4: Definition of programming and erasure times
The programming and erasure times are defined to be per-block erasure times. For example, assume
a case where a 4K-byte block A is programmed in 2,048 operations by writing one word at a time and
erased thereafter.
In this case, the block is reckoned as having been programmed and erased once.
If a product is guaranteed of 100 times of programming and erasure, each block in it can be erased up to
100 times. When guaranteed of 10,000 times of programming and erasure, block 1 and block A can each
be erased up to 10,000 times. All other blocks can each be erased up to 1,000 times.
259
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory Version
260
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory Version
1. Memory Map
The ROM in the flash memory version is separated between a user ROM area and a boot ROM area.
Figure 1.27.1 shows the block diagram of flash momoery. The user ROM area has a 4K-byte block A, in
addition to the area that stores a program for microcomputer operation during singe-chip or memory expan-
sion mode.
The user ROM area is divided into several blocks, each of which can individually be protected (locked)
against programming or erasure. The user ROM area can be rewritten in all of CPU rewrite, standard serial
input/output, and parallel input/output modes. Block A is enabled for use by setting the PM1 register’s
PM10 bit to “1” (block A enabled, CS2 area at addresses 1000016 to 26FFF16).
The boot ROM area is located at addresses that overlap the user ROM area, and can only be rewritten in
parallel input/output mode. After a hardware reset that is performed by applying a high-level signal to the
CNVSS and P50 pins and a low-level signal to the P55 pin, the program in the boot ROM area is executed.
After a hardware reset that is performed by applying a low-level signal to the CNVSS pin, the program in the
user ROM area is executed (but the boot ROM area cannot be read).
00F00016
Block A :4K bytes
00FFFF16
08000016
08FFFF16
09000016
09FFFF16
0A000016
0AFFFF16
0B000016
0BFFFF16
0C000016 0F000016
0CFFFF16
Block 5 : 32K bytes
0D000016
0DFFFF16 0F7FFF16
0E000016 0F800016
Block 4 : 8K bytes
Block 6 : 64K bytes 0F9FFF16
0FA00016
Block 3 : 8K bytes
0EFFFF16 0FBFFF16
0F000016 0FC00016
Block 2 : 8K bytes
Block 0 to Block 5 (32+8+8+8 0FDFFF16
+4+4)K bytes 0FE00016 Block 1 : 4K bytes
0FEFFF16
0FF00016 Block 0 : 4K bytes 0FF00016 4K bytes
0FFFFF16 0FFFFF16 0FFFFF16
User ROM area Boot ROM area
Note 1: The boot ROM area can only be rewritten in parallel input/output mode.
Note 2: To specify a block, use an even address in that block.
Note 3: Shown here is a block diagram during single-chip mode.
Note 4: Block A can be made usable by setting the PM1 register’s PM10 bit to “1” (block A enabled, CS2 area allocated at addresses 1000016 to 26FFF16).
Block A cannot be erased by the Erase All Unlocked Block command. Use the Block Erase command to erase it.
261
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Boot Mode
After a hardware reset which is performed by applying a low-level signal to the P55 pin and a high-level
signal to the CNVSS and P50 pins, the microcomputer is placed in boot mode, thereby executing the pro-
gram in the boot ROM area.
During boot mode, the boot ROM and user ROM areas are switched over by the FMR05 bit in the FMR0
register.
The boot ROM area contains a standard serial input/output mode based rewrite control program which was
stored in it when shipped from the factory.
The boot ROM area can be rewritten in parallel input/output mode. Prepare an EW0 mode based rewrite
control program and write it in the boot ROM area, and the flash memory can be rewritten as suitable for the
system.
262
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
11:
}
10: Enables ROOMCP1 bit
RW
b7 b6
ROMCP1 ROM code protect level
00: RW
1 set bit
(Note 1, Note 3, Note 4) 01:
10:
}
Protect enabled
Note 1: If the ROMCR bits are set to other than ‘002’ and the ROMCP1 bits are set to other than ‘112’ (
ROM code protect enabled), the flash memory is disabled against reading and rewriting in
parallel input/output mode.
Note 2: If the ROMCR bits are set to ‘002’ when the ROMCR bits are other than ‘002’ and the ROMCP1
bits are other than ‘112,’ ROM code protect level 1 is removed. However, because the ROMCR
bits cannot be modified during parallel input/output mode, they need to be modified in standard
serial input/output or other modes.
Note 3: The ROMCP1 bits are effective when the ROMCR bits are ‘012,’ ‘102,’ or ‘112.’
Note 4: Once any of these bits is cleared to “0”, it cannot be set back to “1”. If a memory block that
contains the ROMCP register is erased, the ROMCP register is set to ‘FF16.’
Address
0FFFDF16 to 0FFFDC16 ID1 Undefined instruction vector
4 bytes
263
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
264
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
• EW0 Mode
The microcomputer is placed in CPU rewrite mode by setting the FMR0 register’s FMR01 bit to “1” (CPU
rewrite mode enabled), ready to accept commands. In this case, because the FMR1 register’s FMR11 bit
= 0, EW0 mode is selected. The FMR01 bit can be set to “1” by writing “0” and then “1” in succession.
Use software commands to control program and erase operations. Read the FMR0 register or status
register to check the status of program or erase operation at completion.
• EW1 Mode
EW1 mode is selected by setting FMR11 bit to “1” (by writing “0” and then “1” in succession) after setting
the FMR01 bit to “1” (by writing “0” and then “1” in succession).
Read the FMR0 register to check the status of program or erase operation at completion. The status
register cannot be read during EW1 mode.
265
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Figure 1.27.5 and 1.27.6 show the setting and resetting of EW0 mode and EW1 mode, respectively.
FMR11 Bit
Setting this bit to “1” places the microcomputer in EW1 mode.
FMR16 Bit
This is a read-only bit indicating the execution result of the Read Lock Bit Status command.
266
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
FMR01 CPU rewrite mode select bit 0: Disables CPU rewrite mode
(Note 1) 1: Enables CPU rewrite mode RW
267
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Set CM0, CM1, and PM1 registers (Note 1) Set the FMR01 bit by writing “0” and then “1”
(CPU rewrite mode enabled) (Note 2)
Jump to the rewrite control program which has been Execute the Read Array command
transferred to any area other than the flash memory
(The subsequent processing is executed by the
rewrite control program in any area other than the
flash memory) Write “0” to the FMR01 bit
(CPU rewrite mode disabled)
Note 1: Select 10 MHz or less for CPU clock using the CM0 register’s CM06 bit and CM1 register’s CM17 to 6 bits.
Also, set the PM1 register’s PM17 bit to “1” (with wait state).
Note 2: To set the FMR01 bit to “1”, write “0” and then “1” in succession. Make sure no interrupts or no DMA
transfers will occur before writing “1” after writing “0”.
Write to the FMR01 bit from a program in other than the flash memory. Also write only when the NMI pin is
“H” level.
Note 3: Disables the CPU rewrite mode after executing the Read Array command.
Note 4: User ROM area is accessed when the FMR05 bit is set to “1”.
Note 5: When in CPU rewrite mode, the PM10 and PM13 bits in the PM1 register are set to “1”. The rewrite control
program can only be executed in the internal RAM or in an external area that is enabled for use when the
PM13 bit = 1. When the PM13 bit = 0 and the flash memory is used in 4M-byte mode, the extended
accessible area (4000016 to BFFFF16) cannot be used.
268
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Program in ROM
Set the FMR01 bit by writing “0” and then “1” (CPU
rewrite mode enabled)
Set the FMR11 bit by writing “0” and then “1” (EW1
mode) (Note 3)
Note 1: In EW1 mode, do not set the microcomputer in memory expansion or boot mode.
Note 2: Select 10 MHz or less for CPU clock using the CM0 register’s CM06 bit and CM1
register’s CM17 to 6 bits. Also, set the PM1 register’s PM17 bit to “1” (with wait
state).
Note 3: To set the FMR01 bit to “1”, write “0” and then “1” in succession. Make sure no
interrupts or no DMA transfers will occur before writing “1” after writing “0”.
Also write only when the NMI pin is “H” level.
269
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Transfer a low power dissipation mode program Set the FMR01 bit by writing “0” and then “1”
to any area other the flash memory (CPU rewrite mode enabled)
Jump to the low power dissipation mode program Set FMSTP bit to “1”
which has been transferred to any area other the (flash memory stopped. Low power state)(Note 1)
flash memory.
(The subsequent processing is executed by a
program in any area other than the flash memory.) Switch the clock source for CPU clock.
Turn main clock off. (Note 2)
Note 1: Set the FMSTP bit to “1” after setting the FMR01 bit to “1”(CPU rewrite mode).
Note 2: Before the clock source for CPU clock can be changed to
main clock or sub clock, the clock to which to be changed
must be stable.
Note 3: Insert a tPS wait time in a program. The flash memory
cannot be accessed during this wait time.
Figure 1.27.7. Processing Before and After Low Power Dissipation Mode
270
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
(3) Interrupts
EW0 Mode
• Any interrupt which has a vector in the variable vector table can be used providing that its vector is
transferred into the RAM area.
_______
• The NMI and watchdog timer interrupts can be used because the FMR0 register and FMR1 regis-
ter are initialized when one of those interrupts occurs. The jump addresses for those interrupt
service routines should be set in the fixed vector table.
_______
Because the rewrite operation is halted when a NMI or watchdog timer interrupt occurs, the rewrite
program must be executed again after exiting the interrupt service routine.
• The address match interrupt cannot be used because the flash memory’s internal data is refer-
enced.
EW1 Mode
• Make sure that any interrupt which has a vector in the variable vector table or address match
interrupt will not be accepted during the auto program or auto erase period.
• Avoid using watchdog timer interrupts.
_______
• The NMI interrupt can be used because the FMR0 register and FMR1 register are initialized when
this interrupt occurs. The jump address for the interrupt service routine should be set in the fixed
vector table.
_______
Because the rewrite operation is halted when a NMI interrupt occurs, the rewrite program must be
executed again after exiting the interrupt service routine.
271
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
(10) Low Power Dissipation Mode and Ring Oscillator Low Power Dissipation Mode
If the CM05 bit is set to “1” (main clock stop), the following commands must not be executed.
• Program
• Block erase
• Erase all unlocked blocks
• Lock bit program
272
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Software Commands
Software commands are described below. The command code and data must be read and written in 16-
bit units, to and from even addresses in the user ROM area. When writing command code, the 8 high-
order bits (D1t–D8) are ignored.
273
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
In EW1 mode, do not execute this command on any address at which the rewrite control program is
located.
In EW0 mode, the microcomputer goes to read status register mode at the same time auto program-
ming starts, making it possible to read the status register. The status register bit 7 (SR7) is cleared to
“0” at the same time auto programming starts, and set back to “1” when auto programming finishes. In
this case, the microcomputer remains in read status register mode until a read command is written
next. The result of auto programming can be known by reading the status register after auto program-
ming has finished.
Start
NO
FMR00=1?
YES
Full status check
Program
completed
274
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Block Erase
Write ‘xx2016’ in the first bus cycle and write ‘xxD016’ to the uppermost address of a block (even
address, however) in the second bus cycle, and an auto erase operation (erase and verify) will start.
Check the FMR0 register’s FMR00 bit to see if auto erasing has finished.
The FMR00 bit is “0” during auto erasing and set to “1” when auto erasing is completed.
Check the FMR0 register’s FMR07 bit after auto erasing has finished, and the result of auto erasing
can be known. (Refer to “Full Status Check.”)
Figure 1.27.9 shows an example of a block erase flowchart.
Each block can be protected against erasing by a lock bit. (Refer to “Data Protect Function.”)
Writing over already programmed addresses is inhibited.
In EW1 mode, do not execute this command on any address at which the rewrite control program is
located.
In EW0 mode, the microcomputer goes to read status register mode at the same time auto erasing
starts, making it possible to read the status register. The status register bit 7 (SR7) is cleared to “0” at
the same time auto erasing starts, and set back to “1” when auto erasing finishes. In this case, the
microcomputer remains in read status register mode until the Read Array or Read Lock Bit Status
command is written next.
Start
NO
FMR00=1?
YES
Full status check
275
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Start
NO
FMR00=1?
YES
Full status check
276
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
Start
NO
FMR00=1?
YES
NO
FMR16=0?
YES
277
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
• When the lock bit = 0, the block is locked (protected against programming and erasure).
• When the lock bit = 1, the block is not locked (can be programmed or erased.
The lock bit is cleared to “0” (locked) by executing the Lock Bit Program command, and is set to “1”
(unlocked) by erasing the block. The lock bit cannot be set to “1” by a command.
The lock bit status can be read using the Read Lock Bit Status command
The lock bit function is disabled by setting the FMR02 bit to “1”, with all blocks placed in an unlocked state.
(The lock bit data itself does not change state.) Setting the FMR02 bit to “0” enables the lock bit function
(lock bit data retained).
If the Block Erase or Erase All Unlocked Block command is executed while the FMR02 bit = 1, the target
block or all blocks are erased irrespective of how the lock bit is set. The lock bit for each block is set to “1”
after completion of erasure.
For details about the commands, refer to “Software Commands.”
Status Register
The status register indicates the operating status of the flash memory and whether an erase or program-
ming operation terminated normally or in error. The status of the status register can be known by reading
the FMR0 register’s FMR00, FMR06, and FMR07 bits.
Table 1.27.5 shows the status register.
In EW0 mode, the status register can be read in the following cases:
(1) When a given even address in the user ROM area is read after writing the Read Status Register
command
(2) When a given even address in the user ROM area is read after executing the Program, Block Erase,
Erase All Unlocked Block, or Lock Bit Program command but before executing the Read Array
command.
278
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
279
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
280
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Flash Memory
FMR06 =1 YES
and Command (1) Execute the Clear Status Register command to set
FMR07=1? sequence error these status flags to “0”.
(2) Reexecute the command after checking that it is
entered correctly.
NO
[During programming]
NO (1) Execute the Clear Status Register command to set
FMR06= Program error the program status flag to “0”.
0? (2) Execute the Read Lock Bit Status command to see
if the lock bit for the block in error is “0”. If so, set
YES the FMR0 register’s FMR02 bit to “1”.
(3) Reexecute the Program command.
Note 2: If the error still occurs, the block in error
cannot be used.
Furthermore, if the lock bit = 1 in (2) above,
the block in error cannot be used either.
[During lock bit programming]
(1) Execute the Clear Status Register command to set
the program status flag to “0”.
(2) Set the FMR0 register’s FMR02 bit to “1”.
(3) Execute the Block Erase command to erase the
block in error.
(4) Reexecute the Lock Bit command.
Note 3: If the error still occurs, the block in error
Full status check completed cannot be used.
Note 4: If FMR06 or FMR07 = 1, any of the Program, Block Erase, Erase All Unlocked
Block, Lock Bit Program, or Read Lock Bit Status command is not accepted.
Execute the Clear Status Register command before executing those commands.
Figure 1.27.12. Full Status Check and Handling Procedure for Each Error
281
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
282
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.27.7. Pin Functions (Flash Memory Standard Serial I/O Mode)
Power
Pin Name I/O supply Description
Apply the voltage guaranteed for Program and Erase to VCC1 pin and
VCC1, VCC2, Power input VCC2 to the VCC2 pin. The VCC apply condition is that VCC2 ≤ VCC1.
VSS
Apply 0 V to VSS pin.
RESET Reset input I VCC1 Reset input pin. While RESET pin is "L" level, input a 20 cycle or
longer clock to XIN pin.
XIN Clock input I VCC1 Connect a ceramic resonator or crystal oscillator between XIN and
XOUT pins. To input an externally generated clock, input it to XIN pin
XOUT Clock output O VCC1 and open XOUT pin.
AVCC, AVSS Analog power supply input Connect AVss to Vss and AVcc to VCC1, respectively.
VREF Reference voltage input I Enter the reference voltage for AD from this pin.
P00 to P07 Input port P0 I VCC2 Input "H" or "L" level signal or open.
P10 to P17 Input port P1 I VCC2 Input "H" or "L" level signal or open.
P20 to P27 Input port P2 I VCC2 Input "H" or "L" level signal or open.
P30 to P37 Input port P3 I VCC2 Input "H" or "L" level signal or open.
P40 to P47 Input port P4 I VCC2 Input "H" or "L" level signal or open.
P51 to P54,
Input port P5 I VCC2 Input "H" or "L" level signal or open.
P56, P57
P60 to P63 Input port P6 I VCC1 Input "H" or "L" level signal or open.
P64/RTS1 BUSY output O VCC1 Standard serial I/O mode 1: BUSY signal output pin
Standard serial I/O mode 2: Monitors the boot program operation
check signal output pin.
P65/CLK1 SCLK input I VCC1 Standard serial I/O mode 1: Serial clock input pin
Standard serial I/O mode 2: Input "L".
P66/RXD1 RxD input I VCC1 Serial data input pin.
P70 to P77 Input port P7 I VCC1 Input "H" or "L" level signal or open.
P80 to P84, P86, Input port P8 I VCC1 Input "H" or "L" level signal or open.
P87
P85/NMI NMI input I VCC1 Connect this pin to VCC1.
P90 to P97 Input port P9 I VCC1 Input "H" or "L" level signal or open. (Note 2)
P100 to P107 Input port P10 I VCC1 Input "H" or "L" level signal or open. (Note 2)
P110 to P117 Input port P11 I VCC1 Input "H" or "L" level signal or open. (Note 2)
P120 to P127 Input port P12 I VCC2 Input "H" or "L" level signal or open. (Note 2)
P130 to P137 Input port P13 I VCC2 Input "H" or "L" level signal or open. (Note 2)
P140 to P147 Input port P14 I VCC1 Input "H" or "L" level signal or open. (Note 2)
___________
Note 1: When using standard serial input/output mode 1, the TxD pin must be held high while the RESET
pin is pulled low. Therefore, connect this pin to VCC1 via a resistor. Because this pin is directed for
data output after reset, adjust the pull-up resistance value in the system so that data transfers will
not be affected.
Note 2: Available in only the 128-pin version.
283
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC2
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
81 50
82 49
83 48
84 47
85 46 CE
86 45
87 44
88 43
89 42
90 M16C/62P Group 41 EPM
91 40
92
93
(Flash memory version) 39
38
94 37
95 36
96 35
97 34 BUSY
98 33 SCLK
99 32 RxD
100 31 TxD
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
Vss
Connect
oscillator Mode setup method
circuit. Signal Value
CNVss VCC1
RESET
EPM Vss
RESET Vss to VCC1
CE VCC2
CNVss
VCC1
Package: 100P6S-A
284
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC2
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
76 50
77 49
78 48
79 47
80 46
81 45
82 44 CE
83 43
84 42
85 41
86 40
87
88
M16C/62P Group 39
38
EPM
89
90
(Flash memory version) 37
36
91 35
92 34
93 33
94 32 BUSY
95 31 SCLK
96 30 RXD
97 29 TXD
98 28
99 27
100 26
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
VSS
Connect
oscillator Mode setup method
circuit. Signal Value
CNVss VCC1
RESET
EPM Vss
RESET Vss to VCC1
CE VCC2
CNVSS
VCC1
Package: 100P6Q-A
285
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
VCC2
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 72 71 70 69 68 67 66 65
103 64
104 63
105 62
106 61 CE
107 60
108 59
109 58
110 57
111 56
112 55
113 54
114 M16C/62P Group 53
52
115 EPM
116
117
(Flash memory version) 51
50
118 49
119 48
120 47
121 46
122 45
123 44
124 43
125 42
126 41 BUSY
127 40 SCLK
128 39
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 37 38
Vss
RESET
RxD
TxD
VCC1
Package: 128P6Q-A
286
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Microcomputer
(1) Control pins and external circuitry will vary according to programmer.
For more information, see the programmer manual.
(2) In this example, modes are switched between single-chip mode and standard serial
input/output mode by controlling the CNVss input with a switch.
(3) If in standard serial input/output mode 1 there is a possibility that the user reset
signal will go low during serial input/output mode, break the connection between
the user reset signal and RESET pin by using, for example, a jumper switch.
287
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Microcomputer
P65/CLK1 P50(CE)
TXD output P67/TXD1 P55(EPM)
P85/NMI
(1) In this example, modes are switched between single-chip mode and standard serial
input/output mode by controlling the CNVss input with a switch.
288
Renesas microcomputers
M16C / 62P Group
Flash Memory SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
289
Renesas microcomputers
M16C / 62P Group
Package Dimensions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Package Dimensions
100P6S-A MMP Plastic 100pin 14✕20mm body QFP
EIAJ Package Code JEDEC Code Weight(g) Lead Material
QFP100-P-1420-0.65 – 1.58 Alloy 42 MD
e
HD
D
ME
100 81
b2
1 80
I2
A – – 3.05
A1 0 0.1 0.2
A2 – 2.8 –
b 0.25 0.3 0.4
c 0.13 0.15 0.2
D 13.8 14.0 14.2
30 51 E 19.8 20.0 20.2
e – 0.65 –
31 50 HD 16.5 16.8 17.1
A
L1 HE 22.5 22.8 23.1
L 0.4 0.6 0.8
L1 – 1.4 –
A2
x – – 0.13
y – – 0.1
c
F 0° – 10°
e b2 – 0.35 –
A1
b x M L
Detail F I2 1.3 – –
y MD – 14.6 –
ME – 20.6 –
HD ME
b2
D
100 76
l2
Recommended Mount Pad
1 75
Dimension in Millimeters
Symbol
Min Nom Max
A – – 1.7
A1 0 0.1 0.2
HE
– 1.4 –
E
A2
b 0.13 0.18 0.28
c 0.105 0.125 0.175
D 13.9 14.0 14.1
E 13.9 14.0 14.1
25 51
e – 0.5 –
HD 15.8 16.0 16.2
26 50 HE 15.8 16.0 16.2
A L 0.3 0.5 0.7
L1
F L1 – 1.0 –
e Lp 0.45 0.6 0.75
A3 – 0.25 –
A2
A3
x – – 0.08
y – – 0.1
0° – 10°
A1
b x y L
c
M b2 – 0.225 –
Lp I2 0.9 – –
Detail F
MD – 14.4 –
ME – 14.4 –
290
Renesas microcomputers
M16C / 62P Group
Package Dimensions SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
e
HD
ME
D
b2
128 103
1 102 l2
Recommended Mount Pad
Dimension in Millimeters
Symbol
Min Nom Max
A 1.4 1.5 1.7
A1 0.05 0.125 0.2
HE
E
A2 – 1.4 –
b 0.17 0.22 0.27
c 0.105 0.125 0.175
D 13.9 14.0 14.1
E 19.9 20.0 20.1
e – 0.5 –
38 65
HD 15.8 16.0 16.2
HE 21.8 22.0 22.2
39 64
L1 L 0.35 0.5 0.65
A
L1 – 1.0 –
F
Lp 0.45 0.6 0.75
e A3 – 0.25 –
A3
A2
x – – 0.08
y – – 0.1
0° – 8°
A1
L b2 – 0.225 –
y b x M Detail F Lp I2 – 1.0 –
MD – 14.4 –
ME – 20.4 –
291
Renesas microcomputers
M16C / 62P Group
Differences Between M16C/62P and M16C/62A SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
292
Renesas microcomputers
M16C / 62P Group
Differences Between M16C/62P and M16C/62A SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Differences in Mask ROM version and Flash memory version (2) (Note)
Item M16C/62P M16C/62A
Timers A, B count Selectable: f1, f2, f8, f32, fC32 Selectable: f1, f8, f32, fC32
source
Timer A two-phase Function Z-phase (counter reset) input No function Z-phase (counter reset) input
pulse signal
processing
Timer functions for Function protect by protect register Function protect by protect register
three-phase motor Count source is selected: Count source is selected:
control f1, f2, f8, f32, fC32 f1, f8, f32, fC32
Dead time timer count source is selected: Dead time timer count source is fixed at f1/2
f1, f1 divided by 2, f2 , f2 divided by 2
Three-phase output forcible shutoff function
based on output polarity change, carrier
wave phase detection and NMI input is
available.
Serial I/O (UART, clock synchronous, I2C bus, IE bus) (UART, clock synchronous,) x 2
(UART0 to UART2) x3 (UART, clock synchronous, IIC bus, IE bus)
x1
UART0 to UART2, Select from f1SIO, f2SIO, f8SIO, f32SIO Select from f1, f8, f32
SI/O3, SI/O4 count
source
Serial I/O RTS timing Assert low when receive buffer is read Assert low when reception is completed
A-D converter Select from ports P0, P2, P10 Fixed at port P10
input pin
Note: About the details and the electric characteristics, refer to data sheet.
293
Renesas microcomputers
M16C / 62P Group
Differences Between M16C/62P and M16C/62A SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Note: About the details and the electric characteristics, refer to data sheet.
294
Renesas microcomputers
M16C / 62P Group
Register Index SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Register Index
A I
AD0 to AD7 190 ICTB2 132
ADCON0 189 IDB0 131
ADCON1 189 IDB1 131
ADCON2 190 IFSR 89
ADIC 81 IFSR2A 89
AIER 92 INT0IC to INT5IC 81
AIER2 92 INVC0 129
INVC1 130
B
K
BCNIC 81
KUPIC 81
C
O
CM0 53
CM1 54 ONSF 109
CM2 55
P
CPSRF 109, 122
CRCD 205 P0 to P13 214
CRCIN 205 PC14 215
CSE 40 PCLKR 56
CSR 34 PCR 217
PD0 to PD13 213
D
PLC0 57
D4INT 25 PM0 30
DA0 204 PM1 31
DA1 204 PM2 56
DACON 204 PRCR 74
DAR0 99 PUR0 to PUR2 216
DAR1 99 PUR3 215
DBR 44
R
DM0CON 98
DM0IC to DM1IC 81 RMAD0 to RMAD3 92
DM0SL 97 ROMCP 263
DM1CON 98
S
DM1SL 98
DTT 131 S0RIC to S2RIC 81
S0TIC to S2TIC 81
F S3BRG 183
FIDR 267 S3C 183
FMR0 267 S3IC to S4IC 81
FMR1 267 S3TRR 183
S4BRG 183
295
Renesas microcomputers
M16C / 62P Group
Register Index SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
U
U0BCNIC to U1BCNIC 81
U0BRG to U2BRG 140
U0C0 to U2C0 141
U0C1 to U2C1 142
U0MR to U2MR 141
U0RB to U2RB 140
U0SMR to U2SMR 143
U0SMR2 to U2SMR2 144
U0SMR3 to U2SMR3 144
U0SMR4 to U2SMR4 145
U0TB to U2TB 140
296
REVISION HISTORY M16C/62 GROUP (M16C/62P) Group Hardware Manual
C-1
REVISION HISTORY M16C/62 GROUP (M16C/62P) Group Hardware Manual
C-2
REVISION HISTORY M16C/62 GROUP (M16C/62P) Group Hardware Manual
C-3
REVISION HISTORY M16C/62 GROUP (M16C/62P) Group Hardware Manual
C-4
REVISION HISTORY M16C/62 GROUP (M16C/62P) Group Hardware Manual
C-5
RENESAS 16-BIT CMOS SINGLE-CHIP MICROCOMPUTER
HARDWARE MANUAL
M16C/62 Group (M16C/62P) Rev.1.20
Editioned by
Committee of editing of RENESAS Semiconductor Hardware Manual
This book, or parts thereof, may not be reproduced in any form without permission
of Renesas Technology Corporation.
Copyright © 2003. Renesas Technology Corporation, All rights reserved.
M16C/62 Group (M16C/62P)
Hardware Manual
M16C/62 Group(M16C/62P)
16 Usage Notes Reference Book
For the most current Usage Notes Reference Book, please visit our website.
Before using this material, please visit our website to confirm that this is the most
current document available.
Rev. 1.10
Revision date: May. 28, 2003 www.renesas.com
Keep safety first in your circuit designs!
• Renesas Technology Corporation puts the maximum effort into making semiconductor prod-
ucts 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 ap-
propriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of non-
flammable material or (iii) prevention against any malfunction or mishap.
A-1
1.9 Precautions for Serial I/O (UART Mode) ...................................................................................... 20
1.12 Electric Characteristic Differences Between Mask ROM and Flash Memory Version Microcomputers ...... 24
1.13.1 Precautions for Functions to Inhibit Rewriting Flash Memory Rewrite ................................ 25
1.13.4 Precautions for Low power dissipation mode, ring oscillator low power dissipation mode ................. 25
A-2
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.1 Precautions for External Bus
1. Usage Precaution
2. When resetting CNVss pin with "H" input, contents of internal ROM cannot be read out.
1
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.2 Precautions for PLL Frequency Synthesizer
2
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.3 Precautions for Power Control
2. Insert more than four NOP instructions after an WAIT instruction or a instruction to set the CM10 bit of
CM1 register to “1”. When shifting to wait mode or stop mode, an instruction queue reads ahead to the
next instruction to halt a program by an WAIT instruction and an instruction to set the CM10 bit to “1” (all
clocks stopped). The next instruction may be executed before entering wait mode or stop mode, de-
pending on a combination of instruction and an execution timing.
3. Wait until the td(M-L) elapses or main clock oscillation stabilization time, whichever is longer, before
switching the clock source for CPU clock to the main clock.
Similarly, wait until the sub clock oscillates stably before switching the clock source for CPU clock to the
sub clock.
3
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.4 Precautions for Protect
4
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.5 Precautions for Interrupts
_______
1.5.3 The NMI Interrupt
_______ _______
1. The NMI interrupt cannot be disabled. If this interrupt is unused, connect the NMI pin to VCC1 via a
resistor (pull-up).
_______
2. The input level of the NMI pin can be read by accessing the P8 register’s P8_5 bit. Note that the P8_5
_______
bit can only be read when determining the pin level in NMI interrupt routine.
_______
3. Stop mode cannot be entered into while input on the NMI pin is low. This is because while input on the
_______
NMI pin is low the CM1 register’s CM10 bit is fixed to “0”.
_______ _______
4. Do not go to wait mode while input on the NMI pin is low. This is because when input on the NMI pin
goes low, the CPU stops but CPU clock remains active; therefore, the current consumption in the chip
does not drop. In this case, normal condition is restored by an interrupt generated thereafter.
_______
5. The low and high level durations of the input signal to the NMI pin must each be 2 CPU clock cycles +
300 ns or more.
5
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.5 Precautions for Interrupts
Change the interrupt generate factor (including a mode change of peripheral function)
Use the MOV instruction to clear the IR bit to “0” (interrupt not requested) (Note 3)
End of change
IR bit: A bit in the interrupt control register for the interrupt whose interrupt generate factor is to
be changed
Note 1: The above settings must be executed individually. Do not execute two or more settings
simultaneously (using one instruction).
Note 2: Use the I flag for the INTi interrupt (i = 0 to 5).
For the interrupts from peripheral functions other than the INTi interrupt, turn off the
peripheral function that is the source of the interrupt in order not to generate an interrupt
request before changing the interrupt generate factor. In this case, if the maskable interrupts
can all be disabled without causing a problem, use the I flag. Otherwise, use the corresponding
ILVL2 to ILVL0 bit for the interrupt whose interrupt generate factor is to be changed.
Note 3: Refer to Section 1.1.6, “Rewrite the Interrupt Control Register” for details about the
instructions to use and the notes to be taken for instruction execution.
______
1.5.5 INT Interrupt
1. Either an “L” level of at least tW(INH) or an “H” level of at least tW(INL) width is necessary for the signal
________ ________
input to pins INT0 through INT5 regardless of the CPU operation clock.
2. If the POL bit in the INT0IC to INT5IC registers or the IFSR7 to IFSR0 bits in the IFSR register are
changed, the IR bit may inadvertently set to 1 (interrupt requested). Be sure to clear the IR bit to 0
(interrupt not requested) after changing any of those register bits.
6
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.5 Precautions for Interrupts
(3) When using the I flag to disable an interrupt, refer to the sample program fragments shown below as
you set the I flag. (Refer to (2) for details about rewrite the interrupt control registers in the sample
program fragments.)
Examples 1 through 3 show how to prevent the I flag from being set to “1” (interrupts enabled) before the
interrupt control register is rewrited, owing to the effects of the internal bus and the instruction queue
buffer.
Example 1:Using the NOP instruction to keep the program waiting until
the interrupt control register is modified
INT_SWITCH1:
FCLR I ; Disable interrupts.
AND.B #00h, 0055h ; Set the TA0IC register to “0016”.
NOP ;
NOP
FSET I ; Enable interrupts.
Example 2:Using the dummy read to keep the FSET instruction waiting
INT_SWITCH2:
FCLR I ; Disable interrupts.
AND.B #00h, 0055h ; Set the TA0IC register to “0016”.
MOV.W MEM, R0 ; Dummy read.
FSET I ; Enable interrupts.
7
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.5 Precautions for Interrupts
8
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.6 Precautions for DMAC
Conditions
• The DMAE bit is set to “1” again while it remains set (DMAi is in an active state).
• A DMA request may occur simultaneously when the DMAE bit is being written.
Step 1: Write “1” to the DMAE bit and DMAS bit in DMiCON register simultaneously(*1).
Step 2: Make sure that the DMAi is in an initial state(*2) in a program.
If the DMAi is not in an initial state, the above steps should be repeated.
Notes:
*1. The DMAS bit remains unchanged even if “1” is written. However, if “0” is written to this bit, it is set to
“0” (DMA not requested). In order to prevent the DMAS bit from being modified to “0”, “1” should be
written to the DMAS bit when “1” is written to the DMAE bit. In this way the state of the DMAS bit
immediately before being written can be maintained.
Similarly, when writing to the DMAE bit with a read-modify-write instruction, “1” should be written to
the DMAS bit in order to maintain a DMA request which is generated during execution.
*2. Read the TCRi register to verify whether the DMAi is in an initial state. If the read value is equal to a
value which was written to the TCRi register before DMA transfer start, the DMAi is in an initial state.
(If a DMA request occurs after writing to the DMAE bit, the value written to the TCRi register is “1”.) If
the read value is a value in the middle of transfer, the DMAi is not in an initial state.
9
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
1.7.1 Timer A
2. While counting is in progress, the counter value can be read out at any time by reading the TAi
register. However, if the counter is read at the same time it is reloaded, the value “FFFF16” is read.
Also, if the counter is read before it starts counting after a value is set in the TAi register while not
counting, the set value is read.
______
3. If a low-level signal is applied to the NMI pin when the TB2SC register IVPCR1 bit = “1” (three-phase
______
output forcible cutoff by input on NMI pin enabled), the TA1OUT, TA2OUT and TA4OUT pins go to a
high-impedance state.
10
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
2. While counting is in progress, the counter value can be read out at any time by reading the TAi
register. However, “FFFF16” can be read in underflow, while reloading, and “000016” in overflow.
When setting TAi register to a value during a counter stop, the setting value can be read before a
counter starts counting. Also, if the counter is read before it starts counting after a value is set in the
TAi register while not counting, the set value is read.
______
3. If a low-level signal is applied to the NMI pin when the TB2SC register IVPCR1 bit = “1” (three-phase
______
output forcible cutoff by input on NMI pin enabled), the TA1OUT, TA2OUT and TA4OUT pins go to a
high-impedance state.
11
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
2. When setting TAiS bit to “0” (count stop), the followings occur:
• A counter stops counting and a content of reload register is reloaded.
• TAiOUT pin outputs “L”.
• After one cycle of the CPU clock, the IR bit of TAiIC register is set to “1” (interrupt request).
3. Output in one-shot timer mode synchronizes with a count source internally generated. When an
external trigger has been selected, one-cycle delay of a count source as maximum occurs between
a trigger input to TAiIN pin and output in one-shot timer mode.
4. The IR bit is set to “1” when timer operation mode is set with any of the following procedures:
• Select one-shot timer mode after reset.
• Change an operation mode from timer mode to one-shot timer mode.
• Change an operation mode from event counter mode to one-shot timer mode.
To use the timer Ai interrupt (the IR bit), set the IR bit to “0” after the changes listed above have
been made.
5. When a trigger occurs, while counting, a counter reloads the reload register to continue counting
after generating a re-trigger and counting down once. To generate a trigger while counting, gener-
ate a second trigger between occurring the previous trigger and operating longer than one cycle of
a timer count source.
______
6. If a low-level signal is applied to the NMI pin when the TB2SC register IVPCR1 bit = “1” (three-phase
______
output forcible cutoff by input on NMI pin enabled), the TA1OUT, TA2OUT and TA4OUT pins go to a
high-impedance state.
12
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
2. The IR bit is set to “1” when setting a timer operation mode with any of the following procedures:
• Select the PWM mode after reset.
• Change an operation mode from timer mode to PWM mode.
• Change an operation mode from event counter mode to PWM mode.
To use the timer Ai interrupt (interrupt request bit), set the IR bit to “0” by program after the above
listed changes have been made.
3. When setting TAiS register to “0” (count stop) during PWM pulse output, the following action occurs:
• Stop counting.
• When TAiOUT pin is output “H”, output level is set to “L” and the IR bit is set to “1”.
• When TAiOUT pin is output “L”, both output level and the IR bit remains unchanged.
______
4. If a low-level signal is applied to the NMI pin when the TB2SC register IVPCR1 bit = “1” (three-phase
______
output forcible cutoff by input on NMI pin enabled), the TA1OUT, TA2OUT and TA4OUT pins go to a
high-impedance state.
13
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
1.7.2 Timer B
2. A value of a counter, while counting, can be read in TBi register at any time. “FFFF16” is read while
reloading. Setting value is read between setting values in TBi register at count stop and starting a
counter.
14
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
2. The counter value can be read out on-the-fly at any time by reading the TBi register. However, if this
register is read at the same time the counter is reloaded, the read value is always “FFFF16.” If the
TBi register is read after setting a value in it while not counting but before the counter starts count-
ing, the read value is the one that has been set in the register.
15
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.7 Precautions for Timers
2. The IR bit of TBiIC register (i=0 to 5) goes to “1” (interrupt request), when an effective edge of a
measurement pulse is input or timer Bi is overflowed. The factor of interrupt request can be deter-
mined by use of the MR3 bit of TBiMR register within the interrupt routine.
3. If the source of interrupt cannot be identified by the MR3 bit such as when the measurement pulse
input and a timer overflow occur at the same time, use another timer to count the number of times
timer B has overflowed.
4. To set the MR3 bit to “0” (no overflow), set TBiMR register with setting the TBiS bit to “1” and
counting the next count source after setting the MR3 bit to “1” (overflow).
5. Use the IR bit of TBiIC register to detect only overflows. Use the MR3 bit only to determine the
interrupt factor within the interrupt routine.
6. When a count is started and the first effective edge is input, an indeterminate value is transferred to
the reload register. At this time, timer Bi interrupt request is not generated.
7. A value of the counter is indeterminate at the beginning of a count. MR3 may be set to “1” and timer
Bi interrupt request may be generated between a count start and an effective edge input.
8. For pulse width measurement, pulse widths are successively measured. Use program to check
whether the measurement result is an “H” level width or an “L” level width.
1. The timer remains idle after reset. Set the mode, count source, counter value, etc. using the TAiMR
(i = 0 to 5) register and the TBi register before setting the TABSR register or TBiS bit in the TBSR
register to “1” (count starts).
Always make sure the TBiMR registe is modified while the TBiS bit remains “0” (count stops) re-
gardless whether after reset or not.
16
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.8 Precautions for Serial I/O (Clock-synchronous Serial I/O)
1.8.1 Transmission/reception
_______ ________
1. With an external clock selected, and choosing the RTS function, the output level of the RTSi pin goes
to “L” when the data-receivable status becomes ready, which informs the transmission side that the
________
reception has become ready. The output level of the RTSi pin goes to “H” when reception starts. So if
________ ________
the RTSi pin is connected to the CTSi pin on the transmission side, the circuit can transmission and
_______
reception data with consistent timing. With the internal clock, the RTS function has no effect.
_______
2. If a low-level signal is applied to the NMI pin when the TB2SC register IVPCR1 bit = “1” (three-phase
_______ _________
output forcible cutoff by input on NMI pin enabled), the RTS2 and CLK2 pins go to a high-impedance
state.
17
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.8 Precautions for Serial I/O (Clock-synchronous Serial I/O)
1.8.2 Transmission
When an external clock is selected, the conditions must be met while if the UiC0 register’s CKPOL bit =
“0” (transmit data output at the falling edge and the receive data taken in at the rising edge of the transfer
clock), the external clock is in the high state; if the UiC0 register’s CKPOL bit = “1” (transmit data output at
the rising edge and the receive data taken in at the falling edge of the transfer clock), the external clock is
in the low state.
• The TE bit of UiC1 register= “1” (transmission enabled)
• The TI bit of UiC1 register = “0” (data present in UiTB register)
_______ _______
• If CTS function is selected, input on the CTSi pin = “L”
18
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.8 Precautions for Serial I/O (Clock-synchronous Serial I/O)
1.8.3 Reception
1. In operating the clock-synchronous serial I/O, operating a transmitter generates a shift clock. Fix set-
tings for transmission even when using the device only for reception. Dummy data is output to the
outside from the TxDi pin when receiving data.
2. When an internal clock is selected, set the UiC1 register (i = 0 to 2)’s TE bit to 1 (transmission enabled)
and write dummy data to the UiTB register, and the shift clock will thereby be generated. When an
external clock is selected, set the UiC1 register (i = 0 to 2)’s TE bit to 1 and write dummy data to the
UiTB register, and the shift clock will be generated when the external clock is fed to the CLKi input pin.
3. When successively receiving data, if all bits of the next receive data are prepared in the UARTi receive
register while the UiC1 register (i = 0 to 2)’s RE bit = “1” (data present in the UiRB register), an overrun
error occurs and the UiRB register OER bit is set to “1” (overrun error occurred). In this case, because
the content of the UiRB register is indeterminate, a corrective measure must be taken by programs on
the transmit and receive sides so that the valid data before the overrun error occurred will be retransmit-
ted. Note that when an overrun error occurred, the SiRIC register IR bit does not change state.
4. To receive data in succession, set dummy data in the lower-order byte of the UiTB register every time
reception is made.
5. When an external clock is selected, the conditions must be met while if the CKPOL bit = “0”, the
external clock is in the high state; if the CKPOL bit = “1”, the external clock is in the low state.
• The RE bit of UiC1 register= “1” (reception enabled)
• The TE bit of UiC1 register= “1” (transmission enabled)
• The TI bit of UiC1 register= “0” (data present in the UiTB register)
19
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.9 Precautions for Serial I/O (UART Mode)
20
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.10 Precautions for A-D Converter
2. When the VCUT bit of ADCON1 register is changed from “0” (Vref not connected) to “1” (Vref con-
nected), start A-D conversion after passing 1 µs or longer.
3. To prevent noise-induced device malfunction or latchup, as well as to reduce conversion errors, insert
capacitors between the AVCC, VREF, and analog input pins (ANi(i=0 to 7)AN0i, AN2i) each and the
AVSS pin. Similarly, insert a capacitor between the VCC1 pin and the VSS pin. Figure 1.10.1 is an ex-
ample connection of each pin.
4. Make sure the port direction bits for those pins that are used as analog inputs are set to “0” (input
mode). Also, if the ADCON0 register’s TGR bit = 1 (external trigger), make sure the port direction bit for
___________
the ADTRG pin is set to “0” (input mode).
5. When using key input interrupts, do not use any of the four AN4 to AN7 pins as analog inputs. (A key
input interrupt request is generated when the A-D input voltage goes low.)
6. The φAD frequency must be 10 MHz or less. Without sample-and-hold function, limit the φAD frequency
to 250kHZ or more. With the sample and hold function, limit the φAD frequency to 1MHZ or more.
7. When changing an A-D operation mode, select analog input pin again in the CH2 to CH0 bits of
ADCON0 register and the SCAN1 to SCAN0 bits of ADCON1 register.
Microcomputer
VCC1 VCC1
VCC1 AVCC
C4
VSS VREF
C1 C2
VCC2 AVSS
VCC2 C3
C5 ANi
VSS
21
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.10 Precautions for A-D Converter
8. If VCC2 < VCC1, do not use AN00 to AN07 and AN20 to AN27 as analog input pins.
9. If the CPU reads the ADi register (i = 0 to 7) at the same time the conversion result is stored in the ADi
register after completion of A-D conversion, an incorrect value may be stored in the ADi register. This
problem occurs when a divide-by-n clock derived from the main clock or a subclock is selected for CPU
clock.
• When operating in one-shot or single-sweep mode
Check to see that A-D conversion is completed before reading the target ADi register. (Check the
ADIC register’s IR bit to see if A-D conversion is completed.)
• When operating in repeat mode or repeat sweep mode 0 or 1
Use the main clock for CPU clock directly without dividing it.
10. If A-D conversion is forcibly terminated while in progress by setting the ADCON0 register’s ADST bit
to “0” (A-D conversion halted), the conversion result of the A-D converter is indeterminate. The contents
of ADi registers irrelevant to A-D conversion may also become indeterminate. If while A-D conversion is
underway the ADST bit is cleared to “0” in a program, ignore the values of all ADi registers.
22
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.11 Precautions for Programmable I/O Ports
2. Setting the SM32 bit in the S3C register to “1” causes the P92 pin to go to a high-impedance state.
Similarly, setting the SM42 bit in the S4C register to “1” causes the P96 pin to go to a high-impedance
state.
3. The input threshold voltage of pins differs between programmable input/output ports and peripheral
functions.
Therefore, if any pin is shared by a programmable input/output port and a peripheral function and the
input level at this pin is outside the range of recommended operating conditions VIH and VIL (neither
“high” nor “low”), the input level may be determined differently depending on which side—the program-
mable input/output port or the peripheral function—is currently selected.
23
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.12 Electric Characteristic Differences Between Mask ROM and Flash Memory Version Microcomputers
1.12 Electric Characteristic Differences Between Mask ROM and Flash Memory Version Microcomputers
Flash memory version and mask ROM version may have different characteristics, operating margin, noise
tolerated dose, noise width dose in electrical characteristics due to internal ROM, different layout pattern,
etc. When switching to the mask ROM version, conduct equivalent tests as system evaluation tests con-
ducted in the flush memory version.
24
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.13 Precautions for Flash Memory Version
1.13.4 Precautions for Low power dissipation mode, ring oscillator low power dissipation mode
If the CM05 bit is set to “1” (main clock stop), the following commands must not be executed.
• Program
• Block erase
• Erase all unlocked blocks
• Lock bit program
25
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.13 Precautions for Flash Memory Version
1.13.10 Interrupts
EW0 Mode
• Any interrupt which has a vector in the variable vector table can be used providing that its vector is
transferred into the RAM area.
_______
• The NMI and watchdog timer interrupts can be used because the FMR0 register and FMR1 regis-
ter are initialized when one of those interrupts occurs. The jump addresses for those interrupt
service routines should be set in the fixed vector table.
_______
Because the rewrite operation is halted when a NMI or watchdog timer interrupt occurs, the rewrite
program must be executed again after exiting the interrupt service routine.
• The address match interrupt cannot be used because the flash memory’s internal data is refer-
enced.
EW1 Mode
• Make sure that any interrupt which has a vector in the variable vector table or address match
interrupt will not be accepted during the auto program or auto erase period.
• Avoid using watchdog timer interrupts.
_______
• The NMI interrupt can be used because the FMR0 register and FMR1 register are initialized when
this interrupt occurs. The jump address for the interrupt service routine should be set in the fixed
vector table.
_______
Because the rewrite operation is halted when a NMI interrupt occurs, the rewrite program must be
executed again after exiting the interrupt service routine.
26
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.13 Precautions for Flash Memory Version
27
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
2.1 Vdet2 Detection
Supplementary Explanation
Normally, during the stop mode, the Vdet3 voltage is not detected, and thus no reset is generated even
when the input voltage at the VCC1 pin drops to Vdet3 or less. Therefore, if the microcomputer is not reset
when the VCC1 voltage drops below Vdet2 due to the reason described in the above No.1, the microcom-
puter cannot get out of the stop mode with Hardware Reset 2.
28
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
2.2 RESET Input
29
Renesas microcomputers
M16C / 62P Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
2.3 Serial I/O
30
REVISION HISTORY M16C/62 GROUP (M16C/62P) USAGE NOTES
B-1
RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER
USAGE NOTES REFERENCE BOOK
M16C/62 Group (M16C/62P) Rev.1.10
Editioned by
Committee of editing of RENESAS Semiconductor Usage Notes Reference
Book
This book, or parts thereof, may not be reproduced in any form without permission
of Renesas Technology Corporation.
Copyright © 2003. Renesas Technology Corporation, All rights reserved.
M16C/62 Group (M16C/62P)
Usage Notes Reference Book