Renesas R0E530640MCU00, M16C, М64 User Manual

REJ10J1733-0100(T)
p
R0E530640MCU00
E100 Emulator MCU Unit for M16C/64 Grou
Rev.1.00 Apr. 01, 2008
Notes regarding these materials
1. This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use. Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of Renesas or any third party with respect to the information in this document.
2. Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document, including, but not limited to, product data, diagrams, charts, programs, algorithms, and application circuit examples.
3. You should not use the products or the technology described in this document for the purpose of military applications such as the development of weapons of mass destruction or for the purpose of any other military use. When exporting the products or technology described herein, you should follow the applicable export control laws and regulations, and procedures required by such laws and regulations.
4. All information included in this document such as product data, diagrams, charts, programs, algorithms, and application circuit examples, is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas products listed in this document, please confirm the latest product information with a Renesas sales office. Also, please pay regular and careful attention to additional and different information to be disclosed by Renesas such as that disclosed through our website. (http://www.renesas.com )
5. Renesas has used reasonable care in compiling the information included in this document, but Renesas assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information included in this document.
6. When using or otherwise relying on the information in this document, you should evaluate the information in light of the total system before deciding about the applicability of such information to the intended application. Renesas makes no representations, warranties or guaranties regarding the suitability of its products for any particular application and specifically disclaims any liability arising out of the application and use of the information in this document or Renesas products.
7. With the exception of products specified by Renesas as suitable for automobile applications, Renesas products are not designed, manufactured or tested for applications or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality and reliability such as safety systems, or equipment or systems for transportation and traffic, healthcare, combustion control, aerospace and aeronautics, nuclear power, or undersea communication transmission. If you are considering the use of our products for such purposes, please contact a Renesas sales office beforehand. Renesas shall have no liability for damages arising out of the uses set forth above.
8. Notwithstanding the preceding paragraph, you should not use Renesas products for the purposes listed below: (1) artificial life support devices or systems (2) surgical implantations (3) healthcare intervention (e.g., excision, administration of medication, etc.) (4) any other purposes that pose a direct threat to human life Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use Renesas products in any of the foregoing applications shall indemnify and hold harmless Renesas Technology Corp., its affiliated companies and their officers, directors, and employees against any and all damages arising out of such applications.
9. You should use the products described herein within the range specified by Renesas, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas shall have no liability for malfunctions or damages arising out of the use of Renesas products beyond such specified ranges.
10. Although Renesas endeavors to improve the quality and reliability of its products, IC products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Please be sure to implement safety measures to guard against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other applicable measures. Among others, since the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or system manufactured by you.
11. In case Renesas products listed in this document are detached from the products to which the Renesas products are attached or affixed, the risk of accident such as swallowing by infants and small children is very high. You should implement safety measures so that Renesas products may not be easily detached from your products. Renesas shall have no liability for damages arising out of such detachment.
12. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written approval from Renesas.
13. Please contact a Renesas sales office if you have any questions regarding the information contained in this document, Renesas semiconductor products, or if you have any other inquiries.
R0E530640MCU00 User’s Manual Preface

Preface

The R0E530640MCU00 is a full-spec emulator for M16C/60 Series M16C/64 Group MCUs. This user's manual mainly
describes specifications of the R0E530640MCU00 and how to setup it. For details on the emulator debugger included in this
product, refer to the product's user's manual.
All the components of this product are shown in “
this product, contact your local distributor.
The related manuals for using this product are listed below. You can download the latest manuals from the Renesas Tools
homepage (http://www.renesas.com/tools).
Related manuals
Item Manual
R0E0100TNPFJ00 User’s Manual Accessory
R0E0100TNPFK00 User’s Manual Integrated development environment High-performance Embedded Workshop User’s Manual Emulator debugger R0E530640MCU00 User’s Manual C compiler C Compiler Package for R8C/Tiny, M16C/60, 30, Tiny, 20 and 10 Series
C Compiler User's Manual Assembler C Compiler Package for R8C/Tiny, M16C/60, 30, Tiny, 20 and 10 Series
Assembler User's Manual
1.1 Package Components” (page 16). If there is any question or doubt about
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 3 of 229
R0E530640MCU00 User’s manual Important

Important

Before using this product, be sure to read this user’s manual carefully.
Keep this user’s manual, and refer to it when you have questions about this product.
Emulator:
The emulator in this document refers to the following products that are manufactured by Renesas Technology Corp.:
(1) E100 emulator main unit
(2) MCU unit
(3) Pitch converter board for connecting the user system
The emulator herein does not include the customer’s user system and host machine.
Purpose of use of the emulator:
This emulator is a device to support the development of a system that uses the M16C Family M16C/60 Series M16C/64 Group
of Renesas 16-bit single-chip MCUs. It provides support for system development in both software and hardware.
Be sure to use this emulator correctly according to said purpose of use. Please avoid using this emulator for other than its
intended purpose of use.
For those who use this emulator:
This emulator can only be used by those who have carefully read the user’s manual and know how to use it.
Use of this emulator requires the basic knowledge of electric circuits, logical circuits, and MCUs.
When using the emulator:
(1) This product is a development supporting unit for use in your program development and evaluation stages. In mass-
producing your program you have finished developing, be sure to make a judgment on your own risk that it can be put to practical use by performing integration test, evaluation, or some experiment else.
(2) In no event shall Renesas Technology Corp. be liable for any consequence arising from the use of this product. (3) Renesas Technology Corp. strives to renovate or provide a workaround for product malfunction at some charge or
without charge. However, this does not necessarily mean that Renesas Technology Corp. guarantees the renovation or the provision under any circumstances.
(4) This product has been developed by assuming its use for program development and evaluation in laboratories. Therefore,
it does not fall under the application of Electrical Appliance and Material Safety Law and protection against electromagnetic interference when used in Japan.
(5) Renesas Technology Corp. cannot predict all possible situations or possible cases of misuse where a potential danger
exists. Therefore, the warnings written in this user’s manual and the warning labels attached to this emulator do not necessarily cover all of such possible situations or cases. Please be sure to use this emulator correctly and safely on your own responsibility.
(6) This product is not qualified under UL or other safety standards and IEC or other industry standards. This fact must be
taken into account when taking this product from Japan to some other country.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 4 of 229
R0E530640MCU00 User’s manual Important
Usage restrictions:
This emulator has been developed as a means of supporting system development by users. Therefore, do not use it as a device
used for equipment-embedded applications. Also, do not use it for developing the systems or equipment used for the following
purposes either:
(1) Transportation and vehicular
(2) Medical (equipment where human life is concerned)
(3) Aerospace
(4) Nuclear power control
(5) Undersea repeater
If you are considering the use of this emulator for one of the above purposes, please be sure to consult your local distributor.
About product changes:
We are constantly making efforts to improve the design and performance of this emulator. Therefore, the specification or
design of this emulator or its user’s manual may be changed without prior notice.
About the rights:
(1) We assume no responsibility for any damage or infringement on patent rights or any other rights arising from the use of
any information, products or circuits presented in this user’s manual.
(2) The information or data in this user’s manual does not implicitly or otherwise grant a license for patent rights or any other
rights belonging to us or third parties.
(3) This user’s manual and this emulator are copyrighted, with all rights reserved by us. This user’s manual may not be copied,
duplicated or reproduced, in whole or part, without prior written consent of us.
About diagrams:
The diagrams in this user’s manual may not all represent exactly the actual object.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 5 of 229
R0E530640MCU00 User’s Manual Precautions for safety

Precautions for Safety

Definitions of Signal Words
In both the user’s manual and on the product itself, several icons are used to insure proper handling of this product and also to
prevent injuries to you or other persons, or damage to your properties.
This chapter describes the precautions which should be taken in order to use this product safely and properly. Be sure to read
this chapter before using this product.
This symbol represents a warning about safety. It is used to arouse caution about a potential
DANGER
WARNING
CAUTION
CAUTION
IMPORTANT
In addition to the five above, the following are also used as appropriate.
means WARNING or CAUTION.
Example:
danger that will possibly inflict an injury on persons. To avoid a possible injury or death, please be sure to observe the safety message that follows this symbol.
DANGER indicates an imminently dangerous situation that will cause death or heavy wound unless it is avoided. However, there are no instances of such danger for the product presented in this user's manual.
WARNING indicates a potentially dangerous situation that will cause death or heavy wound unless it is avoided.
CAUTION indicates a potentially dangerous situation that will cause a slight injury or a medium-degree injury unless it is avoided.
CAUTION with no safety warning symbols attached indicates a potentially dangerous situation that will cause property damage unless it is avoided.
This is used in operation procedures or explanatory descriptions to convey exceptional conditions or cautions to the user.
CAUTION AGAINST AN ELECTRIC SHOCK
means PROHIBITION.
Example:
DISASSEMBLY PROHIBITED
means A FORCIBLE ACTION.
Example:
UNPLUG THE POWER CABLE FROM THE RECEPTACLE.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 6 of 229
R0E530640MCU00 User’s Manual Precautions for safety
WARNING
Warnings for AC Power Supply:
z If the attached AC power cable does not fit the receptacle, do not alter the AC power cable and do not plug it
forcibly. Failure to comply may cause electric shock and/or fire.
z Use an AC power cable which complies with the safety standard of the country.
z Do not touch the plug of the AC power cable when your hands are wet. This may cause electric shock.
z This product is connected signal ground with frame ground. If your developing product is transformless (not
having isolation transformer of AC power), this may cause electric shock. Also, this may give an unrepairable damage to this product and your developing one. While developing, connect AC power of the product to commercial power through isolation transformer in order to avoid these dangers.
z If other equipment is connected to the same branch circuit, care should be taken not to overload the circuit.
z When installing this equipment, insure that a reliable ground connection is maintained.
z The rated voltage for this cable is 125 volts. When you connect to a power supply of more than 125V, use an
appropriate cable for the voltage.
z If you smell a strange odor, hear an unusual sound, or see smoke coming from this product, then disconnect
power immediately by unplugging the AC power cable from the outlet. Do not use this as it is because of the danger of electric shock and/or fire. In this case, contact your local distributor.
z Before setting up this emulator and connecting it to other devices, turn off power or remove a power cable to
prevent injury or product damage.
Warnings to Be Taken for This Product:
z Do not disassemble or modify this product. Personal injury due to electric shock may occur if this product is
disassembled and modified. Disassembling and modifying the product will void your warranty.
z Make sure nothing falls into the cooling fan on the top panel, especially liquids, metal objects, or anything
combustible.
Warning for Installation:
z Do not set this product in water or areas of high humidity. Make sure that the product does not get wet. Spilling
water or some other liquid into the product may cause unrepairable damage.
Warning for Use Environment:
z This equipment is to be used in an environment with a maximum ambient temperature of 35°C. Care should be
taken that this temperature is not exceeded.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 7 of 229
R0E530640MCU00 User’s Manual Precautions for safety
Cautions to Be Taken for Turning On the Power:
z Turn ON/OFF the power of the emulator and user system as simultaneously as possible.
z When turning on the power again after shutting off the power, wait about 10 seconds.
Cautions to Be Taken for Handling This Product:
z Use caution when handling the main unit. Be careful not to apply a mechanical shock.
z Do not touch the connector pins of the emulator main unit and the target MCU connector pins directly. Static
electricity may damage the internal circuits.
z Do not pull this emulator by the communications interface cable or the flexible cable. And, excessive flexing or
force may break conductors.
z Do not flex the flexible cable excessively. The cable may cause a break.
z Do not use inch-size screws for this equipment. The screws used in this equipment are all ISO (meter-size) type
screws. When replacing screws, use same type screws as equipped before.
Caution to Be Taken for System Malfunctions:
z If the emulator malfunctions because of interference like external noise, shut OFF the emulator once and then
reactivate it.
CAUTION
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 8 of 229
R0E530640MCU00 User’s Manual Contents

Contents

Page
Preface..........................................................................................................................................................................3
Important.......................................................................................................................................................................4
Precautions for Safety ..................................................................................................................................................6
Contents........................................................................................................................................................................9
User Registration ........................................................................................................................................................14
Terminology ................................................................................................................................................................15
1. Outline.....................................................................................................................................................................16
1.1 Package Components ...................................................................................................................................16
1.2 Other Tool Products Required for Development ...........................................................................................16
1.3 System Configuration ....................................................................................................................................17
1.3.1 System Configuration ..................................................................................................................17
1.3.2 Names and Functions of each part of the emulator.....................................................................18
1.4 Specifications ................................................................................................................................................20
1.5 Operating Environment..................................................................................................................................21
2. Setup.......................................................................................................................................................................22
2.1 Flowchart of Starting Up the Emulator ..........................................................................................................22
2.2 Installing the Included Software ....................................................................................................................24
2.3 Connecting/Disconnecting the MCU Unit to/from the E100 Emulator Main Unit ..........................................25
2.4 Connecting the Host Machine .......................................................................................................................26
2.5 Connecting the Emulator Power Supply........................................................................................................27
2.6 Turning ON the Power...................................................................................................................................28
2.6.1 Checking the Connections of the Emulator System ....................................................................28
2.6.2 Turning ON/OFF the Power .........................................................................................................28
2.7 Self-check......................................................................................................................................................29
2.8 Selecting Clock Supply..................................................................................................................................30
2.8.1 Clocks ..........................................................................................................................................30
2.8.2 Using an Internal Oscillator Circuit Board....................................................................................31
2.8.3 Using the Oscillator Circuit on the User System..........................................................................32
2.8.4 Using the Internal Generator Circuit ............................................................................................32
2.9 Connecting the User System.........................................................................................................................33
2.9.1 Connecting to a 100-pin 0.65mm Pitch Foot Pattern...................................................................34
2.9.2 Connecting to a 100-pin 0.5mm Pitch Foot Pattern.....................................................................35
3. Tutorial ....................................................................................................................................................................36
3.1 Introduction....................................................................................................................................................36
3.2 Starting the High-performance Embedded Workshop ..................................................................................37
3.3 Connecting the Emulator ...............................................................................................................................37
3.4 Downloading the Tutorial Program................................................................................................................38
3.4.1 Downloading the Tutorial Program ..............................................................................................38
3.4.2 Displaying the Source Program ...................................................................................................39
3.5 Setting Software Breakpoints ........................................................................................................................40
3.6 Executing the Program ..................................................................................................................................41
3.6.1 Resetting the CPU .......................................................................................................................41
3.6.2 Executing the Program ................................................................................................................41
3.7 Checking Breakpoints....................................................................................................................................42
3.7.1 Checking Breakpoints..................................................................................................................42
3.8 Altering Register Contents.............................................................................................................................43
3.9 Referencing Symbols ....................................................................................................................................44
3.10 Checking Memory Contents ........................................................................................................................45
3.11 Referencing Variables .................................................................................................................................46
3.12 Showing Local Variables .............................................................................................................................48
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 9 of 229
R0E530640MCU00 User’s Manual Contents
3.13 Single-Stepping a Program .........................................................................................................................48
3.13.1 Executing Step In Command .......................................................................................................49
3.13.2 Executing the Step Out Command ..............................................................................................50
3.13.3 Executing the Step Over Command ............................................................................................51
3.14 Forcibly Breaking a Program .......................................................................................................................52
3.15 Hardware Break Facility ..............................................................................................................................53
3.15.1 Stopping a Program when It Executes a Specified Address .......................................................53
3.16 Stopping a Program when It Accesses Memory .........................................................................................54
3.17 Trace Facility ...............................................................................................................................................55
3.17.1 Showing the Trace Information Acquired by Fill Until Stop .........................................................56
3.17.2 Showing the Trace Information Acquired by Fill around TP........................................................59
3.17.3 Showing a Function Execution History ........................................................................................61
3.17.4 Filter Facility.................................................................................................................................63
3.18 Stack Trace Facility .....................................................................................................................................65
3.19 What Next?..................................................................................................................................................66
4. Preparing to Debug.................................................................................................................................................67
4.1 Starting the High-performance Embedded Workshop ...............................................................................67
4.2 Creating a New Workspace (Toolchain Unused).......................................................................................68
4.3 Creating a New Workspace (Toolchain Used)...........................................................................................70
4.4 Opening an Existing Workspace................................................................................................................73
4.5 Connecting the Emulator............................................................................................................................74
4.5.1 Connecting the Emulator .............................................................................................................74
4.5.2 Reconnecting the Emulator .........................................................................................................74
4.6 Disconnecting the Emulator .......................................................................................................................75
4.6.1 Disconnecting the Emulator.........................................................................................................75
4.7 Quitting the High-performance Embedded Workshop ...............................................................................75
4.8 Setting Up the Debug.................................................................................................................................76
4.8.1 Specifying a Download Module ...................................................................................................76
4.8.2 Setting Up Automatic Execution of Command Line Batch Files..................................................77
5. Debugging Functions..............................................................................................................................................78
5.1 Setting Up the Emulation Environment .........................................................................................................79
5.1.1 Setting Up the Emulator at Startup..............................................................................................79
5.1.2 Setting Up the Target MCU .........................................................................................................80
5.1.3 Setting Up the System .................................................................................................................82
5.1.4 Creating a Memory Map ..............................................................................................................84
5.1.5 Setting Up Flash ROM Overwrite ................................................................................................85
5.1.6 Setting the Warning of Exceptional Events .................................................................................86
5.1.7 Setting Option board....................................................................................................................86
5.1.8 Showing Progress in Boot-up Processing ...................................................................................87
5.2 Downloading a Program.............................................................................................................................89
5.2.1 Downloading a Program ..............................................................................................................89
5.2.2 Showing the Source Code ...........................................................................................................89
5.2.3 Turning columns in all source files off..........................................................................................91
5.2.4 Turning columns in one source file off.........................................................................................91
5.2.5 Showing Assembly Language Code............................................................................................92
5.2.6 Correcting Assembly Language Codes .......................................................................................93
5.3 Displaying Memory Contents in Real Time................................................................................................94
5.3.1 Displaying Memory Contents in Real Time .................................................................................94
5.3.2 Setting RAM Monitor Update Intervals ........................................................................................95
5.3.3 Clearing RAM Monitor Access History.........................................................................................95
5.3.4 Clearing RAM Monitor Error Detection Data ...............................................................................95
5.4 Showing the Current Status .......................................................................................................................96
5.4.1 Showing the Emulator Status ......................................................................................................96
5.4.2 Showing the Emulator Status in the Status Bar...........................................................................97
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 10 of 229
R0E530640MCU00 User’s Manual Contents
5.5 Periodically Reading Out and Showing the Emulator Status.....................................................................98
5.5.1 Periodically Reading Out and Showing the Emulator Information...............................................98
5.5.2 Selecting the Items to Be Displayed............................................................................................99
5.6 Using Software Breakpoints.....................................................................................................................100
5.6.1 Using Software Breakpoints ......................................................................................................100
5.6.2 Adding/Removing Software Breakpoints ...................................................................................100
5.6.3 Enabling/Disabling Software Breakpoints..................................................................................102
5.7 Using Events ............................................................................................................................................104
5.7.1 Using Events..............................................................................................................................104
5.7.2 Adding Events............................................................................................................................104
5.7.3 Removing Events.......................................................................................................................110
5.7.4 Registering Events.....................................................................................................................112
5.7.5 Entering Events Each Time or Reusing Events.........................................................................114
5.7.6 Applying Events .........................................................................................................................115
5.8 Setting Hardware Break Conditions.........................................................................................................116
5.8.1 Setting Hardware Break Conditions...........................................................................................116
5.8.2 Setting Hardware Breakpoints ...................................................................................................116
5.8.3 Saving/Loading the Set Contents of Hardware Breaks .............................................................119
5.9 Looking at Trace Information ...................................................................................................................120
5.9.1 Looking at Trace Information .....................................................................................................120
5.9.2 Acquiring Trace Information.......................................................................................................120
5.9.3 Setting Trace Information Acquisition Conditions......................................................................122
5.9.4 Setting Trace Modes..................................................................................................................124
5.9.5 Setting Trace Points...................................................................................................................126
5.9.6 Setting Capture/Do not Capture Conditions ..............................................................................130
5.9.7 Selecting the Content of Trace Acquisition................................................................................132
5.9.8 Showing Trace Results..............................................................................................................133
5.9.9 Filtering Trace Information.........................................................................................................135
5.9.10 Searching for Trace Records.....................................................................................................137
5.9.11 Saving Trace Information to Files..............................................................................................138
5.9.12 Loading Trace Information from Files........................................................................................139
5.9.13 Temporarily Stopping Trace Information Acquisition.................................................................139
5.9.14 Restarting Trace Information Acquisition...................................................................................139
5.9.15 Switching Time Stamp Display ..................................................................................................139
5.9.16 Showing the History of Function Execution ...............................................................................140
5.9.17 Showing the History of Task Execution .....................................................................................141
5.10 Measuring Performance ...........................................................................................................................142
5.10.1 Measuring Performance ............................................................................................................142
5.10.2 Showing the Result of Performance Measurement...................................................................142
5.10.3 Setting Performance Measurement Conditions.........................................................................143
5.10.4 Starting Performance Measurement..........................................................................................145
5.10.5 Clearing Performance Measurement Conditions.......................................................................146
5.10.6 Clearing the Performance Measurement Result .......................................................................146
5.10.7 About the Maximum Measurement Time of Performance.........................................................146
5.11 Measuring Code Coverage ......................................................................................................................147
5.11.1 Measuring Code Coverage........................................................................................................147
5.11.2 Opening the Code Coverage Window .......................................................................................147
5.11.3 Allocating Code Coverage Memory (Hardware Resource) .......................................................148
5.11.4 Measuring an Address Range ...................................................................................................151
5.11.5 Adding Address Ranges ............................................................................................................152
5.11.6 Changing Address Ranges........................................................................................................154
5.11.7 Removing Address Ranges .......................................................................................................155
5.11.8 Measuring Source Files .............................................................................................................157
5.11.9 Adding Source Files...................................................................................................................158
5.11.10 Removing Source Files..............................................................................................................159
5.11.11 Showing Percentages and Graphs ............................................................................................161
5.11.12 Using the Sort Function .............................................................................................................162
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 11 of 229
R0E530640MCU00 User’s Manual Contents
5.11.13 Searching for Unexecuted Lines................................................................................................163
5.11.14 Clearing Code Coverage Information ........................................................................................164
5.11.15 Updating Coverage Information.................................................................................................164
5.11.16 Inhibiting Updating of Information ..............................................................................................164
5.11.17 Saving Code Coverage Information to Files..............................................................................165
5.11.18 Loading Code Coverage Information from Files........................................................................165
5.11.19 About Coverage Information File Load Modes ..........................................................................166
5.11.20 Showing Code Coverage Results in the Editor Window............................................................168
5.12 Measuring Data Coverage .......................................................................................................................169
5.12.1 Measuring Data Coverage.........................................................................................................169
5.12.2 Opening the Data Coverage Window ........................................................................................169
5.12.3 Allocating Data Coverage Memory (Hardware Resource) ........................................................170
5.12.4 Measuring an Address Range ...................................................................................................172
5.12.5 Adding Address Ranges ............................................................................................................173
5.12.6 Changing Address Ranges........................................................................................................174
5.12.7 Removing Address Ranges .......................................................................................................176
5.12.8 Measuring Sections ...................................................................................................................178
5.12.9 Adding Sections.........................................................................................................................179
5.12.10 Removing Sections ....................................................................................................................180
5.12.11 Measuring Task Stack ...............................................................................................................182
5.12.12 Clearing Data Coverage Information .........................................................................................183
5.12.13 Updating Coverage Information.................................................................................................183
5.12.14 Inhibiting Updating of Information ..............................................................................................183
5.12.15 Saving Data Coverage Information to Files...............................................................................184
5.12.16 Loading Data Coverage Information from Files.........................................................................184
5.13 Viewing Realtime Profile Information .......................................................................................................186
5.13.1 Viewing Realtime Profile Information.........................................................................................186
5.13.2 Setting Realtime Profile Measurement Modes ..........................................................................188
5.13.3 Measuring Function Profiles ......................................................................................................188
5.13.4 Setting Function Profile Measurement Ranges.........................................................................189
5.13.5 Saving Function Profile Measurement Ranges .........................................................................190
5.13.6 Loading Function Profile Measurement Ranges .......................................................................190
5.13.7 Measuring Task Profiles ............................................................................................................191
5.13.8 Setting Task Profile Measurement Ranges ...............................................................................192
5.13.9 Saving Task Profile Measurement Tasks ..................................................................................193
5.13.10 Loading Task Profile Measurement Tasks ................................................................................193
5.13.11 Clearing Realtime Profile Measurement Results.......................................................................194
5.13.12 Saving Realtime Profile Measurement Results .........................................................................194
5.13.13 Setting the Unit of Measurement ...............................................................................................194
5.13.14 Maximum Measurement Time of the Realtime Profile...............................................................195
5.14 Detecting Exception Events .....................................................................................................................196
5.14.1 Detecting Exception Events.......................................................................................................196
5.14.2 Detecting an Access Protect Violation.......................................................................................196
5.14.3 Setting an Access Protected Area.............................................................................................198
5.14.4 Detecting Initialization-Omitted..................................................................................................202
5.14.5 Detecting a Performance Overflow............................................................................................203
5.14.6 Detecting a Realtime Profile Overflow.......................................................................................203
5.14.7 Detecting a Trace Memory Overflow .........................................................................................204
5.14.8 Detecting a Task Stack Access Violation ..................................................................................204
5.14.9 Setting a Task Stack Area .........................................................................................................205
5.14.10 Detecting an OS dispatch ..........................................................................................................208
5.15 Using the Start/Stop Function ..................................................................................................................209
5.15.1 Opening the Start/Stop Function Setting Dialog Box.................................................................209
5.15.2 Specifying the Routine to be executed ......................................................................................209
5.15.3 Limitations of the Start/Stop Function........................................................................................209
5.15.4 Limitations to the Statements written in a Specified Routine ....................................................210
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 12 of 229
R0E530640MCU00 User’s Manual Contents
6. Troubleshooting (Action on Error).........................................................................................................................211
6.1 Flowchart to Remedy the Troubles .............................................................................................................211
6.2 Self-check Error...........................................................................................................................................212
6.3 Error at Debugger Startup ...........................................................................................................................213
6.4 How to Request for Support ........................................................................................................................215
7. Hardware Specifications .......................................................................................................................................216
7.1 Target MCU Specifications..........................................................................................................................216
7.2 Differences between the Actual MCU and Emulator...................................................................................217
7.3 Connection Diagram....................................................................................................................................218
7.3.1 Connection Diagram for the R0E530640MCU00 ......................................................................218
7.4 External Dimensions....................................................................................................................................219
7.4.1 External Dimensions of the E100 Emulator ...............................................................................219
7.4.2 External Dimensions of the Converter Board R0E0100TNPFJ00.............................................220
7.4.3 External Dimensions of the Converter Board R0E0100TNPFK00 ............................................221
7.5 Notes on Using This Product.......................................................................................................................222
8. Maintenance and Guarantee ................................................................................................................................226
8.1 User Registration.........................................................................................................................................226
8.2 Maintenance ................................................................................................................................................226
8.3 Guarantee....................................................................................................................................................226
8.4 Repair Provisions ........................................................................................................................................226
8.5 How to Make Request for Repair ................................................................................................................227
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 13 of 229
R0E530640MCU00 User’s Manual User Registration

User Registration

Customer Registration Sheet is included with this manual, fill it in and FAX or email it to your local distributor. If you register
it by email, you can use a text format for user registration created when installing the software in the following folder. Your
registered information is used for only after-sale services, and not for any other purposes. Without user registration, you will
not be able to receive maintenance services such as a notification of field changes or trouble information. So be sure to carry
out the user registration.
For more information about user registration, please contact your local distributor.
Text format for user registration C:\Program Files\Renesas\Hew\Support
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 14 of 229
R0E530640MCU00 User’s Manual Terminology

Terminology

Some specific words used in this user's manual are defined as follows:
MCU unit R0E530640MCU00
This means the E100 emulator for M16C/64 Group.
Emulator system
This means an emulator system built around the MCU unit R0E530640MCU00. The emulator system is configured with an
emulator main unit R0E001000EMU00, MCU unit R0E530640MCU00, emulator power supply, USB cable, emulator
debugger and host machine.
Integrated development environment High-performance Embedded Workshop
This tool provides powerful support for the development of embedded applications for Renesas microcomputers. It has an
emulator debugger function allowing the emulator to be controlled from the host machine via an interface. Furthermore, it
permits a range of operations from editing a project to building and debugging it to be performed within the same application.
In addition, it supports version management.
Emulator debugger
This means a software tool starting up from the High-performance Embedded Workshop to control this product and enable
debugging.
Firmware
This means a control program stored in the emulator. This analyzes contents of communication with the emulator debugger
and controls the emulator hardware. To upgrade the firmware, download the program form the emulator debugger.
Host machine
This means a personal computer used to control the emulator.
Target MCU
This means the MCU to be debugged.
User system
This means a user's application system using the MCU to be debugged.
User program
This means the program to be debugged.
Evaluation MCU
This means the MCU mounted on the emulator which is operated in the specific mode for tools.
#
This symbol is used to show Low active. (e.g. RESET#: Reset signal)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 15 of 229
R0E530640MCU00 User’s Manual 1. Outline

1. Outline

This chapter describes the package components, the system configuration, the specifications of the emulator functions and the
operating environment.

1.1 Package Components

The R0E530640MCU00 package consists of the following items. When unpacking it, check to see if your R0E530640MCU00
contains all of these items.
Table 1.1 Package components
Item Quantity
R0E530640MCU00 MCU mounting board 1 Oscillator module (20MHz) mounted on the IC17 socket 1 R0E001000FLX10 flexible cable 2 R0E530640MCU00 Release Notes (English) 1 R0E530640MCU00 Release Notes (Japanese) 1 Repair Request Sheet (English) 1 Repair Request Sheet (Japanese) 1 CD-ROM
* Please keep the R0E530640MCU00's packing box and cushion material in your place for reuse at a later time when sending
your product for repair or other purposes. Always use this packing box and cushion material when transporting this product.
* If there is any question or doubt about the packaged product, contact your local distributor.

1.2 Other Tool Products Required for Development

To bring forward program development on an M16C/60 Series M16C/64 Group MCU, the products listed below are necessary
in addition to those contained package above. Get them separately.
Table 1.2 Other tool products required for development
Emulator main unit E100 R0E001000EMU00 100-pin 0.65mm pitch QFP (PRQP0100JD-B Previous code: 100P6F-A) R0E0100TNPFJ00 100-pin 0.5mm pitch LQFP (PLQP0100KB-A Previous code: 100P6Q-A) R0E0100TNPFK00
* For purchasing these products, contact your local distributor.
- M16C R8C E100 emulator debugger
- User’s Manual
Product Part No.
1
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 16 of 229
R0E530640MCU00 User’s Manual 1. Outline

1.3 System Configuration

1.3.1 System Configuration

Figure 1.1 shows a configuration of the emulator system.
(4) USB interface
(1) MCU unit
R0E530640MCU00
(2) Flexible cable
(7) Pitch converter board for
connecting to the user system
(5) AC adapter power
supply for the emulator
(6) Host machine (3) E100 emulator
main unit
(8) User system
Figure 1.1 System configuration
(1) MCU Unit R0E530640MCU00 (this product)
This is an MCU mounting board for the M16C/60 Series M16C/64 Group MCUs with 512 KB ROM and contains an
evaluation MCU.
(2) Flexible cable R0E001000FLX10 (included)
(3) E100 Emulator main unit R0E001000EMU00
This is the E100 emulator main unit.
(4) USB interface cable
This is an interface cable for the host machine and emulator.
(5) AC adapter supply for the emulator
(6) Host machine
A personal computer to control the emulator.
(7) Pitch converter board for connecting the user system R0E0100TNPFJ00, etc.
(8) User system and user system power supply
User system is your application system. This emulator can be used without the user system.
The user system power supply is power supply for the user system. This emulator cannot supply power to the user system.
Get a power supply separately.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 17 of 229
R0E530640MCU00 User’s Manual 1. Outline

1.3.2 Names and Functions of each part of the emulator

Figure 1.2 shows the names of each part of the emulator.
(4) External trigger connector(5) System status LEDs
(1) Power switch
(2) USB cable connector
(3) Power connector
(6) Target status LEDs
Figure 1.2 Names of each part of the emulator
(1) Power switch
This is a switch to turn ON/OFF the emulator.
(2) USB cable connector
This is a connector to connect the USB cable of the emulator.
(3) Power connector
This is a connector to connect the DC cable of the AC adapter power of the emulator.
(4) External trigger connector
This is a connector to connect the external trigger cable of the emulator.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 18 of 229
R0E530640MCU00 User’s Manual 1. Outline
(5) System Status LEDs
The system status LEDs indicate the emulator E100's power supply, firmware operating status, etc. Table 1.3 lists the
definitions of each system status LED.
Table 1.3 Definitions of the system status LEDs
Name Status Meaning
ON Emulator system power supply is turned ON. POWER
OFF Emulator system power supply is turned OFF.
SAFE
(6) Target Status LEDs
The target status LEDs indicate operating status of the target MCU and power supply of the user system. Table 1.4 lists the
definition of each target status LED.
Table 1.4 Definitions of the target status LEDs
Name Status Meaning
ON Emulator system is operating normally. Flashing Flashing
(every 2 seconds)
OFF
ON Power is supplied to the user system. POWER
OFF Power is not supplied to the user system.
ON Target MCU is being reset, or reset signal of the user system is held low. RESET
OFF Target MCU is not being reset.
ON User program is being executed. RUN
OFF User program has been halted.
Emulator system cannot communicate with the host machine. The self-check is being executed.
Emulator system is not operating normally (system status error).
IMPORTANT
Note on the Target Status POWER LED:
z If your MCU has two or more Vcc pins, the LED does not light unless power is supplied to all the pins.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 19 of 229
R0E530640MCU00 User’s Manual 1. Outline

1.4 Specifications

Table 1.5 lists the specifications of the R0E530640MCU00.
Table 1.5 Specifications of the R0E530640MCU00
Applicable MCU M16C/60 Series M16C/64 Group MCUs with 512 KB ROM Applicable MCU mode Single-chip mode, memory expansion mode, microprocessor mode Maximum ROM/RAM capacity 1. Internal flash ROM: 8KB+16KB+512KB
0E000h--0FFFFh, 10000h--13FFFh, 80000h--FFFFFh
2. Internal RAM: 31KB 00400h--07FFFh
Maximum operating frequency Power supply voltage: 2.7--5.5V 25MHz (with PLL)
(Emulation memory 0wait: 12MHz, 1wait or more: 25MHz) Software break 4096 points (uses RAM for break point capability before execution) Hardware break 16 points (Execution address, bus detection, interrupt, external trigger signal) Combination, pass count - Cumulative AND/OR/status transition
- 255 pass counts
Exception event detection Violation of access protection/task stack access violation/OS
dispatch/initialization omitted Real-time trace 192bits × 4M cycles
(Address, data, status, CPU status, bus status, target status, task ID, time stamp, 32
external trigger inputs) Trace mode Fill until stop/full/point and delay/repeat (free)/repeat (full) Trace extract/delete Capture/Do not Capture by events
or
Specified data access instruction extraction/trace extraction before and after point Real-time RAM monitor - 16,384 bytes (512 bytes × 32 blocks)
- Data/last access
Time measurement - Execution time between program start and stop
- Maximum/minimum/average execution time and pass counts of specified eight sections
- Count clock: Equal to MCU Clock or 10ns—1.6us
Coverage measurement 2 MB (256 KB × 8 blocks) Profile 1 MB (128 KB × 8 blocks) Connection to user system 100-pin 0.65mm pitch QFP R0E0100TNPFJ00 100-pin 0.5mm pitch LQFP R0E0100TNPFK00 Emulator power supply Supplied from included AC adapter (power supply voltage: 100--240 V, 50/60 Hz)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 20 of 229
R0E530640MCU00 User’s Manual 1. Outline

1.5 Operating Environment

Make sure to use this emulator in the operating environments listed in Tables 1.6 and 1.7.
Table 1.6 Operating environmental conditions
Item Description
Operating temperature 5 to 35°C (no dew) Storage temperature -10 to 60°C (no dew)
Table 1.7 Operating environment of the host machine
Item Description
Host machine IBM PC/AT compatibles OS Windows XP [*1]
Windows 2000 CPU Pentium IV 1.6 GHz or more recommended Interface USB 2.0 [*2] Memory 768 MB or greater (more than 10 times the file size of the load module)
recommended Pointing device such as mouse Mouse or any other pointing device usable with the above OS that can be
connected to the host machine. CD drive Needed to install the emulator debugger or refer to the user’s manual
Notes:
1. Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States
and other countries.
2. USB interface does not guarantee the operations with all combinations of host machine, USB device and USB hub.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 21 of 229
R0E530640MCU00 User’s Manual 2. Setup

2. Setup

This chapter describes the preparation for using this product, the procedure for starting up the emulator and how to change
settings.

2.1 Flowchart of Starting Up the Emulator

The procedure for starting up the emulator is shown in Figures 2.1 and 2.2. For details, refer to each section hereafter. If the
emulator does not start up normally, refer to “
1 Check the package components. Refer to “1.1 Package Components” (page 16).
2 User registration Refer to “User Registration” (page 14).
3 Install the included software, etc. Install them from the included CD-ROM.
Connect the MCU unit to the E100 main
4
5 Connect the host machine.
6 Connect the emulator power supply. Connect an emulator power supply to the power connector.
7 Turn on the power supply. Turn ON the power to the emulator.
8 Check the LED display of the emulator.
Try to use the emulator debugger according
9
Create a project in the High-performance
10
Start up the emulator debugger from the
11
High-performance Embedded Workshop.
12 Set up the target MCU and system.
13 Execute self-check
Figure 2.1 Flowchart of starting up the emulator (For the first time)
Embedded Workshop.
unit.
to the tutorial.
6. Troubleshooting (Action on Error)” (page 211).
Refer to “ E100 Emulator Main Unit” (page
Connect the USB interface connector of the emulator and the USB port of the host machine.
Check that the system status LED is lighting. When the user system is not connected, the POWER LED does not light up.
When using the emulator debugger for the first time, try to use the emulator functions, referring to “3. Tutorial” (page If the emulator debugger does not start, follow steps 10 through 13 in this chart to perform a self-check.
Start up the High-performance Embedded Workshop and create a project by following “
Start up the High-performance Embedded Workshop to launch the emulator debugger by following “
Set Device Setting dialog box of the emulator debugger and check “Start booting up on successful completion of self checking” by following “
2.3 Connecting/Disconnecting the MCU Unit to/from the
25)
4. Preparing to Debug” (page 67).
4. Preparing to Debug” (page 67).
4. Preparing to Debug” (page 67).
36).
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 22 of 229
R0E530640MCU00 User’s Manual 2. Setup
14 Change the settings.
Change the settings of the power supply to MCUs or clock supply, according to the use condition.
15 Connect the user system. Connect the user system as occasion demands.
16 Turn on the power supply.
Turn ON the power to the emulator and the user system as simultaneously as possible.
Check that system status LEDs, and POWER and RESET of the
17 Check the LED display of the emulator.
target status LED are lighting. When the user system is not connected, the POWER LED does not light up.
Start up the emulator debugger from the
18
High-performance Embedded Workshop.
Start up the High-performance Embedded Workshop to launch the emulator debugger.
19 Set up the target MCU and system.
Debug a program with various functions of
20
the emulator debugger
Check the contents set in the step 12 in Figure 2.1. Do not check “Start booting up on successful completion of self checking”.
Refer to the High-performance Embedded Workshop and “ Debugging Functions” (page
Figure 2.2 Flowchart of starting up the emulator (After the self-check)
5.
78).
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 23 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.2 Installing the Included Software

If you have Windows XP or 2000 on the host machine, this installation must be executed by a user with administrator rights.
Note that users without administrator rights cannot complete the installation.
When you insert the included CD-ROM to a CD-ROM drive, a message will appear. Install the software following a displayed
message.
A dialog for entering the user information (user, company, address, install destination) will appear. The entered information
will be formatted in the user registration sheet by mail.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 24 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.3 Connecting/Disconnecting the MCU Unit to/from the E100 Emulator Main Unit

Figure 2.3 shows the procedure for connecting the MCU Unit to the E100 Emulator Main Unit.
Connecting
MCU Unit
R0E530640MCU00
0
0
U
C
M
0
5
6
0
3
5
E
0
R
E100 emulator main unit
R0E001000EMU00
Disconnecting
Insert the MCU unit following the inside
rails of the main unit.
1
0
HI
G
H
0
PE
R
F
O
EM
R
U
M
L
AN
AT
CE
O
R
SY
S
T
EM
0
0
U
C
M
0
5
6
0
3
5
E
0
R
Pull the MCU unit up.
Push the MCU unit down
to check it is attached properly.
0
0
U
C
M
0
5
6
0
3
5
E
0
R
1
0
H
I G
H
0
P
ER
F O
EM
RM
UL
A
AT
N
C
O
E
R
SY
ST
EM
1
0
H
I G
H
0
PER
F
O
EM
R
M
U L
AN
A
T
C
O
E
R
S YST
EM
Figure 2.3 Connecting/Disconnecting the MCU Unit to/from the E100 Emulator Main Unit
CAUTION
Note on Connecting the MCU Unit to the E100 Emulator Main Unit:
z Always shut OFF power when connecting the MCU unit to the E100 emulator main unit. Otherwise, internal
circuits may be damaged.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 25 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.4 Connecting the Host Machine

USB interface is used for connecting the emulator to the host machine. The USB cable is connected to the USB cable
connector of the emulator and the USB port of the host machine.
Figure 2.4 Connecting the host machine
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 26 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.5 Connecting the Emulator Power Supply

Power is supplied from the included AC adapter to the emulator. The following shows how to connect the AC adapter.
(1) Turn OFF the emulator.
(2) Connect the DC cable of the AC adapter to the emulator.
(3) Connect the AC power cable to the AC adapter.
(4) Connect the AC power cable to the outlet.
Figure 2.5 Connecting the emulator power supply
Cautions for AC Adapter:
z Use only the AC adapter included in the E100 package. z The included AC adapter is exclusively for the E100 emulator main unit. Do not use it for other products. z Before installing this product or connecting it to other equipment, disconnect the AC power cable from the
outlet to prevent injury or accident.
z The DC plug of the included AC adapter has the below polarity.
z The included AC adapter has no power supply switch. The AC adapter is always active while connecting to the
AC power cable.
CAUTION
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 27 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.6 Turning ON the Power

2.6.1 Checking the Connections of the Emulator System

Before turning the power ON, check the connection of the interface cable with the host machine, emulator, and user system.

2.6.2 Turning ON/OFF the Power

- Turn ON/OFF the power of the emulator and user system as simultaneously as possible.
- When the SAFE LED of the system LEDs is flashing, check that the USB cable is connected to the host machine. When each
of the target status LEDs is flashing, check that the MCU unit is connected.
- When turning ON the power again after shutting OFF the power, wait for about 10 seconds.
IMPORTANT
Notes on Power Supply:
z The emulator pin Vcc is connected to the user system in order to monitor user system voltage. For this reason,
the emulator cannot supply power to the user system. Supply power to the user system separately.
The voltage of the user system should be as follows.
2.7 V ≤ Vcc1 = Vcc2 ≤ 5.5 V
z When you start the emulator without the user system, do not attach a converter board. When starting with a
converter board, the MCU will be in a reset status.
z When you start the emulator without the user system, take care that metallic pieces are not touched to the
connector at the head of the flexible cable.
z Do not leave either the emulator or user system powered on. The internal circuits may be damaged due to
leakage current.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 28 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.7 Self-check

The self-check is to check the emulator functions operate properly. To run the self-check function of the emulator, follow the
procedure below. While the self-check is in progress, the LEDs will change as shown in Figure 2.6. In case of ERROR,
because the target status LEDs will change depending on errors, check the system status LEDs.
(1) If the user system is connected, disconnect the converter board and the user system.
(2) Turn on the emulator.
(3) Launch the emulator debugger, and select the Start booting up on successful completion of self checking check box in the
Device Setting dialog box.
(4) When you click OK, the self-check will start. If the normal result is displayed in about 60 seconds, the self-check ends
normally.
M
E
T
S
Y
S
R
E
W
O
P
E
F
A
S
T
E
G
R
A
T
R
E
W
O
P
T
E
S
E
R
N
U
R
Emulator turned on
: ON
: OFF
: Flashing
: ON or OFF
: Indefinite
M
E
T
S
Y
S
R
E
W
O
P
E
F
A
S
T
E
G
R
A
T
R
E
W
O
P
T
E
S
E
R
N
U
R
Self-check started
Self-check executed
or
M
E
T
S
Y
S
R
E
W
O
P
E
F
A
S
T
E
G
R
A
T
R
E
W
O
P
T
E
S
E
R
N
U
R
Self-check
terminated normarlly
M
E
T
S
Y
S
R
E
W
O
P
E
F
A
S
T
E
G
R
A
T
R
E
W
O
P
T
E
S
E
R
N
U
R
Self-check error
Note: See the error display of the debugger
Figure 2.6 LED displays during the self-check
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 29 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.8 Selecting Clock Supply

2.8.1 Clocks

You can choose a clock supplied to the evaluation MCU by the Emulator tab in the Configuration properties dialog box of the
emulator debugger. Table 2.1 shows the clocks and their initial settings.
Table 2.1 Clock supply to the MCU
Clock
Main (XIN-XOUT)
Sub (XCIN-XCOUT)
Display of
emulator debugger
Emulator IC17 mounting oscillator module Yes
User Oscillator circuit on the user system -
Generate
Emulator
User Oscillator circuit on the user system -
Description Default setting
Internal generator circuit
(1.0--20.0 MHz)
Internal oscillator circuit
(32.768 kHz)
-
Yes
IMPORTANT
Notes on Changing the Clock Supply:
z The clock supply can be set by the Configuration properties dialog box when starting up the emulator debugger
or inputting emulator_clock command on the Command Line window.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 30 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.8.2 Using an Internal Oscillator Circuit Board

Kinds of Oscillator Circuit Boards
An oscillator module (20MHz) is mounted on the IC17 at factory setting. If you change the frequency, replace the oscillator
module.
(1) Replacing the Oscillator module
Remove the MCU unit from the E100 emulator main unit, and replace the oscillator module of the IC17 (see Figure 2.7).
EPSON TOYOCOM
SG-8002DC/DB Series
(power voltage 2.7--3.6V : PC/SC)
SG-8002DC
81114
51100
150
CN5
150
51100
CN6
CN
40a1a
1
Figure 2.7 Replacing the oscillator module
1 47
SG-8002DB
CN
40a1a
2
CN
40a1a
3
40b1b
40b1b40b1b40b1b
IC17
81114
1 47
CN
40a1a
4
40b1b
40b1b
CAUTION
Note on Replacing the Oscillator Module and Oscillator Circuit Board:
z Always shut OFF power when replacing the oscillator module. Otherwise, internal circuits may be damaged.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 31 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.8.3 Using the Oscillator Circuit on the User System

To operate this product with an external clock, construct the oscillator circuit as shown in Figure 2.8 in the user system and
input the oscillator output at 50% duty (within the operating range of the evaluation MCU) into pin X
. And pin X
IN
OUT
should
be open. Choose "User" in the emulator debugger to use this clock.
Figure 2.8 External oscillator circuit
Make note that in the oscillator circuit shown in Figure 2.9 where an oscillator is connected between pins X
and X
IN
OUT
oscillation does not occur because a converter board and other devices are used between the evaluation MCU and the user
system. It is the same for sub-clock oscillator circuits (X
CIN
and X
COUT
).
Figure 2.9 Circuit in which oscillation does not occur

2.8.4 Using the Internal Generator Circuit

The dedicated circuit in the E100 can generate any arbitrary frequency specified by the emulator debugger, and it can be
supplied as a main clock. It does not depend on either the oscillator circuit board in the MCU unit or the oscillator circuit on
the user system. If you want to debug programs without the user system or change a frequency temporarily, you can check its
operation before purchasing an oscillator. If you want to use the internal generator circuit in the E100 as a main clock, choose
"Generate" in the emulator debugger and specify a frequency you like to use this clock.
Although you can change a frequency between 1.0 and 99.9 MHz by 0.1 MHz for the E100, do not specify a value exceeding
the maximum input frequency 20 MHz of the X
of the MCU.
IN
,
IMPORTANT
Note on Using the Internal Generator Circuit:
z The internal generator circuit is equipped for temporary debugging purposes. Temperature characteristics of
frequencies are not guaranteed.
z Be sure to evaluate your system with an oscillator whose frequency is the same as that of the oscillator module
or oscillator circuit (emulator) for final evaluation purposes.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 32 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.9 Connecting the User System

Figure 2.10 shows how to connect this product to your user system.
Flexible cable
100-pin
0.65mm pitch
R0E0100TNPFJ00
100-pin QFP
Figure 2.10 Connecting this product to the user system
Note on Connecting the User System:
z Take care not to attach a converter board in a wrong direction. It may cause a fatal damage to the emulator and
user system.
0.5mm pitch
R0E0100TNPFK00
100-pin LQFP
CAUTION
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 33 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.9.1 Connecting to a 100-pin 0.65mm Pitch Foot Pattern

The following is a procedure of connecting to a 100-pin 0.65mm pitch foot pattern on the user system using the R0E0100TNPFJ00 (not included). For details on the R0E0100TNPFJ00 (not included), refer to its user's manual.
(1) Attach the NQPACK100RB included with th e R0E0100TNPFJ00 to the user system. (2) Attach the YQPACK100RB included with the R0E0100TNPFJ00 to the NQPACK100RB and secure it with the YQ-
GUIDEs. (3) Attach the R0E0100TNPFJ00 to the YQPACK100RB. (4) Attach the CN2 side of the R0E0100TNPFJ00 to the CN2 side of the flexible cable. (5) Attach the CN1 side of the R0E0100TNPFJ00 to the CN1 side of the flexible cable.
(4)
(5)
(3)
*
These corners are not round.
(2)
(1)
No. 1 pin
: These four products are
*
available in one package.
Figure 2.11 Connecting to a 100-pin 0.65mm pitch foot pattern
R0E0100TNPFJ00
YQ-GUIDE (×4)
YQPACK100RB
NQPACK100RB
100-pin 0.65mm pitch (PRQP0100JD-B) foot pattern
User system
Evaluation with
actual MCU
HQPACK100RB 168
(not included)
FLASH version
MCU, etc.
CAUTION
Notes on Connecting the User System:
z Take care not to attach a converter board in a wrong direction. It may cause a fatal damage to the emulator and
user system.
z The connectors of the R0E0100TNPFJ00 are guaranteed for only 50 insertion/removal iterations. z For purchasing the HQPACK100RB168, contact the following:
Tokyo Eletech Corporation http://www.tetc.co.jp/e_index.htm
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 34 of 229
R0E530640MCU00 User’s Manual 2. Setup

2.9.2 Connecting to a 100-pin 0.5mm Pitch Foot Pattern

The following is a procedure of connecting to a 100-pin 0.5mm pitch foot pattern on the user system using the R0E0100TNPFK00 (not included). For details on the R0E0100TNPFK00 (not included), refer to its user's manual.
(1) Attach the NQPACK100SD-ND included with the R0E0100TNPFK00 to the user system. (2) Attach the YQPACK100SD included with the R0E0100TNPFK00 to the NQPACK100SD-ND and secure it with the YQ-
GUIDEs. (3) Attach the R0E0100TNPFK00 to the YQPACK100SD. (4) Attach the CN2 side of the R0E0100TNPFK00 to the CN2 side of the flexible cable. (5) Attach the CN1 side of the R0E0100TNPFK00 to the CN1 side of the flexible cable.
(4)
(3)
*
These corners are not round.
(2)
(1)
No. 1 pin
: These four products are
*
available in one package.
Figure 2.12 Connecting to a 100-pin 0.5mm pitch foot pattern
(5)
R0E0100TNPFK00
YQ-GUIDE (×4)
YQPACK100SD
NQPACK100SD-ND
100-pin 0.5mm pitch (PLQP0100KB-A) foot pattern
User system
Evaluation with
actual MCU
HQPACK100SD
(not included)
FLASH version
MCU, etc.
CAUTION
Notes on Connecting the User System:
z Take care not to attach a converter board in a wrong direction. It may cause a fatal damage to the emulator and
user system.
z The connectors of the R0E0100TNPFK00 are guaranteed for only 50 insertion/removal iterations. z For purchasing the HQPACK100SD, contact the following:
Tokyo Eletech Corporation http://www.tetc.co.jp/e_index.htm
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 35 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3. Tutorial

3.1 Introduction

The E100 emulator has a tutorial program available. This program is provided as a means for presenting to you the main
features of the emulator, as will be explained in this document.
This tutorial program is written in C language, and is created to sort 10 pieces of random data in ascending/descending orders.
The following outlines the processing performed by the tutorial program.
The main function calls the tutorial function repeatedly in order to execute a sort process repeatedly.
The tutorial function generates the random data to be sorted and calls the sort and the change functions in that order.
The sort function accepts as its input an array that contains the random data generated by the tutorial function and sorts the
input data in ascending order.
The change function accepts as its input an array that was sorted in ascending order by the sort function and sorts the input data
in descending order.
The tutorial program is a program designed to help user to understand how to use the functions of the emulator and the
emulator debugger. When developing user systems and user programs, refer to the user’s manuals of the target MCUs.
CAUTION
If the tutorial program is recompiled, the addresses in a recompiled program may not be the same as those described in this
chapter.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 36 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.2 Starting the High-performance Embedded Workshop

Open a workspace following the procedure described in Section 4.4, “Opening an Existing Workspace”
For the directory, specify the one that is given below.
OS installed drive\Workspace\Tutorial\E100\M16C
For the file, specify the one that is shown below.
Figure 3.1 Open Workspace dialog box

3.3 Connecting the Emulator

When the debugger is connected to the emulator, a dialog box for setting up the debugger is displayed. In this dialog box,
make initial settings of the debugger.
When you have finished setting up the debugger, you are ready to debug.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 37 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.4 Downloading the Tutorial Program

3.4.1 Downloading the Tutorial Program

Download the object program you want to debug. Note, however, that the program to be downloaded and the address in the
microcomputer to which downloaded differ with each microcomputer used. Read the display of strings, etc. on the screen as
suitable for the microcomputer you are using. Choose Download from Tutorial.x30 of Download modules.
Figure 3.2 Download display of the tutorial program
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 38 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.4.2 Displaying the Source Program

In the High-performance Embedded Workshop you can debug a program at the source level.
Double-click Tutorial.c of C source file.
Figure 3.3 Editor window (displaying the source program)
If necessary, you can change the font and font size to make text more easily readable. For details on how to change, refer to the
High-performance Embedded Workshop User’s Manual.
The Editor window initially shows the beginning of a program. Using the scroll bar, you can look at another part of a program.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 39 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.5 Setting Software Breakpoints

Software breakpoints are one of simple debug facilities.
The Editor window permits you to set software breakpoints easily. For example, you can set a software breakpoint at a place
where the sort function is called.
Double-click a row in the S/W Breakpoints column corresponding to the source line that includes a sort function call.
Figure 3.4 Editor window (setting a software breakpoint)
The source line that includes the sort function will be marked with a red circle, indicating that a software breakpoint has been
set there.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 40 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.6 Executing the Program

The following describes how to run the program.

3.6.1 Resetting the CPU

To reset the CPU, choose Reset CPU from the Debug menu or click the Reset CPU button in the toolbar.

3.6.2 Executing the Program

To execute the program, choose Go from the Debug menu or click the Go button in the toolbar.
The program will be executed continuously until a breakpoint is reached. An arrow will be displayed in the S/W Breakpoints
column to indicate the position at which the program has stopped.
Figure 3.5 Editor window (program at a break)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 41 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
The Status window permits you to check the cause of the break that last occurred. Choose CPU −> Status from the View menu or click the View Status toolbar button
. When the Status window is displayed,
open the Target sheet in it and check.
Figure 3.6 Status window
CAUTION
The contents displayed in this window differ with each product. For details about the displayed contents of each product, refer
to Chapter 3, “Debugging,” or online help.

3.7 Checking Breakpoints

Use the Breakpoints dialog box to check all software breakpoints set.

3.7.1 Checking Breakpoints

Press the keys Ctrl + B on the keyboard of your PC. The Breakpoints dialog box shown below will be displayed.
Figure 3.7 Breakpoints dialog box
Use this dialog box to remove a breakpoint or enable or disable a breakpoint.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 42 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.8 Altering Register Contents

Choose CPU −> Registers from the View menu or click the Registers toolbar button . The Register window shown below will be displayed.
Figure 3.8 Register window
The content of any register can be altered.
Double-click the line for the register you want to alter. The dialog box shown below will be displayed, so enter a new value
with which you want to alter the register.
Figure 3.9 Set value dialog box (PC)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 43 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.9 Referencing Symbols

The Labels window permits you to display the symbol information included in a module.
Choose Symbols −> Labels from the View menu or click the Labels toolbar button
will be displayed. Use this window to look at the symbol information included in a module.
. The Labels window shown below
Figure 3.10 Label window
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 44 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.10 Checking Memory Contents

Specifying a label name, you can check in the Memory window the content of memory where the label is registered. For
example, you can check the content of memory corresponding to _main in byte size, as shown below. Choose CPU −> Memory from the View menu or click the Memory toolbar button
box.
Enter “_main” in the edit box of the Display Address dialog box.
Figure 3.11 Display Address dialog box
Click the OK button. The Memory window will be displayed, showing a specified memory area.
to display the Display Address dialog
Figure 3.12 Memory window
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 45 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.11 Referencing Variables

When single-stepping a program, you can see how the values of the variables used in the program will change as you step
through source lines or instructions. For example, following the procedure described below, you can look at the long-type
array ‘a’ that is declared at the beginning of a program.
Click the left-hand side of the array ‘a’ displayed in the Editor window and place the cursor there. Select Instant Watch with
the right mouse button. The dialog box shown below will be displayed.
Figure 3.13 Instant Watch dialog box
Click the Add button to add a variable to the Watch window.
Figure 3.14 Watch window (array display)
Or you can specify a variable name to add a variable to the Watch window. Click the right mouse button in the Watch window
and choose Add Watch from the context menu. The dialog box shown below will be displayed.
Figure 3.15 Add Watch dialog box
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 46 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
Enter a variable ‘i’ in the Variable or Expression edit box and click the OK button.
An int-type variable ‘i’ will be displayed in the Watch window.
Figure 3.16 Watch window (showing a variable)
Clicking the “+” mark shown to the left of the array ‘a’ in the Watch window, you can look at each element of the array ‘a.’
Figure 3.17 Watch window (showing array elements)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 47 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.12 Showing Local Variables

Using the Local window you can display the local variables included in a function. As an example, let’s check the local
variables of the tutorial function. This function declares three local variables ‘j,’ ‘i’ and ‘p_sam.’
Choose Symbols −> Local from the View menu or click the Locals toolbar button to display the Locals window.
The Locals window shows the local variables and the values of the function indicated by the current program counter (PC).
If no variables exist in the function, no information is displayed in the Locals window.
Figure 3.18 Locals window
Click the “+” mark shown to the left of the class instance p_sam in the Locals window to display the elements comprising the
class instance p_sam.
Look at the elements of the class instance p_sam before and after the sort function is executed to confirm that random data is
sorted in descending order.

3.13 Single-Stepping a Program

The High-performance Embedded Workshop provides various step commands that will prove useful in debugging a program.
Table 3.1 Step Options
Item No. Command Description
1 Step In Executes a program one statement at a time (including statements in a function).
2 Step Over Executes a program one statement at a time by ‘stepping over’ a function call if any.
3 Step Out After exiting a function, stops at the next statement of a program that called the function.
4 Step... Single-step a program a specified number of times at a specified speed.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 48 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.13.1 Executing Step In Command

The Step In command ‘steps in’ a called function and stops at the first statement of the called function.
To enter the sort function, choose Step In from the Debug menu or click the Step In button in the toolbar.
Figure 3.19 Step In button
Figure 3.20 Editor window (Step In)
The highlighting in the Editor window moves to the first statement of the sort function.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 49 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.13.2 Executing the Step Out Command

The Step Out command exits a called function by executing it quickly and stops at the next statement of a program from which
the function was called.
To exit the sort function, choose Step Out from the Debug menu or click the Step Out button in the toolbar.
Figure 3.21 Step Out button
Figure 3.22 Editor window (Step Out)
The data of the variable ‘a’ displayed in the Watch window will be sorted in ascending order.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 50 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.13.3 Executing the Step Over Command

The Step Over command executes the whole of a function call as one step and then stops at the next statement of the main
program.
To execute all statements in the change function at a time, choose Step Over from the Debug menu or click the Step Over
button in the toolbar.
Figure 3.23 Step Over button
Figure 3.24 Editor window (Step Over)
The data of the variable ‘a’ displayed in the Watch window will be sorted in descending order.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 51 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.14 Forcibly Breaking a Program

The High-performance Embedded Workshop permits you to forcibly break a program.
Clear all breakpoints.
To execute the rest of the tutorial function, choose Go from the Debug menu or click the Go button in the toolbar.
Figure 3.25 Go button
Since the program is executing an infinite loop process, choose Stop Program from the Debug menu or click the Halt button in
the toolbar.
Figure 3.26 Halt button
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 52 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.15 Hardware Break Facility

Hardware breaks cause the program to stop when it executes a specified address (instruction fetch) or reads or writes to a
specified memory location (data access).

3.15.1 Stopping a Program when It Executes a Specified Address

The Editor window permits you to set an instruction fetch event easily. For example, you can set an instruction fetch event at a
place where the sort function is called.
Double-click a row in the Event column corresponding to the source line that includes a sort function call.
Figure 3.27 Editor window (setting a hardware breakpoint)
The source line that includes the sort function will be marked with
program to stop when it fetches an instruction has been set there.
, indicating that a hardware breakpoint that will cause a
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 53 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.16 Stopping a Program when It Accesses Memory

To stop a program when it reads or writes a value to a global variable, set up a hardware break as described below.
Choose Event -> Hardware Break from the View menu to display the Hardware Break dialog box.
Open the OR page of the Hardware Break dialog box. In the Editor window, select a global variable that you want to be the
object of a hardware break so that a program is made to stop when it reads or writes a value to the variable, and drag-and-drop
the selected variable into the OR page.
Then click the Apply button.
When you run a program, it will stop running when a value is read or written to the global variable you have set.
Figure 3.28 Hardware Break dialog box
Notes: (1) Only the global variables that are 1 byte or 2 bytes in size can be set.
(2) Local variables cannot be set.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 54 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.17 Trace Facility

The trace facility of the E100 emulator has a special memory known as “trace memory” that can hold an execution record of
up to 4M bus cycles, which is always updated during program execution. The content of trace memory is displayed in the
Trace window. Choose Code −> Trace from the View menu or click the Trace toolbar button
The Trace window shown below will be displayed.
.
Figure 3.29 Trace window
The following outlines the trace facility and describes how to set.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 55 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.17.1 Showing the Trace Information Acquired by Fill Until Stop

The free trace facility acquires trace information successively from when the user program starts running till when it breaks.
(1) Clear all break conditions. Click the right mouse button anywhere in the Trace window and choose Acquisition from the
context menu that is displayed. The Trace conditions dialog box shown below will be displayed. Check to see that the
selected trace mode is Fill until stop. Click the Close button.
Figure 3.30 Trace conditions dialog box (free trace)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 56 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
(2) Set a software break in a line of the tutorial function where p_sam ->s0=a[0]; is written.
(3) Choose Reset Go from the Debug menu. Processing will be halted by a break, and the trace information from start to break
will be displayed in the Trace window.
Figure 3.31 Trace window (free trace)
(4) A mixed display of bus, disassemble and/or source display is possible. Choosing Display Mode −> DIS from the context
menu, you can display trace information in a bus and disassemble mixed mode.
Figure 3.32 Trace window (bus and disassemble mixed display)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 57 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
(5) Furthermore, choosing Display Mode −> SRC from the context menu, you can display trace information in a bus,
disassemble and source mixed mode.
Figure 3.33 Trace window (bus, disassemble and source mixed display)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 58 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.17.2 Showing the Trace Information Acquired by Fill around TP

The point & delay facility stops acquiring trace information a specified number of cycles after a trace point is encountered.
This facility allows you to keep track of program flow from trace information without having to break the user program.
(1) If any break conditions are set, clear all of them.
(2) Choose Fill around TP for trace mode in the Trace conditions dialog box. In the Delay Value (Cycles) column, specify 4M.
(Up to 4M cycles of trace information from where a trace point is encountered will be acquired.)
Figure 3.34 Trace conditions dialog box (Fill around TP)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 59 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
(3) Next, set a trace point at which the debugger starts acquiring trace information. Open the OR page of the Trace conditions
dialog box. Select the main function in the Editor window and drag-and-drop it into the OR page. Click the Apply button
and then the Close button.
Thus, the debugger will start acquiring trace information from when the main function is executed.
Figure 3.35 Trace conditions dialog box (OR page)
(4) Choose Reset Go from the Debug menu. A short time after a trace point is reached, the trace content shown below will be
displayed in the Trace window.
Figure 3.36 Trace window (Fill around TP)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 60 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.17.3 Showing a Function Execution History

A function execution history can be displayed from the acquired trace information.
(1) Clear all break conditions. Click the right mouse button anywhere in the Trace window and choose Acquisition from the
context menu that is displayed. The Trace conditions dialog box will be displayed. Switch the trace mode to Fill until stop
and click the Apply button. Then click the Close button.
(2) Set a software break in a line of the tutorial function where p_sam−>s0=a[0]; is written.
(3) Choose Reset Go from the Debug menu. Processing will be halted by a break, and the trace information from start to break
will be displayed in the Trace window.
(4) Click the right mouse button anywhere in the Trace window and choose Function Execution History -> Function Execution
History from the context menu that is displayed.
Figure 3.37 Trace window (function execution history–before analysis)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 61 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
(5) Click the right mouse button anywhere in the displayed function execution history window and choose Analyze Execution
History from the context menu. A function execution history will be displayed in the upper pane of the Trace window.
<Display form of function execution history> Function name (start address of function) <− function caller address
Example: _main (0F82DC) <- 0F8AB5
Figure 3.38 Trace window (function execution history–after analysis)
(6) Double-click any function in the displayed function execution history, and the trace information corresponding to that
function will be displayed in the lower pane of the Trace window.
Figure 3.39 Trace window (function execution history)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 62 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.17.4 Filter Facility

Use the filter facility to extract only the necessary cycles from the acquired trace information.
The filter facility does this by filtering the trace information in software that was acquired by hardware.
Unlike the “Capture/Do not Capture conditions” where you set acquisition conditions before getting trace information, this
facility allows you to change filter settings for the acquired trace information any number of times without having to reexecute.
Therefore, the necessary information can be extracted easily.
(1) Clear all break conditions. Click the right mouse button anywhere in the Trace window and choose Acquisition from the
context menu that is displayed. The Trace conditions dialog box will be displayed. Check to see that the selected trace
mode is Fill until stop. Click the Close button.
(2) Set a software break in a line of the tutorial function where p-sam−>s0=a[0]; is written.
(3) Choose Reset Go from the Debug menu. Processing will be halted by a break, and the trace information from start to break
will be displayed in the Trace window.
(4) Choose Auto Filter from the context menu of the Trace window. The columns for which filtering can be applied will be
marked by a
button.
Figure 3.40 Trace window (Auto Filter)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 63 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
(5) Click the
button in the R/W column and choose R from the context menu.
Figure 3.41 Trace window (Auto Filter)
(6) That way, the trace information for only R in the R/W column can be displayed.
Figure 3.42 Trace window (Auto Filter)
Notes:
(1) The filter function does not affect the trace memory, so that its content remains intact.
(2) The filter can be used when the selected trace mode is Fill until stop, Fill until full or Fill around TP.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 64 of 229
R0E530640MCU00 User’s Manual 3. Tutorial

3.18 Stack Trace Facility

Using stack information, it is possible to show which function is the caller to the function where the current PC exists.
Set a software breakpoint in any line of the sort function by double-clicking at its corresponding row in the S/W Breakpoints
column.
Figure 3.43 Editor window (setting a software breakpoint)
Choose Reset Go from the Debug menu.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 65 of 229
R0E530640MCU00 User’s Manual 3. Tutorial
After a break, choose Code −> Stack Trace from the View menu to open the Stack Trace window.
Figure 3.44 Stack Trace window
You will see that the current PC exists within the sort() function, and that the sort() function is called from the tutorial()
function.
Clear the software breakpoint that you have set in a line of the sort function by double-clicking at its corresponding row in the
S/W Breakpoints column again.

3.19 What Next?

In this tutorial, we have introduced to you several features of the E100 emulator and how to use the High-performance
Embedded Workshop.
The emulation facility that the E100 emulator provides allows you to perform advanced debugging. Once the conditions that
cause hardware or software problems to occur are exactly separated and identified by that debugging, you can examine those
problems effectively.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 66 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4. Preparing to Debug

4.1 Starting the High-performance Embedded Workshop

Follow the procedure described below to start the High-performance Embedded Workshop.
(1) Connect the host machine and the E100 Emulator and user system. Then turn on the power to the E100 Emulator and user
system.
(2) From Programs on the Start menu, choose Renesas -> High-performance Embedded Workshop -> High-performance
Embedded Workshop.
The Welcome! dialog box shown below will appear.
Figure 4.1 Welcome! dialog box
Select a startup method from the following.
- Create a new project workspace
- Open a recently used project workspace
Select this option when you use an existing workspace.
A history of the workspace you open will be displayed.
- Browse another project workspace
Select this option when you use an existing workspace.
This is the option available to choose when the workspace you opened has no history recorded.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 67 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4.2 Creating a New Workspace (Toolchain Unused)

The procedure for creating a new project workspace differs depending on whether you use a toolchain or not.
The E100 Emulator has no toolchains included in it. You can use a toolchain in an environment in which the C/C++ compiler
package is installed.
Follow the procedure described below to create a new workspace.
(1) In the Welcome! dialog box, select the radio button titled “Create a new project workspace” and click the OK button.
Figure 4.2 Welcome! dialog box
(2) Project Generator will start.
Figure 4.3 New Project Workspace dialog box
Workspace Name: Enter a workspace name here. Project Name: Enter a project name here. If the same name as a workspace name is good, you do not
need to enter it.
Directory: Enter a directory in which you want a workspace to be created. Or you can click the
Browse button and select a workspace directory from the ensuing list.
CPU family: Select the CPU family of the MCU you are using.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 68 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug
The other list boxes are used for setting up a toolchain. If no toolchains are installed, the information specific to the CPU
family is displayed here. Click the OK button.
(3) Select the debugger target.
Figure 4.4 Setting the Target System for Debugging dialog box
Select the target platform you use by placing a check mark in its check box and click the Next button.
(4) Set a configuration name. Configuration refers to the file in which the High-performance Embedded Workshop status
other than the emulator is saved.
Figure 4.5 Setting the Debugger Options dialog box
If you have selected two or more target platforms, click the Next button and then set a configuration name for each target
platform selected.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 69 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug
When you have finished setting configuration names, emulator-related settings are completed.
Click the Finish button, and the Summary dialog box will be displayed. Clicking the OK button in it starts the High-
performance Embedded Workshop.
(5) After starting the High-performance Embedded Workshop, connect the E100 Emulator.

4.3 Creating a New Workspace (Toolchain Used)

Follow the procedure described below to create a new workspace.
(1) In the Welcome! dialog box, select the radio button titled “Create a new project workspace” and click the OK button.
Figure 4.6 Welcome! dialog box
(2) Project Generator will start.
Figure 4.7 New Project Workspace dialog box
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 70 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug
Workspace Name: Enter a workspace name here. Project Name: Enter a project name here. If the same name as a workspace name is good, you do not
need to enter it.
Directory: Enter a directory in which you want a workspace to be created. Or you can click the
Browse button and select a workspace directory from the ensuing list. CPU family: Select the CPU family of the MCU you are using. Toolchain: To use a toolchain, select the appropriate toolchain here. If you do not use, select None.
The other list boxes are used for setting up a toolchain. If no toolchains are installed, the information specific to the CPU
family is displayed here. Click the OK button.
(3) Set the CPU and options for the toolchain and make other necessary settings.
(4) Select the debugger target.
Figure 4.8 Setting the Target System for Debugging dialog box
Select the target platform you use by placing a check mark in its check box and click the Next button.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 71 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug
(5) Set a configuration name.
Figure 4.9 Setting the Debugger Options dialog box
If you have selected two or more target platforms, click the Next button and then set a configuration name for each target
platform selected. When you have finished setting configuration names, emulator-related settings are completed. Click the
Finish button, and the Summary dialog box will be displayed. Clicking the OK button in it starts the High-performance
Embedded Workshop.
(6) After starting the High-performance Embedded Workshop, connect the E100 Emulator.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 72 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4.4 Opening an Existing Workspace

Follow the procedure described below to open an existing workspace.
(1) In the Welcome! dialog box, select the radio button titled “Browse to another project workspace” and click the OK button.
Figure 4.10 Welcome! dialog box
(2) The Open Workspace dialog box shown below will appear.
Figure 4.11 Open Workspace dialog box
Specify the directory in which workspaces are created, select a workspace file (extension “.hws”) and click the Select button.
(3) The High-performance Embedded Workshop will start, and the state of the selected workspace in which it was saved will
be restored. If the saved state of the selected workspace is one in which it was connected to the emulator, the workspace is
automatically connected to the emulator. If the saved state of the selected workspace is one in which it was not connected
to the emulator and you want to connect it, refer to “4.5 Connecting the Emulator”.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 73 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4.5 Connecting the Emulator

4.5.1 Connecting the Emulator

There are following methods for connecting the emulator.
(1) Setting up the emulator at startup before connecting
Choose Debug Settings from the Debug menu to open the Debug Settings dialog box. In this dialog box, you can register
download modules and the command chain to be automatically executed. When you are finished filling in the Debug Settings
dialog box, the emulator will be connected.
(2) Loading a session file
Switching to the session file that has emulator usage settings preregistered in it helps you connect the emulator easily.

4.5.2 Reconnecting the Emulator

While the emulator is disconnected, you can reconnect it following one of the procedures described below.
(1) Choose Connect from the Debug menu.
(2) Click the Connect tool button [
(3) Enter the connect command in the Command Line window.
].
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 74 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4.6 Disconnecting the Emulator

4.6.1 Disconnecting the Emulator

To disconnect the emulator while it is active, follow one of the procedures described below.
(1) Choose Disconnect from the Debug menu.
(2) Click the Disconnect tool button [
(3) Enter the disconnect command in the Command Line window.
].

4.7 Quitting the High-performance Embedded Workshop

Choosing Exit from the File menu lets you close the High-performance Embedded Workshop itself.
Before it closes, a message box will be displayed asking you whether you want to save the session. To save the session, click
the Yes button.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 75 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4.8 Setting Up the Debug

Register download modules, set up automatic execution of command line batch files and set download options, etc.

4.8.1 Specifying a Download Module

Choose Debug Settings from the Debug menu to open the Debug Settings dialog box.
Figure 4.12 Debug Settings dialog box
In the Target drop-down list box, select the product name you want to connect.
In the Default debug format drop-down list box, select the format of the load module you want to download. Then register the
load module corresponding to the selected format in the Download modules list box.
CAUTION
At this point in time, no programs are downloaded yet.
For details on how to download, refer to “5.2 Downloading a Program”.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 76 of 229
R0E530640MCU00 User’s Manual 4. Preparing to Debug

4.8.2 Setting Up Automatic Execution of Command Line Batch Files

Click the Options tab of the dialog box.
Figure 4.13 Debug Settings dialog box
Here, register a command chain that is automatically executed with specified timing.
Select your desired timing from the following four choices:
- When the emulator is connected
- Immediately before download
- Immediately after download
- Immediately after reset
In the Command batch file load timing drop-down list box, select the timing with which you want a command chain to be
executed.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 77 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5. Debugging Functions

The E100 Emulator supports the functions listed in the table below.
Table 5.1 List of Debug Functions
Item
No.
1 Software break 4,096 points
Number of event points Maximum number of effective points: 16
2 Event
3 Exception detection
Hardware
4
break
5 Trace
6 Performance
7 RAM monitor
8 Profile
9 Coverage
Content of event
Task ID Can be set separately for each event Number of times an event occurred Maximum 255 times
Hardware breakpoints
Delay Maximum 65,535 bus cycles Trace size Maximum 4M cycles
Trace mode
Trace point
Delay Maximum 4M bus cycles
Trace Capture/Do not Capture
Content of measurement
Resolution 10 ns to 1.6 us Measurement mode
Item Specification
Executed address detection Data access detection Interrupt generation/exit detection External trigger detection
Violation of access protection Read from uninitialized memory Stack access violation Performance overflow Realtime profile overflow Trace memory overflow Task stack access violation OS dispatch
Event combination
Exception detection See item No. 3
Fill until stop Continues collecting until program stops running Fill until full Stops collecting traces when trace memory is full
Fill around TP
Repeat fill until stop Collects a total of 512 cycles before and after trace point Repeat fill until full Collects a total of 512 cycles before and after trace point
Event combination
Exception detection See item No. 3
Event combination
OR, AND (Accumulation), AND (Simultaneous), subroutine, sequential and state transition
Stops collecting traces after retarded for delay cycles from when trace point is reached
OR, AND (Accumulation), AND (Simultaneous), subroutine, sequential and state transition
Capture/Do not Capture by event
- Between two events
- Duration of an event
- Duration of an event occurring in a subroutine
Data access instruction extraction Measures maximum, minimum and average execution time in up to 8 sections and pass counts Time-out and count-out detection
Between two events, Event period and Interrupt-disabled range between two events
512 bytes × 32 blocks
- Shows last read/write accesses performed
- Comes with initialization-omitted detect function 128 Kbytes × 8 blocks (1 MB space) Cumulative time and pass count overflow detection C0 level code coverage 256 Kbytes × 8 blocks (2 MB space) C0+C1 level code coverage 128 Kbytes × 8 blocks (1 MB space) Address range and source file specification Data coverage 64 Kbytes × 8 blocks (512 Kbytes space)
Address range, section specification and task stack
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 78 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1 Setting Up the Emulation Environment

When the emulator is connected, the Device setting and the Configuration properties dialog boxes are displayed. Here, select
the general options associated with the emulator. Note that the target MCU to be debugged, etc. can be set only once at startup.

5.1.1 Setting Up the Emulator at Startup

When the emulator starts, the following three dialog boxes are displayed.
(1) Device setting dialog box
Use this dialog box to select the target MCU and establish communication.
This dialog box can be redisplayed by selecting Emulator -> Device setting from the Setup menu after starting the emulator. In
this case, however, be aware that changes of the settings after starting the emulator are not reflected immediately and will be
set as the initial value when reconnecting the emulator.
(2) Configuration properties dialog box
This dialog box is displayed after the Device setting dialog box. Use this dialog box to make settings related to the emulator
and debug functions.
This dialog box can be redisplayed by selecting Emulator -> System from the Setup menu after starting the emulator. Some
options in this dialog box can have their settings changed after startup. The changeable options are displayed as in active use,
while the unchangeable options are inactive (grayed out), with their set contents only displayed.
(3) Connecting dialog box
This dialog box shows progress of boot-up processing.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 79 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1.2 Setting Up the Target MCU

(1) Selecting the target MCU
On the Device page of the Device setting dialog box, specify the target MCU to be emulated. For details, refer to the hardware
manual supplied with each product.
Figure 5.1 Device setting dialog box (Device page)
The target MCU you have set here cannot be changed after the emulator is connected. To change the target MCU, you need to
disconnect the emulator and connect it again.
(2) Selecting an operation mode
Select one from the following options:
Single-Chip mode, Memory expansion mode, Microprocessor mode
CAUTION
Options are different depending on the target MCU that you select.
(3) Selecting an external data bus width
You can set this when the operation mode you have selected is Memory expansion mode or Microprocessor mode.
Select one from the following options:
8 bits, 16 bits (initial value)
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 80 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions
(4) Selecting a memory expansion space
You can set this when the operation mode you have selected is Memory expansion mode or Microprocessor mode.
Select one from the following options:
Normal Mode (initial value), 4MB Mode
(5) Using PM13 (b3 of 0x000005) as set to 1
To switch the setting of the CS2 area, specify the PM13 (third bit of processor mode register 1) setting. When using the user
program with PM13 set to 1, select this check box.
(6) Using PM10 (b0 of 0x000005) as set to 1
To expand the internal reserved area, specify the PM10 (zeroth bit of processor mode register 1) setting. When using the user
program with PM10 set to 1, select this check box.
(7) Using PRG2C0 (b0 of 0x000010) and PM10 (b0 of 0x000005) as set to 1
To enable or disable the program ROM 2 area, specify the PRG2C0 (zeroth bit of program 2 area control register) setting.
When using the user program with PRG2C0 set to 1, select this check box.
(8) Setting up communication
Select the other party to which your system is connected via USB. The USB serial No. list box shows a list of the unit
identification information of USB-connected emulators. Clicking the Refresh button refreshes the unit identification
information.
(9) Performing self-diagnostics
By selecting the Start booting up on successful completion of self checking check box and clicking the OK button, it connects
your system and the emulator under the communication conditions you have set to perform hardware self-diagnostics. When
diagnostics is complete, the result is displayed. If diagnostics terminated normally, the system continues to perform boot-up
processing. If diagnostics terminated in error, the system aborts boot-up processing.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 81 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1.3 Setting Up the System

On the System page of the Configuration Properties dialog box, set up the entire emulator system.
This dialog box is displayed following the Device setting dialog box at startup.
Although this dialog box can be redisplayed after startup, you cannot change some settings in it. These settings can only be
changed at startup.
Figure 5.2 Configuration properties dialog box (System page)
(1) Selecting the operating clock
In the Clock section on the System page, select the clocking sources supplied to the main clock and sub-clock.
The main clock can be selected from three choices: Emulator, User and Generate. (By default, Emulator is selected.)
Select Emulator when the main clock is supplied from an internal source or User when the main clock is supplied from an
external source. To use a user-defined clock, select Generate and set the clock frequency to be used in the frequency input text
box.
The clock frequency can be set in the range 1.0 to 99.9 MHz in 0.1 MHz increments. The clock frequency for Generate can be
set only once at startup.
Selection of the sub-clock is displayed only when sub-clocks are supported. It can be selected from Emulator or User. (By
default, Emulator is selected.)
CAUTION The frequency accuracy for Generate is ±5%. Please make sure that final evaluation is performed using a resonator or
oscillator module of the frequency used for the actual target board that is mounted on-board.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 82 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions
(2) Selecting the direction of external trigger cable
For External trigger cable, select whether EXT pins 16–31 are directed for input or output. EXT pins 0–15 are fixed for input.
Select this option from the following:
- EXT 0–31 INPUT (initial value)
- EXT 0–15 INPUT, EXT 16–31 directed for OUTPUT
The setting of this option is reflected at only startup. If you set this option again in the present dialog box after startup, what
you have set has no effect.
(3) Selecting a trigger input level
For Trigger input level, select CMOS level or TTL level. Select this option from the following:
- EXT 0–31 chosen to be CMOS (initial value)
- EXT 0–15 chosen to be TTL, EXT 16–31 chosen to be CMOS
(4) Selecting a switching function
The code coverage, data coverage and realtime profile functions cannot be used at the same time. Select one function from
them.
Initially, code coverage is selected.
The setting of this option can be changed even after startup.
When the code coverage function is selected, measurements are performed at the coverage level selected in Code coverage
mode.
(5) Selecting a code coverage mode
Select a code coverage mode.
C0: Instruction coverage rate
C0 + C1: Instruction coverage rate + Branch coverage rate
You can measure up to 2 Mbytes when using the C0 level coverage, and up to 1 Mbytes when using the C0 + C1 level
coverage
The initial value is C0 coverage.
The setting of this option is reflected at only startup.
This option is available only when the Code coverage is selected in Switching function.
If you use the code coverage function, select the mode in this option at startup.
(6) Enabling Debug the program using the CPU Rewrite Mode
Select whether you want to debug the program using the CPU Rewrite Mode.
(7) Masking the target system’s RESET pin input
Select whether you want the input signal to the RESET pin of the target system to be masked.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 83 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1.4 Creating a Memory Map

On the Memory map page of the Configuration properties dialog box, set a lending memory allocation. You can specify 4
areas. (In a unit of 4KB)
Figure 5.3 Configuration properties dialog box (Memory map page)
The MCU group box displays the device selected in the Device setting dialog box. You cannot change it on this page. The
Memory map page does not appear when single-chip mode has been selected.
(1) Allocating emulation memory
You can allocate emulation memory for up to 4 areas.
Select a check box of the area to be used, and enter the start address and end address.
The addresses can be set in a unit of 4KB. Therefore, the low 12 bits of the start address and end address are fixed.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 84 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1.5 Setting Up Flash ROM Overwrite

On the Internal flash memory overwrite page of the Configuration properties dialog box, set up the overwriting of flash ROM
blocks, block by block.
Figure 5.4 Configuration properties dialog box (Internal flash memory overwrite page)
Block-by-block settings matched to the selected target MCU are automatically displayed in the list.
The blocks selected by placing a check mark in the respective check boxes are overwritten (merged), without being erased,
when a program is downloaded.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 85 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1.6 Setting the Warning of Exceptional Events

On the Exception Warning page of the Configuration properties dialog box, set whether or not to display warnings of
exceptional events in the Status window and status bar balloon.
Figure 5.5 Configuration properties dialog box (Exception Warning page)
The initial settings of Violation of access protection and Read from uninitialized memory are effective.
When downloading the load module including OS, the initial setting of Task stack access violation is also effective.
Other items are not selected.
If you deselect the check box, the item in the Status window will be displayed as “-“.

5.1.7 Setting Option board

On the Option board page of the Configuration properties dialog box, select an option board
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 86 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.1.8 Showing Progress in Boot-up Processing

You can confirm the progress of boot-up processing by checking the Connecting dialog box.
The Connecting dialog box continues displaying progress information from when boot-up processing starts till when it ends.
While the Device setting and the Configuration properties dialog boxes are displayed, you cannot manipulate this dialog box.
Figure 5.6 Connecting dialog box
(1) Showing the history of processing
The history display area on the left-hand side of the dialog box shows the history of completed processing.
The contents shown here are recorded in a trouble report. To check the content of a trouble report, select Technical Support ->
Create Bug Report from the Help menu.
(2) Showing the pin states
The pin states are displayed after the completion of the emulator’s startup process.
If the contents set in the Device setting dialog box and the pin states shown here do not match, a warning message is displayed
in the history display area.
(3) Showing the clocks
The clocks are displayed after the completion of the emulator’s startup process.
Only the actually operating clocks are displayed here.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 87 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions
(4) Showing progress with progress bars
The upper progress bar shows the progress of the entire boot-up processing.
The lower progress bar shows the progress of each individual processing.
The content of the currently executed processing is displayed below the bar.
(5) Aborting a connection
Clicking the Cancel button aborts boot-up processing.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 88 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.2 Downloading a Program

5.2.1 Downloading a Program

Download the load module to be debugged.
To download a program, choose Download from the Debug menu and select your desired load module from the ensuing list, or
right-click a load module in Download modules of the Workspace window and then choose Download from the pop-up or
context menu.
CAUTION
Before a program can be downloaded, you must have it registered as a load module in the High-performance Embedded
Workshop. For details on how to register, refer to “4.7 Setting Up the Debug”.

5.2.2 Showing the Source Code

Follow the procedure described below to show the source code.
- Double-click a source file in the Workspace window.
- Right-click in the source file and choose Open from the context menu.
Figure 5.7 Editor window
Shown at left edge of this window are the line information consisting of the following:
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 89 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions
(1) Line column
Shows the line numbers corresponding to lines in the source file.
(2) Source Address column
When a program is downloaded, this column shows the addresses corresponding to lines in the current source file. This
function will prove convenient when you determine where you want the PC value or breakpoint to be set.
(3) Event column
This column shows the following:
Table 5.2 Event column list
Hardware breakpoint is set Trace point (fetch condition) is set
A hardware breakpoint can be inserted by double-clicking in the event column.
Trace points are displayed when fetch conditions are set.
[*] after the title on the title bar of the dialog boxes of Hardware break, Trace conditions or Performance Analysis Conditions
shows that some setting is under editing. If you are doing some editing work, you cannot set change the settings from the event
column of the Editor window.
(4) Code Coverage column
Shows C0 code coverage information graphically.
(5) S/W Breakpoints column
This column shows the following:
Table 5.3 Software breakpoint column list
Bookmark is set Software break is set
PC position
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 90 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.2.3 Turning columns in all source files off

(1) From the Editor window
1. Right-click in the Editor window and choose Define Column Format from the context menu.
2. The Global Editor Column States dialog box will be displayed.
Figure 5.8 Global Editor Column States dialog box
3. Deselect the check box of the column you want to turn off. Click the OK button, and the new column settings you have set
will take effect.

5.2.4 Turning columns in one source file off

(1) From the Editor window
1. Right-click in the Editor window and choose Columns from the context menu.
2. Cascaded menu items will be displayed. The currently enabled columns have a check mark attached to the left of the
respective names.
Figure 5.9 Popup menu window
3. Clicking a column name lets you enable or disable the column alternately.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 91 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.2.5 Showing Assembly Language Code

While a source file is open, click the right mouse button in the Editor window and choose View Disassembly from the context
menu. The Disassembly window will be displayed.
The display start address in the Disassembly window is the one that corresponds to the cursor position in the Editor window.
You also can use the Disassembly View button in the Editor window to display disassembled codes.
If no source files exist, one of the following methods may be used to display disassembled codes.
Click the Disassembly toolbar button [
].
Choose Disassembly from the View menu.
Use the “Ctrl + D” accelerator.
In this case, the Disassembly window opens at the current PC position.
Mixed mode display where all source lines are displayed beginning with that address is also supported as an option. To display
disassembled codes in mixed mode, click the Show in Mixed Mode button.
Figure 5.10 Disassembly window
Shown at left edge of this window are the line information consisting of the following:
(1) Event column
This column shows the following:
Table 5.4 Event column list
Hardware breakpoint is set. Trace point (fetch condition) is set.
A hardware breakpoint can be inserted by double-clicking in the event column.
Trace points are displayed when fetch conditions are set.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 92 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions
(2) S/W Breakpoints - ASM column
This column shows the following:
Table 5.5 Software breakpoint – ASM column list
Software break is set.
PC position
(3) Disassembly Address column
Shows disassembly addresses. Double-clicking here brings up an Address Specification dialog box. In this dialog box, enter
the address from which you want a disassembly display to start.
(4) Obj code column
Shows object codes.
(5) Label
Shows a label. This column is unusable unless any module is downloaded.

5.2.6 Correcting Assembly Language Codes

Double-click an instruction you want to correct in the Disassembly window or choose Edit from the context menu, and a
dialog box labeled “Assemble” will be displayed. Use this dialog box to correct assembly language.
Figure 5.11 Assembler dialog box
The dialog box shows the address, instruction code and mnemonic of a selected instruction.
Enter a new instruction (or edit the old instruction) in the Mnemonic edit box. When done, hit the Enter key. The memory
content will be overwritten with the new instruction code, and the pointer is moved to the next instruction.
Clicking the OK button overwrites the memory content with the new instruction code and closes the dialog box.
CAUTION
Assembly language codes are displayed from the current memory content. When you correct memory contents, new assembly
language codes are displayed in the Disassembly window and the Assembler dialog box. However, the source file being
displayed in the Editor window remains unchanged. The same applies when the source file includes assembler language.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 93 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.3 Displaying Memory Contents in Real Time

5.3.1 Displaying Memory Contents in Real Time

To monitor memory contents while the user program is running, use the RAM Monitor window.
The RAM monitor function permits the memory content and access status in an allocated monitor area to be recorded and
inspected in real time without obstructing execution of the user program.
The RAM Monitor window shows access statuses (read, write, uninitialized or uninspected) in different colors.
(1) Allocating a RAM monitor area
A 16-Kbyte RAM monitor area is provided.
This RAM monitor area can be allocated to selected contiguous addresses or divided 32 blocks in 512-byte units.
With initial settings, a maximum 16 Kbytes of area from the beginning address of the internal RAM is allocated as a RAM
monitor area.
(2) Monitor display
The access statuses are displayed in different background colors depending on access attributes, as listed below. (The
background colors are customizable.)
The read and write accesses show the last accesses made.
Error detection can be displayed by choosing Show Error Detection from the context menu. In this case, the read and write
accesses are not displayed.
Table 5.6 Access attribute and background color
Access attribute Background color 1 Read access Green 2 Write access Red
When
3 Uninitialized memory (Area not yet write
4
errors detected
accessed is accessed for read)
Uninspected memory (A write accessed area is not yet accessed for read)
Yellow
Sky blue
5 No access White
CAUTION
The contents shown in the RAM Monitor window are the data acquired from bus accesses. Therefore, changes made by
accessing memory via other than the user program, as when memory is rewritten directly from external I/O, are not reflected in
the displayed memory content.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 94 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions
(3) Initialization-omitted detect function
If an area not yet write accessed is accessed for read, this function assumes such a case to be “initialization omitted” and
outputs an error.
To display initialization-omitted detection, choose Show Error Detection from the context menu.
Uninitialized memory is displayed in yellow.
The “initialization-omitted” detection can be used as an exception event comprising a condition of a hardware breakpoint or
trace point. (Refer to “Detecting exception events”.)
(4) Uninspected memory detect function
If a write accessed area is never once accessed for read, this function assumes such a case to be “uninspected” and outputs an
error.
To display uninspected memory detection, choose Show Error Detection from the context menu.
Uninspected memory is displayed in sky blue.

5.3.2 Setting RAM Monitor Update Intervals

Choose Update Interval Setting from the context menu of the RAM Monitor window. The Update Interval Setting dialog box
shown below will appear.
Figure 5.12 Update Interval Setting dialog box
The Update Interval can be specified separately for each window.
The initial value is 100 ms.

5.3.3 Clearing RAM Monitor Access History

Choose Access Data Clear from the context menu of the RAM Monitor window. The history of all accesses made to the RAM
monitor area will be cleared.
CAUTION
If this function is executed while the user program is running, the user program’s realtime capability may be lost because a
memory dump occurs.

5.3.4 Clearing RAM Monitor Error Detection Data

Choose Error Detection Data Clear from the context menu of the RAM Monitor window. The detected data of all uninitialized
memory and unrefered memory of the RAM monitor area will be cleared.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 95 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.4 Showing the Current Status

5.4.1 Showing the Emulator Status

To know the current status of the emulator, display the Status window.
To open the Status window, choose CPU -> Status from the View menu, or click the View Status toolbar button [
This window does not update the displayed status during program execution.
Figure 5.13 Status window
The Status window has the following four sheets.
Table 5.7 sheet list of status window
Sheet name Description Memory Shows information relating to memory resources. Platform Shows information relating to the emulator and debugging. Events Shows information relating to events. Target Shows information relating to the target MCU.
].
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 96 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.4.2 Showing the Emulator Status in the Status Bar

The status of the emulator can be displayed in the status bar.
By right clicking on the status bar, the items are shown. Check the items you want to show in the status bar.
Figure 5.14 Status bar
Table 5.8 Items list of the emulator status shown in the status bar
Item Description
PC PC value
During execution: PC value During Break: Normal
Task ID Task ID, task entry label
BreakCondition Break factors of the user program
ExecutionTime Result of time measurement
Exception Status of the exception event
(1) When more than one break factors occur.
When you click on the status bar area where the break factor is shown, a balloon is shown.
You can check the break factors being occurred in the balloon.
Figure 5.15 Example of break factors display when break factors occur
(2) When an exception event occurs.
When an exception event occurs, a warning is displayed in a status bar balloon.
The exception event that is not checked on the Exception Warning page of the Configuration Properties dialog box is not
shown.
Figure 5.16 Example of warning display when exceptional events occur
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 97 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.5 Periodically Reading Out and Showing the Emulator Status

5.5.1 Periodically Reading Out and Showing the Emulator Information

To know the changing emulator information whether the user program is running or remains idle, use the Extended Monitor
window.
The extended monitor function only monitors the signals output from the user system or MCU, and does not affect execution
of the user program.
To open the Extended Monitor window, choose CPU -> Extended Monitor from the View menu, or click the Extended
Monitor toolbar button [
The displayed items are updated at an interval of about 1,000 ms during user program execution or about 5,000 ms during a
break.
CAUTION
“CPU Clock” can be measured only when a user program is being executed.
].
Figure 5.17 Extended Monitor window
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 98 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.5.2 Selecting the Items to Be Displayed

Choose Properties from the context menu of the Extended Monitor window, and the Extended Monitor Configuration dialog
box will be displayed.
Figure 5.18 Extended Monitor Configuration dialog box
This dialog box permits you to set each item you want to be displayed in the Extended Monitor window.
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 99 of 229
R0E530640MCU00 User’s Manual 5. Debugging Functions

5.6 Using Software Breakpoints

5.6.1 Using Software Breakpoints

A software break causes the user program to stop running by rewriting the instruction code at a specified address with a BRK
instruction to generate a BRK interrupt. In that sense, this is a pre-execution break function.
4096 breakpoints can be set.
If multiple software breakpoints are set, the program breaks at any one of those breakpoints reached.
(1) When stopped at a software breakpoint
When the program you have created is run and the address you have set as a software breakpoint is reached, a message
“Software Break” is displayed on the Debug sheet of the Output window, with the program made to stop there. At this time,
the Editor or the Disassembly window is updated, and the position at which the program has stopped is marked with an arrow
] in the S/W Breakpoints column.
[
CAUTION
When a break occurs, the program stops immediately before executing the line or instruction at which a software breakpoint is
set. If Go or Step is selected after the program has stopped at that software breakpoint, the program restarts from the line
marked with an arrow.

5.6.2 Adding/Removing Software Breakpoints

Follow one of the following methods to add or remove software breakpoints.
- From the Editor or the Disassembly window
- From the Breakpoints dialog box (only removing)
- From the command line
REJ10J1733-0100 Rev.1.00 Apr. 01, 2008 Page 100 of 229
Loading...