Home

Renesas REG10J0083-0100 User's Manual

image

Contents

1. Hes Hee S00 Tool chair Hitachi H 5 H8 300 Standard The example above shows the New Project Workspace dialog with the RSK2H8S2472 selected e Select the H8S H8 300 CPU family and Hitachi H8S H8 300 Standard Tool chain for the RSK e Select the RSK2H8S2472 Project type for the RSK from the project list e Enter a name for the workspace all your files will be stored under a directory with this name e 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 e Click lt OK gt 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 This project is suitable for the user to add code without having to configure the debugger e Select Tutorial as the type of project to generate and then click Next e Click Finish to create the project The project genera
2. Hardware test Hardware test OK Downloading Flash memory write program Now is a good time to save the HEW session e Select File Save Session If you have changed any workspace settings now is a good time to save the workspace e 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 e Right click on the download module listed and Gil Text files TE ASE Header tut aia a Ell Download modules pre a Dependencies Download E FlashLEDs h Download Debug Data Only hweetup h Unload latir mbes L l On completion the debugger and code are ready to be executed To start debugging we need to reset the debugger and target e Press Reset CPU on the Debug Toolbar EI LE The File window should open the Tutorial code at the entry point An arrow marks the current position of the program counter E resetpre c DIE E EEE EEE E E EI EEE E EEE EE IE IEEE EE EEE IE E E EEE EE IE EEE EE E IEEE E E E EI oo kok E EEE EE IE EEE S void PoverON_Reset volid AA Compiler Directives e e e e de ae fpragma section instructs the linker to place all subsequent code in the named section This can be used to relocate code in th
3. and its exclusion in the Release build Contents of common C files are controlled with defines set up in the build configuration options and ifdef statements within the same files Maintaining only one set of project files means that projects are more controllable 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 Workshop from the Windows Start Menu Open a new tutorial workspace from the File gt New Workspace menu or select Create a new project workspace when presented with the Welcome dialog New Project Workspace Projects Project Types l Application E Assembly Application Demonstration ga E104 RSKH852215R ga E104 RSKHBSX16E4 ga E104 RSKHOSX16G8 gal ESA ASKHE38347 T Empty Application 153 Import Makefile Library MIRSK2H852472 gal FSKH836079 ga FSKH852215F ga ASKHSSH1622 e Iu Properties workspace Hame Hes 472 tutorial Project Name Hes 472 tutorial Directory k WworkspacesHes 242 tutorial Browse CPU family
4. 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 and comments on when they should or must be used Please refer to Chapter 7 for more information on the project files 13 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 the purpose and operation of the compiler specific details 7 1 1 Initialisation code resetprg c resetprg h This is the entry point of the main tutorial code pragma section ResetPRG EIE AE AE E E e e e e e e E E E aE AE BEER EES SE ERP E E E IE AE E BBS EEE HBREBRERHEEE gpopopgpogogpgpgpgpgp go E AE AE SE E gr SpSpspopgo gropo Ipo gr dodo orgo Function Name PFPover N_Feset Description Power on reset initialization Parameters Hone Feturn value Hone TEIE IE APAE IE AE IE IE IE rap E
5. AE E o entryi vect 0 void PowerQH Reset void x Disable masked interrupts set oimask ccr unsigned charj1 IHITSCTi e Configure processor pins interrupts etc Hardware5etupl Enable masked interrupts Es set_imask_ccr unsigned charjD Go to main function E malni leepi IEEE IEEE IEEE IE IEEE IEEE IE IE IEEE IE IEEE IEEE IEEE IE TEE IEEE IEEE IEEE IE IEEE IE IEEE IEEE IE IE IEEE IEEE IEEE IE IE IEEE IEEE IE IEEE End of function PoveroN_ Reset o Initialisation of the variables used in the C compilers and initialisation of stack pointers are completed in the _INITSCT function for the H8 and SH compilers The call to HardwareSetup will initialise the device hardware and peripherals ready for the tutorial software The call to main will start the main demonstration code 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 14 void Hardwaresetup void konfiguredperatingFreQduencyij ContigqurePortPins EnahlePeripheralModulesi konfigurelInterruptasil 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 operat
6. REG10J0083 0100 Everywhere you imagine g 2 ENESAS Renesas Starter Kit for H8S 2472 Tutorial Manual RENESAS SINGLE CHIP MICROCOMPUTER H8S FAMILY Rev 1 00 Renesas Technology Europe Ltd Revision date 28 08 2008 www renesas com Table of Contents AA nn TT re re a TE TETTE one eee ee nee ee 1 Ghapter 2 lg kelo Vie alg ee boukso ios eiii 2 Ghaptero Tutorial Project WORKS ACC lactosa 3 Gnapler4 Pro ect WORKS pa CE usna a E N ci 4 A Nec Ma OCA GO 0 A o a E TAT EAA E A AS 4 4 2 Creating a new Project WoO kspace sa A AA o LS 4 4 3 Build Configurations and Debug SesslONs sssssss ssessssssssssccsssssssssssssscsnnnssnnnsssscsnnsssnnanssssstnntes 5 AS MB ONU idas 5 GOD DEB USES IN a A II Sor Sen E a ae SS AS 5 Ghaplero Building the Tutorial Project ad thee Meee tees 6 lt A o Man lu rete Cee a KR Eu ee eres eee 6 9 27 GONMNECLUNO Me GED NGG SMa sss aa a a eda nelo EE o os un KN VOLGO 7 5 3 Connecting to the target with The E TOA cuina tad bd ot 7 Chapter 6 Downloading and Running the Tutorial ooocconccccccconnncnnnnccnononannconnnononononannnnnnnonononannnnnnnnnnnnnnanos 9 aye rro oku TR FRREFTFTTTRrRrRrFFTRT p p ppFpF p p mpmM0L 14 PA OlanGand Pro ies 14 7 1 1 Initialisation code resetprg c resetprg h cccccconnccnccccnoonconncnnnnnconnnnnnnnnncnononcnnnnnonancnnnnnnnanrnnnnnnnanennnns 14 7 1 2 B
7. as com renesas_starter_kits General information on Renesas Microcontrollers can be found at the following website Global http www renesas com Regional English language sites can be accessed from the Global site or directly by going to Europe http renesas eu Americas http america renesas com Asia http sg renesas com Renesas Starter Kit for H8S 2472 Tutorial Manual Publication Date Rev 1 00 28 08 2008 Published by Renesas Technology Europe Ltd Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH UK 2008 Renesas Technology Europe and Renesas Solutions Corp All Rights Reserved Renesas Starter Kit for H8S 2472 Tutorial Manual LENESAS Renesas Technology Europe Lid Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH UK
8. d variables from storage in flash to RAM e Press lt Reset Go on the Debug Toolbar lm Ip The code will stop at the breakpoint Press a button to bypass the flashing LED test e Press Step In on the Debug Toolbar m me It is possible to monitor variables during debugging of the code To set up a watch on a variable place the mouse over the variable If the variable is available in the current context a tool tip will be displayed with the current value of the variable e Hover the mouse over the ucStr variable to see the tooltip value Then Right click on the variable name and select Instant Watch A dialog will open showing the variable and allowing further details to be explored e Press lt Add gt 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 e Seta breakpoint on the call to DisplayString inside the for loop e Press Go to run the code from the current PC zt El 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 e Remove the breakpoint e Right click on the DisplayString function call after the loop and select Go to cursor This
9. e memory map This directive should be used when debugging code in RAM to provide a section name that can be referenced in the build toolchain linker section settings Use of the directive without the section name will reset the section to default pragma section ResetPRo AE E E DEE E E IEEE E E DEE E DEE EEE E DE IEEE EEE EE EEE DE DEE EEE DEE E E E DE IDE EE DEE E DEE EDO DE EE Function Name PowerOH Reset Description Power on reset initialization Parameters None Return value Hone Pe ae 36 E 3 99 ae a oe o E o oo eoo oe 3 3 Eo oc a ae oe ee oe a a ae o NE Se o oe ae a o a oe a a a 3 9 EEE ea a SEGESESEOJ r ex Disable masked interrupts 000406 set_imask_ccr unsigned char 1 000400 000408 INITSCT 3 e Configure processor pins interrupts etc Es 00040 HardwareSetupt ex Enable masked interrupts Es 000410 set imask_ocorffunsigned char 0 e Go to main function 000412 mairt 000416 leep 000415 EII IO EEE EEE IEEE TOTO EE OOOO OIE IO IEEE IE IEEE IEEE IE OEI IE IE EEE IEEE E IE EEE IEEE IE IEEE IEEE IEEE EEE IEEE IEEE We will now skip over the initialisation code and proceed to the main tutorial e Open the file called resetprg c by double clicking it in the project navigator e 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
10. e 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 a a Function Hane hain Description Hain function Parameters Hone Return value Hone HEHE EE E E E EE EE E E E E E E E E E E E E EE E E E E E EE IE IE E IE E E E E E E E E E E E E E IEEE E E E 3 9 96 E ETE E E E E E E EE oe e EEE e EE AE Fold main vold 1 x Variables initialization tlFlagLed l quckeyPres ed UxUN count UsFF sx Transmit to System Medium Clock mode clock lt 16 s SYSTEM SETOCE BIT SCE 4 SYSTEM MSTPCRL Usd Reset the LCD module Es InitisliseDisplayt x Display Renesas Splash Screen Ez DisplaySstring LCD LIHEl Renesas DisplayString LCD LIHEZ HICKHAHME x Flash the user LEDs for some time or until a key 15 pressed s FlashLEDs 3 Flash the user LEDs at a rate set by the user potentiomenter ADC using Interrupts Es Timer DC Demonstration of initialised variables Use this funtion with the debugger Statice Testi x End of the user program This function must not exit Ez while 1 la F 15 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 renes
11. i 1 96 g7 x Demonstration of initialised variables Use this funtion with the debugger Es 58 OOODEB4 Statice Testi a 100 End of the user program This function must not exit Es 101 OOODES while 1 102 T 103 p 104 ODODCA 105 BERS an SHEER E OE aK Nc pr o pr pr dE ar o ap ee RE EE pn p EdE E ro i o gr dn pr ro E pr pr ap e pr le NEE E E ra REE e gro o NE dr a pr pro e pr p E NEO dn pe ER po pr e pr gro o pr dr ro na mec EL OL EE EREN aila e Insert a breakpoint on the call to the TimerADC function 10 e Right click on the FlashLEDs function and select EAR Go to cursor Toggle Breakpoint FQ Define Column Format Columns lo To Cursor Set PL Here Display PE 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 e Press Step Over on the Debug Toolbar mh p p 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 e If the LEDs are still flashing press the SW1 button on the RSK to exit the FlashLEDs function The code will run to the breakpoint we previously set on the TimerADC function The TimerADC 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 inter
12. nd the E10A drivers have been installed e Fit the LCD module to LCD on the RSK so it lies above U13 Ensure all the pins of the connector are correctly inserted in the socket e Connect the E10A debugger to the USB port on your computer e Connect the E10A debugger to the target hardware ensuring that it is plugged into the connector marked E10A e Fit jumper E10A EN to enable E10A debugger if any of the applications should work without E10A the jumper must be removed e An external power to the board can be turned on now 5 3 Connecting to the target with the E10A This section will take you through the process of connecting to the device programming the Flash and executing the code e Select the SessionH8S 2472 E10A USB SYSTEM debug session Select Emulator mode Device e Click the lt Connect gt button i WIE gp En on the debug toolbar Program Flash e Select the correct Microcontroller type H8S 2472 illustrated Cancel e Select E10A USB Emulator e Press lt OK gt System Clock Please input System Clock e Type 8 5 in MHz field and press OK EE MHz Cancel ID Code Pleaze input ID Code e Enter ID code as 0000E10A OOOOE 10A W New ID code Lancel Connecting e The Flash Memory write program is downloaded e The Output window in HEW will state Connected Downloading FPGA data Downloading firmware Firmware test Firmware test LIE
13. oard initialisation code hwsetup c DWSetup h ccccooonncnnccccooncnnnccnnnncnnnnononnonononanennnonnnnnrnnnnnnnanennnnss 14 Zo MalnTulorlal code mane AMARA salsa OE sao 15 Shaplere Additional Informatore a KENO Sa KJ duelas do Vua ka la a SE 16 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 O Renesas Technology Europe Ltd 2008 All rights reserved O Renesas Technology Corporation 2008 All rights reserved Renesas Solutions Corporation 2008 All rights reserved Website http www eu renesas com Glossary CPU Central Processing Unit LCD HEW High performance Embedded Workshop ADC LED Light Emitting Diode CD PC Program Counter E10A RSK Renesas Starter Kit Liquid Crystal Display Analog to Digital Converter Compact Disc On chip debugger module 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 e How do I compile link download and run a simple program on the RSK e How do build an embedded ap
14. on will be DefaultSession The purpose of the debug sessions is to allow the use of different debugger tools or different debugger settings on the same project Debug SessionHes 2474 EIDA Select SessionH8S 2472 E10A USB SYSTEM debug session 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 PERA tool chain options It is important when changing any setting to be Corfiauraion SIGE cant aa sea a ees LLO Debus y Category Source y A All Loaded Projects Show entries for US H8S2472_tutoriall wish to modify multiple or all build configurations this is possible by e C source file Include fle directories i aware of the current configuration that is being modified If you selecting All or Multiple from the Configuration drop down list e Review the options on each of the tabs and Category dropdown lists to be aware of the options available When complete close the dialog box by clicking lt OK gt Options C C cpu 26004 24 object CONFIGDIR FILELEAF obj debug nolist
15. optimize 0 chgincpath nologo 5 1 Building Code There are three shortcuts available for building the project 1 Select the Build All toolbar button This will build everything in the project that has not been excluded from the build This includes the standard library 2 Select the Build toolbar button This will build all files that have changed since the last build The standard library will not be built unless an option has been changed 3 Press F7 This is equivalent to pressing the Build button described above Build the project now by pressing F7 or pressing one of the build icons as shown above During the build each stage will be reported in the Output Window The build will complete with an indication of errors and warnings encountered during the build 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 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 a
16. or right click on the line and select Toggle breakpoint Alternatively set an eventpoint by clicking in 9 the column to the left of the breakpoint column Eight eventpoints can be set Eventpoints do not require programming the flash memory and thus are faster to use e Press Reset Go on the Debug Toolbar Lm Ip The code will execute to the breakpoint At this point all the device initialisation will have been completed e Press Step In on the Debug Toolbar P TH yy The code window will open main c and show the new position of the program counter Line OLITE Event 5 Source 67 Function Name main 66 Description Main function 69 Parameters None 70 Return value Hone 72 ODOODEC Fold main void 73 74 xe Variables initialization Es 75 ODODEC TE OOODT4 guckeyPressed 0x00 77 OOODTOC count UFF 75 79 Transmit to System Medium Clock mode clock lt 7 16 Es 50 ODOODO4 SYSTEM SEYCR BIT SCK 4 ol 52 OOODOC SYSTEM HSTPCEL UxOO 53 Reset the LCD module Es 84 ooOpon InitialiseDisplay 65 56 e Display Renesas Splash Screen a7 OOODS4 DisplayString LCD LIHEl Renesas 3 ss OOODA Display5tring LCO LINE2 HICEHAMHE ma 20 Ze Flash the user LEDs for some time or until a key is pressed Es 21 OOODAC FlashLED 3 ga g3 se Flash the user LEDs at a rate set by the user potentiomenter ADC using 94 interrupts Es 95 OOODBO TimerADC
17. plication e How do I use Renesas tools The project generator will create a tutorial project with two selectable build configurations e Debug is a project built with the debugger support included e Release build demonstrating code suitable for release in a product Files referred to in this manual are installed using the project generator as you work through the tutorials The tutorial examples in this manual assume that installation procedures described in the RSK Quick Start Guide have been completed Please refer to the Quick Start Guide for details of preparing the configuration NOTE These tutorials are designed to show you how to use the RSK and are not intended as a comprehensive introduction to the High performance Embedded Workshop HEW debugger the compiler tool chains or the E10A Emulator please consult the relevant user manuals for more in depth information 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 allows the inclusion of the debug monitor within the Debug build
18. rupt reads the last ADC conversion for the external potentiometer and uses the result to set the next compare match value The ADC conversion is then re started The interrupt initialisation is completed as part of the hardware setup This is contained in the file interrupts c e Open the file interrupts c by double clicking on the file in the workspace view e Review this file and find the interrupt function that changes the LED pins INT_OCIB_FRT void e Seta breakpoint on the line where the LED pins are modified e Press lt Go gt or lt F5 gt to run the code from the Inl I Oh HH current PC position EI a The code will stop in the interrupt routine lt is now possible to step through the interrupt function e Remove the breakpoint in the interrupt by double clicking again before exiting the function e Press lt Go gt to run the code from the current PC f El position The code will now run to the infinite loop at the end of main function The user LEDs should now be flashing You can modify the flashing rate by adjusting the potentiometer on the board 11 e Press lt Stop gt on the debug toolbar e Press CTRL B to open the breakpoint Breakpoints window e Select Remove All e Press OK Cancel e Open the file main c e Inserta breakpoint on Statics_Test The statics test is used to demonstrate that the initialisation has successfully copied all initialise
19. tor wizard will display a confirmation dialog Press OK to create the project and insert the necessary files A tree showing all the files in this project will appear in HEW e To view the file main c double click on the file in the Workspace window A new window will open showing the code 4 3 Build Configurations and Debug Sessions The workspace that has been created contains two build configurations and two debug sessions The Build Configuration allows the same project to be built but with different compiler options The options available to the user are described fully in the HEW Users Manual 4 3 1 Build Configuration The build configurations are selected from the left hand drop down list on the toolbar The options available are Debug and Release The debug build is configured for use with the debugger The Release build is configured for final ROM able code A common difference between the two builds may be the optimisation settings With Optimisation turned on the Debugger may seem to execute code in an unexpected order To assist in debugging it is often helpful to turn off optimisation on the code being debugged e Select the Debug Build Configuration SessionH85_2472_E104_ 4 3 2 Debug Session The debug sessions are selected from the right hand drop down list on the toolbar The options vary between RSK however one will always start Debug and include the type of debug interface The alternate selecti

Download Pdf Manuals

image

Related Search

Related Contents

取扱説明書はこちら  電動車いすのご利用にあたって (PDFファイル 668KB)  Le Fascisme Ingénu - Michel Delord  LED TV  ZTE-G S511 Manual do Utilizador  BIBLIOTHÈQUE À VIVRE : L`éCRIVAIN EUGÈNE EN RéSIDENCE  SphinxOnline Manuel d`utilisation  E300 Electronic Overload Relay  Vinotemp VT-PARTYCOOLER Use and Care Manual  Guia do usuário - Zebra Technologies Corporation  

Copyright © All rights reserved.
Failed to retrieve file