Resumen del contenido incluido en la página 1
REG10J0023-0100
Renesas Starter Kit
RSK H8S2215R Tutorial Manual
RENESAS SINGLE-CHIP MICROCOMPUTER
Rev.1.00 Renesas Technology Europe Ltd.
Revision date 12.01.2007 www.renesas.com
Resumen del contenido incluido en la página 2
Table of Contents Chapter 1. Preface..................................................................................................................................................3 Chapter 2. Introduction............................................................................................................................................4 Chapter 3. Tutorial Project Workspace ............................................................................................................
Resumen del contenido incluido en la página 3
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. 2006. All rig
Resumen del contenido incluido en la página 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
Resumen del contenido incluido en la página 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 without the debug monitor 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
Resumen del contenido incluido en la página 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 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. Creating a new Project Workspace To look at the program, start High-performance Embe
Resumen del contenido incluido en la página 7
• 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. 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
Resumen del contenido incluido en la página 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 selected tool-chain. 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 o
Resumen del contenido incluido en la página 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 provided by the E8 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 you can provide an external power source, taking care to ensure the correct polarity and voltage. The Quick Start Guide provided with the RSK board
Resumen del contenido incluido en la página 10
• Select the Device on the RSK from the drop down list. • In the sub pane, select the kernel version that ends in ‘.RSK’. • Press . If you have copied the kernel to another location to modify for a different crystal frequency, the device will not be listed in the sub pane. In this case: • Press and navigate to your modified kernel. • Select E8DIRECT as the communication Port • Press . • The default settings are suitable for an un-modified RSK board. •
Resumen del contenido incluido en la página 11
• Ensure that ‘USER Program Mode’ is selected. • Confirm that ‘Use Default’ is selected. • Press . • Confirm the default selections of ‘Automatic’ and ‘Advanced’. • Press . • The following warning dialog will be displayed. • Press . To communicate with the RSK FDT and HMon need to be able to change the operating mode of the microcontroller. To do this there are settings to control the state of the Mode pins via the E8Direct interface. These settings are con
Resumen del contenido incluido en la página 12
Damage to the microcontroller can be sustained with incorrect settings. • Confirm the mode pin settings. • Press . • The following warning dialog will be displayed. • Press . Damage to the microcontroller can be sustained with incorrect settings. • Confirm the mode pin settings. • Press . The Flash configuration has now been completed. If you have changed any workspace settings, now is a good time to save the workspace. • Select [File’ -> ‘Save Workspa
Resumen del contenido incluido en la página 13
5.3.1. Connecting To HMon We can now attempt to connect to the target device. • Press the Green ‘Connect’ Icon. HMon is able to discover the internal flash configuration of the device from the FDT kernel we configured earlier. HMon also needs information on the location of the IO registers and internal / external RAM. This information is stored in a ‘.TCF’ file. The TCF file is supplied and registered with HEW. As it is possible to have TCF files with slightly different configurations t
Resumen del contenido incluido en la página 14
• Confirm the settings shown and press . HMon will attempt to connect to the RSK. If it succeeds then the Output window in HEW will show the ‘Connected’ message. In this case please proceed to Chapter 6. If the connection fails you will be returned to the previous dialog with the ‘Abort’ button enabled. This is likely to be caused by a connection error with the RSK and the E8. It can also be caused if the RSK has not got a working copy of the HMon target code programmed. Check the s
Resumen del contenido incluido en la página 15
• Ensure ‘0x000D – 1 [Closed]’ is selected and click . On completion of the download HMon will automatically re-connect to the monitor and revert back to User programming mode. 15
Resumen del contenido incluido en la página 16
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’ The download options dialog will be displayed. This dialog provides various options for HMon operation and downloading. This dialog allows the re-configuration of any HMon c
Resumen del contenido incluido en la página 17
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(); 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’ • Press ‘Reset Go’ on the Debug Tool Bar. The code will execute to the breakpoint. At this point
Resumen del contenido incluido en la página 18
• Right click on the ‘FlashLEDs();’ function and select ‘Go to cursor’. The code will run to the selected line and stop. A temporary breakpoint was automatically inserted in the code and then removed when the program stopped at the breakpoint. • Press ‘Step Over’ on the Debug Tool Bar. The code will run and flash the LEDs 200 times. The debugger will not stop running until all 200 flashes have completed or any of user switches (i.e. SW1, SW2 or SW3) is pressed on the RSK. • If the L
Resumen del contenido incluido en la página 19
The code will now run to the infinite loop at the end of Main(). The user LEDs should now be flashing. You can modify the flashing rate by adjusting the potentiometer on the board. • Press ‘Stop’ 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 at the call to the function ‘Statics_Test()’. The ‘Statics_Test’ function is used to demonstrate that the initialisation has succes
Resumen del contenido incluido en la página 20
• 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. 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 breakpoint • Right click on the ‘DisplayString();’ function call after the loop and select ‘Go to cursor’. This shows that the variable was initialised at