Home
Renesas Starter Kit for RX210 (B Mask) Tutorial Manual
Contents
1. function call by double clicking in the 76 ekta center of the text 78 7a 80 81 82 83 84 85 86 87 FFFFOOOO 88 89 90 FFFFOOOE 91 92 93 FFFF0017 94 95 96 FFFFOO1B 97 98 99 FFFF001F 100 FFFF0020 101 FFFFOO28 102 103 104 FFFFOO3D e Click the Go to Cursor button to run the program up to this point Elf e e Click Step In to HardwareSetup function enter the 0 S Source void PowerON_Reset_PC void Main program function declaration void main void RERRARAAERA RARER AREA AA RA AR ARTA AA AAA RARER AREA AREA AREA ER AR ARA RRE RARER ER ER ERT Outline PowerON Reset PC Description This program is the MCU s entry point from a power on reset The function configures the MCU stack then calls the HardwareSetup function and main function sequentially argument none Return value none RARAAAAAAAAATAAAAAAR AA RRA ERE AAA AREA ER AR AREA AA EA AA RATA AERA AA EAE RARER ER ER ERE RES void PowerON Reset PC void o 1461 6 6 1 46 46 6 Initialise the MCU processor word set intb sectop i C VECT 5 Initialise the MCU stack area _INITSCT x Configure the MCU and RSK hardware Change the MCU s usermode from supervisor to user nop set psw PSU init Change PSW PM to UserMode 5 Call the main program function main Line Source Add 52 e The program counter s
2. 127 FF1 Static Testi Line S O S Source 64 ERRAARAAAAAAAARTARAAATARATATARTAAALATARALARLARALA LAR AEAAEA TERA EAAAR EAA LEREEREE 65 Outline Flash LED 66 Description The LED flash function used at the beginning of the program 67 Argument none 68 Return value none 69 FF RFKKFRKFFKRERKTRKFRKARKARKARKKFKRERKKFRKFRKARKARKARKARKARKKRRKFRRFRKTRKFRKTRKA 70 FFI void Flash LED void 71 72 Declare error flag 73 FF bool err true 74 Fii Configure compare match timer 76 FFI err R CMT Create 77 i 78 o 79 PDL CMT PCLK DIV 512 80 DxFEO 81 CB TimerLED 62 3 83 Ve 84 85 Checks if the flash count has been reached 86 or if a button has been pressed 87 FF while gSwitchFlag 0 amp gFlashCount gt 0 88 89 Waits for a switch press or 200 flashes to complete 90 91 92 7 Reset the gSwitchFlag flag variable 93 FFI gSwitchFlag 0 94 95 7x Stop Timer 96 FF err R CMT Destroy 97 98 o 99 Ve 100 101 Halt in while loop when RPDL errors detected 102 FF while err R20UT2605EG0100 Rev 1 00 May 02 2013 TENESAS Page 22 of 29 RSKRX210B e Click Go to resume the program and then press a switch to proceed The program should halt at the event point set on the Timer_ADC function call e Press Step In twice to step into the StartTimer function e The StartTimer function configures the timer used to periodica
3. build configuration SessionRX E1 E20 SY 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 be Default and the other will include the type of debug interface in this case SessionRX E1 E20 SYSTEM The purpose of the debug sessions is to allow the use of different debugger tools or different debugger settings on the same project e Select the session Debug v SessionRX_E1_E20 SY v SessionRX_E1_E20_SYSTEM R20UT2605EG0100 Rev 1 00 Page 11 of 29 May 02 2013 RENESAS RSKRX210B 5 Building the Tutorial Program 5 Building the Tutorial Program The tutorial project build settings have been pre configured in the toolchain options To view the toolchain options select the Build menu item and the relevant toolchain This should be the first option on the drop down menu The dialog box that is displayed will be specific to the toolchain selected The Configuration pane on the left hand side will exist on all the toolchain options It is important when changing any setting to be aware of the current configuration that is being modified If you wish to modify multiple or all build configurations this is possible by selecting All or Multiple from the Configuration drop down list e Review the options on each of the tabs and RX Standard Toolchain Lo
4. PDL ADC 12 PIN ANOOO P40 le Configure the ADC in single mode software triggered err R_ADC 12 CreateUnit 0 PDL ADC 12 SCAN SINGLE PDL NO DATA PDL NO DATA PDL NO DATA PDL NO DATA PDL NO DATA CB ADConversion 6 PDL NO FUNC PDL NO DATA Ve Configure the ADC channel ANOOO err R ADC 12 CreateChannel 0 0 PDL ADC 12 CH GROUP A X PDL ADC 12 CH SAMPLE AND HOLD ENABLE SE 6 R20UT2605EG0100 Rev 1 00 May 02 2013 TENESAS Page 23 of 29 RSKRX210B 7 Reviewing the Tutorial Program Li s 0 1 s si Press F5 to resume mp rmo Uoo EE 137 Z R5FFFYKKFKKKKRAKKKRKKKRKKRKKEKKEKKEKKAKKAKKKKKKKKKKKKKKKKEKKEKKEKKAKRKKKEKKKKAK the code where it 138 Outline Static_Test x 139 Description Static variable test routine The function replaces the will then halt at the 140 contents of the string ucStr with that of ucReplace one 141 element at a time Right click the variable ucStr and break point on the 142 x select instant watch click add in the subsequent dialog 143 r If you step through the function you can watch the string Static_Test function 144 ki elements being overwritten with the new data call 136 A paid oun 147 ARAAAAAAA AAA AAA AER ARA RRA RRA RRA RRA RA AER AER AER ARA RRA RRA RRA RRA RRA ERA RAR EERE ARERR e Press F11 to step FU 148 FF poid Static Te 1 1 11811 149 into the function 150 Declare error fla
5. a a Download A New Module pi Remove 6 2 Running the Tutorial Once the program has been downloaded onto the RSK device the program can be executed Click the Reset Go button to begin the program It is recommended that you run through the program once first and then continue to the review section Bl R20UT2605EG0100 Rev 1 00 Page 17 of 29 May 02 2013 RENESAS RSKRX210B 7 Reviewing the Tutorial Program 7 Reviewing the Tutorial Program This section will look at each section of the tutorial code how it works and how it could be altered to be implemented into more complex code It is recommended that a copy of the RX210 API Manual is made available as the tutorial program uses RPDL and it is outside the scope of this manual to fully document the API system 7 1 Program Initialisation Before the main program can run the microcontroller must be configured The following parts of the tutorial program are used exclusively for initialising the RSK device so that the main function can execute correctly The initialisation code is run every time the device is reset via the reset switch or from a power reboot Ensuring the tutorial program has been downloaded onto the RX210 B Mask press the Reset CPU button on the Debug toolbar i i i Li Ad 0 S S e The File window will open the B 75 void PowerON_Reset_PC void Tutorial code at the entry po
6. loop Line J 0 S J Source 102 FRTRRRKFFRAFKRFKRFRARKARKFRKHRAFRKRKIRKIRKTRKERTRRKRKAFKARKARKFRKFKRKTTRTAFKIFTT 103 Outline main 104 Description The main program function Displays the Renesas splash screen 105 x onto the LCD display then calls the flashLED and TimerADC 106 functions The function then calls the statics test routine 107 r before waiting in an infinite while loop 108 Argument none 109 Return value none 110 iii 111 FF oid main void 112 4 113 Initialise the debug LCD 114 FF 115 116 Displays the Renesas splash screen LIT ME Display LCD LCD LINE1 Renesas 118 FFI Display LCD LCD LINE2 NICKNAME 119 120 Begins the initial LED flash sequence 121 FFI Flash LED 122 123 Begins the ADC varying flash Sequence 124 FF Timer ADC 125 126 Begins the static variable test 127 FF Static Test 128 129 Infinite while loop 130 Defines an infinite loop to keep the MCU running 131 FF while 1 132 133 RRTYRFKKKKKKKFKKRKKFFKKKKKKKRKKFKKFKKKKKRKFKRKKKKKKRKKKKKKKKKKKRKKRKKKKKRKFKRKRKAF 134 End of function main 135 RRAEAREREAAATARARA EAA ERRERAERA ERE ER EEA EER EERE RR ERR ERE EE EERE ER ERR EER ERR ERR ER EERE 120 Begins the initial LED flash sequence 121 FFI 6 Flash LED 122 123 Begins the ADC varying flash Sequence 124 FF e Timer ADC 125 126 Begins the static variable test
7. Library User s Manual R20UT2605EG0100 Rev 1 00 Page 24 of 29 May 02 2013 RENESAS RSKRX210B 8 Additional Information 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 For information about the RX210 series microcontrollers refer to the RX210 Group Hardware Manual For information about the RX210 assembly language refer to the RX200 Series Software Manual Online technical support and information is available at http www renesas com rskrx210b Technical Contact Details Please refer to the contact details listed in section 7 of the Quick Start Guide 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 2013 Renesas Electronics Europe Limited All rights reserved 2013 Renesas Electronics Corporation All rights reserved 2013 Renesas Solutions Corp All rights reserved R20UT2605EG0100 Rev 1 00 Page 25 of 29 May 02 2013 stENESAS
8. Refresh Cancel Dor w this dialog box aga e Click the Startup and Communication tab and a ensure the Mode Pin Register 8 Endian re settings match the screenshot opposite Device Startup and Communication Ensure the FINE Baud Rate is set to 2000000bps Once these settings have been Ej confirmed click the OK button to continue Mode Pin Setting EMPIRE e The Flash Memory write program will be Register Setting Single chip mode y downloaded to the target Endian teenin sa Operating Mode Communication C JTAG Cock x muz FINE Baud Rate 2000000 y bps R20UT2605EG0100 Rev 1 00 Page 14 of 29 May 02 2013 RENESAS RSKRX210B 5 Building the Tutorial Program e The Connecting dialog box will appear showing the status of the connection process Under default settings this dialog box will disappear once the connection is complete e Once the debugger has connected the Configuration Properties dialog box will appear e Ensure the following configurations are set Mode Single chip mode Endian Little Endian Input Clock EXTAL 20 0000 MHz Work RAM Start Address 0 e Once the settings have been reviewed click OK to proceed The Output Window in HEW will show Connected e The connection to the target will activate the debugger buttons on the HEW toolbar The function of these buttons will be explained in
9. The build will complete with an indication of any errors and warnings encountered during the build R20UT2605EGO100 Rev 1 00 Page 12 of 29 May 02 2013 TENESAS RSKRX210B 5 Building the Tutorial Program 5 2 Connecting the Debugger For this tutorial it is not necessary to provide an external power supply to the board The power will be obtained from the USB port Please be aware that if you have too many devices connected to your USB port it may be shut down by Windows If this happens remove some devices and try again Alternatively provide an external power source taking care to ensure the correct polarity and voltage Other sample code supplied with this RSK will require a variable power supply in which case an external 5V variable power supply should be used Refer to the RSKRX210B User Manual for further details The Quick Start Guide provided with the Renesas Starter Kit board gives detailed instructions on how to connect the E1 to the host computer The following assumes that the steps in the Quick Start Guide have been followed and the E1 drivers have been installed e Fit the LCD module to LCD connector on the board via the header marked LCD Ensure all the pins of the connector are correctly inserted in the socket e Connect the E1 Debugger to a free USB port on your computer e Connect the E1 Debugger to the target hardware ensuring that it is plugged into the connector marked El e f supplying external power t
10. This Manual 1 Purpose and Target Readers This manual is designed to provide the user with an understanding of how to use the High performance Embedded Workshop HEW IDE to develop and debug software for the RSK platform It is intended for users designing sample code on the RSK platform using the many different incorporated peripheral devices The manual comprises of step by step instructions to load and debug a project in HEW but does not intend to be a complete guide to software development on the RSK platform Further details regarding operating the RX210 B Mask microcontroller may be found in the Hardware Manual and within the provided sample code Particular attention should be paid to the precautionary notes when using the manual These notes occur within the body of the text at the end of each section and in the Usage Notes section The revision history summarizes the locations of revisions and additions It does not list all revisions Refer to the text of the manual for details The following documents apply to this RSK and the RX210 Group Make sure to refer to the latest versions of these documents The newest versions of the documents listed may be obtained from the Renesas Electronics Web site Document Type Description Document Title Document No User s Manual Describes the technical details of the RSK RSKRX210B User s R20UT2604EG hardware Manual Software Manual Describes the functio
11. pressing the F9 key The E1 emulator features advanced logic based event point trigger system and full instruction on its use is outside the scope of this tutorial For further details please refer to the RX Family E1 E20 Emulator User s Manual R20UT2605EG0100 Rev 1 00 Page 21 of 29 May 02 2013 RENESAS RSKRX210B 7 Reviewing the Tutorial Program Press Reset Go on the Debug toolbar The code will execute to the event point At this point all the device initialisation will have been completed The code window will open main c and show the new position of the program counter 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 Insert event points on the Flash LED Timer ADC and Static Test function calls Press Go to run the program up to the Flash LED event point then press Step In to move the program counter to the beginning of the Flash LED function definition El The Flash LED function uses RPDL functions to create a periodic CMT callback which toggles the LEDs at regular intervals The while statement checks the value of the gFlashCount variable which counts down with every LED flash Once this reaches zero the function destroys the CMT timer and exits the while
12. radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical 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 microcomputer software alone is very difficult please evaluate the safety of the final products or systems manufactured by you 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 liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations 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 You should not use Renesas Electronics products or technology described in this document for any purpose relating to military applications or use by t
13. subsequent sections of this tutorial Connecting Fa FPGA Status CONFIGURED FPGA Version 06 Communication FPGA Version 05 User WCC 474V Target Board CONNECTED Setting of debugging information Communication clock FINE Baudrate 2000000 bps Connecting to MCU Debug function authentication 4 11 V Close the dialog box when the connection is completed Configuration Properties External flash memory System Internal flash memory overwrite MCU Operating mode Mode Single chip mode Endian Little endian 20 0000 External memory areas Writing internal flash memory by the emulator debugger Vv Allow to change the clock source on writing internal flash memory 0 Work RAM start address 04400 bytes used Cancel I Do not show this dialog box again R20UT2605EG0100 Rev 1 00 May 02 2013 TENESAS Page 15 of 29 RSKRX210B 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 If you make any changes to files in HEW and want to preserve these change you can save them by e Select File Save You can also save files by clicking the Save or Save All buttons from the HEW
14. C V D D 0 D D LENESAS RX210 Group B Mask Renesas Starter Kit Tutorial Manual RENESAS MCU RX Family RX200 Series 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 Corporation without notice Please review the latest information published by Renesas Electronics Corporation through various means including the Renesas Electronics Corporation website http www renesas com Renesas Electronics www renesas com Rev 1 00 May 2013 10 11 12 Notice Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design 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 Renesas Electronics has used reasonable care in preparing the information included in this document but 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 Rene
15. REVISION HISTORY RSK RX210B Tutorial Manual Date Description Summary 1 00 May 02 2013 First Edition issued Renesas Starter Kit User s Manual Tutorial Manual Publication Date Rev 1 00 May 02 2013 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 588 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 651 700 Fax 44 1628 651 804 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 M
16. c 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 potentially 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 regulatory standards for an end product How to Use
17. d for use in products or systems that may pose a direct threat to human life or bodily injury artificial life support devices or systems surgical implantations etc or may cause serious property damages nuclear reactor control systems military equipment etc You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application for which it is not intended 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 which the product is not intended by Renesas Electronics 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 installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Further Renesas Electronics products are not subject to
18. ent none the system clocks 23 Return value none 74 ARARARERERARE NARRA RARA RAR AREA EE ERA RARA RARA ARAN ARENA NARRAR AAA RE RENA RENARAARARARAS e Several RPDL APIs are called within alezi dn this function their exact function cae ES 79 can be found by referring to the 80 Configure the PLL to use the 20 0 MHz crystal as clock input 61 FFI err R_CGC_Set RPDL manual 82 83 PDL CGC CLK MAIN e We will now skip past the hardware Be DL CSC BCLK DIVA PDL CGC MAIN RESONATOR 86 20E6 setup functions to look at the 37 2086 AT A 88 20E6 tutorial s main program code es 20E6 30 PDL NO DATA 91 ke 92 93 Configure the clocks as follows 94 Clock Description Frequency ee 96 PLL Clock frequency 97 System Clock Frequency 98 Peripheral Module Clock B 99 Peripheral Module Clock D 100 FlashIF Clock 101 External Bus Clock 102 103 FF err R_CGC_Set 104 105 PDL CGC CLK PLL 106 PDL CGC BCLK DIV 2 107 100E6 108 SOE6 109 SOE6 110 25E6 111 25E6 112 25E6 113 Ve For further details regarding hardware configuration please refer to the RSKRX210B User s Manual and the RX210 Hardware Manual R20UT2605EG0100 Rev 1 00 Page 20 of 29 May 02 2013 stENESAS RSKRX210B 7 Reviewing the Tutorial Program 7 2 Main Functions This section will look at the program code called from within the mai
19. g 151 FF bool err true 152 153 Declare loop count variable e The Static Test function 15 vinta ulCounte initialises a character string with 156 Write ucStr variable STATIC to LCD ih tent f tati g bl 157 FF Display_LCD LCD_LINE2 ucStr e contents ol a static variable 158 i 159 Begin for loop which writes one letter of ucReplace to the LCD at a time then gradually replaces it letter 160 The nested while loops generate the delay between each letter change 161 FF for uiCount O uiCount 8 uiCount by letter with another static iez strin 163 7 Replace letter number uiCount of ucStr from ucReplace g 164 FF ucStr uiCount ucReplace uiCount LUOS ERI Displ LCD LCD _LINE2 ucStr e Click Go or press F5 to resume es RIN KA SA MEGA del b h l the program code You should ee VAJ eat nega timer to create a delay between eac oop observe the word STATIC 169 FFI err R CNT CreateOneShot 170 appear on the second LCD line 271 1 172 PDL NO DATA to be gradually replaced with 175 600E 3 E 174 PDL_NO_FUNC the string TESTTEST The izs o 176 le program then reverts the LCD 17 i 178 back to the original message of 79 Clear LCD Display RX210B 180 FFI ucStr uicount 10 e This is the extent of the tutorial code For further information on the RPDL function calls used in the tutorial sample please refer to Renesas Peripheral Driver
20. he military including but not limited to the development of weapons of mass destruction When exporting the Renesas Electronics 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 It is the responsibility of the buyer or distributor of Renesas Electronics products who distributes disposes of or otherwise places the product with a third party to notify such third party in advance of the contents and conditions set forth in this document Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained 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 subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics 2012 4 Disclaimer By using this Renesas Starter Kit RSK the user accepts the following terms The RSK i
21. hould now move to the HardwareSetup function E definition This function groups rezer together several key functions that sa FEFELEFI are used to ensure the device is 60 FFFF16F7 y 61 FFFF16FA setup correctly before the main 2 program is executed 68 69 70 71 72 mn e Click Step In again to enter the ConfigureOperatingFrequency function 0 S Source Description Contains all the setup functions called at device restart Argument none Return value none ARRRRRARARARARARR RARA RARA AAA RARA RR RRA AAA RARA RRA AA RARA RAR RARA RARA RARAS void HardwareSetup void 1 ConfigureOutputPorts ConfigureInterrupts EnablePeripheralModules End of function HardwareSetup RRA RR RR RRR RRR RRR RRR RRR RR RRR RRR RR RRR RR RARE RARER RRR RRR RRR RRR ERR RES RARER RRR RRR REE RRR RRR REE EERE EERE EERE E RRR E REE RRR Outline ConfigureOperatingFrequency Description Configures the clock settings for each of the device clocks Argument none Return value none PLL R20UT2605EG0100 Rev 1 00 May 02 2013 TENESAS Page 19 of 29 RSKRX210B 7 Reviewing the Tutorial Program Line S D Source e The ConfigureOperatingFrequency ET NANTES 70 Outline ConfigureOperatingFrequency function IS used to set the speed of 71 Description Configures the clock settings for each of the device clocks 72 Argum
22. ials 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 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 compiler toolchains or the E1 emulator Please refer to the relevant user manuals for more in depth information 2 1 Note Regarding Source Code During the project generator it is possible that the line numbers for source code illustrated in this document does not match exactly with that in the actual source files It is also possible that the source address of instructions illustrated in this manual differs from a user s code compiled from the same source These differences are minor and do not affect the functionality of the sample code or the validity of this accompanying manual R20UT2605EG0100 Rev 1 00 Page 8 of 29 May 02 2013 stENESAS RSKRX210B 3 Tutorial Project Workspace 3 Tutorial Project Workspace The workspace includes all of the files for two build configurations Debug and Release The tutorial code is common to both build configurations and is designed to show how code can be written debugged and then downloaded without the debug monitor in a Release situation The build configuration menu in High performance E
23. int An 76 Main program function declaration pei void main void i i 78 arrow and a yellow highlight marks Esl ais Hi 80 Outline PowerON Reset PC the current position of the program 81 Description This program is the MCU s entry point from a power on reset 82 w The function configures the MCU stack then calls the counter 83 x HardwareSetup function and main function sequentially a 84 Argument none Use these buttons to switch between as r Return value lt none s6 RRREREAAARARERTEREEDR ARERR EER EEEERE RARER EER EEREER EERE EERERERER RRR ERE ERRERR ERS source disassembly and mixed capo an 89 Initialise the MCU processor word modes i 90 FFFFOOOE set intb sectop C VECT 91 pl 92 5 Initialise the MCU stack area ey 93 FFFFOO17 _INITSCT e 9a 95 Configure the MCU and RSK hardware 96 FFFFOO1B HardwareSetup 97 98 Change the MCU s usermode from supervisor to user 99 FFFFOO1F nop Li 100 FFFFOO20 set_psw PSW_init Ensure the view IS switched to source 101 FFFFO028 Change PSU PM to UserMode l l 102 before continuing 103 5 Call the main program function 104 FFFFOO3D maini 105 106 Invoke a break interrupt 107 FFFFOO41 brk R20UT2605EG0100 Rev 1 00 Page 18 of 29 CENESAS 9 May 02 2013 RSKRX210B 7 Reviewing the Tutorial Program Source Ad e Highlight the HardwareSetup
24. lly flash the LEDs e Press the Step Out button to exit the StartTimer function then press Step In The program should now reach the StartADC function e The StartADC function configures the ADC unit to make repeat conversions of the voltage from the potentiometer RV1 7 Reviewing the Tutorial Program S J FF FF FF FF 0 Source J PRARAAAAAAAAA AAA RATATAT AAA AAA AAA RATA AAA EEEE EE EEEE EEEE EE EEEE EEE EEEE EEEE EEE EE E Outline StartTimer Description Configures CMT channel 0 to call the CB TimerADC callback l function which starts the AD conversion Argument none RERERERERR ARERR ERED ARRE RANA ARERR ER ERR ER ARERR ARERR ER ER RAR ER EE RERARRERERREREREREE 5 Declare error flag bool err true Configure compare match timer err R CNT Create 0 PDL CMT PCLK DIV 512 OxO3FF CB Timer 3 J 7 Halt in while loop when RPDL errors detected while err S O 8 Source FF FF FFI FF FF V le ES K FTAA AAA TAKARA ATA TAA ATTA ALARA ATTA AAT AT AT ATTA TATA TTA T AAT ATA ATTA AAA AA ATTA TTT Outline StartADC Description Initialises the ADC s channel O for one shot operations and set the callback function Argument none Return value none ii 5 Declare error flag bool err true Set analog channel ANOOO err R_ADC 12 Set
25. mbedded 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 C files are controlled with defines set up in the build configuration options and wi fdef statements within the source files Maintaining only one set of project files means that projects are more controllable R20UT2605EG0100 Rev 1 00 Page 9 of 29 May 02 2013 stENESAS RSKRX210B 4 Project Workspace 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 Starting HEW and Connecting the E1 Debugger 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 n New Project Workspace Lo omoj Projects Workspace Name Project Types E Application RX210B Tutorial e De
26. mesa Category drop down lists to be aware of the E C C Assembly Link Library Standard Library CPU Toole 4 options available For the purposes of the palaj Category Source z 3 3 E All Loaded Projects LA Karaj tutorial leave all options at default E G MEE prn eies ots a C source file Source file Y e When complete close the dialog box by clicking ee o ee OK Qj Linkage symbol file E c99 Y C P C Input character code SJIS X T Allow comment nest Interchangeability check None Options C C cpu rx200 dbl_size 8 include PROJDIR include PROJDIR NRPDL message m 7 change_message warning output obj CONFIGDIR 5 1 Building Code There is a choice of three shortcuts available for building the project e Selecting the Build All toolbar button This will build everything in the project that has not been Ea excluded from the build The standard library is built only once FRE e Selecting the Build tool bar button This will build all files that have changed since the last build ib The standard library will not be built unless an option has been changed 1 E e Pressing 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
27. monstration Project Name I Empty Application AXZ10B Tutorial Library T RSKRX2108 Directory 7 Debugger only RX E1 E20S GA WworkSpaceVAXZI0B Tutorial Browse CPU family RX Tool chain Renesas RX Standard Properties Cancel The example above shows the New Project Workspace dialog with the RSKRX210B selected e Select the RX CPU family and Renesas RX Standard toolchain e Select the RSKRX210B project type from the left hand projects list 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 but this name may be changed manually e 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 e Click OK to start the Renesas Starter Kit Project Generator wizard R20UT2605EG0100 Rev 1 00 Page 10 of 29 May 02 2013 stENESAS RSKRX210B 4 Project Workspace The next dialog presents the three types of example project available e Tutorial this is the one of interest at this time the code is explained later in this manual e Sample Code This provides examples for using various peripherals If you select this and click Next it will open a new dialog allowing the selection of many code examples fo
28. n function and how it works e Find the main c file from the file tree on the left a RXZ10B Tutorial a hand side then double click it to open the file BI RX210B Tutorial or right click the filename and select Open ZA C source file main c dbsct c flashLED c hwsetup c id code c led c Open main c Build main c 1 a a a e aj J 0 J Source Place an event at the call to main by double Lre i P a LTAKAAAAAAAAA AAA AAA AAA AAA AAA RAAT AAA THAR AAA AAT AA HT clicking in the On Chip Breakpoint column 103 Outline mata i 104 Description The main program function Disp next to the line to stop at 105 onto the LCD display then calls 106 functions The function then cal 107 before waiting in an infinite w A 108 Argument none Note that two event points will appear because they sua nekura suluoo Siena share the same source address 110 EA FAFKFKRKFKFKRKRKFARAFAFAKAKKKHKHKRKRKFARKRARARTI 111 FFI 96 void main void 112 113 Initialise the debug LCD 114 FFI Init LCD 115 116 Displays the Renesas splash screen 117 FFI Display_LCD LCD_LINE1 Renesas 118 FF Display LCD LCD LINE2 NICKNAME 119 120 Begins the initial LED flash sequence 121 FFI Flash LED 122 123 Begins the ADC varying flash Sequence 124 FF Timer ADC e It is also possible to set breakpoints by selecting the line to stop at and
29. nality of the sample code and RSKRX210B R20UT2607EG its interaction with the Renesas Peripheral Driver Software Manual Library RPDL Tutorial Provides a guide to setting up RSK environment RSKRX210B R20UT2605EG running sample code and debugging programs Tutorial Manual Quick Start Guide Provides simple instructions to setup the RSK and RSKRX210B Quick R20UT2606EG run the first sample on a single A4 sheet Start Guide Schematics Full detail circuit schematics of the RSK RSKRX210B R20UT2603EG Schematics Hardware Manual Provides technical details of the RX210 RX210 Group RO1UH0037EJ microcontroller Hardware Manual 2 List of Abbreviations and Acronyms Abbreviation Full Form Analog to Digital Converter Application Programming Interface Compact Disc Central Processing Unit E1 Emulator E20 Emulator High performance Embedded Workshop Liquid Crystal Display Light Emitting Diode Read Only Memory Renesas Starter Kit Universal Serial Bus Analog to Digital Converter Table of Contents IOMO NION e PEON da Sate ETO POPES Trt MEDS CORES Nu kro mee No om a e e a A PORES 7 1 1 PUIPOS EA TTT TTT TTT TT TTT TTT elie al diel ay ay Va divides eben 7 129 OUT Nue cele FOL OA tie vet a A AEE AE ee a ve 7 2 AIIAN LOTE ETEN A UE A von rc ean e a re kro reese kro trema E ma on o e e esa ae aces 8 24 Note Regarding Source Code ooconcconncccinnccnnncccconccnnonnnnnc cnc cnn cnn rn 8 3 Tu
30. o the board it can be turned on now 5 3 Connecting to the Target with the E1 Debugger This section will take you through the process of connecting to the device programming the Flash and executing the code Please note that the Emulator Mode wizard shown here will only appear the FIRST time you connect to the target within a project On subsequent connections the Emulator Setting dialog box will appear please choose the same options to connect R20UT2605EG0100 Rev 1 00 Page 13 of 29 May 02 2013 stENESAS RSKRX210B 5 Building the Tutorial Program e Select the SessionRX_E1_E20 SYSTEM initial Settings WWW debug session e Click the Connect button on the ana Device Startup and Communication debug toolbar dk MCU group Rx210 Group e The Initial Settings configuration dialog box Device R5F52108 y will appear Ensure the follow configurations r Mode are sel Debugging mode MCU group RX210 Group PE Device R5F5210B Eheee ME skla kra Mode Debugging mode em A e Ifthe El is to provide power to the CPU board Po tie le hah memo moda select Power target from the emulator and Eset ie Geer nroaamn alter end choose the 5 0V option Otherwise connect a suitable power supply refer to the RSKRX210B User Manual for details Power supply V Power target from the emulator MAX 200m4 eral N display CO 33 e 5 0 Communication Emulator ET 015002550 v
31. ongkok Kowloon Hong Kong Tel 852 2886 9318 Fax 852 2886 9022 9044 Renesas Electronics Taiwan Co Ltd 13F No 363 Fu Shing North Road Taipei Taiwan Tel 886 2 8175 9600 Fax 886 2 8175 9670 Renesas Electronics Singapore Pte Ltd 80 Bendemeer Road Unit 06 02 Hyflux Innovation Centre Singapore 339949 Tel 65 6213 0200 Fax 65 6213 0300 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 7955 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 O 2012 Renesas Electronics Corporation All rights reserved Colophon 1 3 RX210 Group B Mask LENESAS T2605EG01 Renesas Electronics Corporation R20UT2609EG0100
32. r the peripheral modules of the device e 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 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 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 High performance Embedded Workshop 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 programmable 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 optimisation off on the code being debugged e Select the Debug
33. s not guaranteed to be error free and the entire risk as to the results and performance of the RSK is assumed by the User The RSK is provided by Renesas on an as is basis without warranty of any kind whether express or implied including but not limited to the implied warranties of satisfactory quality fitness for a particular purpose 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 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 Electromagneti
34. sas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted hereby under 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 Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration modification copy or otherwise misappropriation of Renesas Electronics product Renesas Electronics products are classified according to the following two quality grades Standard and High Quality The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots etc High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anticrime systems and safety equipment etc Renesas Electronics products are neither intended nor authorize
35. toolbar You can also save files using the following keyboard 5 Building the Tutorial Program New Workspace Open Workspace Save Workspace Save Workspace As Close Workspace New Session Import Session e ave Session Save Session As Refresh Session i RXZ210B Tutorial High performance Embedc File Edit View Project Build Debug Si D New Ctrl N 5 Open Ctrl 0 Close Ctrl F4 New Workspace Open Workspace Save Workspace Save Workspace As Close Workspace Save Session Save Session As Refresh Session Download A New Module Ctrl S Save As Bl Save All Ctrl Shift S Page Setup amp Print Ctrl P shortcut R20UT2605EG0100 Rev 1 00 LEN ESAS Page 16 of 29 May 02 2013 RSKRX210B 6 Downloading and Running the Tutorial 6 Downloading and Running the Tutorial 6 1 Downloading the Program Code Now the code has been built in HEW it needs to be downloaded to the RSK As you are now connected to the target you should see an additional category in the workspace view called Download Modules Description txt Right click on the downoad module E ASK_Header txt listed and select Download 3 3 Download modules e On completion the debugger and code a Tutorial abs 00000000 are ready to be executed Say Depend D i Download Debug Data Only iode Unload
36. torial Project Workspace So sara nee senro dp a oero du so o ada 9 ASJPTO ECENNOKSpacbc A A KE DJ 10 4 1 INIVVO UGUON sse tel Miele stil dep o karlo elasta oal ka lrbo leew aJ 10 4 2 Starting HEW and Connecting the El D DUGQET cececeeeeeeeceneeeeeeeeeeeeeeeaeeecaaeeeeaeeseeeeeseaeeeseaeeseneeeeaes 10 4 3 Build Configurations and Debug Sessions ccccceseceeeeeeeeeeeceaeeeeeaeeeeeeeseaeeesaaeeeeaaeseeeeeseaeeesiaeeneaeeesaes ti 4 3 1 Build Configuration sss SA SALMO MLA MN ti 4 3 2 Deb g SESSION iii Hitt tie det ee ees ve et eee ee 11 5 Building the Tutorial Progra M sensns an a E E A E EEE 12 A A E ber ta ata ar a oda 12 5 2 Goninectingthe Debugger miserien and aa anao ei eda ake pa bia 13 5 3 Connecting to the Target with the El De DUQGED cceseeeeeceeeeeeeeeaeeeeeeeeeeeeeeaaeeesaaeeeeaeeceaeeeseaeesenaeenenees 13 6 Downloading and Running the Tutorial ocooononcnccccccnnnccccnnnnnononncnnonnnonnnnnnannoncnnnnc ranas 17 6 1 Downloading the Program COde cccccscccceecceeeeeeeeeaeeeeneeceeeeceaeeeeaaeeseneeseaeeeeaaeeseaaeseeeeeseaeeesaeeseaeeseeeeesaes 17 6 2 Running the Tutorial besuti ria 17 7 Reviewing the Tutorial PrograM ooooooocccccccnnccccnnanonononcnnnnncnnnnnnnnnnnnnnnnnnnrnnnnnnnnnnnnnnnnnnrnnnnnnns 18 7 1 Program InitlaliSation o a ia 18 Te Mal FUnCtons errante laa io eiii 21 8 Additional Information cccccccecceccecceecceccececeececcuceceecuecaeeceecaeeaeec
37. ueeaeeceecaeeaeeceeceeseeeaees 25 LENESAS RSKRX210B RENESAS STARTER KIT 1 1 1 Overview Purpose R20UT2605EG0100 Rev 1 00 May 02 2013 This RSK is an evaluation tool for Renesas microcontrollers This manual describes how to get the RSK tutorial started and basic debugging operations 1 2 Features This RSK provides an evaluation of the following features The RSK board contains all the circuitry required for microcontroller operation Renesas microcontroller programming User code debugging User circuitry such as switches LEDs and a potentiometer Sample application Sample peripheral device initialisation code R20UT2605EG0100 Rev 1 00 a2 AS May 02 2013 XENES Page 7 of 29 RSKRX210B 2 Introduction 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 compile link download and run a simple program on the RSK e How do build an embedded application 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 is a project with optimised compile options producing code suitable for release in a product Files referred to in this manual are installed using the project generator as you work through the tutor
Download Pdf Manuals
Related Search
Related Contents
Sistema de corte por arco de plasma User Guide SM-S210i User Manual (ATT Users) Life Fitness LC8500 User's Manual Data sheet Micron 128GB RealSSD C400 SED FHTJ-41107N-PA9 Copyright © All rights reserved.
Failed to retrieve file