CodeWarriorV软件使用指南

合集下载

codewarrior快速使用手册

codewarrior快速使用手册

CodeWarrior™ Development Studiofor Microcontrollers V6.x Quick StartSYSTEM REQUIREMENTSHardware PC with 1 GHz Intel® Pentium® compatibleprocessor512 MB of RAM (1 GB recommended)CD-ROM driveDepending on host-target connection: ParallelPort, 9-pin Serial Port, or USB PortOperating System Microsoft® Windows® XP orMicrosoft Windows Vista® Operating Systems32-bit (Home Premium Edition and BusinessEdition)Disk Space 2 GB total400MB on Windows system diskThis Quick Start explains how to install the CodeWarrior Development Studio for Microcontrollers V6.x software, and how to use the IDE to create, build, and debug a project.NOTE You must install the CodeWarrior software on the equipment on which you intend to use the software.1.Insert CodeWarrior Development Studio CD into CD-ROM drive —CW Auto Install beginsNOTE If Auto Install does not start, run launch.exe, which is located in the root directory of the CD.The CodeWarrior software may be part of a DVD included withyour kit. In this case, click Install CodeWarrior DevelopmentStudio for Microcontrollers, follow the on-screen instructions,and skip to step "Check for updates".2.Follow setup program's on-screen instructionsNOTE Special Edition: The Special Edition license is automatically installed with your product and you do not need to register it.This license allows you to develop projects with unlimitedassembly code, up to 32KB of C code for HC(S)08/RS08derivatives and up to 64KB of C code for ColdFire V1derivatives.NOTE Evaluation Edition: The Evaluation license is automatically installed with your product and you do not need to register it.This license allows you to develop projects as ProfessionalEdition within the 30-day evaluation period. After 30 days, thelicense works as Special Edition license (free permanent, butfeature limited) which supports unlimited assembly code, up to32KB of C code for HC(S)08/RS08 derivatives and up to 64KBof C code for ColdFire V1 derivatives.1.Create a projecta.Select Start > Programs > Freescale CodeWarrior >CW forMicrocontrollers V6.x > CodeWarrior IDE — IDE starts and displaysstartup dialog box.Startup Dialog Boxb.Select Create New Project — the Microcontrollers New Project Deviceand Connection dialog box appears.NOTE This section of the quick start demonstrates using the New Project Wizard. We use an MC68HC908GZ60target as anexample.c.Expand HC08 and GZ Family and select MC68HC908GZ60 derivative. NOTE If your MCU is missing from the list, download a service pack for that device at /codewarrior/downloads.Device and Connection Dialog Boxd.Select Full Chip Simulation as your default connection.e.Click Next — the Project Parameters dialog box appears.Project Parameters Dialog Boxf.In Project name text box, the IDE supplies a default project name. Entera project name of your choice.NOTE The IDE automatically creates a folder with the same name in specified location. The IDE automatically adds .mcp extensionwhen it creates project.g.In Location text box enter location to store project, click Set to browse tofolder locationh.Select C as language to be supported by project.NOTE You can click Finish to accept defaults for remaining options.i.Click Next — the Add Additional Files dialog box appears.This dialog box lets you browse folders and add or remove files to or fromthe project.Add Additional Files Dialog Boxj.Click Next — the Processor Expert dialog box appears.This dialog box let you specify whether you want your project configuredto use Device Initialization or Processor Expert.Processor Expert Dialog Boxk.Select the None option button.l.Click Next — the C/C++ Options dialog box appears.This dialog box allows you to specify C/C++ Options.C/C++ Options Dialog Boxm.Select ANSI startup code as code, the New Project Wizard will place in your project as startup code.n.Select Small as memory model to use.o.Select None for floating point format to support.p.Click Finish — the IDE creates your project according to your specifications; Project window appears, docked at left side of mainwindow.Project WindowNOTE To undock project window, double-click the double gray lines.To re-dock window, right click in title tab and select Docked.2.Select connectionFor this example, we specified Full Chip Simulation (FCS).a.To change MCU and connection, select Project >Change MCUConnection.b.Make sure Full Chip Simulation is selected in drop-down list.3.Edit source codea.Double click main.c in Sources folder — the Editor window opensdisplaying contents of file.main.c in Editor Windowb.Make changes to contents of main.c file, if desired.c.From the IDE main menu bar, select File > Save — the IDE saveschanges.4.Add files if appropriatea.In the project window, select a folder.b.From IDE main menu bar, select Project > Add Files.The Select files to add dialog box appears.c.Navigate to the directory that contains file you want to add.d.Select the filename of file you want to add to project.e.Click Open — the Project Messages window appear indicating accesspath has been added to target, if the path is new to the project.f.In the project window, filename of the added file appears under theselected folder.5.Build projecta.From IDE main menu bar, select Project > Make — the IDE builds(assembles, compiles, and links) project; Error & Warnings windowopens showing any error messages and warning messages1.Start debuggera.Click on project window title bar to ensures that window is active projectb.From main menu bar, select Project > Make.c.From main menu bar, select Project > Debug — the True-TimeSimulator & Real-Time Debugger window opens.True-Time Simulator & Real-Time Debugger WindowNOTE The Source and Assembly panes display the main.c program and code.2.Set breakpointa.Point at a C statement in Source window and right-click — the Sourcecontext menu appears.b.Select Set Breakpoint — a permanent breakpoint mark is set.3.Run applicationa.From the True-Time Simulator & Real-Time Debugger window, selectRun — the Run menu appears.b.Select Start/Continue or click on Start/Continue icon — theProgram executes till the first breakpoint; Command pane displaysprogram statusDebugger Simulator Command Pane4.Click the Start/Continu e icon — the simulator resumes programexecution.5.Click the Halt icon — the Simulator stops program execution.6.From the True-Time Simulator & Real-Time Debugger windowtoolbar, select File > Exit to exit the debugger.7.From IDE main Window toolbar, select File > Exit to exit theCodeWarrior IDE.Congratulations!You have successfully created, built, and run an HC08 application with the CodeWarrior for Microcontrollers V6.xsoftware!Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. CodeWarrior is a trademark or registered trademark of Freescale Semiconductor, Inc. in the United States and/or other countries. PROCESSOR EXPERT and EMBEDDED BEANS are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners.Copyright © 2009 Freescale Semiconductor, Inc. All rights reserved.Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document.Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals”, must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part.How to Contact UsCorporate Headquarters Freescale Semiconductor, Inc. 6501 William Cannon Drive West Austin, Texas 78735U.S.A.World Wide Web /codewarrior Technical Support /supportRevised: 24 September 2009。

CodeWarriorV.软件使用指南

CodeWarriorV.软件使用指南

CodeWarriorV.软件使⽤指南Code Warrior 软件使⽤指南⼀、软件安装指南⼆、关于BDM驱动三、创建⼀个新的⼯程四、编写与运⾏你的程序2011年10⽉16⽇陈万忠Code Warrior 软件使⽤指南⼀、软件安装指南1. 打开⽂件安装⽂件夹2. 找到安装⽂件3. 双击此⽂件,出现安装界⾯:4. 点击“NEXT”按钮,出现安装路径信息。

如果修改系统默认路径,点击“change”按钮,然后修改安装路径,否则点击“NEXT”按钮。

5. 在安装过程中,根据提⽰信息,完成每⼀步的安装。

6. 安装完毕后,在所有程序中找到Code Warrior 执⾏⽂件,点击执⾏即可进⼊Code Warrior 集成环境。

7. 也可以拖到桌⾯上。

