Home

SKP16C26 Tutorial 2

image

Contents

1. 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 Th Proj iia Qe BO 214 El ejeje 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 qn a A A 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 tENESAS 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 D1 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 processes what peripherals are needed the p
2. h header files for pa 2 Acommonisir262 h main_tutor2 c 3 Dependencies BA ATutor2 cmd EA Ancrt _tutor2 130 CA Amain_tutor2 r30 CA Ast 26 130 E Command A MLN OR ODINCMAD E LALIST ON 3 Acommontskp_ led h ce LA Ast 26 30 19 tENESAS Building compile amp link the Program TM Proj d olele 23 E eje Click on this icon to Build the program Look at the Builder window Builder lt Tutor C MTOOLA RTA M16C26 5KP S ample_CodettutorZx T utor tmk gt Oj x and check whether any errors File Edit View Action Help or warnings occurred uj Dl m Copyright 2666 MITSUBISHI ELECTRIC CORPORATION AND MITSUBISHI ELECTRIC SEMICONDUCTOR SYSTEMS CORPORATION All Rights Reserved now processing pass 1 processing ncrt tutor r38 processing main tutor r3e processing Libraries now processing pass 2 If there are no errors you can try processing ncrt6_tutor2 r36 i processing main_tutor2 r30 running the program on the DATA 8660257 80181H Byte s SKP16C26 Board using the ICD CODE 8888539 8621BH Byte s and KD30 Debugger ooppsss 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 downloaded using KD30 but not device programmers including the FOUSB Programmer which
3. uses hex files in Motorola or Intel format Information Target Tool To generate a mot file from the x30 onat Ee ae file we use the Imc30 exe program It Reime 0S s Package information a can be done automatically or i Content _ _ manually from the command prompt as30 Version 4 00 00 nso Version 4 00 00 ba Version 1 00 02 To do it automatically click on CO coe ut 1 01 Information from the Project menu of Imc30 Yersion 3 0 00 the Project Editor From the Tool tab Environment variable TETE J J G BINSO CAMTOOLSBIN click on Amean under Package E US INC30 CAMTOOLMNC3Q Information to enable the feature eo E ae a 21 tENESAS End of Tutorial 2 This is the end of the tutorial You can try modifying or downloading other sample programs from the iISample_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 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 Tool Manager V3 X User s Manual To fully understand and get the most out of Tool Manager this is recommended reading e KD30 Version X XX User s Manual The tutorial only covered the basics of KD30 Read this manual to find out a
4. RENESAS SKP16C26 Tutorial 2 Creating A New Project Using TM Tool Manager 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 tENESAS The Development Process SKP16C26 Board 1 Write programs User RAM using text editor i Monitor RAM 5 Correct errors amp repeat process User Flash Monitor Flash I O Connector 2 Tool Manager automates compile amp link a SS Host PC USB y LA 4 Debugging info Editor iE ey 3 KD30 sends the machine sent back amp ony Enos code to the SKP16C26 during he y downloads and uses the symbols for source level debugging Tool Managery Build commana Absolute file i x30 Start Tool Manager Microsoft Office Tools RENESAS TOOLS Flash OverUSBY200 son Handheld eL Technical Support Sheet Sony yal EDSOY 3 20 Release 16 F 2 Th Help MSY SU262 ShP Ti TM Users Manual Startup Utilities cal Adobe Illustrator 10 4
5. ew 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 Step 1 A project i made Specify Target MCU Project name Working directory f E 4 made project iz kept with the specified project name in the working 2 z E nter the name O the project directory CG 3 Target chip Project name Tuto r2 j Tutora a MTEC Family l l a 3 For the working directory JESMTOOLRTAMTEC25SKPXS browse your machine or enter CAMTOOLISKP16C26 Sample_Code tutor2 4 Click on Next Back Lancel 1 You must click here to select the Target Chip Select M16C Family 11 tENESAS Open a New Project in Tool Manager 1 Select C Project 2 Click on Next tENESAS Selecting Startup Files New Project Step Compiler 1 Select the compiler Specify a compiler package to use with the project GG KN C30WA V2001 3 Compiler package RNE S 42007 T T 2 Select Custom and browse RN a oa until you find ncrt0_tutor2 a30 f Custom CAMTOOLAR TA M16C26 SKP4S ample _Codetul at i n C M TOO L S KP 1 6C26 Sample_code tutor2 Specify a linker script file f 4 default linker script file is used Custom E 3 Leave the default setting as is lt Back Hest gt Cancel 4 Click on Next Note A discuss
6. ion on the differences between default startup program and custom SKP startup program will follow after creating the new project 13 tENESAS Dpen a New Project in Tool This completes the setup of the new project New Project Step Finish Target Chip Project Name Working Directory Project Type Goal File Compiler Startup Program M160 Family Tutor CAM TOOLSATA MIBCZE SEPSS ample Code bite C language PROJECT CNM TOOLSATA MT6C26 SE PSS ample Code tute ENCIDAA 42007 customIC M TOOLSATA M16C26 SEPSS ample_C tENESAS Default and User 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 on user file Stack sizes Smaller 0x100 on user file default at 0x300 Heap size 0 no heap size on user file Vector Base Address 0xFF800 for M16C 26 on 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 on 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 t
7. ll 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 for the SKP e RTA FoUSB MON User s Manual Read this manual to understand how the ICD works 23 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 24 ENESAS
8. n the by all to view the tutor2 x30 output file EA Ancrt _tutor2 130 a Deperdancies E clean e ATutor2 30 2 Command z 2 Click to highlight tutor2 x30 Ready 2 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 17 tENESAS Adding Source amp Header Files After adding the main_tutor2 c source file the Project Editor should look like the like the figure below Click on this icon to check for dependencies header files mA ProjectE ditor Tutor C MTOOL ATA M16C26 SEKP S ample ode tutor2 T utor pax File View Project Help abel xila Bal sal all Dl adi Tutora 30 E E FH ATutor cmd BES Aneti tutor r30 J Dependencies BES Aman tutors r30 p Tutor cmd EA Astr 26 130 EA Ancrt _tutor2 r30 Fre clean CA Amain_tutor2 r30 CA Ast 26 130 ds Command 2 LN ESODINCMODJAE LALIST 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 ATutor2 emd i EA AmertO_tutor2 r30 a ES Amain tutor r30 m Amain_tutor2 c Sou rce and pus ED Acommontskp_bsp
9. o make the necessary modifications The customized startup files for the SKP can be found under C MTOOL SKP16C26 Sample_Code Startup_files directory 15 tENESAS 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 ncrt0_original a30 and sect30_original inc respectively 4 Copy ncrt0_26skp a30 and sect30_26skp inc from C AMTOOL SKP16C26 Sample_Code Startup Files directory 5 Rename ncrt0_26skp a30 to ncrt0 a30 Do NOT rename sect30_26skp inc iY 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 26 ensure that you review these files when you use a different MCU or create a new project 16 tENESAS Adding Source amp Header Files 3 Add the source files main_tutor2 c and sfr_26 a30 by clicking on Add File icon main_tutor2 c in C MTOOL SKP16C26 Sample_Code tutor2 sfr_26 a30 in C MTOOL SKP16C26 Sample_Code Common fa ProjectE ditor lt T ator2 CAMTOOLARTA M16C26 5KP Sample_Codettutor24 Tutor M E3 File LO ca al Sf all Se Tutor x30 cl 2 ATutor2 crnd View Project Hs 1 Click o
10. rogramming 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 SKP16C26 Board as hardware 7 tENESAS 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 a Main_tutor2 c controls the processing b Sfr262 h header file for the M16C 26 Special Function Registers SFR c NcrtO_tutor2 a30 amp sect30_tutor2 inc startup files for our C program d Sfr 26 a30 label file for the M16C 26 SFR s so the labels are displayed on KD30 s memory window 8 tENESAS 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 Coan 5 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 tENESAS Open a New Project in Tool Manager Start a n

Download Pdf Manuals

image

Related Search

Related Contents

KOMA Elektronik BD101 User Manual  Voir la notice  Samsung DVD-P191 Manual de Usuario  取扱説明書 三菱電機ビル空調 フリープランシステム 室内ユニット  LC-16-1 E/V/G LC-20-1 E/V/G  WIDE DYNAMIC RANGE CAMERA Smartec  Précautions Standard: 2 précautions sous la loupe en EMS  簡易取扱説明書  PJ5KPS - RVR Elettronica SpA Documentation Server  ディーアーツ ロックマン 取扱説明書 259.5 KB  

Copyright © All rights reserved.
Failed to retrieve file