Home
M16C/Tiny SKP Tutorial 2
Contents
1. Tutorial 2 Creating A New Project Using HEN 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 Specific examples are shown throughout this tutorial using the SKP16C28 The SKP16C26A and SKP16C29 CL are similar in all respects 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 J Reviewed Tutorial 1 2 tCENESAS Starting HEW FR PrintFolders QuickTime fgg High performance Embedded Workshop 3 1 rm Manuals b if sprint E WinRAR I Onine Support Tools itt gma High performance Embedded Workshop w Manuals Browser E Register on line From the Windows Start menu click on Programs gt Renesas gt High performance Embedded Workshop 3 1 gt High performance Embedded Workshop 3 RENESAS Creating a Project Workspace g gt High performance Embedded Workshop File Edit View Project Options Build Memory Tools Windo
2. Creating a New Project 4 8 New Project 3 6 Setting the Contents of Files to be Generated Ed T hat kind of inibalization routine would you like to create M Usel o Library See as 1 Select None as we Heap Size OS00H already have a file Generate main Function with the main function tENESAS 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 avallable New Project 4 6 Setting the Stack rea El E What are the stack settings 17 ENESAS me a New Project 5 6 Setting the Target System for Debugging Targets Creating a New Project 6 8 Mo tems x External Debugger 1 Select KD30 2 Leave as Is 3 Click on Next 18 ENESAS 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 Project 6 6 Changing the File Names to be Created Ed The following source files will be generated File Name Ext 1 Click on Finish to complete project creation process ee I ll Creating a New Project 8 8 A project summary Is displayed to indicate a successful creation of the new project tutor2
3. 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 SKP16C28 Sample_Code Startup_files directory 22 ENESAS 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 2 Browse to C MTOOL Look ir Tutor2_ sre aes a SKP16C28 es i ukor a30 Sample_Code Tutor2_src EE e folder which contains the 3 Select main_tutor2 c and source codes tor this tutorial ncrt0_28skp_tutor2 a30 4 Click on Add File name main tutor2 c ncrl_28skp tutor a30 Files of type Project Files Lancel Relative Path tENESAS Adding Source Files 2 2 After adding source files HEW s workspace will look like the figure below xl 1 To display dependencies per source file right click on the Workspace window and click on the Configure View E Tutor Assembly source file nen 4bskp tutor a0 C source file maln_ tutor c Dependencies sect30 28skp tutor2 inc Configure View W Show dependencies under each file sh 28h 3 skp bsp h Cancel Ej skp_led h Show file paths a Projects E Temp Mavi 2 Click on check boxes in Configure View dialog box
4. Summary Project Summary PROJECT GENERATOR AME Tutor EAMTOODL 5SKP1b6E2845ample _ MI6C20 Other Renesas M16C Standard Toolch Eritry GENERATION FILES DATE TIME 32152004 3 01 37 PM 1 Click on OK yie project directory Cancel 20 RENESAS HEW After creating the project HEW will look similar to the figure below 3 TutorZ High performance Embedded Workshop File Edit view Project Options Build Memory Tools Window Help osuna S ieelira om p easle os 2 2 22 nasa em ss pes Apra ARA ss ENE dE E E E Tutor2 ASS Dependencies Projects E EDT APETITO E tal Seo Neeson Es em F Active Project Tutor Default and User SKP Startup Files Except for comments the differences between the default ncrt0 a30 and sect30 inc and user ncrt0O_28skp a30 and seci30_28skp inc startup files are listed below Ncrt0 a30 m 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 28 in user file default at OxFFDOO M16C 62 m Device Package set to 80 pin package n Section Allocation Calls user sect30 file sect30_28skp 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
5. Verify SKP and Sample Code allow you to test the SKP and evaluate the MCU peripherals and features using pre built sample code 6 tENESAS Creating a New Project with the SKP project generator 3 4 M16C 28 Starter Kit Plus Step 2 Ed The following files will be added to the project defaultsession het HE Sessio maln_ lt Bskp template c Shell for your readme bet Readme Tex debugincitO z8skp r30 Relocatable nel 4Yoskp a30 Startup Progr sect 0_ Bekp no Section and st 2o h SFA definitio SFR Definitio Macros for th Header File f 1 Click on Finish button Next gt Finish Cancel Note Step 2 shows all the files that will be added to the new project and their description 7 tENESAS Creating a New Project with the SKP project generator 4 4 Project generator information The project will be generated with the following specication CPU informations CPU M16C Additional files defaultsession haf main 2oskp template c readme byt neh Beskp r30 nerti Bskp a30 sect 0_ Bekp no skp ledh 1 Click on OK button E Cancel The project generator information is shown once the project has been created ENESAS 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
6. 3 Click on OK button Z zl Tutor 3 Assembly source file 3 nert Bekp tutor as B secta0_ Bekp tutora ine C source file main_tutor2 c sft_26 h B sabah J Z skp_lcd h a E Displaying the source file dependencies this way makes it easier to verify if the header files are included before building the project TA Projects E Templates al Mawigatior 24 tCENESAS 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 M16 Standard Toolchain the Option menu and f Configuration E Assembly Link Librarian Lime Cfg py 4 this window is displayed alconi J Catego inca ey All id aeaiee Show entries for E source file Relocatable files J Assembly source file 2 Select All Configurations 4 Select Relocatable 5 Click on Add files E E Specifies start address of absolute module i all Options Link L nc SDlib G MiS ERRORE OJECTNAMEJ 30 25 CENESAS Linking the Startup File First 2 2 Add relocatable file a z Relati 1 Select Configuration aii d i recto ry Configuration directory Cancel File path 3 Cli
7. File menu New Project Workspace 1 Select e 4 Enter Tutor2 Application TAREA Tas name of the Te Import Makefile Pae p roj e ct 2 Browse to or enter pw Tutor bae a 5 L C MTOOL SKP16C28 22s _ Discos petites i h CAMTOOLSSKPTEC28 S ample_Code T utor2 i e Tutor2 Sample_Code a MIBC A Tool chain 3 Select M1 6C Renesas M16C Standard ees 6 Verity Renesas M16C Standard is selected Properties Cancel 13 RENESAS Creating a New Project 2 8 New Project 1 6 Select Target CPU Toolchain version El E Toolchain VEISION 1 Le ave as IS i Entry Which CPU do you want to use for this project CPU SNES Ho 2 Select MEE M160 20 MI6CY 10 Rely T iny CPU Type IF there is no CPU type to be selected select the CPU Type that a similar to hardware specification or select Uther lt Back Next gt Finish Cancel ENES Creating a New Project 3 8 New Project 2 6 Select RTOS Ed ee 1 Select M16C 20 aros none A 2 Leave as is Startup file type i es 3 Select USER Startup files ly Project oy C source file AS C header file Add AS Assembly source file ja AS Configuration file Remove 4 Click on Next button Note 1 Differences between Default and USER Startup files is discussed after the project is created Mm 1 T
8. NESAS SKP project generator Summary 2 2 The project structure C Hew3 Tutor2_pe Tutor 2_pe and files created File Edit wiew Favorites Tools Help when using the SKP sack gt ye Search E role FEE project generator are Address B Cu Hew3Tutor2_ pal Tutorz_pg vl Go shown here Folders x Mame Size Type E 5 Documents and Settings debug File Folder 5 flexlm y defaultsession hsf 2KB HSF File E G Hew E Empty_Project tps 1KB TPS File 5 BACKUP _ El main_28skp_template c 1 KE File E E ETC El ncrt0_28skp a30 BEB 430 File y help E readme txt LKB Text Document E ES Manuals E sect30_28skp inc 11 KB INC File Online 188 sfr_28 830 17KB 430 File 5 System El sfr_28 h 143KB HFile E E test El skp_bsp h 4KB HFile Tools E skp_led h SKB HFile E 5 Tutor2 pg E Tutor2_pg hwp 17 KB HWP File 5 Tutor pg 5 debug 9 MTOOL BIN 5 FOUSE iii 12 objects Disk Free space 26 7 GB 4 My Computer 11 tENESAS 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 tCENESAS Creating a New Project 1 8 Select New Workspace from the
9. Window Help sad cea o To ross lig n 8 2 m Gyles EF EL Et El OD OS z xl ja Empty Project 4 Assembly include file 2 sect 0_ Bekp inc EA Assembly source file nerti dskp as0 str _28 a30 H E C source file main 2oskp template c ce Dependencies sect30_ Bskp mc 7 sft_28 h skp bsp h 3 skp ledh FE EDOT lt APL IAEA Sed MeEES POR a CB F Active Project Empty Project A L gt Flash Build A Debug A Findin Files A Version Control SKP project generator 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_28skp a30 and sect30_28skp inc files A cfile main_28skp_template c that contains the main function Copies of the SKP header files sfr_28 h skp_bsp h and skp_Icd h included in the c file A copy ofthe sfr_28 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 26 3 Configures the external debugger to launch KD30 as shown in the Launching KD30 trom 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 tCE
10. al Debugger settings d e b U g g er External debugger location 4 Locate KD30 from CAMTOOLAKD30 KD 30 EXE l a C MTOOL KD30 folder o Enter LOAD ENE l CONFIGDIR PROJECT N AM E x30 Download module IOWSE 6 Click on OK Mea To launch and download x30 a file KD30 click on this icon Release re A igi Le ie 29 ENESAS 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 l Build Phases 1 To generate a hex file during the build process Build Order Build File Order File Mappings Build phase order select Build Phases from gt 7 MBC Assembler the Option menu ie ne Mody MIEL Stype Converter JMT6C Libranan 2 Click on M16C Stype PSE ass ul bass Converter checkbox Remove Move Lp Move Down lt M Import Cancel With the feature enabled a hex mot file is created when building the project Look for a Tutor2 mot file under C MTOOL SKP16C28 Sample_Code Tutor2 Tutor2 Debug folder 3 Click on OK 30 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
11. built tutor2 project can be found in the Zip file under C MTOOL Sample_Code tutor2_src folder Be sure to check out the references on the following pages Have Fun 31 tCENESAS References and Recommended Reading All documents that came with the SKP can be found using the Document Description from the Start gt Programs gt Renesas Tools gt SKP16C28 menu e User s Manuals Individual manuals for SKP16C26A SKP16C28 and SKP16C29 CL These documents provide details on the Starter Kits e HEW User s Manual To fully understand and get the most out of HEW this is recommended reading e KD30 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 26A 28 amp 29 Hardware Manuals M16C Tiny device specifications e RTA FOUSB MON User s Manual Provides details on the In Circuit Debugger and Flash over USB Programmer 32 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 introduction and reference on the C language The next chapter explains specifics of C programming with the M16C microcontroller e M16C 10 20 60 Series Software Manual This document describes the instruction set and timing information for th
12. ck on OK nerti 28skp tutor 2 Enter the startup source file i e nertO_tutor2 Renesas M16C Standard Toolchain EE Configuration E Assembly Link Librarian Lmc Cig Mal fai Configurations Category Input y All Loaded Projects Show entries hor tuo TEE C source file Relocatable files H Assembly source file HICONFIGDIRA neti 28skp tutor2 130 ye Remove A Y Up Down E Specities start address of absolute module Options Link L nc30lib G M5 0 4 Click on OK on aproce D ENESAS Defining an Include Directory For this SKP files that are common to all the sample code are kept in a directory named Common under Sample_Code An example is the register definition file str h that is included for all the projects yet never needs to be modified Because of this we will need to setup up in HEW how to instruct the compiler where to look for these files during compile time Renesas M16C Standard Toolchain ag Configuration 5 Assembly Link Librarian Lrnic Cig calel Debug Category E All Loaded Projects Show entries for Er MEE _ _ a Include file directories ll E Assembly source file 1 Specifies the directory containing the file s specified in include You can specify up to 8 directories Add include file directory Met Relative to _fenove_ i E MU Custom direct
13. e M16C 20 60 series CPU cores 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 33 ENESAS
14. ory Cancel gt Directory ICAMTOOLSS EPI6C2E S ample _Code common Browse C WAIP WUP Le 1 Select Renesas M16C Standard Toolchain from the Options menu and this window is displayed 2 Click the Add button 3 Set the Relative to option to Custom directory and the Directory to the location of your Common directory for your SKP tENESAS Building compile amp link the Program o Tutor High performance Embedded Workshop File Edit wiew Project Options Build Memory Tools Window Help ae ieee Es ye ia e BA as NES AEE t Pe on Ps ll Ty Tutor2 E al Assembly source file 3 ncrtdl_28skp_tutor2 a30 B sectalL 4Oskp_tutor inc Ey 7 L source file Ll malr_ tutora c E E sfi_28 h Z skp_bep h 3 skp_led h Projects E Templates SAren S Projects Templates a Mawigation a Mit aerer siase Phase M1 6C Linker finished F Build Finished Look at the Output window and check O Errors 0 Warnings n i whether any errors or warnings occurred If there are no errors you can try running the program on the M16C Tiny SKP Board using the ICD and KD30 Debugger RENESAS Launching KD30 from HEW KD30 can be launched directly from HEW but HEW must be configured as shown below 1 Select Customize from Cust PX from the Tools menu Toolbars Commands Menu Place Debugger Log Help 2 Click on Debugger tab 3 Select Other extern
15. w Help Coa bel E Et E amp T ar oI Welcome Ed ES Options Cancel a 2 Click on 1 Ensure MIA o button this option gt Is selected When HEW starts up you will be prompted to select a workspace By ar default Create a new project workspace option is selected pa Creating a New Project with the SKP project generator 1 4 New Project Workspace El Ed Projects 3 Enter Tutor2 pg Ts Application Workspace Name Py Empty Application Tutor pg tl Import Makefile E pl Library 2 Se act ga M16C 26 Starter Kit Plus Tutor po 4160 28 Starter Kit Plus M1 6C 28 a cd Starter Kit Plus O aac Starter Kit A 1 Select M16C Plus as the mam project type Renesas MIC Standard le 4 Verify Renesas M166C Standard Is selected ME ao Note This ts the directory where the project will be created zs CHAHEWJS Tutor2_ po 5 Click on OK button 5 ENESAS Creating a New Project with the SKP project generator 2 4 M16C 28 Starter Kit Plus Step 1 E What type of project do wou want to generate CO Verify SKP These projecte allow you to verify the SEP and the development environment C Sample Code sample eas o menor 1 Select re write and board components J Empty Project n is Initializes the M16C28 for o Click on Next button Next gt Ha Note The other project selections
Download Pdf Manuals
Related Search
Related Contents
T'nB CIRJDCBL37782 networking cable ESTAÇÃO EXTREME 2000M L`éleveur responsable de l`identification de son cheptel Severin WK 3414 PROBLÈME CAUSE PROBABLE SOLUTION Élargissement ou FB400/FB900 Manual de operacion rapida THALIA - TORI Portails Honda Power Equipment 659800 Portable Generator User Manual Samsung S19A350B 用户手册 Copyright © All rights reserved.
Failed to retrieve file