此时桌⾯出现如下图标:⼆、关于BDM驱动请将“BDM使⽤说明和驱动”⽂件夹下的⽂件:和以及三个⽂件,复制到:C:\Program Files\Freescale\\Prog\gdi⽬录下(或者你安装时修改过的Code Warrior 所在⽬录\Prog\gdi⼦⽬录下),在调试时选择Open Source BDM 调试接⼝即可。

三、创建⼀个新的⼯程创建⼀个新的⼯程,要按照下⾯向导选项的8个步骤来选择完成。

双击桌⾯快捷图标,进⼊ Code Warrior集成开发环境窗⼝。

第⼀步:创建⼀个新的⼯程。

第⼆步:选择CPU类型,选择HCS12X⽬录下的HCS12X Family。

第三步:选择CPU芯⽚型号和BDM⼯具TBDML。

第四步:选择编程语⾔,我们选择C语⾔编程。

第五步:添加⽂件到⼯程,⼀般直接按“下⼀步”。

第六步:快速开发应⽤程序选择,选None。

第七步:选择中的⽤户⾃定义模式。

第⼋步:选择不使⽤PC-Lint(TM)链接⼯具软件,点击“完成”按钮,Code Warrior集成开发环境就会⾃动⽣成整个⼯程的⽂件系统。

四、编写与运⾏你的程序在Code Warrior集成开发环境中,利⽤其⾃动⽣成的函数模板,就可以编写和调试你的应⽤程序了。

codewarrior v10.x快速指南

codewarrior v10.x快速指南

Quick Startfor Microcontrollers V10.1CodeWarrior Development Studiofor Microcontrollers V10.x Quick StartSYSTEM REQUIREMENTSHardware Windows® OS: PC with 1 GHz Intel® Pentium®compatible processorLinux® OS: 1.8 GHz Intel Pentium class processor(or better)2GB of RAMCD-ROM driveDepending on host-target connection: ParallelPort, 9-pin Serial Port, or USB PortOperating System Microsoft® Windows XP 32-bit and 64-bit(Professional Edition),Microsoft Windows Vista® 32-bit and 64-bit (HomePremium Edition and Business Edition), orMicrosoft Windows 7 32-bit and 64-bit (HomePremium Edition and Professional Edition)Red Hat Enterprise Edition 5.2Disk Space 2 GB total400MB on Windows system diskThis Quick Start explains how to install the CodeWarrior Development Studio for Microcontrollers V10.x software on Windows and Linux operating systems, and how to use the CodeWarrior IDE to create, build, and debug a project.NOTE This section describes how to download and installCodeWarrior for Microcontrollers V10.x from the Web or installit from the CD. The Web version has a time-bombed license.NOTE Special Edition: The Special Edition license is automatically installed with your product and you do not need to register it.This license allows you to develop projects with unlimitedassembly code, up to 32KB of C code for HC(S)08/RS08derivatives, up to 64KB of C code for ColdFire V1 derivativesand up to 128 KB of C code for ColdFire V2-V4 derivatives. NOTE Evaluation Edition: The Evaluation Edition license isautomatically installed with your product and you do not needto register it. This license allows you to develop projects asProfessional Edition within the 30-day evaluation period. After30 days, the license works as Special Edition license (freepermanent, but feature limited) which supports unlimitedassembly code, up to 32KB of C code for HC(S)08/RS08derivatives, up to 64KB of C code for ColdFire V1 derivativesand up to 128 KB of C code for ColdFire V2-V4 derivatives. NOTE CodeWarrior Eclipse usage on a Microsoft® Windows Vista® or Microsoft Windows 7 system:Administrator rights are required to install CodeWarriorsoftware on Microsoft Windows Vista and Microsoft Windows 7systems, since the installer copies files into the System andProgram Files folders.The default CodeWarrior installation folder is C:\ProgramFiles\Freescale CodeWarrior\CW MCU v10.1. Toprotect against malware, Windows Vista and Windows 7 do notallow normal processes to change files in the Program Filesfolder; therefore, you must have administrator rights to installand run CodeWarrior software from this location. If you will berunning CodeWarrior software with a non-administratve useraccount, then you need to install CodeWarrior software inanother folder (e.g., C:\Freescale CodeWarrior\CW MCUv10.1).Your project workspace needs to be setup in any folder thatyou can fully access.1.Download CodeWarrior software from the Weba.Go to /cwmcu10 — the CodeWarrior forMicrocontrollers v10.x Product Summary page appears.b.Click the Downloads tab — the page displays separate downloads forthe Windows and Linux operatings systems.c.Click Download next to the required Microcontrollers V10.x download.You will be directed to the Freescale log-in page if you are not logged inalready.d.Enter your user name and password and click Log in.NOTE If you are not a registered user, click Register Now and follow the on-screen instructions.e. A dialog box appears asking you to save the installer file. The extensionof the installer file is .exe for Windows and .tar for Linux.f.Specify the location where you want to save the installer file.2.Install CodeWarrior software downloaded from WebWindows OSa.When the download finishes on the Windows host computer, navigate tothe CodeWarrior installer EXE file you have downloaded, double-click theEXE file — the install wizard appears.b.Follow the wizard instructions to install the CodeWarrior software.When software installation is finished, wizard displays the installationcomplete page.c.Check the Display Start Here page checkbox and click Finish to close thewizard.d.The start here page appears in your default browser. The page gives youinformation about the different documents, such as getting started, userguides, application notes, and cheat sheets available in the product. NOTE CodeWarrior Eclipse usage on a Linux system:The CodeWarrior installer must be run from a root account.CodeWarrior service packs are installed with the EclipseUpdater. The updater must also be run from a root account. Tostart the Eclipse Updater select 'Window > Install newsoftware' in the menu.Eclipse needs read/write access to the installation folder. Makesure the eclipse installation folder has the appropriatepermissions for all users.Make sure your project workspace has read and writepermissions.If the CodeWarrior software does not restart automatically aftera successful CodeWarrior update operation, run ‘./cwide -clean' to launch the CodeWarrior software.Linux OSa.When download finishes on the Linux host computer, navigate to thefolder containing the CodeWarrior installer TAR file you havedownloaded.b.Right-click the TAR file and select Extract Here. The system extracts thecontents of the TAR file. A new folder appears next to the TAR file in thefile browser window; usually, the new folder's name is disk1.c.Open a new terminal window — the shell session starts.d.In the terminal window, log in as root or super user.e.Issue command: xhost +.f.Change working directory to the disk1 directory.g.Issue command: ./setuplinux — the install wizard starts; the welcomepage appears.h.Follow wizard instructions to install the CodeWarrior software.i.When software installation is finished, wizard displays the installationsummary page.NOTE Using P&E hardware via the USB port within the CodeWarrior software requires the Jungo USB drivers. During theCodewarrior software installation on a Linux operating system,it attempts to install the drivers automatically. However, if thedriver installation fails and a warning message is displayed,then please refer to the Readme.pdf found within[CodewarriorInstallDir]\Drivers\pemicro tomanually install the P&E drivers.j.Click Finish.3.Install CodeWarrior Software from CDa.Insert CodeWarrior Development Studio CD into CD-ROM drive — CWAuto Install begins.NOTE If Auto Install does not start, navigate to the CodeWarrior installer EXE file, double-click the EXE file — the install wizardappears.b.Follow the wizard instructions to install the CodeWarrior software.4.Restart your computer — operating system reboots which ensuresthat CodeWarrior IDE finds newly installed drivers.NOTE Before starting the CodeWarrior IDE in Linux, make sure that LD_LIBRARY_PATH is set to empty.1.Start CodeWarrior IDEa.For Windows, select Start > Programs > Freescale CodeWarrior > CWfor MCU v10.1 > CodeWarrior — the Workspace Launcher dialog boxappears.For Linux, open a new terminal window and change the working directory as shown below:CWInstallDir/eclipse/where, CWInstallDir is the directory in which you installed theCodeWarrior software.Issue command: ./cwide — the Workspace Launcher dialog boxappears.Workspace Launcher Dialog BoxNOTE If you want to store your projects in the default location, click OK and proceed to step 2, otherwise follow the steps givenbelow.b.Click Browse — the Select Workspace Directory dialog box appears.Select Workspace Directory Dialog Boxc.Select required folder or click Make New Folder to create a new folder forstoring your projects.d.Click OK — the Select Workspace Directory dialog box closes. NOTE Check the Use this as the default and do not ask again checkbox in the Workspace Launcher dialog box to set thechosen path as the default location for storing all your projects.e.Click OK — the CodeWarrior IDE launches and the Welcome pageappears.NOTE The Welcome page appears only if the CodeWarrior IDE or the selected Workspace is opened first time. Otherwise, theWorkbench window appears. Switch directly to step 2a if theWorkbench window appears.Welcome Pagef.In the Welcome Page, click Go to Workbench — the Workbenchwindow appears.Workbench Window2.Create new projecta.From the IDE menu bar, select File > New > Bareboard Project — theNew Bareboard Project wizard starts; the Create an MCU bareboardProject page appears.b.Enter Project_1 in the New Project Name field.Create an MCU bareboard Project PageNOTE The Location field shows the default project location. If you wish to change this location, clear the Use default locationcheckbox. Click Browse and use the subsequent dialog box tospecify a new location. Click OK. The Create an MCUbareboard Project page now shows new location.c.Click Next — the Devices page appears.d.Expand the tree control and select HCS08 > HCS08G Family >MC9S08GB32.Devices Pagee.Clcik Next — the Connections page appears.Connections Pagef.Select the desired connection.NOTE In the Connections page, you can select multiple connections at once.g.Click Next — the Add Files page appears.Add Files Pageh.Click Next — the Languages page appears.NOTE The page displayed may vary depending on the derivative or board selected. For example, if you select ColdFire V2 >MCF5221X > MCF52210 and click Next, the ColdFire BuildOptions page appears.i.Select the C language.Languages Pagej.Click Next — the C/C++ Options page appears.NOTE If you check only the Relocatable Assembly or Absolute Assembly checkbox and click Next, the Rapid ApplicationDevelopment page appears instead of the C/C++ Optionspage.C/C++ Options Pagek.Click Next — the Rapid Application Development page appears.Rapid Application Development Pagel.Select None from the Rapid Application Development options.m.Click Finish — the IDE creates the project.n.Select Project > Build Project from the IDE menu bar— the IDE builds the project. Expand the project directory in the CodeWarrior Projectsview to view the list of files and folders in the project.CodeWarrior Projects ViewNOTE To set Linker, Complier, and Assembler options for a project, select the project in the CodeWarrior Projects view and selectProject > Properties from the IDE menu bar. In theProperties dialog box that appears, select C/C++ Build >Settings. You can make the required settings in the ToolSettings tab page.1.Debug programa.From the IDE menu bar, select Run > Debug Configurations — theDebug Configurations dialog box appears.b.Expand the CodeWarrior Download tree control in the left pane andselect Project_1 - MC9S08GB32 - PnE Full Chip Simulator.Debug Configurations Dialog Boxc.Click the Debugger tab — the Debugger page opens in the right pane.Debug Configurations Dialog Box — Debugger Paged.Make the appropriate changes in the Debug tab.e.Click Apply to save the changes in the settings, if any.f.Click Debug — the debugger downloads program to simulator and theDebug Perspective appears. The execution halts at the first statement ofmain()and program counter icon on the marker bar points to the next statement to be executed.Debug Perspective2.Set and run to breakpointa.Double-click on the marker bar next to a statement — the breakpointindicator (blue dot) appears next to the statement.b.From the Debug view, click Resume — the debugger executes allstatements up to but not including the breakpoint statement.3.Control programa.From the Debug view, click Step Over — the debugger executesbreakpoint statement and halts at next statement.b.From the Debug view, click Resume — the simulator resumesprogram execution.c.From the Debug view, click Terminate — the debug session ends.4.Select File > Exit from the IDE menu bar to exit the CodeWarrior IDE.Congratulations!You have created, built, and debugged an Microcontrollers project using CodeWarrior for Microcontrollers V10.xsoftware!Freescale, the Freescale logo, CodeWarrior and ColdFire are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Flexis and Processor Expert are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners.© 2010–2011 Freescale Semiconductor, Inc. All rights reserved.Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document.Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals”, must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part.How to Contact UsCorporate Headquarters Freescale Semiconductor, Inc. 6501 William Cannon Drive West Austin, Texas 78735U.S.A.World Wide Web /codewarrior Technical Support /supportRevised:2 February 2011Freescale, the Freescale logo and CodeWarrior are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their respective owners.© 2010, 2011 Freescale Semiconductor, Inc.。

