Résumé du contenu de la page N° 1
REG10J0077-0100
Renesas Starter Kit for H8/36079
Tutorial Manual
RENESAS SINGLE-CHIP MICROCOMPUTER
Rev.01.00 Renesas Technology Europe Ltd.
Revision date: 17.OCT.2007 www.renesas.com
Résumé du contenu de la page N° 2
Table of Contents Chapter 1. Preface..................................................................................................................................................1 Chapter 2. Introduction............................................................................................................................................2 Chapter 3. Tutorial Project Workspace ............................................................................................................
Résumé du contenu de la page N° 3
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. © Renesa
Résumé du contenu de la page N° 4
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 incl
Résumé du contenu de la page N° 5
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. This
Résumé du contenu de la page N° 6
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. Creating a new Project Workspace To look at the program, start High performance Embedded Work
Résumé du contenu de la page N° 7
• 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 progra
Résumé du contenu de la page N° 8
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. It is important when changing any setting to be aware
Résumé du contenu de la page N° 9
5.2. Connecting the debugger For this tutorial it is not necessary to provide an external power supply to the board. The power will be obtained from the USB port. 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 provide an external power source taking care to ensure the correct polarity and voltage. The Quick Start Guide provided with the RSK board gives detailed ins
Résumé du contenu de la page N° 10
• Enter ID code as ‘0E8A’. • 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’. 8
Résumé du contenu de la page N° 11
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
Résumé du contenu de la page N° 12
• 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’. Alternatively set a eventpoint, by clicking in the column to the left of the breakpoint column. Only one eventpoint can be set. Eventpoints do not require programming the flash memory, and thus are faster to use. • Press ‘Reset Go’ on the De
Résumé du contenu de la page N° 13
• 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. • If the LEDs are still flashing press the SW1 button on the RSK to exit the Flash
Résumé du contenu de la page N° 14
• 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.) • Press
Résumé du contenu de la page N° 15
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. We suggest that you review the rest of the tutorial code as many functions have important information on the operation of the code, the compiler directives an
Résumé du contenu de la page N° 16
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. Please refer to the source code for greater detail on
Résumé du contenu de la page N° 17
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. 15
Résumé du contenu de la page N° 18
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.com/ 16
Résumé du contenu de la page N° 19
Renesas Starter Kit for H8/36079 Tutorial Manual Publication Date Rev.01.00 17.OCT.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.
Résumé du contenu de la page N° 20
Renesas Starter Kit for H8/36079 Tutorial Manual Renesas Technology Europe Ltd. Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK