Home
SKP16C62P Tutorial 2
Contents
1. AL main tutor Aman tutarz c amp cammoarn sfrezp h amp bsp h s E cammon skp led h AA Asfr B2p r30 Dependencies qe Tutar 30 2 Command Source and header files for main tutor2 c 19 24 NE S AS Building compile amp link the Program TM os alao E eje Click on this icon to Build the program Look at the Builder window and check whether any errors Builder lt Tutor C MTOOL RTA M16C62P SKP S ample_Code tutor2 Tutor2 tm Pi a Ed d File Edit View Action Help processing Xmain tutor2 r3B processing sfr_62p r36 processing C XHTODLXLIB38Xnc3 8lib lib BZERD r3B processing C XHTODLXLIB38Xnc3 8lib lib BCOPY r3 DATA H B1277 BBhFDH Byte s ROMDATA 6000001 00061H Byte s CODE 6000728 6802D8H Byte s If there are no errors you can try LNC38 L ATutor2 x30 th th Load Hodule Converter 1mc3H for H16C 66 Series Version 3 26 Copyright 2666 MITSUBISHI ELECTRIC CORPORATION running e program on e AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION SKP16C62P Board using the ICD oe hanes Reece and KD30 Debugger ooppsss menennne Finish don t forget to connect your hardware 20 tENESAS Generate mot Files for Programmer After building a program a file with an x30 is generated For this example tutor2 x30 is generated This x30 file can be down
2. AS Open a New Project in Tool Manager otart a new project by clicking on this icon Proj ole eje 21 Note You can also start a new project from the File menu of the Project Editor 10 ENESAS Open a New Project in Tool Manager Hew Project 5tep 1 project is made Specify Target MCU Project name Working directory A made project is kept with the specified project name in the working 2 name of the project directory T 3 utor2 Target chip Project name Tutora EE 3 For the working directory CAMTODLARTAMTECEZP SKPNE browse your machine or enter CAMTOOLISKP16C62P Sample_Code tutor2 4 Click on Next lt Back Lancel 1 You must click here to select the Target Chip Select M16C Family T ENESAS Open a New Project in Tool Manager 1 Select C Project 2 Click on Next 434 NESAS Selecting Startup Files Hew Project 5tep Compiler B 5 1 Select the compiler Specify a compiler package to use with the project KNC30WA V2001 T Compiler package W200 2 Select Custom and browse Specify a startup program IUE until you find ncrt0_tutor2 a30 A default startup program is used f Custom EAMTODLNRTA MTECEZP SKP Sample 7 in C MTOOL SKP16C62P Sample_code tutor2 Specify a linker script File f default linker script file is used
3. Adobe Illustrator 10 var Internet Esplorer From the Windows Start menu click on Programs gt Renesas tools gt TM V3 X gt TM RENESAS Tool Manager Project Bar Open project button Rebuild button Start new project wizard Build button Run debugger button Partial build button Help button Tool register button Project currently loaded TM v Proj oe ec 214 El elella o Open project editor button Map Viewer button Start default editor button Tool Manager customize button 5 ENESAS Steps in Creating a New Program The style and approach in developing new programs vary from one engineer to another and may also depend on experience and know how The basic steps are shown below Application and Method of Implementation Write the program Compile link the program Debug the program Write program documentation uto E pe Note 1 Steps 4 and 5 are not discussed in this tutorial as the focus is on how to create new programs with Renesas M16C software development tools 6 24 NE S AS Application and Implementation A new program starts from an idea of an application For this tutorial our application is an LED Switch demo The application will blink the user LED s 01 D2 4 D3 sequentially and pressing S1 will stop or re start the sequence After knowing the application we need to think on how to implement the application These includes the processe
4. Custom m 3 Leave the default setting as is lt Back gt Lancel A 4 Click on Next Note A discussion on the differences between default startup program and custom SKP startup program we used will follow after opening the new project 13 24 NE S AS Open a New Project in Tool This completes the setup of the new project New Project Step Finish Target Chip Project Mame Working Directory Project Type Goal File Compiler Startup Program MTBC Family Tutora CAM TO LDLSRTA MT1BCBZP SEP S ample C language PROJECT CAM TOLDLSRTA MT1BCBZP SEP S ample EMC3UNVA 2001 custom M TOLDLLSRTA M TBCBZP SEP S ample 234 NE S AS Default and Custom Startup Files Except for comments the differences between the default ncrt0 a30 and sect30 inc and custom ncrt0_62pskp a30 and sect30 62pskp inc startup files are listed below Ncrt0 a30 Set to f1 div by 1 of Xin BCLK Xin frequency in custom file Stack sizes Smaller 0x100 on custom file Heap size No heap size on custom file Vector Base Address 0xF D000 for custom M16C 62P and OxFFDOO for default M16C 62 Section Allocation Calls custom sect30 file sect30 62pskp inc instead of default sect30 file Standard I O Initialization No initialization on custom file done in main but default file calls _ nit routine Sect30 inc Variab
5. KD30 Version X XX User s Manual The tutorial only covered the basics of KD30 Read this manual 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 62P Datasheet and SKP16C62P Board Schematic These are required to write user application programs for the SKP e RTA FoUSB MON User s Manual Read this manual to understand how the ICD works 23 234 NE S AS 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 530 Version X XX User s Manual Read this manual if you plan on writing A programs in Assembly or when making changes to the startup file 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 24 ENESAS
6. RENESAS SKP16C62P Tutorial 2 Creating A New Project Using TM Renesas Technology America Inc Overview This tutorial describes the steps in creating new programs 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 SKP Tutorial 1 2 24 NE S AS The Development Process SKP16C62P M16C 62P MCU Board 1 Write programs User RAM using text editor Monitor RAM 5 Correct errors amp repeat process User Flash Monitor Flash I O Connector 2 Tool Manager automates compile amp link a DE Host PC USB 4 Debugging info T Editor E ere 3 KD30 sends the machine Errors code to the SKP16C62P durin jl VA a downloads and uses the symbols for source level debugging Tool Managery Build commanq Absolute file 11 x30 Start Tool Manager Microsoft Tools RENESAS TOOLS Flash OverUSBY200 Sony Handheld 20 Technical Support Sheet Sony V alo EDSOY 3 0 Helease E Th Help MSY 3llzbz SkKP T TM Users Manual Startup Utilities cal
7. le Vector Definition Simplified and described in custom file Note You can use the default startup files but ensure that you understand the how to make the necessary modifications The custom startup files for the SKP can be found under C MTOOL SKP16C62P Sample_Code Startup_files directory 15 24 NES AS Changing the Default Startup Files As you get accustomed to the way the custom startup files are setup you may want to use these custom startup files as default startup files The steps to do this are shown below Open Windows Explorer Locate C MTOOL SRC30 Startup directory Rename the ncrt0 a30 and sect30 inc to 0 original a30 and sect30 original inc respectively 4 Copy ncrtO 62pskp a30 and sect30 62pskp inc from C AMTOOL SKP16C62P Sample_Code Startup Files directory 5 Rename ncrt0_62pskp a30 to ncrt0 a30 Do NOT rename sect30 62pskp inc adi Now every time you use the default startup when you create a new project it will use the custom startup files Note As the custom startup files are setup for the M16C 62P ensure that you review these files when you use a different MCU or create a new project 16 24 NE S AS Adding Source amp Header Files 3 Add the source files main tutor2 c and sfr 62p a30 by clicking on Add File icon main tutor2 c in C MTOOL SKP16C62P Sample_Code tutor2 Sfr 62p a30 C MTOOL SKP16C62P Sample_Code Common fx ProjectE ditor l
8. loaded using KD30 but not device programmers including the FoUSB Programmer which uses hex files in Motorola or Intel format Information Target Tool To generate a mot file from the x30 onat file we use the Imc30 exe program It Fesine 0S Package information a can be done automatically or i manually from the command prompt as30 Version 4 00 00 30 Version 4 00 00 30 Version 1 00 02 To do it automatically click on iB 1 UI Information from the Project menu of Imc Version 3 0 00 the Project Editor From the Tool tab Environment variable J P G BINSO CAMTOOLSBIN click on en under Package E US INCSO CAMTOODLAINC30 Information to enable the feature TE DUE MIDI QN 21 24 NE S AS 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 within the tutor2 project folder Be sure to check out the references on the following pages Have Fun 22 24 NE S AS References and Recommended Reading e SKP16C62P 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 Tool Manager V3 X User s Manual To fully understand and get the most out of Tool Manager this is recommended reading
9. s what peripherals are needed the programming language to use etc Other factors such as development time cost hardware etc also affect the way an application is implemented We will implement our application with the following a C Programming Language b Peripherals GPIO Timers c SKP16C62P Board as hardware 7 24 NE S AS Write the Program After understanding the application and how you want to implement it we have to write the source code For this tutorial we already have the source code The source code consists of the following tutor2 c controls the processing b Sfr62p h header file for the M16C 62P Special Function Registers SFR NertO tutor2 a30 amp sect30 tutor2 inc startup files for our C program d Sfr 62p a30 label file for the M16C 62P SFR s so the labels are displayed on KD30 s memory window 8 24 NE S AS Build the Program Now that we have the source codes we need to compile link the program so we can run and test our application Building the program consists of several steps and these are listed below Open a new project in Tool Manager Selecting startup files Add source codes and header files Building compile amp link the program Generate mot files for Programmer doo Note 1 This step is only necessary when the program is written in C Skip this step when the program is written developed in Assembly 9 24 NE S
10. t Tutor2 C MTOOL RTA M16C62P SKP S ample Codextutor2X 8 x 1 Click on the by all to view the tutor2 x30 output file File View Project D EREGI all E ATutor2 x30 re EE Anc tutor um gem Tutor 3 am clear dB Command 2 Click to highlight tutor2 x30 Ready NOTE n most cases your project will consist of one output file with an x30 i e Tutor2 x30 extension You add source files TO THIS file and NOT to all ENESAS Adding Source amp Header Files After adding the main tutor2 c and sfr 62p a30 source file the Project Editor should look like the like the figure below Click on this icon to check for dependencies header files zl ProjectE ditor lt Tutor C MTOOL ATA M16C62P SKP S ample _ 2 X File View Project Help Eget ATutor2 30 8 ATutorz emd La nct tuterz r3t Dependencies La Amain tutorz r30 Ze ATutor2 230 aN Ast B2p r30 gd Command 18 RENESAS Adding Source amp Header Files After checking dependencies with the branches extended the Project Editor should look like the figure below Header files used in the source files are shown in these branches Save the project and let s build the program 1 Click this icon to save the project Eau ATutor2 x30 E 0 vneti pEuterz
Download Pdf Manuals
Related Search
Related Contents
GE WCCD1030YWC User's Manual User manual ALFA-45A and ALFANET-45A SMCI47-S Technical Manual V2.3 2 Selezionare le impostazioni nel pannello Ultrathin Keyboard Mini ARB® Air Locker™ Locking Differential, Rear 7.5" (10 Magnavox MAS-80 User's Manual CAMTVI4 - Velleman Copyright © All rights reserved.
Failed to retrieve file