codewarrior使用指南

codewarrior使用指南
CodeWarrior 快速入门
1、安装 CodeWarrior 软件 安装 CodeWarrior 所需要的电脑的硬件资源如下,目前一般的电脑都可以满足这个要求。
16 位单片机的编程环境:CodeWarrior V4.6,V4.7,V5.0,V5.1 CodeWarrior V5.1 的下载链接: /lgfiles/devsuites/HC12/CW_HC12_v5.1_SPECIAL.exe 软件安装很简单,和其它软件的安装过程是一样的,按照默认的设置直接点击“下一步” 即可完成安装。 2、创建新工程(单片机以以 MC9S12XS128 为例,调试工具以 BDM 为例) 1) 点 击电 脑 左下 角 的 开始 菜 单, 开 始 >所 有 程 序>Freescale CodeWarrior> CodeWarrior development studio for S12(X) V5.0> CodeWarriorIDE。IDE 开始运行,出现下图 1 所示的窗口。
图11
图12 接下来给核心板供电,核心板的供电电压是 5V。有的 BDM 有 5V 供电模式,这个时候 直接用 BDM 供电就可以。 2)在新建的工程中键入如下代码 #include <hidef.h> #include "derivative.h" #define LEDCPU PORTK_PK4 #define LEDCPU_dir DDRK_DDRK4 void delay(void) { unsigned int i; for(i=0;i<50000;i++); } void main(void) { LEDCPU_dir=1; EnableInterrupts;
图8

codewarrior快速使用手册

codewarrior快速使用手册

