Home
SKP16C26 Tutorial 2 - Personal Web Pages
Contents
1. Tutorial 2 Creatin g A Nev j roject Renesas Technology America Inc Overview This tutorial describes the steps in creating new projects for the M16C using two different methods The first method uses the SKP project generator that will create an empty project The second method will provide step by step instructions on creating a project with existing source files To get the most out of the SKP including the development tools check out the references at the end of this tutorial Note This tutorial assumes the user has done the following 1 Followed the Quickstart Guide 2 Installed the SKP files examples and software tools in the default directories 3 Reviewed Tutorial 1 2 tENESAS Starting HEW RENE545 TODL5 Son Handheld d Sony Yala d TPF High performance Embedded workshop Manual Navigator Location C Hew3 Startup d Utilities d From the Windows Start menu click on Programs gt Renesas High performance Embedded Workshop gt High performance Embedded Workshop 3 ENESAS Creating a Project Workspace igs High performance Embedded Workshop File Edt View Project Options Build Memory Toole Window Help AE al Welcome m Cancel X 2 Click on 1 Ensu re A Open a recent project workspace Administration OK bukon this option ES ESMTOOLSKP16C26 Sample Code z is selected C Browse to another
2. User Stack Painter Stack Size 0300H Interrupt Stack Porter Stack Size o200H 1 Click on Next button 17 ENESAS Creating a New Project 6 8 New Propect 5 6 Setting the Target System hor Debugging CINo items 1 Select KD30 none MIEC Famile KD30 4 5 20 Release 16 EH MTEC Family POS0 5 10 Release 1 i SS eA e ia s N 3 Click on Next RENESAS Creating a New Project 7 8 We already have the source files and selected USER startup files see Creating a New Project 3 8 and 4 8 and so there are no source files that will be generated New Propect 6 6 Changing the File Names to be Created The following source files will be generated 1 Click on Finish to complete project 4 creation process Hest gt Finish Cancel la da oll Ih 19 ENESAS Creating a New Project 8 8 A project summary is displayed to indicate a successful creation of the new project tutor2 1 Click on OK RENESAS HEW A ter creating the project HEW will look similar to the figure below lal x Ema Tutor High performance Embedded Workshop File Edit View Project Options Build Memon Toole Window Help ED Er El Ohi Do A B p Tutor a Dependencies 27 Projects E Templ Mawiga EA TER sio As Aena A nc J Loo Do E S f
3. sa Tutor2_po hwp HF File sect30_26skp inc INC File am Assemblyincludefil SHL File am Assemblylisttile shl SHL File a Assemblysourcetile SHL File a Cheaderfile shl SHL File fam Clistfile shl SHL File Contigurationtile shl SHL File sa Csourcefile shl SHL File a Default shl SHL File am editordefault shl SHL File Hesfile sh SHL File F a Link agemaptile shl SHL File 21 SON YSYS a PreprocessedLsau SHL File 3 TEMP s Recordtile shl SHL File A WINNT E readme tet Text Docum le m 24 object s Disk free space 2 10 GB 1 bz KB My Computer ADC_ Repeat H E ETC _ help _ Manuals System e Tutora pg Ey Tutors _ pg _ 386 MTOOL Multimedia Files OR CAD WIN _ Program Files Creating a New Project Environment The SKP project generator simplifies several steps in creating a new project but what if you already have source files The following slides will walk you through the following e Creating a new workspace from scratch e Adding source files e Setting up the software development environment including linker build debugger and programming configuration 12 tENESAS Creating a New Project 1 8 select New Workspace from the File menu New Project Workspace Fx one 3 Enter Tutor2 Application En tal Import Makefile E a project Empty Application Tuto as name of th e Mot 2 Browse
4. 4 Click on Add File name maln_tutore c nerti tutors a30 Add Files of type Project Files Cancel Relative Path E ENESAS Adding Source Files 2 2 After adding source files HEW s workspace will look like the figure below xi E El T Tutor Sl a Assembly source file f hun ncrO_tutore as a a C source file bas main tutore c El a Dependencies cs sects0 tutor ine TA Projects E Templates al Navigator EE Tutor iy Tutor 1 To display dependencies per source file right click on the Workspace window and click on the Configure View Configure Yiew M Show dependencies under each file 2 Click on check boxes in EE Configure View dialog box 3 Click on OK button aj a Assembly source file E 1 nert tutor a30 El sect30_ tutor2 inc Displaying the source file 5 C source file gt dependencies this way makes 8 roya it easier to verify if the header tee L files are included before building the project ey Projects Templates al Mavigaton 24 tENESAS Linking the Startup File First 1 2 After checking dependencies NC30 must be setup to compile and link the startup files first The startup files contain information on memory addresses and sections which the linker uses to place the code at the correct addresses 1 Select Renesas M16C 3 Click on Link tab Standard Toolchain from Renesas M16C Standard Toolcha
5. Creating a New Project with the SKP project generator 3 4 HM16C 26 Starter Kit Plus Step 2 The following files will be added to the project detaultsession hsf HE Sessio main bskp template c Shell for your readme bet Readme Tex nerti bekp a30 Startup Progr sect3D_ bekp mc Section and sHr2b2 h SFA definitio st_ 2b as SFA Definitio skp bsp h Macros for th skp led h Header File f 1 Click on Finish button Back ea Finish Cancel Note Step 2 shows all the files that will be added to the new project and their description ENESAS Creating a New Project with the SKP project generator 4 4 1 Click on OK button The project generator information is shown once the project a has been created gt RENESAS HEW after Creating a New Project using the SKP project generator 3 Empty_Project High performance Embedded Workshop File Edit View Project Options Build Memory Tools Window Help Ooo ed ot fe Tu IA 8 2 z7 ga also o 1 a E Empty Project E a Assembly include file T E sect30_26skp inc E de Assembly source file oe A nortO_ bskp a30 sft_26 a30 E a C source file Oe B main_26skp_template c Er Dependencies p5 E sect30_26skp inc sfr262 h vee skp bsp h E skp lod h 2 Projects E Templ Naviga xl Te P AE INS NUM 9 RENESAS SKP project gener
6. E T A igh Od Pe 28 tENESAS Generate a hex file for the Programmer After building a program a file with an x30 is generated For this example tutor2 x30 is generated This x30 file can be downloaded using KD30 However device programmers including the FOUSB Programmer use hex files in Motorola or Intel format Build Phases 1 To generate a hex file Build Order Build File Order File Mappings during the build process A select Build Phases from 21416C C Compiler Add the Option menu ceria Modify 2 Click on M16C Stype CIMEC Jump lable Compose converter checkbox fed al With the feature enabled a hex mot file is created when building the project Look for a Tutor2 mot file under C MTOOL SKP16C26 Sample_ Code Tutor2 Tutor2 Debug folder 29 ENESAS End of Tutorial 2 This is the end of the tutorial You can try modifying or downloading other sample programs from the Sample_ Code directory The completely built tutor2 project can be found in the Zip file under C MTOOL Sample_ Codeltutor2 src folder Be sure to check out the references on the following pages Have Fun 30 tENESAS References and Recommended Reading e SKP16C26 User s Manual This is a must read document It details all the things you need to know on how to use the Starter Kit e HEW User s Manual To fully understand and get the most out of HEW This is recommended reading e KD3
7. 0 Version X XX Help The tutorial only covered the basics of KD30 Check out the Help menu to find out all of KD30 s features e NC30 Version X XX User s Manual Check this manual out for features specific to the NC30 compiler e M16C 26 Datasheet and SKP16C26 Board Schematic These are required to write user application programs e RTA FoUSB MON User s Manual Read this manual to understand how the ICD works 31 ENESAS References and Recommended Reading e M16C 10 20 60 Series C Language Programming Manual This is a great document for any level of programmer The first chapter is an intro to C programming The next chapter explains the memory map of C programs on microcontrollers and the role of startup programs e M16C 10 20 60 Series Software Manual This document describes the instruction set and timing information for the M16C 20 60 series CPU cores e AS30 Version X XX User s Manual Read this manual if you plan on writing programs in Assembly or when making changes to the startup file e Application Notes and Sample Programs Application notes and other sample programs can be accessed from Renesas Technology America s website http www renesas com PLATFORM 32 ENESAS
8. Oo l San 21 Default and User SKP Startup Files Except for comments the differences between the default ncrt0 a30 and sect30 inc and user ncrt0_26skp a30 and sect30_26skp inc startup files are listed below Ncrt0 a30 BCLK Set to f1 div by 1 of Xin BCLK Xin frequency in user file Stack sizes Smaller 0x100 in user file default at 0x300 Heap size 0 no heap size in user file Vector Base Address 0xFF800 for M16C 26 in user file default at OxFFDOO M16C 62 Section Allocation Calls user sect30 file sect30_26skp inc default calls default sect30 inc Standard I O Initialization No initialization in user file done using mcu_init from main default file calls _init routine Sect30 inc Variable Vector Definition Simplified and described in user file Note You can use the default startup files but ensure that you understand the how to make the necessary modifications The customized startup files for the SKP can be found under C MTOOL SKP16C26 Sample_Code Startup_files directory 22 tENESAS Adding Source Files 1 2 1 From HEW s Project menu select Add Files and the Add Files dialog box is displayed Add File s sat EE 2 Browse to C MTOOL Brad hod 20 SKP16C26 ES sect30_tutord ine Sample_Code Tutor2_src folder which contains the 3 Select main_tutor2 c source codes for this and ncrt0_tutor2 a30 tutorial
9. ator Summary 1 2 The following is a summary of what happens when creating a new project using the SKP project generator Empty Project 1 The following files are created in the workspace or project directory in this example under CiHew31Tutor2_ pg A copy of the user startup ncrtO_26skp a30 and sect30 26skp inc files A cfile main 26skp_ template c that contains the main function Copies of the SKP header files sfr26 h skp bsp h and skp_lcd h included in the c file A copy of the sfr_26 a30 file so SFR labels are visible in KD30 2 Links the startup files first as shown in the Linking the startup files first slides slides 25 4 26 3 Configures the external debugger to launch KD30 as shown in the Launching KD30 from HEW slide slide 28 4 Adds the phase to generate a hex file when building a project as shown in the slide Generate a hex file for the Programmer slide 29 10 tENESAS SKP project generator Summary 2 2 En Tutor2_pg The project structure File Edt View Favortes Tools Help and files created Era Search rode METE a E when using the SKP Address C Tutor2_pa olders ize Type project generator are fe shown here 3 7 Cadence E nertO_26skp a30 A30 File 9 DISCOVER ES sf_26 a30 A30 File H Documents and Settings E man_e bskp_templ C File H DRIVERS sa sfr262 h H File E skp_bsp h H File a skp_lcd h H File sa defaultsession het HSF File
10. in the Option menu and ATT i i Configuration C Assembly Link Librarian Lmz Cfg ha F this window is displayed al Configuatons E ontigurations Category E a All Loaded Projecte Show entries for A Tutora La C source file Relocatable files Y Assembly source file 2 Select All Insert Configurations Remove 5 Click on Add l Up Down 4 Select Relocatable files C E Species start address of absolute module Options Link L nesblib G MS 0 F COMFIGDIAYE PROJECT AAME 30 Linking the Startup File First 2 2 Add relocatable file x Relative to 1 Select Configuration directo T Configuration diectoy 7 ld File path 3 Click on OK 2 Enter the startup A nertO_ tutor source file i e ncrt0_tutor2 Renesas M16C Standard Toolchain lx Configuration C Assembly Link Librarian Lmc Chg ma all Configurations Category Input El All Loaded Projects ley Tutor E E source file Felocatable files Er a Assembly source fle le CONFIGDIAAncrt_tutor2 r30 Add 3 nerti tutorz a3 mE Default Options Insert Show entres for E Specifies start address of absolute module Options Link neat G MS 3 LU 4 Click on OK SCONFIGDIRN SIPROUECT NAMIE 30 26 Building compile amp link the Program Em Tutor High performance Embedded Work
11. project workspace Ol Projects LE Templates Navigation a x D DARTE kui Aton A prince Aven coma Heady When HEW starts up you will be prompted to select a workspace By default Create a new project workspace option is selected A 4 RENESAS J ae a Creating a New Project with the SKP project generator 1 4 Hew Project Workspace Med Ed 2 Enter Tutor2 pg ey Application T Empty Application 1 Select ta Import Makefile M16C 26 Starter Kit Plus as the 3 Select M16C project type 4 Verify Renesas M16C Standard Is selected Note This is the directory where OK a the project will be created CAHEWS Tutor2_ pg 5 Click on OK button tENESAS Creating a New Project with the SKP project generator 2 4 M16C0726 Starter Kit Plus Step 1 What type of project do you want to generate C Verify SEP These projecte allow you to verity the SKF and the developement environment C Sample Code Sample code for penpherals memary 1 Se ect re write and board po dl E m pty P roj act Sets up and initializes the M1606 for this SEP 2 Click on Next button Back Hest gt Finish Lancel Note The other project selections Verify SKP and Sample Code allow you to test the SKP and evaluate the MCU peripherals and features using pre built sample code 6 ENESAS
12. shop ioi xj File Edt View Project Options Build Memo Tool Window Help osa clreaejoro om jale AAA oo I AS ros ASK HF E Debug DetaultSession or Assembly source file gE nerti tutor a30 B sects tutor inc E source file i 2 main_tutor2 c a sft262 h ae skp bsp h skp ledh TA Projects Templates al Navigator Hi Pnase mec Linker finished Look at the Output window and check Build Finished 4 whether any errors or warnings occurred ME EA Ready A ee ee E E O If there are no errors you can try running the program on the SKP16C26 Board using the ICD and KD30 Debugger E kai F T ti 27 ENESAS y Launching KD30 from HEW KD30 can be launched directly from HEW but HEW must be configured as shown below 1 Select Customize from Customize x from the Tools menu AQ External debugger selected 2 Click on Debugger tab gt Other external debugger 3 Select Other exte rnal Debugger settings d e b u g g er External debugger location 4 Locate KD30 from CAMTOOLSKD30 K 030 EXE Browse C MTOOL KD30 folder Command line options 9 Enter LOAD LOACD CONFIGOIR A PROJECTNAME x30 CONFIGDIR PROJECT N AM E x30 k Download module 7 TOWE 6 Click on OK ae To launch and download x30 file KD30 click on this icon Release
13. to or enter 4 Leave as is L CAMTOOLSKPIECE Sampie Codet Bowe fa C MTOOL SKP16C26 i e Tutor2 Sample Code MICs 5 Select M16C Renesas M16C Standard 7 6 Verify Renesas M16C Standard Is selected q dm 7 Click on OK button RENESAS Creating a New Project 2 8 New Propect 1 6 Select Target CPU_Toolchain version Ei x 1 Leave as Is S 2 Select Ho MIBE S20 M 1 6C 20 M16 10 RCT in RENESAS Creating a New Project 3 8 New Project 2 6 Select RTOS CN 160 20 1 Select M16C 20 2 Leave as Is Startup fle ype 3 Select USER Startup files ley Project Sa E source file Add q En Remove 4 Click on Next button Note 1 Differences between Default and USER Startup files is discussed after the project is created 15 ENESAS Creating a New Project 4 8 New Project 3 6 Setting the Contents of Files to be Generated P Use 120 Library Falter eas tere 1 Select None as we Heap See O already have a file with the main function 16 EN ESAS oll Ih Creating a New Project 5 8 The stack settings are grayed out because USER startup file was selected see Creating a New Project 3 8 If DEFAULT startup file was selected these settings become available Hew Project 4 6 Setting the Stack rea Med E SS What are the stack settings
Download Pdf Manuals
Related Search
Related Contents
その他の便利な機能 Hotpoint AQGMD 129 Washer/Dryer User Manual Samsung FG87K-B Manual de utilizare KOHLER K-2381-8-0 Installation Guide FLUXO 307 AEROSOL - FDS Version 1 du 01.01.2015 PLUS+1® MC0XX-1XX Controller Family Technical Samsung NX MINI 17MM 단렌즈 User Manual Copyright © All rights reserved.
Failed to retrieve file