Home
Tutorial Manual - Renesas Electronics
Contents
1. LENESAS n D Vi I Renesas Starter Kit2 for SH7269 Tutorial Manual O Y RENESAS SINGLE CHIP MICROCOMPUTER SuperH RISC Engine All information contained in these materials including products and product specifications represents information on the product at the time of publication and is subject to change by Renesas Electronics Corp without notice Please review the latest information published by Renesas Electronics Corp through various means including the Renesas Electronics Corp website http www renesas com Renesas Electronics www renesas com Rev 1 00 May 2012 Notice Ti 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 in formation with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website 2 Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third par ties by or arising from the use of Renesas Electronics products or technical information described in this document No license express im plied or otherwise is granted hereby un
2. Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein 7 Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Elec tronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electron ics Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless other wise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers
3. 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 underflow value The ADC conversion is then restarted e Clear all eventpoints as mentioned below e Press CTRL E to open the Eventpoints window F e Chl IA Disable None Ch2 IA Disable None Break Ch3 IA Disable None Break Ch4 IA Disable None Break Ch5 IA Disable None Break Ch IA Disable None Break Ch IA Disable None Break Ch8 IA Disable None Break Ch9 IA Disable None Break Ch10 IA Disable None Break Breakpoint AJEvent condition The interrupt initialisation is completed as part of the hardware setup This is contained in the file interrupts c e Click on the Event condition tab e Select the eventpoints displayed in the window e Click on Delete eventpoint icon to remove eventpoints 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 requests changes the LED pins INT_MTU2_TGI3B_user e Setan event point on the line where the g_toggle_leds variable is modified e Press Go or lt F5 gt to run the code from the me g nr position of the PC o The code will stop in the interrupt routine It is now possible to step thr
4. successfully connected Configuration e Click Emulator System icon on the tool bar General Loading flash memory e Switch to the Loading flash memory Tab Note Please ensure all settings for both tabs of the Read Wite onthefy HUDI Read Write nl AUD clock 174 CPU clock Exclusive terminals y Configuration Dialog match the diagrams shown fiomHz e Select the Enable radio button for both Loading flash memory and for Erasing flash memory General Loading flash memory options Loading flash memory Disable Enable e Browse and select the fmtool mot file available in Ecce tah memory aio GET Fle name Tutoral FMToolfmtool mot Browse Bus width of flash memory 32 bit bus width the FMTool folder present in the project directory e Please ensure that the other settings Bus width lego did AE Flash memory erasing time etc match with the H FFF80000 settings shown here Feo e Click lt OK gt 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 RSK2 There will now be an additional category in the workspace view fo
5. te RE e de e TERE RETE RETE RE RENE RETE TERE ve e a de e ee EROI RE RETE RR RE RESOR RESORT RR He e He he REANO de RESERO RR RESERO RE de ve de Re Re de de de e End of function power on reset pc PORORORORO RO RR RE e RR RR RR RR RR RR RR RR RR RR RR e e de de e e e The call to HardwareSetup configures the external bus interface to access external memory and initialises device hardware and peripherals before they are accessed by the tutorial software The cache memory has been configured for release build only in write back mode After initialisation the main function is called The call to main will start the main demonstration code 15 7 1 2 External bus and Memory configuration bus init c bus init h External bus initialization and cache memory configuration has been implemented in this function The tutorial project initializes NOR flash only PORRO RO ROTO PORRO RO PORO RO ROO RO PORO RO RO ROO PORRO RO ROO RO PORRO RO ROO RO ROO RO ROO PORRO RO ROO ROOT RR RR RE RETE RE RETE e RETE RE RR RE dle de de dle de Function Name ConfigureBusAndMemory Description Configures the external bus and memory Argument none Return value none kkkkkkkkkkkkkkkkkkkkkkekkkkkekkkekkkkekkkkekkkekkkkkkkkkekkkkkkkkekkekkkkkkkkkkekkkkekkkix void ConfigureBusAndMemory void Configure the CSO space init_bsc_cs0 GORRO ORO ROO ORO RO ROO PORO PORO ROO PORO RO RO ROO RETE ROO ROO RE RE
6. 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 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 e Setan event point on the call to DisplayString inside the for loop e Press Go to run the code from the current PC 7 position IIU p 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 event point e 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 12 The modified string is also displayed on the LCD 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 TimerADC function initialises an interrupt on
7. 5 9510 Renesas Electronics Korea Co Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 2012 Renesas Electronics Corporation All rights reserved Colophon 1 0 Renesas Starter Kit2 for SH7269 Tutorial Manual RENESAS Renesas Electronics Corporation R20UT0S93EG 0100
8. 8 6130 Renesas Electronics Canada Limited 1101 Nicholson Road Newmarket Ontario L3Y 9C3 Canada Tel 1 905 898 5441 Fax 1 905 898 3220 Renesas Electronics Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 585 100 Fax 44 1628 585 900 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf Germany Tel 49 211 65030 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shanghai Co Ltd Unit 204 205 AZIA Center No 1233 Lujiazui Ring Rd Pudong District Shanghai 200120 China Tel 86 21 5877 1818 Fax 86 21 6887 7858 7898 Renesas Electronics Hong Kong Limited Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2886 9318 Fax 852 2886 9022 9044 Renesas Electronics Taiwan Co Ltd 7F No 363 Fu Shing North Road Taipei Taiwan Tel 886 2 8175 9600 Fax 886 2 8175 9670 Renesas Electronics Singapore Pte Ltd 1 harbourFront Avenue 06 10 keppel Bay Tower Singapore 098632 Tel 65 6213 0200 Fax 65 6278 8001 Renesas Electronics Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 Jin Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 60 3 7955 9390 Fax 60 3 795
9. DC LCD initialisation functions The user LEDs flashes until the user presses a switch on the RSK Argument none Return value none ni e E e e e e se E e E ve ee e e e ve ee ee ee ee ee de de void main void Initialise the IIC port Expanders to default settings Reset the LCD module R_LCD InitialiseDisplay Display Renesas Splash Screen R LCD DisplayString LCD LINE1 Renesas R LCD DisplayString LCD LINE2 NICKNAME Flash the user LEDs for some time or until a push button is pressed FlashLEDs Demonstration of initialised variables Use this function with the debugger Statics Test Flash the user LEDs at a rate set by the user potentiometer ADC using interrupts TimerADC This function must not exit while 1 if g_toggle leds ToggleLEDs g toggle leds 0 v ote da ole RR he he Fe he he ie e e e e e e e e e de He Fe Fe Fe Fe ie e e e e e e e e e Fe He He Fe Fe Fe ie ie Fe He Fe e e e e e e e e e e de ie ie dE Fe Fe Fe Fe He He de e e e e e de de de de de End of function main EHHH HER ERRE RARE RH ERRE RARA KARA ERA kkk kkkt kkk kkkt kkk RRR RRR RRR RR RRR RR RR RS Support for the IIC channel 2 devices has been included in the tutorial code We do not need to be concerned about the details of the IIC interface except that the interface has been written to support this sample board so the connected devices port expanders Audio cod
10. ISC engine y Tool chain Renesas SuperH Standard y The example above shows the New Project Workspace dialog with the RSK2 SH7269 selected Select the SuperH RISC Engine CPU family and Renesas SuperH Standard tool chain Select the RSK2 SH7269 Project type from the project list Enter a name for the workspace all your files will be stored under a directory with this name 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 Click OK to start the RSK2 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 on the device The final option is for an application code 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 generator wizard will display a confirma
11. TE RETE RETE RETE RE RETE RR RETE RETE e e e e RETE RE RE e e RE de e de RE e e e e e e e e de e End of function ConfigureBusAndMemory via dle RE RE RON da ERE REESE de RENE RE RE RON RE RENEE RENO RETE RR RETE RE RENE RENE RE RENE RE REESE RE RETE RE RENE RE RETE RE RE RE RE RE ERE RE RE e e e Re de de de de de y 16 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 RIO RO RO RO RO RO RO PORO RO ROO RO PORO RO PORO RO RO PORO RO ROO FORO PORO RO ROTOR ROO RO POROS PORO RO RO ROO RO ROO ROOT He He e Fe He He e RENE RE RENEE RETE de dle de de de de Function Name HardwareSetup Description Sets up the hardware kaj This function calls the hardware initialization functions to configure the CPU operating frequency port pins amp required on chip modules in order to setup the RSK for the main w application x Argument none x Return value none vie e ode e RETE ode e RETE RETE oe e e TE HE e ce HE e ce e a a ce e a e da e e e e ede ee e e e a e a e a de He He la e RETE a de la de le EKER de de de de de de de de de e de ke e void HardwareSetup void Configures CPU clock ial configure operating frequency configur
12. ally susceptible to certain EMC phenomena To mitigate against them it is recommended that the following measures be undertaken e The user is advised that mobile phones should not be used within 10m of the product when in use e The user is advised to take ESD precautions when handling the equipment The Renesas Starter Kit does not represent an ideal reference design for an end product and does not fulfil the regula tory standards for an end product Table of Contents Chapter Kalite jeleo Ere rer ra A ia CREE OMAN Tee 1 Ghapter 2 Introduction cacy eee kOKO EA DA AD E SA ATO EGAJ 2 Chapter 3 Tutorial ProjectWorkSpace utorrent tebe 3 Chapter 4 Project Workspace iii 4 41 INIFOAUGHoni a aaa p ro ror TO ro roo Ten oo rr nn ron ae at eee at 4 4 2 Creating a new Project WorkSpace ii 4 4 3 Build Configurations and Debug Sessions cara nn nan nara nn rana nn ran nn nan na nannnnns 5 4 31 BUIN Configuration ui a 5 4 3 2 DODUO OSO ru ro rr ro i i ii aaa 5 Chapter 5 Building the Tutorial ProjeCt i 6 DA Building COG sico re rn rr adas 6 5 2 Connecting the debugger i 7 5 3 Connecting to the target with the E10A i 7 Chapter 6 Downloading and Running the Tutorial i 9 Ghapter 7 Project Flles sss a assise ao o dede ia 14 FA Standard Project Flle e tua al aa ae io 14 7 1 1 Initialisation co
13. damages Precautions The following precautions should be observed when operating any RSK product This Renesas Starter Kit is only intended for use in a laboratory environment under ambient temperature and humidity conditions A safe separation distance should be used between this and any sensitive equipment Its use outside the laboratory classroom study area or similar such area invalidates conformity with the protection requirements of the Electromagnetic Compatibility Directive and could lead to prosecution The product generates uses and can radiate radio frequency energy and may cause harmful interference to radio communications However there is no guarantee that interference will not occur in a particular installation If this equipment causes harmful interference to radio or television reception which can be determined by turning the equip ment off or on you are encouraged to try to correct the interference by one or more of the following measures e ensure attached cables do not lie across the equipment e reorient the receiving antenna e increase the distance between the equipment and the receiver e connect the equipment into an outlet on a circuit different from that which the receiver is connected e power down the equipment when not is use e consult the dealer or an experienced radio TV technician for help NOTE It is recommended that wherever possible shielded interface cables are used The product is potenti
14. de resetprg c resetprg h ii 14 7 1 2 External bus and Memory configuration bus init c bus init h i 16 7 1 3 Board initialisation code hwsetup c hwsetup h i 17 7 1 4 Main tutorial code main c main h i 18 Chapter 8 Additional Information ii 19 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 2012 Renesas Electronics Europe Ltd All rights reserved O 2012 Renesas Electronics Corporation All rights reserved O 2012 Renesas Solutions Corporation All rights reserved Website htto www eu renesas com Glossary ADC Analog to Digital Converter MCU CD Compact Disc PC CPU Central Processing Unit RAM E10A E10A for Starter Kit debugger ROM HEW High performance Embedded Workshop RSK LCD Liquid Crystal Display RSK2 LED Light Emitting Diode USB Microcontroller Unit Program Counter Random Access Memory Read Only Memory Renesas Starter Kit Renesas Starter Kit Plus Universal Serial Bus Chapter 2 Introduction This manual is designed to answer in tutorial form the most common questio
15. der any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part 4 Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconduc tor products and application examples You are fully responsible for the incorporation of these circuits software and information in the de sign of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information 5 When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the tech nology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations 6 Renesas Electronics has used reasonable care in preparing the information included in this document but
16. e HardwareSetup ifdef RELEASE Configure and initialize the cache memory io_init_cache Cache write back io cache writeback fendif Set Vector Base Register set vbr void char amp INT Vectors INT OFFSET Reset Status Register set_cr SR_Init nop We will now skip over the initialisation code and proceed to the main tutorial e In Source View scroll down the file until you see the call to main e Place an eventpoint at the call to main by double clicking in the Event column next to the line to stop at Maximum eleven eventpoints can be set Eventpoints do not require programming the flash memory and thus are faster to use Please refer to the following document for further information SuperH Family E10A USB Emulator Additional Document for User s Manual Supplementary Information on Using SH7269 and SH7262 e Press Go on the Debug Toolbar sl The code will execute to the event point At this point all the device initialisation will have been completed e Press Step In on the Debug Toolbar la The code window will open main c and show the new position of the program counter 000015FC 000015FE 00001602 0000160E 0000161C 0000162A 00001634 0000163E 0000164E 00001656 00001662 0000166E 0000167E ore da RO RR ROOT de de de ke Outline main Description Main program This function calls timer A
17. e the external Memory configure bus and memory Configures port pins configure port pins Enables required on chip peripherals enable peripheral modules PORRO RO ROO RE RO RO ROO RO ROO RO ROO RO RO ROTO RO ROTO RO ROO RO PORO RO PORO RO RR e He he ROERO PORRO RO ROO ROO RO ROI RO RIO RR RR A A End of function HardwareSetup iio A 17 7 1 4 Main tutorial code main c main h The display initialisation and string display functions operate on the LCD display module In addition to the tutorial code several samples of use of the on chip peripherals are supplied Check compatibility with a ks0066u controller and pin connection on the schematic before connecting an LCD module not supplied by Renesas FREE RE RE ERE RARA RE RE E ERE EE RE ERE E e e e e e e e de e e e de e e e e e e e e e e e de e e e de e e e de e e e de e e e e e e e de e e e e e ke Outline Description main Main program This function calls timer ADC amp LCD initialisation functions The user LEDs flashes until the user presses a switch on the RSK Argument none Return value none TERE ROERO RE Fe Fe Fe Fe Fe Fe FE e FE Fe KK Fe ROERO Fe Fe Fe Fe Fe Fe Fe Fe Fe Fe Fe Fe Fe Fe F Fe ROERO Fe Fe ROERO RE RR RORE RE Fe Fe ie Fe Fe ie ve Fe he dle de de de de de e de ke e void main void Initialise the IIC port Expanders to default settings R_IIC3 2 InitDefault Reset the LCD module R_LCD InitialiseDispla
18. ec HDMI device and touch screen controller can be accessed safely by the user code 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 Open the file main c Insert an event point at Statics_Test function 0 Statics Test ti e Right click on the FlashLEDs function and select Toggle Breakpoint F9 Go to cursor Define Column Format Columns Turn Header On Off Set PC Here Display PC The code will execute to the selected line and stop e Press Step Over on the Debug Toolbar DP The code will run and flash the LEDO LED1 LED2 and LED3 for 200 times The debugger will not exit until all 200 flashes have completed or a switch is pressed on the RSK2 e Ifthe LEDs are still flashing press the any switch SW1 SW2 or SW3 on the RSK2 to exit the FlashLEDs function The code will run to the event point we previously set on the Statics_Test function The Statics_Test is used to demonstrate that the initialisation routine has successfully copied all the initialised variables from storage in flash to RAM e Press Step ln on the Debug Toolbar PIP er It is possible to monitor variables while debugging the code To set up a watch on a variable place the mouse over the variable If the
19. figuration 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 and its exclusion in the Release build Contents of common C files are controlled with defines set up in the build configuration options and Hifdef 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 or from its icon 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 Workspace Name RS K25H7269 Tutorial Project Name RSK2SH7269_Tutoral Directory Y Library RSK2 SH7269 CAWorkSpaceNRSK2SH7269 Tutorial a 7 Debugger only SH 2A E10A CPU family SuperH R
20. ide provided with the RSK2 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 e Fitthe LCD module to LCD on the RSK2 Ensure all the pins of the connector are correctly inserted in the socket e Connect the E10A debugger to any spare USB port on your computer e Connect the E10A debugger to the target hardware ensuring that it is plugged into the connector marked E10A on the RSK2 e Turnon the external power to the board 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 Debug y SessionsH24_FPU_E1O SessionSH2A FPU E10A USB SYSTEM debug session e Click the lt Connect gt button on the debug toolbar La e In the Select Emulator mode dialog E EN0A USB Emulator For Device select SH72691 IMEI For Mode select E10A USB Emulator e e e Click lt OK gt Warning Incorrect connection will damage the user system OK Cancel e Press the RST button on the RSK2 board e Click lt OK gt A Please reset the user system and press Enter Key e Please wait until the message Connected o appears in the HEW output window this indicates that the RSK2 board has
21. ined in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned sub sidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics Disclaimer By using this Renesas Starter Kit RSK the user accepts the following terms The RSK is not guaranteed to be error free and the entire risk as to the results and performance of the RSK is as sumed by the User The RSK is provided by Renesas on an as is basis without warranty of any kind whether ex press or implied including but not limited to the implied warranties of satisfactory quality fitness for a particular pur pose title and non infringement of intellectual property rights with regard to the RSK Renesas expressly disclaims all such warranties Renesas or its affiliates shall in no event be liable for any loss of profit loss of data loss of contract loss of business damage to reputation or goodwill any economic loss any reprogramming or recall costs whether the foregoing losses are direct or indirect nor shall Renesas or its affiliates be liable for any other direct or indirect special incidental or consequential damages arising out of or in relation to the use of this RSK even if Renesas or its affiliates have been advised of the possibility of such
22. malfunctions under certain use conditions Further Renesas Electronics prod ucts are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physi cal injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of micro computer software alone is very difficult please evaluate the safety of the final products or system manufactured by you 10 Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liabil ity for damages or losses occurring as a result of your noncompliance with applicable laws and regulations 11 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Rensas Electronics 12 Please contact a Renesas Electronics sales office if you have any questions regarding the information conta
23. ns 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 I build an embedded application e How do 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 and then downloaded without the debug monitor in a Release situation The build con
24. nt defined by the Power on reset vector Source Ad E S Source ZIE SORTE he e he e Fe e TERRE ie he He e e He e de de e de Fe R ORRORI RR RR RR RENT e RESI e de e e de e de de de de de de de ke Function Name Description power on reset pc Power on reset function laj This function executes following a power on reset bed It first calls hardware initialisation function led amp then main function Argument none Return value none e se se e e e e e ae se se e e e E ve e e E ve e se e se III ISI RR ie de de ie ie pragma entry power on reset pc pragma section ResetPRG 00000590 void power on reset pc void Configure Floating Point Status Control Register 00000590 set fpscr FPSCR Init Copy initialized data from ROM to RAM 00000596 _INITSCT Initialize the hardware 0000059A HardwareSetup ifdef RELEASE x Configure and initialize the cache memory io init cache Cache write back io cache writeback fendif Set Vector Base Register 000005A6 set_vbr void char amp INT Vectors INT_OFFSET Reset Status Register OOOOOSAE set cr SR Init 000005BC nop Use the separate register bank for interrupts 000005BE INTC IBNR BIT BE 0x01 Disable interrupt mask 000005D6 set_imask 0 Call user program OOOOOSEO main End of user program OOOOOSEA sleep 000005EC pragma section A 7E e te he
25. office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime sys tems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g exci sion etc and any other applications or purposes that pose a direct threat to human life 8 You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installa tion and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Rene sas Electronics products beyond such specified ranges 9 Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific charac teristics such as the occurrence of failure at a certain rate and
26. ough the interrupt function e Remove the event point in the interrupt by double clicking it again before exiting the function e Press Go to run the code from the current T position of the PC 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 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 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 a detailed comment section 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 code after a power on reset Initialise is the entry poi
27. r Download Modules Right click on the download module Y main c 8 i resetprg c 9 listed and select Download D krale 10 Y vecttbl c 11 On completion the debugger and Text Files 12 RSK_Header bt 13 reri t xecuted la code are ready to be executed Download 14 IA ASK25H7269_Tutorial abs 0000007 LI as E bus_in th Download Debug Data Only i O Li j To start debugging we need to reset the debugger and target Press Reset CPU on the Debug Toolbar Reset CPU The File window should open the tutorial code at the entry point An arrow marks the current position of the program counter Source Ad 00000590 00000590 00000596 0000059A 00000546 000005AE 000005BC E S ES Source jp de da ada da e TERRORE PORO ORO FORO ROO PORO PORO PORRO PORO PORO ROO PORO PORO ORIO ROO ROI OOOO OOO ROO ROI III RIOR IR RE e de de de de Function Name power on reset pc Description Power on reset function ba This function executes following a power on reset kaj It first calls hardware initialisation function laj amp then main function Argument none de Return value none o A pragma entry power on reset pc pragma section Reset PRG void power on reset pc void Configure Floating Point Status Control Register Copy initialized data from ROM to RAM _INITSCT Initialize the hardwar
28. sas eu America http america renesas com Asia http sg renesas com Technical Contact Details America techsupport america renesas com Europe software_support eu Im renesas com Japan csc renesas com General information on Renesas Microcontrollers can be found on the Renesas website at http www renesas com Trademarks All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations Copyright 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 Electronics Europe Limited 2012 Renesas Electronics Europe Ltd All rights reserved 2012 Renesas Electronics Corporation All rights reserved 2012 Renesas Solutions Corporation All rights reserved REVISION HISTORY RSK2 SH7269 Tutorial Manual Rev Date Description Page Summary May 11 2012 First Edition issued Renesas Starter Kit2 Tutorial Manual Publication Date Rev 1 00 May 11 2012 Published by Renesas Electronics Corporation LENESAS SALES OFFICES Renesas Electronics Corporation http www renesas com Refer to http www renesas com for the latest and detailed information Renesas Electronics America Inc 2880 Scott Boulevard Santa Clara CA 95050 2554 U S A Tel 1 408 588 6000 Fax 1 408 58
29. ssage wi When complete close the dialog box by clicking lt OK gt RNA SFILELEAP obi debug optimized gbr ado 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 RSK2 from the supplied PSU as the E10A debugger cannot supply power to the RSK The E10A debugger 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 disconnect some of the connected USB devices and try again Alternatively you can provide an external power source taking care to ensure the correct polarity and voltage The Quick Start Gu
30. te selection will be DefaultSession The purpose of the Debug session is to allow the use of different debugger tools or different debugger settings on the same project e Select SessionSH2A_FPU_E10A_USB_SYSTEM Debug SessionsH2A_FPU_E10 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 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 Superk RISC engine Standard Toolchain Configuration C C Assembly Link Library Standard Library CPU gt tool chain options It is important when changing any setting to Category Source y be aware of the current configuration that is being modified If sq Al ceded oc mmm Show ents for l a em sia re Include file directories Se you wish to modify multiple or all build configurations this is E GA C source file E Assembly source file possible by selecting All or Multiple from the Configuration I Linkage symbol fle drop down list e Review the options on each of the tabs and Category dropdown lists to be aware of the options available Options C C pt S CONFIGDIR o me
31. tion 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 User s 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 optimization settings With the optimization turned on the debugger may seem to execute code in an unexpected order To assist in debugging it is often helpful to turn off optimization on the code being debugged e Select the Debug build Configuration EN SessionSH2A FPU E10 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 alterna
32. y Display Renesas Splash Screen R LCD DisplayString LCD LINE1 Renesas R LCD DisplayString LCD LINE2 NICKNAME Flash the user LEDs for some time or until a push button is pressed FlashLEDs Demonstration of initialised variables Use this function with the debugger Statics Test Flash the user LEDs at a rate set by the user potentiometer ADC using interrupts TimerADC This function must not exit while 1 if g toggle leds ToggleLEDs g toggle leds 0 ORAR de RE e de RE RETE a dle e RE ERE RE RETE RE RENE de da oe dde ole de da RES RE RE ERE da ole de RE RENE de e e e RE RE de RE ERE RE de de e a e de e le RE RE RR e dle de de de de End of function main via dde de e RE e de e de de e de de da e ve RE le e RE e de RE RETE RE RE oe de da e de de RENE RE de e de de le dde le e e RENE RE RE le RRR ERR RE e de de de de ke Chapter 8 Additional Information Technical Support 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 Awww renesas com Regional English language sites can be accessed from the Global site or directly by going to Europe http rene
Download Pdf Manuals
Related Search
Related Contents
USER`S MANUAL Emberglow - Direct Fireplaces Mode d`emploi Manual Manuale Veterinario 2015 conversor - ip / usb / serial [U4.14.01] Opérateur DETRUIRE 取扱説明書 PW-G4200 取扱説明書 Instructions d`utilisation pour scie médicale Copyright © All rights reserved.
Failed to retrieve file