CodeWarrior™ Development Studiofor Microcontrollers V6.x Quick StartSYSTEM REQUIREMENTSHardware PC with 1 GHz Intel® Pentium® compatibleprocessor512 MB of RAM (1 GB recommended)CD-ROM driveDepending on host-target connection: ParallelPort, 9-pin Serial Port, or USB PortOperating System Microsoft® Windows® XP orMicrosoft Windows Vista® Operating Systems32-bit (Home Premium Edition and BusinessEdition)Disk Space 2 GB total400MB on Windows system diskThis Quick Start explains how to install the CodeWarrior Development Studio for Microcontrollers V6.x software, and how to use the IDE to create, build, and debug a project.NOTE You must install the CodeWarrior software on the equipment on which you intend to use the software.1.Insert CodeWarrior Development Studio CD into CD-ROM drive —CW Auto Install beginsNOTE If Auto Install does not start, run launch.exe, which is located in the root directory of the CD.The CodeWarrior software may be part of a DVD included withyour kit. In this case, click Install CodeWarrior DevelopmentStudio for Microcontrollers, follow the on-screen instructions,and skip to step "Check for updates".2.Follow setup program's on-screen instructionsNOTE Special Edition: The Special Edition license is automatically installed with your product and you do not need to register it.This license allows you to develop projects with unlimitedassembly code, up to 32KB of C code for HC(S)08/RS08derivatives and up to 64KB of C code for ColdFire V1derivatives.NOTE Evaluation Edition: The Evaluation license is automatically installed with your product and you do not need to register it.This license allows you to develop projects as ProfessionalEdition within the 30-day evaluation period. After 30 days, thelicense works as Special Edition license (free permanent, butfeature limited) which supports unlimited assembly code, up to32KB of C code for HC(S)08/RS08 derivatives and up to 64KBof C code for ColdFire V1 derivatives.1.Create a projecta.Select Start > Programs > Freescale CodeWarrior >CW forMicrocontrollers V6.x > CodeWarrior IDE — IDE starts and displaysstartup dialog box.Startup Dialog Boxb.Select Create New Project — the Microcontrollers New Project Deviceand Connection dialog box appears.NOTE This section of the quick start demonstrates using the New Project Wizard. We use an MC68HC908GZ60target as anexample.c.Expand HC08 and GZ Family and select MC68HC908GZ60 derivative. NOTE If your MCU is missing from the list, download a service pack for that device at /codewarrior/downloads.Device and Connection Dialog Boxd.Select Full Chip Simulation as your default connection.e.Click Next — the Project Parameters dialog box appears.Project Parameters Dialog Boxf.In Project name text box, the IDE supplies a default project name. Entera project name of your choice.NOTE The IDE automatically creates a folder with the same name in specified location. The IDE automatically adds .mcp extensionwhen it creates project.g.In Location text box enter location to store project, click Set to browse tofolder locationh.Select C as language to be supported by project.NOTE You can click Finish to accept defaults for remaining options.i.Click Next — the Add Additional Files dialog box appears.This dialog box lets you browse folders and add or remove files to or fromthe project.Add Additional Files Dialog Boxj.Click Next — the Processor Expert dialog box appears.This dialog box let you specify whether you want your project configuredto use Device Initialization or Processor Expert.Processor Expert Dialog Boxk.Select the None option button.l.Click Next — the C/C++ Options dialog box appears.This dialog box allows you to specify C/C++ Options.C/C++ Options Dialog Boxm.Select ANSI startup code as code, the New Project Wizard will place in your project as startup code.n.Select Small as memory model to use.o.Select None for floating point format to support.p.Click Finish — the IDE creates your project according to your specifications; Project window appears, docked at left side of mainwindow.Project WindowNOTE To undock project window, double-click the double gray lines.To re-dock window, right click in title tab and select Docked.2.Select connectionFor this example, we specified Full Chip Simulation (FCS).a.To change MCU and connection, select Project >Change MCUConnection.b.Make sure Full Chip Simulation is selected in drop-down list.3.Edit source codea.Double click main.c in Sources folder — the Editor window opensdisplaying contents of file.main.c in Editor Windowb.Make changes to contents of main.c file, if desired.c.From the IDE main menu bar, select File > Save — the IDE saveschanges.4.Add files if appropriatea.In the project window, select a folder.b.From IDE main menu bar, select Project > Add Files.The Select files to add dialog box appears.c.Navigate to the directory that contains file you want to add.d.Select the filename of file you want to add to project.e.Click Open — the Project Messages window appear indicating accesspath has been added to target, if the path is new to the project.f.In the project window, filename of the added file appears under theselected folder.5.Build projecta.From IDE main menu bar, select Project > Make — the IDE builds(assembles, compiles, and links) project; Error & Warnings windowopens showing any error messages and warning messages1.Start debuggera.Click on project window title bar to ensures that window is active projectb.From main menu bar, select Project > Make.c.From main menu bar, select Project > Debug — the True-TimeSimulator & Real-Time Debugger window opens.True-Time Simulator & Real-Time Debugger WindowNOTE The Source and Assembly panes display the main.c program and code.2.Set breakpointa.Point at a C statement in Source window and right-click — the Sourcecontext menu appears.b.Select Set Breakpoint — a permanent breakpoint mark is set.3.Run applicationa.From the True-Time Simulator & Real-Time Debugger window, selectRun — the Run menu appears.b.Select Start/Continue or click on Start/Continue icon — theProgram executes till the first breakpoint; Command pane displaysprogram statusDebugger Simulator Command Pane4.Click the Start/Continu e icon — the simulator resumes programexecution.5.Click the Halt icon — the Simulator stops program execution.6.From the True-Time Simulator & Real-Time Debugger windowtoolbar, select File > Exit to exit the debugger.7.From IDE main Window toolbar, select File > Exit to exit theCodeWarrior IDE.Congratulations!You have successfully created, built, and run an HC08 application with the CodeWarrior for Microcontrollers V6.xsoftware!Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. CodeWarrior is a trademark or registered trademark of Freescale Semiconductor, Inc. in the United States and/or other countries. PROCESSOR EXPERT and EMBEDDED BEANS are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners.Copyright © 2009 Freescale Semiconductor, Inc. All rights reserved.Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document.Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including “Typicals”, must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part.How to Contact UsCorporate Headquarters Freescale Semiconductor, Inc. 6501 William Cannon Drive West Austin, Texas 78735U.S.A.World Wide Web /codewarrior Technical Support /supportRevised: 24 September 2009。

codewarrior的使用

codewarrior的使用

第六章CodeWarrior的软件开发环境6.3 打开工程在主菜单下选择File/Open。

如图6-2图6-2 打开工程菜单弹出对话框图6-3,在“对象类型”中选择“Project Files(*.mcp)”。

图6-3 工程对象类型出现图6-4,选择要打开的工程,然后点击“打开”,就可以打开一个工程。

图6-4 工程对象名称如果想要修改程序,在图6-5界面可以完成。

图6-5用户工程文件窗口此时,如果想要编译连接和在线调试程序,参考6.5和6.6。

6.4 创建项目从主菜单栏选择File\New。

出现一个新的窗口如图6-6所示。

注意: 新窗口可能和你的屏幕不相同,取决于你的安装对象。

图6-6新建工程单击Project标签显示项目面板。

选择HC(S)08 New Project Wizard。

在Project name 输入框,输入新项目的名称。

在Location输入框,确定你想保存的文件的路径。

注意:当IDE创建一个项目时,会自动在项目文件中添加扩展名为.MCP的工程文件。

点击确定,出现新项目对话框如图6-7所示。

在Page1中,选择你所使用的芯片的类型。

图6-7 选择芯片类型在Page2中,选择使用语言的种类,如图6-8所示图6-8 选择编程语言在Page3种选择使用相对汇编还是绝对汇编,如图6-9所示。

图6-9 选择汇编方式在Page4中进行方式选择,如图6-10所示。

图6-10选择调试模式P&E Full Chip Simulation方式允许芯片及其外围设备进行在线调试,或者是利用软件进行模拟时采用这种方式。

P&E Hardware Debugging 方式是当HC08与外围设备硬件接口是通过P&E提供的时候,就得采用这种方式。

MMDS-MMEVS 方式是指目标界面与MMDS-MMEVS 仿真系统连接,使用Motosil 协议是多使用的方式。

上述三种是比较常用的几种的方式,如果不确定的时候,可以把三种方式都选上,这样会把连接变得更简单。

【最新资料】CodeWarriorforARMDeveloperSuite的使用方法

【最新资料】CodeWarriorforARMDeveloperSuite的使用方法

CodeWarrior for ARM Developer Suite v1.2安装及使用简称ADS 1.2 .它支持ARM10之前的所有ARM 系列微控制器,支持软件调试及JTAG硬件仿真,支持汇编,c和c++源程序, 下载1、安装:按照提示安装即可。

