Home

Renesas Starter Kit for RL78/G14 Tutorial Manual

image

Contents

1. D D mu 0 lt Q o RL78 G14 Renesas Starter Kit Tutorial Manual CubeSuite mb op RENESAS MCU RL78 Family G1X Series All information contained in these materials including products and product specifications rep resents 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 Jun 2012 Notice 1 All information included in this document is current as of the date this document is issued Such information however is sub ject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please con firm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to ad ditional 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 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 hereb
2. 2 List of Abbreviations and Acronyms Abbreviation J OOO O OOOO oO Table of Contents VC O SS RR UTITUR 7 1 1 rigor dene pd TT T 7 EZ SBONINOS ure cL c m 7 ZOCO oiii EE p n MEE pem MIDI RAM Qua RPE SS paie M abe ca iu nd eed tA 8 2 Introduction to Code Generator sa DD sao 9 3 1 natas Code GER TOT ara aE EA Ri 9 DEM C a ATT TN TTT E E A T E AN EE A 9 3 3 GRIO I AIO RR RR RR RD RR tahoe gerd ER RR DO RR RR RP Y 9 d T torrd Project Works Pace saio tetas fd kor sn ko dd lees beds 11 O A Ol A A a arth e UR utah o DUE eU che 12 5 1 INTO CUCTIO M ira KO RA e ko KN RO de E ed 12 5 2 Starting CubeSuite and Conncelmo Me El Debus POE ssa riri tede peas a n Pe Dated EE Re FUP c boi do Sk RA 12 5 3 Contbsutins the Debus GOE Lx sna di a 15 xe DUNGON CIS ETT 17 o Buildinie the Tutorial Prostate 18 6 1 jo UT TEN the Code con cob lt iros tte ni beato octo Use o Coba 18 OZ Conncenne tie DEDUS SCE sko zo sako oil ei ERG kei 19 6 3 Connecting to the Tareer witht the E DEDUS BOE sss a Oa a EE KS acd a KR KA EAS a a 19 7 Downloading and Running the Tutortal ooccccncnononncnnnnnnnnnononononnnnnnnnnonononnnnnnnnnononnnnnnnnnnnnnnnos 21 Tal Downloading the Prostran Ode su ido you obe Ads 21 T2 Running he tonal TEmo o Tm TTT ub Eom Oo tree URS teen TITT at an teen rte A 21 o Reviewins the Tutorial Program iei errata asi 22 8 1 Pro Chany Intt alisatiOT sus ieu or iia 22 5 2 NAN AS eho TTT MAU
3. Computers 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 systems 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 excision 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 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 9 Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have spe cific characteristics such as the occurrence of failure at a certain ra
4. 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 RSKRL78G14 User Manual for further details The Quick Start Guide provided with the Renesas Starter Kit board gives detailed instructions on how to connect the El to the host computer The following assumes that the steps in the Quick Start Guide have been followed and the El drivers have been installed 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 Connect the El Debugger to a free USB port on your computer Connect the El Debugger to the target hardware ensuring that it is plugged into the connector marked El If supplying external power to the board please refer to Section 5 3 to turn off the option of supplying power from the El before turning on the external power supply 6 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 Double click on CA78KOR Build Tool to open B Dux the P
5. functions contained in the source code Code generating function Code Generator can output not only device driver programs in accordance with the information configured using the GUI but also a build environment such as sample programs containing main functions and link directive files Project workspace file generating function 3 3 Code Generation The following steps serve as a short presentation of how to generate source code using the Code Generator design tool for a new project subproject It assumes that a project already exists and is opened For more details on how to use Code Generator refer to the document CubeSuite V1 02 00 Integrated Develop ment Environment User s Manual RL78 Design Double click the Code Generator Design Tool from the Project Tree pane to reveal the list of pe H ripherals 3 Code Generator Design Tool R20UTO786EGO100 Rev 1 00 a2 AS Page 9 of 30 Jun 21 2012 KENES RSKRL78G14 3 Introduction to Code Generator The project tree shows all configurable peripherals u En Code Generator Design Tool of the selected device P e Clock Generator The exclamation mark on the Clock Generator will Port disappear after the Pin Assignment configuration Interrupt shown in the screen shot that follows the one oppo 8 Serial site to this text in A D Converter The Watchdog Timer module is configured and en e D A Converter abled by defa
6. Generator Design Tool be A CATBKOR Build Tool T ma RL78 Simulator Debug Tool AB Program Analyzer Analyze Tool E File E Ea Application Subproject H Im ADC Repeat Subproject B Im ADC OneShot Subproject 1 1 f DAC Subproject E Build RSKRL78G14 Tutorial amp UR DTC Subproject E Rebuild RSKRL78G14_Tutorial E R Ec Subproject E B A Lamo Due Mode Subpro H IR DC Master Subproject H fS NC Slave Subproject Add If PWM_TAU Subproject TR Set ADC OneShot as Active Project a PWM TimerRD Subprojeci Open Folder with Explorer Page 14 of 30 RSKRL78G14 To open a file for viewing right click on the file A CATBKOR Build Tool go RL78 El Serial Debug Tool and select Open Alternatively double click on the file ap File PM amp X Startup eE Code Generator ej 5 3 Configuring the Debug Tool E1 em Ce Program Analyzer Analyze Tool 5 Project Workspace Note The Tutorial sample project s settings are pre configured This section serves to helps the user familiarise themselves with the settings for when they decide to create a new project The Project Tree will be displayed on the left RSKRL78614 Tutorial CubeSuite Project Tree Hi hand pane of CubeSuite File Edit View Project Build Debug Tool Window This can be invoked from the menu bar View gt amp Sta Project Tree Project Tree This list contains a number of tools use
7. M Ei n Lu oni uL Les 23 O Additional O aedo 26 24 NE SAS RSKRL78G14 R20UTO786EGO100 Rev 1 00 RENESAS STARTER KIT Jun 21 2012 1 Overview 11 Purpose 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 Renesas microcontroller programming User code debugging User circuitry such as switches LEDs and a potentiometer Sample application Sample peripheral device initialisation code The RSK board contains all the circuitry required for microcontroller operation R20UTO786EGO100 Rev 1 00 lt 2 AS Page 7 of 30 Jun 21 2012 KENES RSKRL78G14 2 Introduction 2 Introduction This manual is designed to answer in tutorial form the most common questions asked about using a Renesas Start er Kit RSK The tutorials help explain the following How do I compile link download and run a simple program on the RSK How do I build an embedded application How do I use Renesas tools The project generator will create a tutorial project with two selectable build configurations DefaultBuild is a project with debug support and optimisation level set to two DebugBuild is a project built with the debugger support included Optimisation is set to zero ReleaseBuild is a project with optimised compile options producing code suitable for
8. Project Workspace The opposite screen shot indicates that the select ed Debug Tool is El Right click on RL78 El Serial DebugTool Click on Property View the Connect Settings Verify that the settings match with what is shown on the opposite screen shot Note to supply external power to the target board set the Power target from emulator MAX 200mA entry to No The project is configured to halt code execution on the first instruction of the main function after pro gramming the microcontroller To specify another function as the entry point View the Download File Settings of the RL78 Els property Change the specified symbol to another availa ble function Ensure to pre fix the function name with an un derscore Note Do not specify an interrupt handler as the entry point E 3 R3ERLZIEGIA luboria Prayer A ASFIOAPI Quticrorantraller LE Code Generator Design Tool A CATOKIR Budd Tool e AL TE El senafi Debug Tool P Program Anabyrer Analyze T g LX File m UR Application Subproject Mm x PDC Ure shal subprime HHR ADC Repeat Gubproject ERA DTE Subproject El x ELL Subproject De ALTA ETS eia Property ALTO IECUBE e ALTE EMSera ALTA E Serial ALTO EZ Ermalator MEDIR Sirnulatar Using Debug Tool E Irana ROMAAN Sume dd riara ROMER ues b tameo ander Ras B ue SEE Los ol Dai hh mera Bore 4 E Choc
9. Tag Jump shitt F12 EP AA 3 553 i J Start user code t generated here E Jump to Disassemble kok RRE RRA RO ARCA FERRERA AA RRE ERRE AAA koko kk ok kj f Function Name Advanced d Description 2 Break Settings d iu Set Hardware Break Argument Trace Settings lll Set Software Break Return value none da er iba e o a a ee ee cde eoo dece eo cC de e e l REGE EN set Read Break to void Timer ADC void A set Write Break to T iil Set Break to Start ADC operations aM ja R ADC Starti Jn Break Option R20UT0786EG0100 Rev 1 00 Jun 21 2012 ENESAS Page 24 of 30 RSKRL78G14 8 Reviewing the Tutorial Program interrupt static void r tau0 channelO interrupt void The program will halt at the hardware breakpoint due to the D Start user code Do not edit comment generated here timer s period elapsing Toggle user LEDs ENT LED2 LEDS LEDS l 3 qp la pb Le b ll Remove the hardware breakpoint by clicking on the icon once ijoid Starica Test void E Press F5 to resume program exe cution and observe the string on Declare Loop count variable Mi the debug LCD s second line LIL Declare ati ing variable Eo hold Ehe string to be copied i31 Binta E ucstr i change one character at a time 13 fe Declare variable buffer to store the copied string nnd E Feni lme mi J from STATIC to TESTTEST xx p
10. the Step Over button Alter natively press F10 The Timer ADC function starts a continuous A D conversion and a periodic timer whose period is up dated with the ADC result Open the r_timer_user c file Set a hardware break point on the first line of code inside the r tauO channelO interrupt inter rupt handler Right click on the first instruction line gt Break Settings gt Set Hardware Break Execute the program by pressing the Go button Alternatively press F5 Flash the user LEDs for zome time or until a Flash LEDs Flash the user LEDs at a rate set by the use interrupts Coo Timer ADCO 0000000000000 0000 Demonstration of initialised variables Use debugaer Statics Test Halt program in an infinite while loop while 10 interrupt static void r tau channelO interrupt void Start user code Do not edit comment generated here Toggle user LEDs D LEDO LEDI LED1 LEDA LEDZ2 LEDS LED3 Register to Watch Register Action Event Cut Ctrl X fok 1 th below DT f Ensure that Copy Ctrl C below 0x75 if gTimer ADC Paste Ctrl r L grIimer ADC Find Ctrl F Go Tn Ctrl 65 T Update Forward to Next Cursor Position pe ECE yee Ss TDROO gTimer Back to Last Cursor Position Clear TMOO TMIFOO 0 Go to Here Set PC to Here End user co ed here lump to Function Fi
11. 0 IE ETE Display LCD Revert back to the source by clicking D071a do POP Sm E on the file containing the function 56 Display LCD LCD_LINE2 NICKNAME pointed to by the program counter OO71h 300e30 Hoy AX 300EH indicator Alternatively right click in a M araj TJ the Diassemble1 window and click O 722 fecO00200 CALL Display LCD Jump to Source 00726 en POP AKO E R20UT0786EG0100 Rev 1 00 ENESAS Page 22 of 30 Jun 21 2012 RSKRL78G14 8 Reviewing the Tutorial Program 8 2 Main Functions This section will look at the program code called from with the main function and how it works Right click the Flash LEDs function call and select Go to Here to execute the program up to this line The function In it LCD call initialises the de bug LCD and the Dis play LCD function calls will write the strings Renesas and RL78G14 on line 1 and 2 re spectively Set a software break point on the Timer ADCY function call by clicking on the On Chip Break point column to the left of the number column Click the Step In button to step into the Flash LEDs function Alternatively press F11 C E The program counter should now move into the Flash LEDs func tion definition This function en ables the external interrupts con nected to the user switches and flashes the user LEDs 200 times or until a user switch has been pressed Press the Go button to res
12. 12 KENES RSKRL78G14 9 Additional Information 9 Additional Information Technical Support For details on how to use CubeSuite refer to Help gt Tutorial from the menu bar within the CubeSuite For information about the RL78 G14 microcontrollers refer to the RL78 G14 Group hardware manual For information about the RL78 G14 assembly language refer to Help gt Tutorial from the menu bar within the CubeSuite Online technical support and information is available at http www renesas com rskr178 14 Technical Contact Details 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 com panies 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 1s prohibited without the written permission of Renesas Electronics Europe Lim ited 2012 Renesas Electronics Europe Limited All rights reserved 2012 Renesas Electronics Corporation All rights reserved 2012 Renesas Solutions Corp All rights reserved R20UT0786EG0100 Rev 1 00 ENESAS Page 26 of 30 Jun 21 2012 REVISION HISTORY RSKRL78G14 Tutorial Manual Rev Description Summary e mamo eon E E a Renesas Starter Kit Tutorial Manual
13. 175 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 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 2012 Renesas Electronics Corporation All rights reserved Colophon 1 0 RL78 G14 Group 424 NESAS Renesas Electronics Corporation R20UTO786EG0100
14. 1U4PI Microcontroller a FI Code Generator Design Tool CATEKOR Build Tool m ee RLT8 EliSeriali Debu Build Project Fi E Program Analyzer Ar EA Rebuild Project Shift F7 co File a Application Subproje aL ADC_OneShot Subpy Ef Set to Default Build Option for Project H f ADC Repeat Subproj H f DTC Subproject a ELC Subproject set Link Order H f Async Serial Subproj m f DAC Subproject Right click on CA78KOR Build Tool from the Project Tree Clean Project Import Build Options The Common Options sheet will open by default dead Verify that the Build Mode is set to DebugBuild E DuipuFle Tyre andP uh Click on the Compile Options sheet to view com Common Options A Compile Options A Assemble Options Link Options A piler options Ensure the Add debug information entry is set KE to Yes Add to both assembly and object file eciam tapui im both secambly wed gheni the p g2 m eee Hol re Ensure the Optimization is set to No R20UT0786EG0100 Rev 1 00 LENES AS Page 17 of 30 Jun 21 2012 RSKRL78G14 6 Building the Tutorial Program 6 Building the Tutorial Program The tutorial project build settings have been pre configured in the toolchain options To view the toolchain options double click on CA78KOR Build Tool from the Project Tree and select the available tabs It 1s important when changing settings to be aware of the current configuration befo
15. Publication Date Rev 1 00 Jun 21 2012 Published by Renesas Electronics Corporation 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 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 8
16. Rev 1 00 2 NS Page 13 of 30 Jun 21 2012 KENES RSKRL78G14 5 Project Workspace The Project Tree as seen in CubeSuite RSKRL78G14_Tutorial Project is the master project and includes the tools shown on the oppo site screenshot The File folder seen in the screenshot belongs to the master project RSKRL78G14_ Tutorial This folder contains and lists all project source and header files including text files arranged in sepa rate folder structures Folders containing the subprojects indicated by Subproject are listed below the File folder Each subproject folder when expanded reveals an identical tools and folder structure to that of the master project being RSKRL78G14_Tutorial By default the RSKRL78G14_Tutorial project is set as the active project indicated by the line un der the project name To change the active project right click on the project subproject name and select Set as Ac tive Project represents the project name The main project s default debug tool is set to RL78 Simulator To change the debug tool Right click on RL78 Simulator Debug Tool Select Using Debug Tool Select RL78 El Serial Project Tree BE RSFLO4P Microcontroller E CE Code Generator Design Tool A CAZBKOR Build Tool m a RL 8 Simulator Debug Tool aD Program Analyzer Analyze Tool H a File EE A Application Subproject LR ADC Repeat Subproject amp ff ADC_OneShot Su
17. T0786EG0100 Rev 1 00 Jun 21 2012 ENESAS lm mo Page 20 of 30 RSKRL78G14 7 Downloading and Running the Tutorial 7 Downloading and Running the Tutorial 7 1 Downloading the Program Code Now that the code has been built in CubeSuite it needs to be downloaded to the RSK Click on the program down load button Alternatively se lect Debug from the Menu bar and click on Download Lh On completion of program download the debugger and 1 code are ready to be executed Start user code Do not edit comment generated here The program counter indicator will point to first line of code d inside the main function this 1s the program s entry point Initialise the LCD module 7 2 Running the Tutorial Once the program has been downloaded onto the RSK device the program can be executed Click the Go button to begin the program from the current program counter position It is recommended that you run through the program once first and then continue to the review section R20UT0786EG0100 Rev 1 00 ENESAS Page 21 of 30 Jun 21 2012 RSKRL78G14 8 Reviewing the Tutorial Program 8 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 imple mented into more complex code 8 1 Program Initialisation Before the main program can run the microcontroller must be configured Due to the debugger
18. ages 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 ensure attached cables do not lie across the equipment reorient the receiving antenna increase the distance between the equipment and the receiver connect the equipment into an outlet on a circuit different from that which the receiver is connected power down the equipment when not is use 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 certai
19. bproject m A DAC Subproject aL DTC Subproject H A ELC Subproject IR RSKELTEGIA Tutorial Project e property SE Code Generator A Code ALTA Gemdator Property Fl Infernal RUA taza of internal ROMKES tes cube cd bernal RE des O Clock Mam clock amp eguency MHz RL 6 IECUSE ru Property RL7G El Serial KLAE EZD Serial A PI ASFLOSP Microcontroller y Code Generator Design Toul A CATSKOR Build Tool eM ALFA Siomoldalor Deus E Program Analyzer Anak File UR Application ubprojecti cie ti A ADC Repeat Subproject Fl Configu UR ADC OneShot Subprepect Use sima ELTE EF Emulator LR DAC subpreyect E TREE Simulatu A DTC Gubproject The screenshot shown opposite serves as a demon Project Tree NE stration of how to change the active project The 2 oa ADC_OneShot subproject is used as an example The File folder contains four subfolders This structure is common to all projects All Code Generator generated source files are grouped under the Code Generator folder which it self is listed under the File folder in the Project Tree These files are prefixed with r_ to indicate that they were generated by Code Generator All other user generated or user included source files are listed separately from those of Code Genera tor s This can be seen above R20UT0786EG0100 Rev 1 00 Jun 21 2012 ENESAS a i R5FLO4PI ok E g ok Code
20. configuration used for the Tutorial project and the rest of the sample projects the user will not be able to step through the hardware initialisation code as a result Please refer to Section 5 3 to change the entry point after programming the microcon troller Specify _R_Systeminit as the function name if viewing of hardware initialisation is desired The initialisa tion code is executed every time the device is reset via the reset switch or from a power reboot The user is advised not to use the step feature of the debugger to exit the R_Systeminit function Ensuring the Tutorial program has been downloaded onto the RL78 G14 press the CPU Reset button on the Debug Toolbar as From the Menu bar select View gt t_main c 3 Disassemble1 Disassemble gt Disassemblel Al A MB BE views ternatively use the Display Dis TE None irqument n sie n assemble button to open and a e E a E R E E VELAI ALEEA view the source and disassem 77 id reda ore dal bly 78 i TI Start user code Do not edit comment generated here To make the Display Disassem an ble button available on the 5l Initialise the LCD module toolbar right click on the toolbar ERE and select View Panels Le 1 2 MEN B3 3 N od Display information on the debug LCD mmm HB Display LCDILCD LINEI Eenesas 00711 300630 NOVI AX 3006H 00714 ci PUSH AX 00715 6 CLRW AX 00716 fecoozo
21. d in configuring the IDE for programming and debugging of the device as well as listing source code files Follow the following instructions to verify the pre configured settings Right click on CA78KOR Build Tool Project Tree Click on Property Sur 2 08 gm RSKRL78G14 Tutorial Project B RSFL04PJ Microcontroller a Code Generator Design Tool v XA CATSKOR Build Tool ng F7 08 mum Te a Fie ER nan dn Shift F7 sa f Application Subproje Clean Project amp fS ADC_OneShot Subpt ES Set to Default Build Option for Project m LR ADC Repeat Subproj post E DR DTC Subproject ir Import Build Options c ELC Subproject Set Link Order a Async Serial Subproj m A DAC Subproject Click on the Link Options tab to open the sheet EN Property Ae CATIRDR Propery Expand the Device entry to reveal the sub entry El System hbrares Bater itn arses E aight libiary palha Adek ary prila ZO options FI Sytem library puja LT ere liar albo dm El Daria Verify that the Debug monitor area start address Usecrrchip debug Vasto obon byte values for OC LE ma is as Shown on the opposite screen shot Port iiri hai pg ECI PEDO Hug morir ama LE ey B Sen iii Spor Esth re a Ligar ipit as nth dia rrrTER Spee mirror area MARS ri Sel flash star address ho Set aran lna module Ne nama Corto allocabor lo aa FEM arta Ha R20UT0786EG0100 Rev 1 00 LENESAS Page 15 of 30 Jun 21 2012 RSKRL78G14 5
22. 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 subsidiaries 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 dam
23. k Mur clock hequerey MH 20 00 Subs clock emer Hz 32 768 M core cheek Tarien E Conmeciisn with Taga Board Corra Bon Pra bcd ine hoe TOOLO Fora Legal hom te emulator MAM Imi Yer Supply voltage ti UN E Flash Permit ach programming Yes LE oi vendi rod made Pet Chap siri heri stan Ho Lras flash AOH before dosmiosd Debug Information Frome lu the geese cento alaj CFTE Fic viet mam Samay tta ibe EH Starti ene sprites cond Specilied symbol Species the portion at whch program esscu on ir to be stopped lolon CPU repeto Connect Tat el Dabo Tol Settings a Downlo i ad lde Settings J Hack Transaction 54 ta R20UT0786EG0100 Rev 1 00 ENESAS Page 16 of 30 Jun 21 2012 RSKRL78G14 5 Project Workspace 5 4 Build Configuration The build configurations are selected from the build tool s Property panel The options available are DefaultBuild DebugBuild and ReleaseBuild The DefaultBuild and DebugBuild are configured for use with the debugger The ReleaseBuild is configured for the final ROM programmable code A common difference between the two builds is the optimisation setting and the addition of debug information With optimisation turned on the debugger may seem to execute code in an unexpected order To assist in debug ging it is often helpful to turn optimisation off on the code being debugged Project Tree n x 2 08 lt gm RSERL78G14 Tutorial Project Select Property e qu RSF
24. ment but Renesas Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages in curred 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 applica tion You may not use any Renesas Electronics 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 Electronics 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 applica tion categorized as Specific or for which the product is not intended where you have failed to obtain the prior written con sent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard
25. n EMC phenomena To mitigate against them it is recommended that the following measures be undertaken The user is advised that mobile phones should not be used within 10m of the product when in use 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 How to Use This Manual 1 Purpose and Target Readers This manual is designed to provide the user with an understanding of the RSK hardware functionality and electrical characteristics It is intended for users designing sample code on the RSK platform using the many different incor porated peripheral devices The manual comprises of an overview of the capabilities of the RSK product but does not intend to be a guide to embedded programming or hardware design 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 the RL78G14 Group Make sure to refer to the latest versions of these docu ments The newest versions of the documents listed may be obtained from the Renesas Electronics Web site
26. oscat as the Statics Test function is ex E e rege dci T RN T d 1j uint3z t ulbe lay ecuted ff Urite estr varmible ETATIC Ea LOD 138 DisplayString LcCD LIMEZ inti t uc3tr fe Begin for lopp which veL es one letter of ucheplace to che LOD ar a rime The nesred while loops generare che delay beweeen each leerer change f After all characters have been L4 141 sa changed the debug LCD s se 143 for uilounteO uiCount B8B uilount s 144 i cond line will display L45 Replace lecter number uilount of vuc5rtr from ucReplace RL 14 si ucZrr uicounr uckeplace uiCounr 78G14 idi ku Display ERE OhAaracktr n tht debug LEP T7 145 DisplayString LCD LINES into r jucSrr ft LED Flashing Belay or uiD l amp y D gulDel Ag c DOJUQQ lpDelagyse Delay fe Clear LCD Display 159 acZrr uicount 0 r Write ACU nickname to LCD again bimplaySrringiLCDb LINES NICENAME Press the Stop button to halt pro gram execution pe This is the extent of the tutorial code For further details regarding hardware configuration please refer to the RL78 Series Software Manual and the RL78G14 Hardware Manual 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 E1 Emulator User s Manual R20UT0786EG0100 Rev 1 00 e AS Page 25 of 30 Jun 21 20
27. ot below Create Project Subprojects to Add Subproject information Low Power Mode WOT watchdog Timer J Pal TAL Phd TimerRD Demonstrates usage of the Watchdog y ATC AAA lS Serial A timer channel is configured to m yne 2 EM penodically Hash user LEDs based on W Timer Capture the ADC value set by the ADPOT Timer Event Ince the timers period equals FO of Wf Timer Made IMM DT s period a WOT interrupt is Voltage Detect generated User LEDs Hashing ts F stopped and a message is displayed on Ll JL 1 OM Mame HSKRL 86514 Tutorial Location CARSERLF8GI4 Tutorial Make the project folder Select all sub projects by clicking on each tick box and observe the information displayed under the Subproject information heading as you click on each tick box Enter a name in the Name field as shown above Specify a folder where the project is to be saved Click on lt Create gt A dialog will appear if the location specified does not exist asking to create the folder specified Click on lt OK gt CubeSuite will create the project in the specified folder A number of dialogs will appear consecutively as each sub projects is added to the main project To view the file project source files double click on the files listed in the Project Tree window A new window will open showing the code Note A different name and location may be specified R20UT0786EG0100
28. re modifying the settings Review the options on each of the tabs to be aware of the options available For the purposes of the tu torial leave all options at default When complete the Property panel can be closed X by clicking x on the right hand corner of the Property window 6 1 Building the Code There is a choice of three shortcuts available for building the project Selecting the Build Project toolbar button will build all projects listed in the project tree Pressing F7 This is equivalent to pressing the Build Project toolbar button F7 Selecting the Rebuild Project toolbar button will rebuild all project files El B gl Selecting the Build amp Download toolbar button will only build the active project and download the code to the target device after a successful build Pressing F6 This is equivalent to pressing the Build amp Download toolbar button 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 R20UT0786EG0100 Rev 1 00 ENESAS Page 18 of 30 Jun 21 2012 RSKRL78G14 6 Building the Tutorial Program 6 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
29. release in a product Files referred to in this manual are installed using the project generator as you work through the tutorials The tuto rial 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 CubeSuite s debugger compiler toolchains or the E1 emulator Please refer to the relevant user manuals for more in depth information R20UT0786EG0100 Rev 1 00 LENESAS Page 8 of 30 Jun 21 2012 RSKRL78G14 3 Introduction to Code Generator 3 Introduction to Code Generator 3 1 What is Code Generator Code Generator is a design tool which enables you to output the source code device driver programs C source files and header files necessary to control the peripheral hardware functions provided by the microcontroller de vice clock generator port functions etc by configuring various information using the GUI This tool is integrated into CubeSuite 3 2 Features The Code Generator has the following features Reporting function You can output configured information using the Code Generator as files in various formats for use as design documents Renaming function The user can change default names assigned to the files output by Code Generator and the API
30. roperty view coxe I E Fuld Hethi In the Common Options tab found under the E Versioni Hoha Property view B Others Verify that the Security ID is set to Scedker fa macul I d dan devio that meai Had irii ha say ID sth a OE Ora nurnbe s i Podria 00000000000000000000 under the Device en Note The project has been configured not to use the Secu rity ID feature If you have changed any project settings now is a RSKRL78G14 Tutorial CubeSuite good time to save the project File Edit View Project Build Debuc Iaris TEC Mew Select File Save Project Ai pen Ctrl 0 Open with Encoding Add d UR Close Project Y Close r cg timer User t d save Project Ctrl Shift R20UT0786EG0100 Rev 1 00 ENESAS Page 19 of 30 Jun 21 2012 RSKRL78G14 6 Building the Tutorial Program If you make any changes to files in CubeSuite and want to preserve these change you can save them by Select File Save All gl Save All File Edit View Project Build Debug Mew KE Open Cer 0 Add Close Project Close ia mamo save Project Ctrl e Shift 5 save Project As save Cl main c Ctrl 5 save Cla maln c As Lia maln c Save Settings Ctrl Shift A You can also save files by clicking the Save or Save All buttons from the CubeSuite toolbar You can also save files using the following keyboard shortcut R20U
31. s Start Menu The first time CubeSuite is started the One Point Advice dialog box will be shown E Do you know A 1 Td y 0 CubeSuite 4141414 w Presa ta Ctrl Tab loma to daplmy tha diala bos for inlet panels and He o s Haee Sees Luis dame poras with the Tab key arar the inrer kama CN E de Pia Diapleyad contarte render E D u uM 205 7 Da i Back heat gt Do not shes thes dialo box at startup Malo The One Point Advice dialog box provides some useful tips when using CubeSuite Press OK to skip the ad vice and close the One Point Advice dialog The user will then be presented with the Start panel which contains six sections Under the Open Sample RSK Project open a new Tutorial project by selecting the RSKRL78G14 Tutorial pro ject template and click on Go as shown below This will save a copy of the RSKRL78G14_ Tutorial project Open Sample RSK Project B Select an ASE project template from those installed ASKAL 79614 Tutorial ADC Oneshot D emonstration of the ADC module in oneshot mode Add all sub projects by clicking on the tick box next to each sub project name Information on each sub project is listed below the Subproject information heading R20UT0786EG0100 Rev 1 00 2 NS Page 12 of 30 Jun 21 2012 KENES RSKRL78G14 5 Project Workspace CubeSuite will present a Create Project dialog as seen in the next screensh
32. t is an empty sample project with temporary files generated from Code Gener ator Users are encouraged to use Code Generator to generate the source files containing API functions based on their application development s requirements and use them in the Application sample project R20UT0786EG0100 Rev 1 00 e AS Page 10 of 30 Jun 21 2012 KENES RSKRL78G14 4 Tutorial Project Workspace 4 Tutorial Project Workspace The project includes all of the files required to get started The tutorial code is designed to show how code can be written debugged and then downloaded Contents of common C files are controlled with defines set up in the build configuration options and ifdef state ments within the source files Maintaining only one set of project files means that projects are more controllable R20UT0786EG0100 Rev 1 00 ENESAS Page 11 of 30 Jun 21 2012 RSKRL78G14 5 Project Workspace 5 Project Workspace 5 1 Introduction CubeSuite is an integrated development tool that allows the user to write compile program and debug a software project on the RX 78K RL and V850 family of Renesas Microcontrollers CubeSuite 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 5 2 Starting CubeSuite and Connecting the E1 Debugger To look at the program start CubeSuite from the Window
33. te and malfunctions under certain use conditions Further Renesas Electronics products are not subject to 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 system manufactured by you 10 Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibil ity 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 11 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics 12 Please contact a Renesas Electronics sales office if you have any questions regarding the information conta
34. ult indicated by the open box _ e Comparator Clock Dutput Buzzer Output ve Data Transfer Controller Event Link Controller Voltage Detector Click on the lt Fix settings gt button Temi ammeiom Ear Tua et Oe IDA a The Clock setting tab contains options for config uses inc au wang kako miaj maco E a uring the clocks seers lee PERO kiui HOMI Edu The On chip debug setting tab contains an option PORE Ba 1 PORI ba 1 PUEDO ka 1 PAE bet 7 to enable disable debugging and the use of a securi easter dna ty ID Ensure to set the On chip debug operation PORE a 1 1 i 1 1 dorm d grt inr oide la chamie i eter setting to Used for debugging projects an ded co a pt charge a Tis lerra P Friars P IHTPED P IHTP PE FeV Sa DADO The icons highlighted in the opposite screen shot Module File Property shows the available peripherals that can be config we F o Oe E d a ured Click each icon to open the settings view and configure the desired peripherals Click on Generate Code after configuring all de sired peripherals to generate the project source and header files The generated files will automatically be created and placed in the project folder Note If files of the same name already exist in the IDE project folder it may be necessary to back up the old files before overwriting them Note The Application sample projec
35. ume program execution On exiting the loop the function disables the switch interrupts and returns to the main function oid main void ft Start user code Do not edit comment generated here Initialise the LCD module Display information on th Display LCD LCD LINE1 Re Display LCD LCD LINEZ NICKNAME Flash the user LEDs for some time or until a push button is pressed Flash LEDs Flash the user LEDs at a rate set by the user potentiometer ADC using interrupts Timer ADC Flash the user LEDs for some time a E Flash the user LEDs at a rate set interrupts WO Timer AD 0000000000000 void Flash LEDs void Declare loop iteration count variable uint32 t led delay 0 uintB t flash count 0 ft Enable SWl interrupts R INTCE Start Enable SWZ y R INTCS Start Enable SW3 interrupts R INICIO Start Flash the LEDs for 200 times or until a user switch is while O0 gSwitch Flag amp amp flash count lt 200 J d fx LED flashing Delay or led delay 0 led delay lt 400000 led delay Fh pe Delay E Toggles the LEDs after a specific delay Toggle LEDs R20UT0786EG0100 Rev 1 00 Jun 21 2012 ENESAS Page 23 of 30 RSKRL78G14 8 Reviewing the Tutorial Program The program counter should come to a halt at the Timer_ ADC function Step over the function by click ing
36. y under any patents copyrights or other intellectual property rights of Renesas Electronics or others 3 You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part 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 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 Electron ics products or the technology described in this document for any purpose relating to military applications or use by the mili tary including but not limited to the development of weapons of mass destruction Renesas Electronics products and technol ogy 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 docu

Download Pdf Manuals

image

Related Search

Related Contents

STRATEGIE et politique générale D`ENTREPRISE  Samsung SCH-I535ZKBVZW User's Manual  SAFETY DATA SHEET  Holley 950-19S Fuel Injection Kit Installation Instructions  Adobe Creative Suite 5.5 Web Premium, Win  Honeywell MS9590 VoyagerGS  製品安全データシート - ホーム|Enviro Tech  Medifab Triton Chair User Manual    CalculiX USER`S MANUAL - CalculiX GraphiX, Version 2.9 -  

Copyright © All rights reserved.
Failed to retrieve file