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的路径。

  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;
}。

相关文档
最新文档