安装完成后,提示出现 "ARM License Wizard" 对话框,选择 "Install License",然后在 "License File To Be Installed" 中使用 "Browse",选择 CRACK 目录下的 license.dat 文件即可。

2、调试。

它具有单步,断点,全速等调试功能。

可以观察变量、寄存器、内存等。

2.1、建立工程,启动CodeWarrior for ARM Developer Suite v1.2。

图一点击 File --〉New图二如上图:大家会问。

怎么和我的不一样啊!对了!我的模板是后添加上去的。

我们要用到的工程模板需要添加。

添加方法:下载模板/tools/开发板/EasyARM2100.asp 。

解压,放在安装软件目录下。

如ADS1.2安装在C盘下。

就把工程模板文件(5个)拷贝到C:\ProgramFile\ARM\ADSV1.2\Stationery 下即可。

点击 File --〉 New弹出建立工程对话框,选择ARM Executable Image for IPC22XX。

在Location下选择存放工程的目录。

这个你爱放哪就放哪,就是不能放在有中文的路径下。

一定要记得。

2.2、建立文件。

点击 File --〉 New,弹出建立工程时的对话框(还是图二那个窗口),如果你想直接添加到哪个文件夹下,你就点一下那个文件夹,然后在点击点击 File --〉 New,图三图二File选项卡,同样在右边写入你的文件名。

文件名一定是.S或者.C文件。

CodeWarrior介绍(自己整理)

CodeWarrior介绍(自己整理)

写给CodeWarrior初学者1.运行CodeWarrior IDE,打开软件界面;2.点击“File”菜单下的“New”选项,然后在“Project”选项卡中选择“HC(S)12 New Project Wizard”,也就是新建工程向导,在右侧输入你要键入的工程名和你要放在哪个文件夹下面;3.点击“确定”后下面选择你采用的单片机型号,比如你选择“MC9S12D64”或者“MC9S12NE64”;(其中如果选择MC9S12NE64,则必须安装光盘上的NE64补丁插件)4.点击“下一步”后,选择你采用哪种编程语言,尽量不要选第三个“C++”,因为好像我试的有问题,如果你单纯的C,则选择第二个,如果你是C和汇编混合编程,则前两个都要选的;5.选择是否采用“处理器专家”,该项功能可以方便程序的寄存器设置,但我用过感觉比较糊涂,所以我一般选择“No”;6.下面就是选择是否采用“PC-lint”,选择“No”;7.选择是不是支持浮点数,如果你的工程采用浮点数则选择下面的两个中一个,否则选择“No”;8.选择采用哪种内存定位模式,一般选择第一个“Small”模式9.最后一步,选择前面两项,如果仅选择第一项,则仅可以软件调试,前两项都选择可以支持软件和硬件调试。

10.完成后,软件会自动创建一个工程,如下图所示,,其中左侧的sources 文件夹下面的main.c就是你的主程序文件,你可以在里面添加代码,同时在左侧按鼠标右键,会弹出菜单,里面有“Add Files”或“Create Group”等,可以根据你的需要往新创建的工程里添加你自己的头文件或者C文件。

11.你可以在main.c里面编辑你的代码,如果需要加入中断,则在左侧找到Prm文件夹下面打开“P&E_ICD_Linker.prm”,然后在右侧该文件里你可以加入你自己的中断函数和中断向量入口地址,记住:你在这个Prm里定义的自己的中断函数名,要和主函数里面的中断函数名对应起来;比如我在Prm文件里定义了串口接收中断:VECTOR ADDRESS 0XFFD6 SCI0Recive_ISR则在主函数(main.c)里面这样引用该中断函数:interrupt void SCI0Recive_ISR(void){里面是你自己的代码}12.现在一个简单的工程基本创建完成,点击下面的编译按钮进行或者调试按钮就进入调试环境13.如果您点击调试(绿色类似箭头按钮)的时候没反应,那可能是您设置的Debug 路径有问题,如果您采用我的方法,比如CW3.0仅安装了Compiler,然后安装了CW4的Debugger,这样的话就要设置一下Debug的路径。

CodeWarrior操作步骤

CodeWarrior操作步骤

CodeWarrior操作步骤建立Workspace1.打开CodeWarrior2.在目录下建立Workspace(注意工程不要建在桌面,在此为示范请勿效仿)3.建立新项目4.输入项目名称→Next5.选择您使用的芯片型号→Next6.选择编译器类型7.选择编译语言8.选择是否使用PE工具和视图工具9.代码优化选择10.配置完成,点击Finish工程各项配置1. 时钟配置。

用户根据自己需求选择内外时钟及时钟大小2. 功能模块配置。

用户根据自己需求选择功能模块。

eg.IO 配置3.4. 各个功能模块配置好后,进行程序编写5. 主函数在ProcessorExperience.c 中6. 事件和中断等处理函数编写在Events.c 中Main 函数中的for 或while 循环从此出开始写,不然在更新PE 配置是程序被擦除触摸按键编写1.先将触摸按键库的5个文件添加进工程项目Sources中2.将触摸库添加到工程项目中。

右键点击Properties,进行一下设置。

3.更改触摸库TSI_config.c文件设置第一步:根据项目需要增加和减少使用到的TSI 通道。

在TSI_config.c文件中,TSI_TOUCH _DELTA[MAX_TSI_NUM]数组定义了每个按键出发的阈值,分别对应TSI 物理通道的0-15,当某个按键触摸前后的差值大于该Delta 值时,就会触发对应的通道事件。

如果不需要使用某个通道时,可以直接把对应的Delta 值配置为0,那么在代码中该通道就不会被Initial, calibrate 和scan,如果重新启用,只需Delta 值配置为非0 即可。

第二步:配置按键号与物理通道之间的映射关系。

如下二维数组中,左侧TSI_x是实际的TSI 物理通道,右侧KEY_1,2…N 对应着按键号0~N-1,这个按键号和TSI_main函数的返回值touched_key相对应,0xFF 表示未启用。

CodeWarrior V10.1 使用方法快速入门

CodeWarrior V10.1 使用方法快速入门

CodeWarrior V10.1 使用方法快速入门CodeWarrior V10.1 Quick Start Guide1.启动CodeWarrior。

如果是首次启动该软件,需要设定一个工作空间。

选定工作空间后,如果是第一次运行CodeWarrior,则首先进入“欢迎”界面,点击该界面左上角“×”按钮,关闭该界面后即进入“C/C++项目”编程界面。

2.新建工程:在工具栏中选择 “文件->新建->BareBoard Project”,如图1所示。

图11)设定文件名在缺省状态下,该新建工程将保存在当前工作空间的文件夹下。

完成后点击“下一步”,如图2所示。

图22)选择芯片类型。

此处以MK10N512VMD100为例。

选择好芯片类型后,点击“下一步”,如图3所示。

图33)选择调试器类型(可多选)如果成功安装了新的USBBDM并且patch成功,此处会出现USBDM选项,如图4所示。

如果要在该工程中添加一些已有文件、或者希望生成一个默认的main.c文件,则完成后点击“下一步”。

如无上述需求,则直接点击“完成”。

此时将生成一个包含Startup Code、但不含main.c 的新工程。

图44)选择导入的默认文件以及是否生成main.c,完成后点击“下一步”。

CodeWarrior的默认编程语言是C,也支持C++和汇编,如果使用C语言编程,此处也可直接单击“完成”,具体操作如图5所示。

图55)选择编程语言,完成后点击“下一步”,如图6所示。

图66)选择是否需要调用一些快速开发工具(如Processor Expert、Device Initialization),完成后点击“完成”,如图7所示。

图7至此,CodeWarrior将为您生成一个包含Startup.c和main.c的新工程。

在编程界面(C/C++项目)下的工程窗口下,您可以浏览该工程含有的全部文件。

