To our customers, Old Company Name in Catalogs and Other Documents On April 1st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the old company name remains in this document, it is a valid Renesas Electronics document. We appreciate your understanding. Renesas Electronics website: http://www.renesas.
Notice 1. 2. 3. 4. 5. 6. 7. All information included in this document 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 Electronics products listed herein, please confirm the latest product information with a Renesas Electronics sales office.
User’s Manual Renesas Starter Kit for SH7211 Tutorial Manual RENESAS SINGLE-CHIP MICROCOMPUTER Rev.1.00 2008.
Table of Contents Chapter 1. Preface ..................................................................................................................................................1 Chapter 2. Introduction............................................................................................................................................2 Chapter 3. Tutorial Project Workspace ...................................................................................................................
Chapter 1. Preface Cautions This document may be, wholly or partially, subject to change without notice. All rights reserved. No one is permitted to reproduce or duplicate, in any form, a part or this entire document without the written permission of Renesas Technology Europe Limited. Trademarks All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations. Copyright © Renesas Technology Europe Ltd. 2008. All rights reserved.
Chapter 2. Introduction This manual is designed to answer, in tutorial form, the most common questions asked about using a Renesas Starter Kit (RSK): The tutorials help explain the following: • How do I compile, link, download, and run a simple program on the RSK? • How do I build an embedded application? • How do I use Renesas’ tools? The project generator will create a tutorial project with two selectable build configurations • ‘Debug’ is a project built with the debugger support included.
Chapter 3. Tutorial Project Workspace The workspace includes all of the files for two build configurations. The tutorial code is common to both the Debug and the Release build configurations. The tutorial is designed to show how code can be written, debugged then downloaded without the debug monitor in a ‘Release’ situation.
Chapter 4.Project Workspace 4.1. Introduction HEW is an integrated development tool that allows the user to write, compile, program and debug a software project on any of the Renesas Microcontrollers. HEW will have been installed during the software installation for the RSK product. To begin using the RSK, this manual will describe the stages required to create and debug the supplied tutorial code. 4.2.
• The project name field will be pre-filled to match the workspace name above; this name may be changed. Note: HEW allows you to add multiple projects to a workspace. You may add the sample code projects later so you may wish to choose a suitable name for the Tutorial project now. • Click OK to start the RSK Project Generator wizard. The next dialog presents the example projects available. Choose the Tutorial code which will be explained later in this manual.
Chapter 5. Building the Tutorial Project The tutorial project build settings have been pre-configured in the toolchain options. To view the tool chain options select the ‘Build’ Menu item and the relevant toolchain. This should be the first option(s) on the drop down menu. The dialog that is displayed will be specific to the selected toolchain. The configuration pane on the left hand side will exist on all the toolchain options.
5.2. Connecting the debugger For this tutorial it is necessary for you to power the RSK from the supplied PSU. The E10A module will be powered via the USB cable. Please be aware that if you have too many devices connected to your USB port it may be shut down by Windows. If this happens remove some devices and try again. Alternatively you can provide an external power source, taking care to ensure the correct polarity and voltage.
Chapter 6. Downloading and Running the Tutorial Once the code has been built in HEW it needs to be downloaded to the RSK. Now that you are connected to the target you should see an additional category in the workspace view called ‘Download Modules’ • Right click on the download module listed and select ‘Download’ On completion the debugger and code are ready to be executed. Note: Please note that you need to execute SH2A_SBSTK ENABLE command on the command line to enable breakpoints.
The code window will open ‘main.c’ and show the new position of the program counter. Support for the LCD display is included in the tutorial code. We do not need to be concerned about the details of the LCD interface – except that the interface is write-only and so is not affected if the LCD display is attached or not. • Insert a Eventpoint on the ‘TimerADC();’ function call. • Right click on the ‘FlashLEDs();’ function and select ‘Go to cursor’. The code will run to the selected line and stop.
• Review this file and find the interrupt function that changes the LED pins, INT_MTU2_MTU3_TGI3A(void) • Set a Eventpoint on the line where the LED pins are modified. • Press ‘Go’ or ‘F5’ to run the code from the current PC position. The code will stop in the interrupt routine. It is now possible to step through the interrupt function. • Remove the Eventpoint in the interrupt by double clicking again before exiting the function.
When the program stops you can see the modified string displayed on the second line of the LCD. Inspection of the watch pane will show that the first character of the variable string has been replaced with the first character of the constant replacement string. • Remove the Eventpoint • Right click on the ‘DisplayString();’ function call after the loop and select ‘Go to cursor’. This shows that the variable was initialised at program start up and can be overwritten with ‘TESTTEST’.
Chapter 7. Project Files 7.1. Standard Project Files The RSK tutorials are configured so that it is possible to provide the same tutorial code on multiple RSK products. This allows the evaluation of the different processor cores using equivalent code. To achieve this the following files are common between all device cores / Toolchains. Each of the tutorial files has expanded comment text describing the function of each code entry.
7.1.2. Board initialisation code (Hwsetup.c / hwsetup.h) There are four common stages to the configuration of the microcontroller device. The code to demonstrate this is therefore split into four functions. Each function is written specifically for the device supported. The function calls are shown below. 7.1.3. Main tutorial code (Main.c / main.h) The main tutorial code is common to all tutorial projects. The display initialisation and string display functions operate on the LCD display module.
Chapter 8. Additional Information For details on how to use High-performance Embedded Workshop (HEW), refer to the HEW manual available on the CD or from the web site. Further information available for this product can be found on the Renesas website at: www.renesas.com/renesas_starter_kits General information on Renesas Microcontrollers can be found at the following websites. Global: http://www.renesas.
Renesas Starter Kit for SH7211 Tutorial Manual Publication Date Rev.1.00 17.Jan.2008 Published by: Renesas Technology Europe Ltd. Dukes Meadow, Millboard Road, Bourne End Buckinghamshire SL8 5FH, United Kingdom ©2008 Renesas Technology Europe and Renesas Solutions Corp., All Rights Reserved.
Renesas Starter Kit for SH7211 Tutorial Manual 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REG10J0126-0100