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 SH7203 Tutorial Manual RENESAS SINGLE-CHIP MICROCOMPUTER SuperH RISC Engine Rev.2.00 2008.
Table of Contents Chapter 1. Preface ..................................................................................................................................................3 Chapter 2. Introduction............................................................................................................................................4 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 next dialog presents the example projects available. Choose the Tutorial code which will be explained later in this manual. There is also an option for Sample code which provides examples for using various peripherals. This will open a new dialog allowing the selection of many code examples for the peripheral modules of the device. The final option is for an application build where the debugger is configured but there is no program code.
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 connect an external power supply to the board, taking care to ensure the correct polarity and voltage. The Quick Start Guide provided with the RSK board gives detailed instructions on how to connect the E10A to the host computer. The following assumes that the steps in the Quick Start Guide have been followed and the E10A drivers have been installed. • Connect the E10A debugger to the USB port on your computer.
• Select ‘Enable’ for ‘Loading and Erasing flash memory’ • Browse and select the ‘fmtool.mot’ file in your workspace.
Chapter 6. Downloading and Running the Tutorial Now 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 • Press ‘Reset CPU’ on the Debug Tool Bar. The File window will open the Tutorial code at the entry point.
• Press ‘Step In’ on the Debug Tool Bar. 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 event on the ‘TimerADC();’ function call. • Right click on the ‘FlashLEDs();’ function and select ‘Go to cursor’.
There are several versions of the timer function depending upon the peripherals available in the device. The default function is TimerADC which we shall demonstrate here. The timer function initialises an interrupt on an available internal timer. On a compare match in the timer module an interrupt is generated. In the TimerADC code version the interrupt reads the last ADC conversion from the external potentiometer and uses the result to set the next compare match value.
A dialog will open showing the variable and allowing further details to be explored. • Press ‘Add’ The dialog will close and a new pane will open in the workspace containing the variable. It is possible to see that the string has been successfully initialised to ‘ STATIC ‘. • Set a event point on the ‘DisplayString();’ function call inside the loop. • Press ‘Go’ to run the code from the current PC position. When the program stops you can see the modified string displayed on the second line of the LCD.
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.
After initialisation the ‘main’ function is called. The call to ‘main()’ will start the main demonstration code. 7.1.2. External bus and Memory configuration (bus-init.c/bus-init.
7.1.3. Board initialisation code (hwsetup.c/hwsetup.h) Further hardware initialisation should be performed in this function. For debug purposes, the interrupt priority registers are initialised to zero (as they would be after a power on reset). In the case of the tutorial the interrupts are configured and the LCD interface is initialised. 7.1.4. Main tutorial code (main.c) 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: http://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 SH7203 Tutorial Manual Publication Date Rev.2.00 17 Jan 2008 Published by: Renesas Technology Europe Ltd. Duke’s 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 SH7203 Tutorial Manual 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REG10J0061-0200