如果您无法找到上述窗口,可在CodeWarrior界面左下角的视图管理器中寻找。

CodeWarriorV.软件使用指南

CodeWarriorV.软件使用指南

Code Warrior 软件使用指南一、软件安装指南二、关于BDM驱动三、创建一个新的工程四、编写与运行你的程序2011年10月16日陈万忠Code Warrior 软件使用指南一、软件安装指南1. 打开文件安装文件夹2. 找到安装文件3. 双击此文件,出现安装界面:4. 点击“NEXT”按钮,出现安装路径信息。

如果修改系统默认路径,点击“change”按钮,然后修改安装路径,否则点击“NEXT”按钮。

5. 在安装过程中,根据提示信息,完成每一步的安装。

6. 安装完毕后,在所有程序中找到Code Warrior 执行文件,点击执行即可进入Code Warrior 集成环境。

7. 也可以拖到桌面上。

此时桌面出现如下图标:二、关于BDM驱动请将“BDM使用说明和驱动”文件夹下的文件:和以及三个文件,复制到:C:\Program Files\Freescale\\Prog\gdi目录下(或者你安装时修改过的Code Warrior 所在目录\Prog\gdi子目录下),在调试时选择Open Source BDM 调试接口即可。

三、创建一个新的工程创建一个新的工程,要按照下面向导选项的8个步骤来选择完成。

双击桌面快捷图标,进入 Code Warrior集成开发环境窗口。

第一步:创建一个新的工程。

第二步:选择CPU类型,选择HCS12X目录下的HCS12X Family。

第三步:选择CPU芯片型号和BDM工具TBDML。

第四步:选择编程语言,我们选择C语言编程。

第五步:添加文件到工程,一般直接按“下一步”。

第六步:快速开发应用程序选择,选None。

第七步:选择中的用户自定义模式。

第八步:选择不使用PC-Lint(TM)链接工具软件,点击“完成”按钮,Code Warrior集成开发环境就会自动生成整个工程的文件系统。

四、编写与运行你的程序在Code Warrior集成开发环境中,利用其自动生成的函数模板,就可以编写和调试你的应用程序了。

1.Freescale CodeWarrior 简要使用说明

1.Freescale CodeWarrior 简要使用说明

Freescale CodeWarrior 使用说明在智能车竞赛中,我们主要使用Freescale公司提供的CodeWarrior软件开发环境对单片机进行编程,在应用中,我们使用的是CodeWarrior4.7或CodeWarrior5.0的版本,在这里以CodeWarrior5.0为例,给大家说明CodeWarrior软件的一些使用说明。

点击桌面或开始菜单中的CodeWarrior IDE的图标,就可以进入CodeWarrior集成开发环境,具体结果如图一所示。

图一我们点击Startup中的第一个选项”Create New Project”,来新建工程。

之后进入向导菜单,如图二所示图二智能车使用的MC9S12XS128单片机作为主控芯片,所以我们在器件中选择相应的芯片,同时,在智能车校赛过程中,大家都是使用学校提供的BDM作为下载区,所以在Connections 中选择TBDML。

然后点击下一步。

下一步界面如图三所示图三在这一界面中,我们首先选择编程的语言,我们主要使用C语言进行编程,所以我们需要选中C的复选框,同时我们还需要在project name和location中对我们工程的名称和路径进行设定,这里我们给出的例子的工程名为SMARTCAR,路径在D盘根目录,这里每个人都可以根据喜好自由设定,然后点击下一步。

之后的界面如图四所示图四在这里,我们可以将一些已经编写好的文件纳入到工程中,这里由于我们是建立一个空白的全新的工程,所以,我们跳过此步,直接点击下一步。

之后的界面如图五所示图五这里我们不进行修改,直接点击下一步。

下一步菜单如图六所示,这里我们对C或C++语言进行一些设置。

图六在实际使用中,我们主要对第三项”Select the floating point format supported”进行修改,默认选择了”None”,这样我们在编程中就无法使用浮点数”float”,这是非常不方便的。

CodeWarrior使用说明

CodeWarrior使用说明

CodeWarrior使⽤说明第⼀章: 认识CodeWarrior第⼆章: ⼯程和⽬标⽂件的显⽰和定制第三章: 编译第四章: 链接第五章: 调试第六章: 定制第七章: 库函数和Microsoft Foundation Classes (MFC)1). CodeWarrior 能做些什么?A).使⽤C/C++ 进⾏编程B).也⽀持Java 开发本课程仅限于应⽤C/C++ 语⾔在Windows 平台上使⽤CodeWarrior 进⾏的开发.2). CodeWarrior 优点是什么?CodeWarrior 能够⾃动地检查代码中的明显错误,它通过⼀个集成的调试器和编辑器来扫描你的代码,以找到并减少明显的错误,然后编译并链接程序以便计算机能够理解并执⾏你的程序.3).常⽤编程类型说明:A).应⽤程序(如:⽂本编辑器WordPad )B). 庞⼤的商业软(如:⽐如象Adobe Photoshop,MicrosoftWord,CodeWarrior…)C). 控制⾯板(control panels)<实际上是设置系统功能的⼀个简单界⾯,⽐如可以在控制⾯板中完成.如:设置⾳量和⿏标移动速度这样⼀些参数.>D). 动态链接库(dynamic linked libraries,DLLs)<提供⼀些很有⽤的被系统和应⽤程序共享的函数.通常它们没有⽤户界⾯.>E). 插件(plug-ins)<类似于DLLs,插件也是可供其它软件使⽤的⼩程序,但插件只能被特定的软件使⽤.>4).CodeWarrior⼯具条介绍: 4.1).⽂件菜单: 4.2).编辑菜单4.3).查看菜单4.4).查找菜单4.5).⼯程菜单4.6).调试菜单4.8).窗⼝菜单4.9).帮助菜单4.7).VCS 菜单5).CodeWarrior 集成开发环境的设置5.1).通⽤设置5.5.1).编译设置(Build Settings): 选择是否在执⾏编译之前保存已打开的源⽂件,以及有多少内存被⽤于编译⼯作;5.5.2).IDE 之外(IDE Extras): ⼏个独⽴的设置.⽐如指定CodeWarrior 是否使⽤⼀个第三⽅的⽂本编辑器——因为集成的编辑器并不是很完美,这可以通过指定⼀个你惯⽤的编辑器来替代它;5.5.3).插件设置(Plug-In Settings): 供插件开发商调试他们的插件;5.5.4).隐藏⽂件夹(Shielded Folders): 在这⾥指定的⽂件夹在⼯程设计期间,或执⾏查找和⽐较操作期间,将要被忽略掉.如果在你的⼯程级有⼀个巨⼤的“数据”⽂件⽬录,⽽你⼜不想让这些⽂件降低CodeWarrior 的操作速度时,这个设置就很管⽤了;5.5.5).资料树(Source Trees): ⽤于指定CodeWarrior 在编译程序时⽤不着的⽬录.5.2).编辑器设置5.2.1).编辑器设置(Editor Settings): ⼏个⽤于定制编辑器显⽰、管理⽂本和窗⼝的设置项;5.2.2).字体和制表符(Fonts and Tabs): 设置编辑器中的⽂本⼤⼩、字体、制表符和其它显⽰设置;5.2.3).⽂本颜⾊(Text Colors): ⽤于指定特定语⾔元素(⽐如程序的注释)在编辑窗⼝中的显⽰的颜⾊。

CodeWarrior使用指南

