Home

Renesas REJ10J1330-0200 User's Manual

image

Contents

1. Debug Data Only Note The output display will show Flash memory iir a write end to confirm the completion of the uP Download 4 New Module download SE Debug Settings zot version WVEF On completion of the download the debugger is ready for the code to be executed To start debugging it is necessary to reset the debugger and target e Press Reset CPU on the debug toolbar RII sit s The File window should open the Tutorial code at the entry point An arrow marks the current position of the program counter SECTION P ORG 8700 s RR E E E E E E E E E ppp ppp ppp spp ppp pp pp pop pp ppp p ppp pp pp pop ppp pop ppp ppp pp pp pop pp ppp ppp sR R R E R R R E E qp ppp pep pp ppp spp pop pp pp E R ppp pop pp pp pp ppp pop pp pp ppp ppp pop pp dp ppp spp pop p Function Name Reset Description Reset start BCC R R E R Ce R R 0 E R R R E R pp ppp spp pop pp pp qp ppp pp pp pp pp ppp spp pop pp pp ppp ppp pp pp pp pp spp pop p B RESET I Interrupt Disable D 0 Binary Arithmetic Executed T 0 A Maode Flag Clear IFFH set Stack Pointer CPIM 10000000B single Chip Mode Stack Pagell Un Chip OSC NOP Waiting For Stable Of Oscillation NOP NOF CFUM 000000006 switch To Main Clock High peed Mode J amp R Ini tRAM JSA Cont igureFfortFins J amp R EnablePeripheraModules JSR Cont igurelnterrupts I Reset the LCD module J amp R InitialiseDisplay We will
2. 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 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 a74 e Open the file interrupts a74 by double clicking on the file in the Workspace window e Review this file and find the interrupt function that changes the LED pins TimerX Handler e Seta breakpoint on the line where the LED pins are modified ToggleLEDs subroutine e Press Go or F5 to run the code from the F current PC position The code will stop in the interrupt routine It 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 Go to run the code from the current PC zt position The code will now run to the infinite loop at the end of Main The user LEDs will now be flashing You can modify the flashing rate by adjusting the potentiometer on the Renesas Starter Kit 11 e Press Stop on the debug toolbar TOP e Press CTRL B to open the breakpoint window Breakpoints This dialog is not available if user debugged using eventpoints as suggested at top of page 10 CTRL E will open the eventpoint window Eventpoints can be Lene viewed in Breakcondition tab of event window
3. x E es Tutorial 5 you wish to modify multiple or all build configurations this is C Assembly source fie possible by selecting All or Multiple from the Configuration drop down list e Review the options on each of the tabs and Category drop down lists to be aware of the Options Assembly options available H Note For the purposes of the tutorial leave all Concet options at default When complete close the dialog box by clicking OK 5 1 Building Code There is a choice of three shortcuts available for building the project 1 Selecting the Build All tool bar button This will build everything in the project that has not been excluded from the build This includes the standard library 2 Selecting the Build tool bar 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 Pressing F7 This is equivalent to pressing the Build button described above e 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 any errors and warnings encountered during the build 5 2 Connecting the debugger For this tutorial itis not necessary to provide an external power supply to the board The power will be
4. Erase Flash and Connect Select the correct MCU group and device type 9 KosspERD ERES RSKM37542 as illustrated f Debugging of CPU rewrite made E Select Erase Flash and Connect If the E8a is to provide power to the CPU Power supply board select Power Target from Emulator and w Power Target from Emulator Maes 30Um choose the 5 0V option 33V Cancel Press lt OK gt Do not show this dialog box again e The Flash Memory write program will be Connecting downloaded to the target e The Output window in High performance Embedded Workshop will show Connected Note The connection to the target will activate Flash memory erasing the debugger buttons on the High performance TS Downloading Flash memory write program Embedded Workshop toolbar Now is a good time to save the High performance Embedded Workshop 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 High performance Embedded Workshop it needs to be downloaded to the Renesas Starter Kit itself There will now be an additional category in the workspace view for Download Modules H E Download modules e Right click on the download module listed and Download select Download E Dependencie Download
5. e Press Remove All e Press OK e Open the file main a74 e Inserta breakpointon Statics_Test subroutine The Statics testis used to demonstrate that the initialisation has successfully copied all initialised variables from storage in flash to RAM e Press Reset Go on the debug toolbar zl pP p The code will stop at the breakpoint Press one of the Renesas Starter Kit buttons to bypass the flashing LED test e Press Step In on the debug toolbar m tri Itis 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 tooltip will be displayed with the current value of the variable e Hover the mouse over the STR DISP variable and its value will appear as a tooltip Now 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 12 The dialog will close and a new pane will open in the workspace containing the variable e Press Go To Memory a In the ASCII column on a Memory Window itis possible to see that the string has been successfully initialised to STATIC Set a breakpoint on the call to DisplayString Subroutine inside the for loop Press Go to run the code from the current PC position eI hi oO e Press Step Over on the debug toolbar
6. p mum When the program stops you can see the modified string displayed on the second line of the LCD Inspection of the watch pane and Memory Window 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 Right click on the DisplayString subroutine 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 assembler 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 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 assembler specific details 7 1 1 Main tutorial code main a74 main inc This is the entry point of the main tutorial code The call t InitRAM ConfigurePortPins EnablePeripheraModules and ConfigureInterrupts Will initialise the device hardware and peripherals ready for the tutorial software The display initialisation and stri
7. workspace when presented with the Welcome dialog New Project Workspace Projects EN Assembly Application Workspace Mame T Empty Application RSKEM37542_Tutorials pE Import Makefile e e Library P IRSKM 37542 Tutorial 00 Directory w arkbpaceXHSKM3 542 Tutorials Browse CPU family 40 Family Tool chain Renesas 740 Family Standard Properties The example above shows the New Project Workspace dialog with the RSKM37542 selected Select the 740 CPU Family and Renesas 740 Family Standard Toolchain Select the RSKM37542 Project type from the left hand Projects list Enter a Workspace Name all your files will be stored within a folder called c WorkS pace lt your_name gt The project name field will be pre filled to match the workspace name above you can change this name if you wish Note High performance Embedded Workshop 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 Renesas Starter Kit Project Generator wizard The next dialog presents the three types of example project available 1 Tutorial This is the one of interest at this time the code is explained later in this manual 2 Sample code this provides examples for using various peripherals If you select this and click Next it will open a new dialog allowing the
8. HRR E R R E E E R E E E ppp pep pp pp ppp ppp pp pp E E R E E E R H pop pp pp pp ppp pop pp pp ppp spp pop pp pp pp ppp p Function Name EnablePeripheral Modules Description Enables Peripheral Modules before use BECO 0 t t On e 0 Oo d Co t e e e i ppp pp pop pp Oo Co p ppp pp pp pop pp ppp pp pop pp ppp ppp EnablePeripheraladulses 2 All modules are active in the 754 device RIS BI R E R E R E E ppp p ppp pp ppp ppp ppp pp pp ppp pop ppp pp ppp ppp ppp ppp ppp ppp ppp pop ppp End of function EnablePeripheralMadules sE E ppp pp pp pop p ppp p ppp ppp pp pop p pop pp pp ppp p ppp p ppp pp ppp ppp qp pop gp pop ppp p ppp pp Imppp ppp pp poppe ppp ppp pop pp ppp p p pop pp pop ppp ppp ppp pop ppp pop ppp pp pop ppp ppp Function Mame LanfizurePaortPins Description Initial setting BRC R HR R R ppp ppp pep pp pp ppp ppp pop pp ppp ppp pop pp pp qp H E R R pp pp ppp ppp pep pp pp ppp Cont tgzurePortPins P D 100001006 P20 001111006 P3 11111111B POPE Po F30 000111116 Port F3_0 to P3 4 are Output Made THSTP 1 RTS s EER R E R E E E E E E R E E E R E E E E E E E E E E E E E E E E E E E E E E E E R E E E E E E E E E E E E E E E E E E E R E E E E E E E E R E E E E op ppp End of function Cont igureFortPins sR R HR R E R R E E E R E E E R R E E pp pp ppp ppp pep pop pp R H E ppp pop pp pp R H E R R pop pep ppp p psp p pop ppp pp pp R GR 15 Chapter 8 Additional Information For details on how to us
9. REJ10J1330 0200 Everywhere you imagine m l ENESAS Renesas Starter Kit for 7542 Tutorial Manual for M3T SRA74 RENESAS SINGLE CHIP 8 BIT CMOS MICROCOMPUTER 740 FAMILY Rev 2 00 Renesas Solutions Corp Revision date Aug 10 2007 www renesas com Table of Contents Or gfe eV S il ea Pe gt eee mm m m m Um mU 1 chapter 2 injifore B ejiro o ett CL 2 Onapter 3 Tutorial T roject WOIKSDaOO xtti usns tar iicet a isa ibt ue isum E 3 Ghapier As Prolect WOFKSDAdOG s oit eodiscusuieu ote scene aise ede cod edad one ote occid t endie tute pus tab evades coder abe naei 4 A Me lgirgoroid ie ein e E LE Eo ooo ooo oom 4 4 2 Creating a new Project Workspace vsus vel occ a BU idu vu dut ubt eu sh da ria bu LR B d pw ne 4 4 3 Build Gontigurations and Debug SESSIONS ae intend Lane oni eiue Usu Po LR D hex redu Drs ener anu e i bx Ri 5 LS UNG SOF UAL ONN EE 5 S SEMI 6 6 0 Re sci 9 NER TE TEL E 5 Chapter 5 Building the Tutorial Project subi rtt na tapa ce p Eri pul uec Le Do Debt cu HO chads ocv dm cham ED eiu PL odes 6 SN O 0 ayo OOE C r PR 6 6 23 CONNEC Me aebuddE mL 7 5 3 Connecting to the target with the E8a lssssssesssssesssseseseeee nennen nnne nnn nnn nnn nnns nnn n nnns naar nnns 7 Chapter 6 Downloading and Running the Tutorial ccccccceccccecceeseeceeeeee
10. e High performance Embedded Workshop refer to the High performance Embedded Workshop manual available on the CD or from the web site Further information available for this product can be found on the Renesas website at htto www renesas com renesas_ starter kits General information on Renesas Microcontrollers can be found at the following websites Global htto www renesas com R egional English language sites can be accessed from the Global site or directly by going to Europe http eu renesas com Americas http america renesas com Asia htto sq renesas com 16 Renesas Starter Kit for 7542 Tutorial Manual for M3T SRA74 Publication Date Rev 2 00 Aug 10 2007 Published by Renesas Solutions Corp 4 1 6 Miyahara Yodogawa ku Osaka City 532 0003 Japan 2007 Renesas Solutions Corp Renesas Technology Europe Ltd and Renesas Technology Corp All Rights Reserved Henesas Starter Kit for 7542 Tutorial Manual for M3T SRA74 434 NE SAS Renesas Solutions Corp 4 1 6 Miyahara Yodogawa ku Osaka City 532 0003 Japan
11. eeeeeeesseeseeeeeeeeeeeeesseaeeeeesseaseeeeesaaaeeeees 9 Chapter 7 Project a M X 14 Til otandard Project TE WSS iach T eka oaacan acd aa a e nse 14 7 1 1 Main tutorial code main a74 mailn Inc iicuee ececestecdcscedenaicebeanctnned E E S a 14 7 1 2 Board initialisation code NWSEtUP A74 cccccsssssecccceesseceecceeeeceecseaueeeccssaueeeessuseeeeesseaseeessssaseesessaas 15 chapters Additlonabintermaellobiscescuc ub tudt lassen papers eas somalia asttasalonsakdatauolantddacktnaetanacedauees Galas Sout La E t Pi susct 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 Solutions Corporation Trademarks All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations Copyright Renesas Solutions Corporation 2007 All rights reserved Renesas Technology Europe Ltd 2007 All rights reserved Renesas Technology Corporation 2007 All rights reserved Renesas Global Website htto www renesas com Renesas Europe Website http eu renesas com Glossary ASM Assembler MCU CPU Central Processing Unit PC E8a E8a On chip debugger module PCB LCD Liquid Crystal Display RSK LED Light Emitting Diode Microcontrolle
12. l 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 Debug situation The build configuration menu in High performance Embedded Workshop 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 ASM 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 High performance Embedded Workshop is an integrated development tool that allows the user to write compile program and debug a software project on any of the Renesas Microcontrollers High performance Embedded Workshop will have been installed during the installation of the software support for the Renesas Starter Kit product This manual will describe the stages required to create and debug the supplied tutorial code 4 2 Creating a new Project Workspace Start High performance Embedded Workshop from the Windows Start Menu Start All Programs Renesas High Performance Embedded Workshop Open a new tutorial workspace from the File gt New Workspace menu or select Create a new project
13. ng display functions operate on the LCD display module Check compatibility with ks0066u controller and pin connection on the schematic before connecting an LCD module not supplied by Renesas BI Co E E R E ppp pep pep pep ep pp pp ppp ppp pp E E E E ppp pep R R E E E E E E E ppp pp ppp pp ppp pp pop gp Function Mame Reset Description Reset start mi tt pp pop ppp pop pp pep ppp pop ppp ppp qp pop ppp pop pp pop pp Co Co ppp pp ppp ppp pop ppp pop gp RESET I Interrupt Disable D I Binary Arithmetic Executed T 0 A Mode Flag Clear OFFH set stack Pointer LOPUMIJ 100000008 Single Chip Mode Stack Pagel 0n Chip OSC NOP Waiting For stable Of Uscil lation MOF MOF CFU 000000006 switch To Main Clock Hizh Speed Mode J amp R Init RAH JSR Cont igureFfortFins J amp R EnablePeripheraModules JSR Conf igurelnterrupts I 0 Reset the LCD module JSR InitialiseDisplawv Display Renesas Splash Screen 7 LFOSITION LCD LINE DISP PHT STR_RENESAS DISP PHT4 1 ZSTR REMESAS JSR DisplayString POSITION LCD_LINE DISP PNT gt NICK_NAME DISP_FNT 1 lt NICK NAHE JSR DisplayString 14 7 1 2 Board initialisation code hwsetup a74 There are two stages to the configuration of the microcontroller device The code to demonstrate this is therefore split into two functions Each function is written specifically for the device supported The function calls are shown below sR R
14. now skip over the initialisation code and proceed to the main tutorial e Placea breakpoint at the callto InitialiseDisplay Subroutine Breakpoints can only be set when the E8a is connected to the target and the module is downloaded Breakpoints can be set by double clicking in the grey 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 an eventpoint by double clicking in the column to the left of the breakpoint column Up to 2 eventpoints can be set Eventpoints do not require programming the flash memory and so are faster to use e Press Reset Go on the debug toolbar mp p The code will execute to the breakpoint At this point all the device initialisation will have been completed The code window will show the new position of the program counter c Reset the LCD module J amp R InitialiseDisplay ft Display Renesas Splash Screen 7 LFOSITION LCD LINE1 DISP PNT 5STR REMESAS DISP PHT4 1 lt STR RENESAS JSR Displavstrinz POSITION LCD LINE 2 DISP PNT gt NICK NAME DISF_PNT 1 lt NICK NAME J amp R Displaystring Flash the user LEDs for some time ar until a key is pressed J amp R FlashLEDs it Flash the user LEDs at a rate set by the user potentiomenter ADC using interrupts 7 J amp R TimerADE Demonstration af initialised variables Use this f
15. 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 Renesas Starter Kit board gives detailed instructions on how to connect the E8a to the host computer The following assumes that the steps in the Quick Start Guide have been followed and the E8a drivers have been installed Fitthe LCD module to J 8 on the Renesas Starter Kit ensuring that pin 1 on the module corresponds to the indication on the Renesas Starter Kit PCB Connect the E8a debugger to the USB port on your computer Connect the E8a Debugger to the target hardware ensuring that it is plugged into the connector marked 6 which is nearest the power connector If supplying external power to the board this can be turned on now 5 9 Connecting to the target with the E8a This section will take you through the process of connecting to the device programming the Flash and executing the code Otherwise connect a 5V centre positive supply Select the Session 40 E8a SYSTEM debug Emulator Setting Session Emulator mode Click the lt Connect gt button Er MCU Group 7542 Group on the debuo toolbar 3 Device M37542F8 RS5K The Emulator Setting dialog will be shown Mode
16. r Program Counter Printed Circuit Board Renesas Starter Kit Chapter 2 Introduction This manual is designed to answer in tutorial form the most common questions asked about using the Renesas Starter Kit The tutorials help explain the following e How dol compile link download and run a simple program on the Renesas Starter Kit e How dol build an embedded application e How dol use Renesas s development 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 Renesas Starter Kit Quick Start Guide have been completed Please refer to the Quick Start Guide for details of installation and configuration of the Renesas Starter Kit NOTE These tutorials are designed to show you how to use the Renesas Starter Kit and are not intended as a comprehensive introduction to the High performance Embedded Workshop debugger the compiler tool chains or the E8a 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 tutoria
17. selection of many code examples for the peripheral modules of the device 3 Application 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 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 High performance Embedded Workshop e To view the file main a74 double click on the file in the Workspace window main a74 will appear in the code window 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 fully described in the High performance Embedded Workshop 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 optimisation settings With Optimisation turned on the Deb
18. ugger may seem to execute code in an unexpected order To assist in debugging it is often helpful to turn optimisation off on the code being debugged v D efautS ession e Select the Debug Build Configuration 4 3 2 Debug Session The debug sessions are selected from the right hand drop down list on the toolbar The options vary between Renesas Starter Kit types however one will always start Debug and include the type of debug interface the alternate selection is the DefaultS ession The purpose of the debug sessions is to allow the use of different debugger tools or different debugger settings on the same project Debug Sessian 4dl Efa SYSTER e Select the Session740 E8a 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 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 Renesas 740 Family Standard Toolchain tool chain options It is important when changing any setting to Configuration Assembly Link Librarian CPU Toolchain Option Debus rl Category Soue v be aware of the current configuration that is being modified If All Loaded Projects rene
19. unction with the debugger 4 JSR statics Test At End af the user program This function must mot exit w MAIN BRA MAIN BE COCO 0 Coo ppp pop ppp pop ppp pp ppp pop ppp pop ppp p pp pop ppp ppp ppp p gp pop ppp pop ppp ppp pop ppp End of function RESET unqupppppeppep ppp ppp pop pop pep pop ppp ppp pop pop pep pp ppp ppp ppp pop pop pep ppp ppp ppp ppp ppp e Inserta breakpoint on the call to the T imerADC Subroutine 10 e Rightclick on the call to FlashLEDs subroutine ieu and select Go To Cursor as illustrated Toggle Breakpoint Fa Define Column Format Columns 3n Ta Cursor Set PC Here Display PC 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 pmi The code will run and flash the LEDs 200 times The debugger will not exituntil all 200 flashes have completed or a button is pressed on the Renesas Starter Kit e Tostopthe LEDs flashing press the SW1 button on the Renesas Starter Kit to exit the FlashLEDs Subroutine The code will run to the breakpoint we previously set on the TimerADC Subroutine note that the yellow PC arrow will now be Superimposed on the breakpoint indicator this confirms the breakpoint has been reached The TimerADC subroutine initialises an interrupt on an available internal timer On a compare match in the timer module an interrupt is

Download Pdf Manuals

image

Related Search

Related Contents

BEDIENUNGSANLEITUNG  Northern Industrial Tools BLACK NICKEL 3" AIR CUTOFF TOOL User's Manual    User Manual iCube  PomPe di calore aria/acqua  Diluciones y Aplicaciones – Dodiderm Sanitizantes  UC 24YFB - Hitachi Koki  ダウンロード  CC 10, CC 50, CC 100  AD-4531B デジタルインジケータ 簡易取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file