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 H8SX/1648 Tutorial Manual RENESAS SINGLE-CHIP MICROCOMPUTER Rev.1.00 2007.
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. Duplication of this document, either in whole or part is prohibited 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. 2007. All rights reserved. © Renesas Technology Corporation.
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 in a ‘Release’ situation. The build configuration menu in High-performance Embedded Workshop (HEW) allows the project to be configured such that certain files may be excluded from each of the build configurations.
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 installation of the software support for the RSK product. This manual will describe the stages required to create and debug the supplied tutorial code. 4.2.
• Click 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. 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 tool-chain options. To view the tool chain options select the ‘Build’ Menu item and the relevant tool-chain. This should be the first option(s) on the drop down menu. The dialog that is displayed will be specific to the tool-chain selected. The configuration pane on the left hand side will exist on all the tool-chain 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.
• Enter ID code as ‘0000E10A’. • The Flash Memory write program is downloaded. • The Output window in HEW will state ‘Connected’ Now is a good time to save the HEW session. • Select ‘File’ | ‘Save Session’. If you have changed any workspace settings now is a good time to save the workspace. • Select ‘File’ | ‘Save Workspace’.
Chapter 6. Downloading and Running the Tutorial Once the code has been built in HEW it needs to be downloaded to the RSK. There will now be an additional category in the workspace view for ‘Download Modules’ • Right click on the download module listed and select ‘Download’. On completion the debugger and code are ready to be executed. To start debugging we need to reset the debugger and target. • Press ‘Reset CPU’ on the Debug Tool Bar. The File window should open the Tutorial code at the entry point.
We will now skip over the initialisation code and proceed to the main tutorial. • Open the file called ‘resetprg.c’ by double clicking it in the project navigator. • Place a breakpoint at the call to main(); Breakpoints can be set by double clicking in the column containing the PC arrow next to the line to break at; or selecting the line and pressing F9; or right click on the line and select ‘Toggle breakpoint’.
function. • Right click on the ‘FlashLEDs(); function and select ‘Go to cursor’. The code will execute to the selected line and stop. An automatic breakpoint was inserted in the code and then removed after calling the break. • Press ‘Step Over’ on the Debug Tool Bar. The code will run and flash the LEDs 200 times. The debugger will not exit until all 200 flashes have completed or a button is pressed on the RSK.
• Press on the debug tool bar. • Press ‘CTRL-B’ to open the breakpoint window. • Select ‘Remove All’ • Press . • Open the file ‘main.c’ • Insert a breakpoint on ‘Statics_Test();’. The statics test is used to demonstrate that the initialisation has successfully copied all initialised variables from storage in flash to RAM. • Press on the Debug Tool Bar. The code will stop at the breakpoint. (Press a button to bypass the flashing LED test.
replacement string. • Remove the breakpoint • 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’. You have now run the tutorial code and used many of the common features of the debugger.
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 and Tool-chains. Each of the tutorial files has detailed comment text describing the function of each code entry.
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. Check compatibility with ks0066u controller and pin connection on the schematic before connecting a LCD module not supplied by Renesas.
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 website. Global: http://www.renesas.
Renesas Starter Kit for H8SX/1648 Tutorial Manual Publication Date Rev.01.00 20.NOV.2007 Published by: Renesas Technology Europe Ltd. Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK ©2007 Renesas Technology Europe and Renesas Solutions Corp., All Rights Reserved.
Renesas Starter Kit for H8SX/1648 Tutorial Manual 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REG10J0080-0100