CodeWarrior使用指南
用于在 CodeWarrior 环境管理窗口显示方式的菜单。 帮助菜单
4
PDF 文件使用 "FinePrint pdfFactory Pro" 试用版本创建
通过帮助菜单可以到网上寻求关于 CodeWarrior 任何问题的在线解答。够酷 的吧?
了解 CodeWarrior 集成开发环境的设置 CodeWarrior IDE 提供了许多设置以便让你定制你的工作环境。当你选择了
3
PDF 文件使用 "FinePrint pdfFactory Pro" 试用版本创建
图 1-2: 查看菜单中的工具条子菜单 查找菜单
查找菜单用于在单个文件或硬盘的目录中查找指定的代码。你可以使用它来 方便地替换文本块或在你的代码中搜索指定的项目。即使是在小工程中使用这个 工具也非常方便。
调试器设置
• 显示设置(Display Settings): 几个用于定制调试器显示的设置项; • 视窗化(Windowing): 设定调试器如何管理它的窗口(比如隐藏所有打开
的编辑器窗口); • 全局设置(Global Settings): 几个用于定制调试器在全局层次如何工作
的设置。比如当一个包含了程序调试信息的文件被打开时,是否启动这个 程序; • 远程连接(Remote Connections): 允许通过 TCP/IP 进行远程调试。这 样,你就可以在地球的另一边调试你的软件了; • Java 设置/Java 调试(Java Settings/Java Debugging): 允许你设置 特定的 Java 编程语言选项。本课程不涉及这部分内容。
件,以及有多少内存被用于编译工作; • IDE 之外(IDE Extras): 几个独立的设置。比如指定 CodeWarrior 是否

CodeWarrior V10 快速入门

CodeWarrior V10 快速入门

CodeWarrior V10.1 使用方法快速入门CodeWarrior V10.1 Quick Start Guide1.启动CodeWarrior。

如果是首次启动该软件,需要设定一个工作空间。

选定工作空间后,如果是第一次运行CodeWarrior,则首先进入“欢迎”界面,点击该界面左上角“×”按钮,关闭该界面后即进入“C/C++项目”编程界面。

2.新建工程:在工具栏中选择 “文件->新建->BareBoard Project”,如图1所示。

图11)设定文件名在缺省状态下,该新建工程将保存在当前工作空间的文件夹下。

完成后点击“下一步”,如图2所示。

图22)选择芯片类型。

此处以MK10N512VMD100为例。

选择好芯片类型后,点击“下一步”,如图3所示。

图33)选择调试器类型(可多选)如果成功安装了新的USBBDM并且patch成功,此处会出现USBDM选项,如图4所示。

如果要在该工程中添加一些已有文件、或者希望生成一个默认的main.c文件,则完成后点击“下一步”。

如无上述需求,则直接点击“完成”。

此时将生成一个包含Startup Code、但不含main.c 的新工程。

图44)选择导入的默认文件以及是否生成main.c,完成后点击“下一步”。

CodeWarrior的默认编程语言是C,也支持C++和汇编,如果使用C语言编程,此处也可直接单击“完成”,具体操作如图5所示。

图55)选择编程语言,完成后点击“下一步”,如图6所示。

图66)选择是否需要调用一些快速开发工具(如Processor Expert、Device Initialization),完成后点击“完成”,如图7所示。

图7至此,CodeWarrior将为您生成一个包含Startup.c和main.c的新工程。

在编程界面(C/C++项目)下的工程窗口下,您可以浏览该工程含有的全部文件。

如果您无法找到上述窗口,可在CodeWarrior界面左下角的视图管理器中寻找。

codeWarrior 3.1 for HC08 使用指南V1.0

codeWarrior 3.1 for HC08 使用指南V1.0

Codewarrior 3.1 for HC08使用指南V1.0编者:老木QQ:54170265laomu-room@2006年01月05日小序编者从事单片机开发工作至今已经有两年多了,先后用过51、A VR、华邦、PIC等单片机。

一年前因工作需要接触了摩托罗拉的单片机,一开始遇到了很多难题,归其原因,一是摩托罗拉的单片机结构指令、开发环境等与以往的51、PIC、A VR等都不太一样;二是由于国内使用摩托片子的还比较少,遇到了问题很难找到高人的指点,而且网上的资料基本上又都是E文,这让编者着实头疼了一阵,还好摩托的FAE还是比较认真热心的,给了笔者很多帮助,在此对Freescale的FAE们表示感谢!一年多下来,总算有了些心得体会。

新的一年开始了,编者的窝窝也开始建设装潢了,编者结合一些资料整理了这篇说明文档,以供初学者参考,同时,因本人能力有限,难免有不正确之处,还请网友们批评指正。

笔者今后还将在网上不断增加一些使用的心得,提供一些例程到供初学者参考!祝各位网友新年快乐!Codewarrior 3.1使用指南:本说明文挡以MC68HC908JL8_SDIP32型号单片机为例,说明如何使用Codewarrior 3.1软件新建一个简单的工程文件,编译以及如何将编译生成的目标文件下载到目标板的MCU:一、新建一个工程项目:1、启动Codewarrior IDE 3.1:图12、点击工具栏图标或菜单FILE—>NEW新建一个工程项目:图23、选择“HC(S)08 New Project Wizard”项,在Project name中输入项目名(如图3)按“确定”按钮;或者点击在“Location”右侧的按钮以设置所建项目的路径,并输入文件名(如图4),点击“保存”按钮。

图3图44、选择所使用的单片机型号:图5 5、选择编程语言:图6 6、选择是否使用处理器专家,此处不使用:图7 7、点击“下一步”:图8 8、点击“下一步”:图9 9、点击“下一步”:图10 10、选择存储模式,点击“下一步”:图11 11、选择连接方式:图12 点“完成”:图1313、到此为止,一个名为“MC68HC908-TEST”的项目就建立完成了(如图14):图14二、下载程序到目标板单片机:1、点击编译按钮进行编译(如图15-16):图15图16 2、点击按钮下载程序到目标板(如图17):图17选择PEDebug|Mode:Full Chip Simulation|In-Circuit Debug/Programming:图18点击(如图19)开始下载程序到目标板:图19图20当出现如下画面(图21)表示下载完成,可以断开烧路连接:图21现在可以接通正常工作的电路来验证你的程序了,如果有问题完全可以修改程序后重新来一次,摩托罗拉的MCU是采用FLASH的,可反复擦除烧路,用起来非常方便!。

Codewarrior入门指导

Codewarrior入门指导

2 创建一个工程
下面 以 M68908GP32 的 C 语言 为 例 简 单 介 绍 在 CodeWarrior for Microcontrollers v6.1 集成开发环境中创建工程的方法,在其他版本中创建工程的方法基本相同。 1、打开 CodeWarrior 集成开发环境 安装 CodeWarrior 后点 击 桌 面 快 捷 方 式 图 标 或 选 择 “ 开始 > 程序 > Freescale CodeWarrior > CW for Microcontrollers V6.1 > CodeWarrior IDE” 打开 CodeWarrior 集成开发环境,如图 1-1 所示。
第4 页 共27页
CodeWarrior IDE 入门指导
图 1-3
微控制器新工程建立界面
3、点击下一步进入工程名称、存放路径、开发语言设置界面,输入工程名称、指定工程存 放路径、 选择相应的开发语言(可多选) , 如图 1- 4 所示。 图中工程名称为 “ Demo01.mcp”, 存放路径在“E\My Documents ”,选择的开发语言为 C,当然你也可以根据需要选择 “绝对 汇编(Absolute assembly) 、重定位汇编( Relocatable assembly )或 C++ ”作为开发语言。
第6 页 共27页
CodeWarrior IDE 入门指导
图 1-7
C/C++ 设置界面
7、点击下一步进入 PC-lint (TM)设置界面,如图 1-8 所示。 PC-lint (TM)是 Gimpel 软 件公司开发的程序调试工具,图中选择 “No”。
图 1-8
PC-lint (TM)设置界面

