DOC PREVIEW
UNCC ECGR 4101 - Creating A New Project Using TM

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Renesas Technology America Inc.SKP16C62PSKP16C62PTutorial 2Tutorial 2Creating A New Project Creating A New Project Using TMUsing TM2OverviewOverviewThis 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.3The Development ProcessThe Development ProcessNC30 CompilerNC30 CompilerAbsolute file“.x30”Absolute file“.x30”Project Barand ProjectEditorProject Barand ProjectEditorAS30 AssemblerAS30 AssemblerLN30 LinkerLN30 LinkerProject filesEditor(eg. Notepad)Editor(eg. Notepad)Options and SettingsTool ManagerBuild commandDebugSymbolsDebugSymbolsMachineCodeMachineCodeKD30 DebuggerBuilder: Error reportingBuilder: Error reporting.r30files.c.h.a30.incCorrect ErrorsUART1RAMFlashMonitor FlashUser FlashMonitor RAMUser RAMM16C/62P MCU3. KD30 sends the machine code to the SKP16C62P during downloads and uses the symbols for source level debugging1. Write programs using text editor5. Correct errors& repeat processHost PC2. Tool Manager automates compile & linkI/O ConnectorICDUSB4. Debugging info sent back & forthSIOSKP16C62PBoard4Start Tool ManagerStart Tool ManagerFrom the Windows Start menu, click onPrograms > Renesas-tools > TM V3.X > TM5Tool Manager Project BarTool Manager Project BarProject currently loadedStart new project wizardOpen project buttonTool register buttonTool Manager customize buttonMap Viewer buttonStart default editor buttonOpen project editor buttonBuild buttonHelp buttonRebuild buttonPartial build buttonRun debugger button6Steps in Creating a New ProgramSteps in Creating a New ProgramThe 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.1. Application and Method of Implementation2. Write the program3. Compile/link the program4. Debug the program15. Write program documentation1Note: 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.7Application and ImplementationApplication and ImplementationA 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, & 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 programming language to use, etc. Other factors suchas development time, cost, hardware, etc. also affect the way anapplication is implemented.We will implement our application with the following:a. C Programming Languageb. Peripherals - GPIO, Timersc. SKP16C62P Board as hardware8Write the ProgramWrite the ProgramAfter 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 processingb. Sfr62p.h – header file for the M16C/62P Special Function Registers (SFR)c. Ncrt0_tutor2.a30 & 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.9Build the ProgramBuild the ProgramNow 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.a. Open a new project in Tool Manager b. Selecting startup files1c. Add source codes and header filesd. Building (compile & link) the programe. Generate .mot files for ProgrammerNote 1. This step is only necessary when the program is written in C. Skip this step when the program is written/developed in Assembly.10Open a New Project in Tool ManagerOpen a New Project in Tool ManagerStart a new project by clicking on this icon.Note: You can also start a new project from the File menu of the Project Editor.11Open a New Project in Tool ManagerOpen a New Project in Tool Manager1. You must click here to select the Target Chip. Select “M16C Family”.2. Enter the name of the project, “Tutor2”.4. Click on “Next”3. For the working directory, browse your machine or enter “C:\MTOOL\SKP16C62P \Sample_Code\tutor2”12Open a New Project in Tool ManagerOpen a New Project in Tool Manager1. Select “C Project”2. Click on “Next”13Selecting Startup FilesSelecting Startup Files2. Select “Custom” and browse until you find “ncrt0_tutor2.a30” (in C:\MTOOL\SKP16C62P \Sample_code\tutor2).3. Leave the default setting as is.1. Select the compiler, “KNC30WA V2001”.Note: A discussion on the differences between default startup program and custom SKP startup program we used will follow after opening the new project.4. Click on “Next”.14Open a New Project in Tool ManagerOpen a New Project in Tool ManagerClick on “Finish”This completes the setup of the new project.15Default and Custom Startup FilesDefault and Custom Startup FilesExcept 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 BCLK – 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 – 0xFD000 for custom(M16C/62P) and 0xFFD00 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 _init routine.Sect30.inc Variable Vector Definition – Simplified and described in custom fileNote: 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.16Changing the Default Startup FilesChanging the Default Startup FilesAs you get accustomed to the way the custom startup files are setup, you may want to use these


View Full Document

UNCC ECGR 4101 - Creating A New Project Using TM

Documents in this Course
Load more
Download Creating A New Project Using TM
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Creating A New Project Using TM and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Creating A New Project Using TM 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?