Codewarrior使用指南

Codewarrior使用指南

Codewarrior 使用指南飞思卡尔 HC08/HCS12 系列微控制器开发环境 - Codewarrior 使用指南(草稿)tyf01@ 2005 年 10 月仅供学习参考,请勿用于商业目的1Codewarrior 使用指南第一章 Codewarrior IDE 概述在软件开发过程中,通常需要经过以下几个步骤: • 新建:创建新项目,源文件 • 编辑:按照一定的规则编辑源代码,注释 • 编译:将源代码编译成机器码,同时还会检查语法错误和进行编译优化 • 链接:将编译后的独立的模块链接成一个二进制可执行文件 • 调试:对软件进行测试并发现错误 在软件开发中,每个过程都会用到不同的工具。

如果每个工具都单独存在,这样就 会给开发人员带来很多不便。

所以很多公司为开发人员提供了集成开发环境。

开发 人员可以在同一个工具或平台上完成以上全部的工作。

Codewarrior 是 Metrowerks 公司开发的软件集成开发环境(以后简称 IDE)。

飞思 卡尔所有系列的微控制器都可以在 codewarrior IDE 下进行软件开发。

Codewarrior IDE 特点Codewarrior IDE 为软件开发提供了一系列的工具,其中包括: 项目管理器:为软件开发人员管理上层的文件;将项目进行分组管理,比如文件或 目标系统;跟踪状态信息,比如修改日期;决定编译顺序或每次编译应包括哪些文 件;与插件一起提供版本控制功能 编辑器:利用颜色来区分不同的关键字;允许用户利用颜色机制自定义关键字;自 动检查括号范围;利用菜单在不同的文件或函数中导航 搜索器:搜索一个特定的字符串;用特定的字符串代替查找到的字符串;允许使用 常规表达式;提供文件比较功能; 源代码浏览器:标志符(变量名称,函数名称)数据库;利用数据库来对代码快速 定位;对所有的标志符连接到用到它的代码中; 编译系统:编译器将源代码编译成机器码;链接器将目标文件链接成可执行文件 调试器:利用标志符数据库进行源代码级调试;支持各种标志符数据库,比如: codeview, DWARF, SYM 等Codewarrior IDE 优点•交叉平台开发2Codewarrior 使用指南 开发人员可以在不同的操作系统下使用 codewarrior IDE 来开发自己的软 件。

Codewarrior使用指南

Codewarrior使用指南

创建新工程 6
9、是否添加Startup Code 10、选择Memory类型 11、选择是否使用浮点数及 类型
Slide 8
TM
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2005.
创建新工程 5
8、选择是否用设置初始化或处理器专家
Slide 7
TM
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2005.
模拟调试器界面
工具条
打开文件 单步 进入 单步 跳出 停止 复位
保存当前 设置
运行 单步跳过
汇编单步
Slide 15
TM
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2005.

Coder Warrior for RVDS 使用手册

Coder Warrior for RVDS 使用手册

2、在工程中添加源文件
• (1)在工程管理窗口中,右键单击选择 “Create group”命令,命名group,如图:
• (2)点击OK按钮创建group,右键单击生 成的文件夹选Add Files…命令。
• (3)点击打开按钮,添加选中的文件,添 将生成调试信息; Release:将不生成调试信息。
• (3)点击确定按钮后,可在文本编辑框中 编写代码。
4、配置工程
• (1)执行Edit/Release setting…Target setting默认设置如下:
• (2)Language Settings 汇编器和编译器 arm类别选择ARM926EJ-S,其他默认。
• (2)Linker设置,Output选项的linktype选 中scattered
Coder Warrior for RVDS 使用手册
version 2.2 叶凤麟
概要
RVDS的全称为:RealView Developer Suite, 是ARM公司推出的新一代ARM集成开发环境, 支持所有系列的ARM核,并与众多第三方实时 操作系统及工具商合作简化开发流程。
1、建立新工程
• (3)fromELF设置,Output format选择 Plain binary
5、编译与链接
• 执行Project/Make菜单命令,或按快捷键 F7,进行编译,信息提示框中出现提示信 息,双击错误信息,系统自动指向错误出 错的语句。
• (1)运行CodeWarrior for RVDS ,打开
Metrowerks CodeWarrior工作界面如下:
• (2)执行File/New…新建一个可执行镜像 工程,并命名工程名。
• (3)点击Location后面的set按钮,浏览想 要保存的路径并保存。
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Code Warrior V5.1软件使用指南
一、软件安装指南
二、关于BDM驱动
三、创建一个新的工程
四、编写与运行你的程序
2011年10月16日陈万忠
Code Warrior V5.1软件使用指南
一、软件安装指南
1. 打开文件安装文件夹
2. 找到安装文件
3. 双击此文件,出现安装界面:
4. 点击“NEXT”按钮,出现安装路径信息。

如果修改系统默认路径,点击“change”按钮,然后修改安装路径,否则点击“NEXT”按钮。

5. 在安装过程中,根据提示信息,完成每一步的安装。

6. 安装完毕后,在所有程序中找到Code Warrior V5.1执行文件,点击执行即可进入Code Warrior V5.1集成环境。

7. 也可以拖到桌面上。

此时桌面出现如下图标:
二、关于BDM驱动
请将“BDM使用说明和驱动”文件夹下的文件:
OpenSourceBDM.dll 和
tblcf.dll以及
tblcf_gdi.dll 三个文件,复制到:
C:\Program Files\Freescale\CWS12v5.1\Prog\gdi目录下(或者你安装时修改过的Code Warrior V5.1所在目录\Prog\gdi子目录下),在调试时选择Open Source BDM 调试接口即可。

三、创建一个新的工程
创建一个新的工程,要按照下面向导选项的8个步骤来选择完成。

双击桌面快捷图标,进入 Code Warrior集成开发环境窗口。

第一步:创建一个新的工程。

第二步:选择CPU类型,选择HCS12X目录下的HCS12X Family。

第三步:选择CPU芯片型号和BDM工具TBDML。

第四步:选择编程语言,我们选择C语言编程。

第五步:添加文件到工程,一般直接按“下一步”。

第六步:快速开发应用程序选择,选None。

第七步:选择V5.0中的用户自定义模式。

第八步:选择不使用PC-Lint(TM)链接工具软件,点击“完成”按钮,
Code Warrior集成开发环境就会自动生成整个工程的文件系统。

四、编写与运行你的程序
在Code Warrior集成开发环境中,利用其自动生成的main.c函数模板,就可以编写和调试你的应用程序了。

例如,最简单的程序,试着在main.c函数模板上添加两条语句:
PORTB=0XAA;//让接在B口上的8个LED间隔点亮
DDRB=0XFF //B口8个引脚全部设为输出
单击“编译”按钮,如果有错误,会指出错误类型和位置,可修改后重新编译;如果没有错误,单击“运行”按钮就会弹出仿真和实时调试窗口,由于选择了TBDML调试方式,程序会在单击运行后,被自动下载到单片机中。

其他的实验程序,请试着自主设计完成。

I/O口输出程序
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
延时子程序:
void delay(void)
{ unsigned int i,j;
for(i=0;i<100;i++)
for(j=0;j<10000;) j++;
}
主程序:
void main(void) {
DDRB=0xFF;
PORTB=0xaa;
for(;;){
delay();
PORTB=~PORTB; 隔位点亮程序
}
}。

PORTB>>=1; 右移点亮程序
PORTB|=0x80; //或运算,保证其中只有一位是0; if(PORTB==0xFF){
PORTB=0x7F;
}。

相关文档
最新文档