<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="Module.2003-12-10.4517">
  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Code Composer Studio Tutorial</name>
  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:bib="http://bibtexml.sf.net/">1.3</md:version>
  <md:created xmlns:bib="http://bibtexml.sf.net/">2003/12/10 15:45:17 US/Central</md:created>
  <md:revised xmlns:bib="http://bibtexml.sf.net/">2004/02/13 13:54:21.555 US/Central</md:revised>
  <md:authorlist xmlns:bib="http://bibtexml.sf.net/">
    <md:author xmlns:bib="http://bibtexml.sf.net/" id="deaniafe">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Deania</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">M.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Fernandez</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">deaniafe@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="jpfrantz">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Patrick</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Frantz</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">jpfrantz@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="deaniafe">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Deania</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">M.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Fernandez</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">deaniafe@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">Code Composer Studio</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">tutorial</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">elec 424</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:bib="http://bibtexml.sf.net/">A brief tutorial on how to get started using Code Composer Studio.</md:abstract>
</metadata>

  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="introduction">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Introduction</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="intro1">
This is a brief tutorial over Code Composer Studio which is a programming environment used to implement various algorithms and load code onto a DSP.  If you would like a more in-depth tutorial, please feel free to click on <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Help --&gt;Tutorial</term> in Code Composer.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="StartingCCC">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Starting Code Composer Studio</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="startccc1">
Before starting, it would be a good idea to create a folder where you will be saving your project files.  Label the folder <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">ELEC424_Tutorial</term>.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="startccc0">
To open Code Composer Studio in a Windows 2000 system, click on <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Start</term> and select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Programs --&gt; Texas Instruments --&gt; Code Composer Studio DSK Tools 2 (‘C2000) --&gt; Code Composer Studio</term>.
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig2">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SelectingCodeComposer.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="startccc2">
You should see the following screen:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig3">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="CodeComposerWorkEnvironment.jpg"/>
</figure>
</section>


<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="creatingfile">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Creating a File</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createfile1">
To create a new source code file, click on <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">File --&gt; Source File</term>.  A window titled ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Untitled1</term>’ will appear within the Composer environment:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig5">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="CreatingANewFile.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createfile2">
You can double-click on the ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Untitled1</term>’ window to make it larger.  
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createfile3">
To save your file, click on <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">File --&gt; Save</term>.  The following prompt will appear:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig6">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SavingAFilePrompt.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createfile4">
There are several <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Save as type…</term> options.  Choose the appropriate one for your code.  It will give your file the proper file extension.  It is also lets the linker know when you compile your code what kind of language the file is written in.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createfile5">
When you are done, click <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Save</term>.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="creatingproject">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Creating a New Project</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createproject1">
After you have finished creating the files you need to run on the DSP, you will now want to create a project that will include all the files.  Select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Project --&gt; New…</term>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createproject2">
The following prompt will appear:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig7">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ProjectCreationDialog.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createproject3">
Fill in the project name in <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Project Name</term>.  Browse to the folder you created for the project in <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Location</term>.  Make sure you select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Executable (.out)</term> in <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Project Type</term>, and select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">TMS320C28XX</term> in <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Target</term>.  When you are done, click <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Finish</term>.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="createproject4">
<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Example.pjt</term> will appear in the left-hand side of the Composer environment.  Click on the ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">+</term>’ to expand the project:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" orient="horizontal" id="horfig1">
<subfigure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="subfig1">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="BeforeExpandingProject.jpg"/>
<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Before expanding project</caption>
</subfigure>
<subfigure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="subfig2">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="AfterExpandingProject.jpg"/>
<caption xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">After expanding project</caption>
</subfigure>
</figure>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="addingfiles">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Adding New Files to the Project</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="addfiles1">
In order to add new files, select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Project --&gt; Add Files to Project…</term>   The following prompt will appear:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig8">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="AddingFilesPrompt.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="addfiles2">
Select the file you want to add.  To make it easier, you can narrow your search of a particular file by choosing which type of file you want in the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Files of type…</term>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="addfiles3">
When you are done, click <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Open</term>.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="addfiles4">
You should now see the file after clicking on the ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">+</term>’ in the left-hand window:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig9">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ExpandingSource.jpg"/>
</figure>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compilingfiles">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Compiling Files and Building Projects</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compfiles1">
Once you have added all the files you want to be included in your project, you will now need to build your project.  Select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Project --&gt; Rebuild All</term>.  You should see the following window at the bottom of the Code Composer Studio Environment:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig10">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="AfterCompilingWindow.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="compfiles2">
If there are errors in your code, they will be listed with the corresponding line numbers.  Correct them and rebuild your project.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="loadingprograms">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Loading/Reloading Programs</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="load1">
After your code has been successfully compiled and built, you must now load your program onto the DSP.  Select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">File --&gt; Load Program…</term> You will see the following prompt dialog:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig11">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/src" src="LoadProgramPrompt.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="load2">
When you rebuild your project, Code Composer Studio is set at default to create a new folder in your directory called <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Debug</term>.  This is where the executable file is created.  Double-click on the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Debug</term> folder and you should see your <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">*.out</term> file:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig12">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SelectingOutFilePrompt.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="load3">
After you select your file, click <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Open</term>.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="executing">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Executing, Halting, or Stopping Your Program</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="execute1">
To execute your program, select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Debug --&gt; Run</term> or press the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">F5</term> key:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig13">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SelectingDebugRun.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="execute2">
Your program will then begin to run.  You will see the following at the bottom left-hand corner of the Code Composer Studio environment:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig14">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="CPURunning.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="execute3">
To stop running your code, select Debug --&gt; Halt:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig15">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SelectingHaltCPU.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="execute14">
You should then see the following at the bottom left-hand corner of the work environment:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig16">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="CPUHalted.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="execute15">
To resume running your code, press the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">F5</term> button.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="debuggingcode">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Debugging Your Code</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="debug1">
Since there are few of us that can get our code working right the first time, you will probably have to debug your code.  To figure out what could be wrong, there are several methods you can use to break the problem down.
</para>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="setbreakpoints">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Setting Breakpoints</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="setbreak1">
To execute your code a little at a time or to stop it after a certain point, you can place breakpoints.  You can do this by placing the cursor on the line you want to set the breakpoint on, highlighting it by clicking once, and double-click.  You should see a solid red circle on the left:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig17">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SettingBreakpoint.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="setbreak2">
You can set as many as you like.  Rebuild and reload the program.  Execute it.  The DSP will stop at the first breakpoint.  To get to the next breakpoint, press the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">F5</term> button to run the DSP again.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="setbreak3">
To remove the breakpoint(s), place the cursor on the line, highlight it by clicking once, and double-click.  The solid red circle should disappear:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig18">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="RemovingBreakpoint.jpg"/>
</figure>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="watching">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Watching Variables</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="watch1">
To see what values your variables, constants, and/or registers are getting, you can view them in a watch window.  Select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">View --&gt; Watch Window</term>.  You should see the following appear in the Code Composer Studio environment:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig19">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="WatchWindows.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="watch2">
Click on the ‘Watch 1’ tab:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig20">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ClickOnWatchWindow.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="watch3">
To add a variable, double-click on the row under the ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Name</term>’ column:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig21">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SettingAWatchVariable.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="watch4">
Type in the name of the variable and press the <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Enter</term> key:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig22">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="EnteringAWatchVariable.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="watch5">
You can change the base of the value by clicking on the ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Radix</term>’ column and selecting how you want to view the value.
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig23">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ChangingBaseInWatchWindow.jpg"/>
</figure>
</section>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profiling">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Profiling Sessions</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profile1">
You can benchmark your code by profiling a session.  To do this, you can set one breakpoint at the line where you want the counter to start counting and another breakpoint at where to stop.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profile2">
Select <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Profiler --&gt; Start New Session…</term>  You will see the following dialog:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig24">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ProfileSesionNameDialog.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profile3">
Type in a name for your profile session and click <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">OK</term>.  
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profile4">
A window will appear at the bottom:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig25">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ProfileWindow.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profile5">
To profile a function, you need to add it to the profile session you just created.  Double-click on the file you want to do this in, and place the cursor on any line inside the function and right click.  Choose <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Profile Function --&gt; in (session-name) Session</term>.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="profile6">
Execute the code.  When the CPU stops, click on the ‘<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Functions</term>’ tab to see the result of the profiling.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="counting">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Counting Clock Cycles</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="count1">
If you just want to count the cycles and do not need all the stats from profiling, you can just view the clock.  Select<term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Profiler --&gt; View Clock</term>:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig26">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="SelectingViewClock.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="count2">
The following window should appear at the bottom:
</para>

<figure xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="fig27">
<media xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" type="image/jpg" src="ClockWindow.jpg"/>
</figure>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="count3">
After setting up your breakpoints, reset the PC to start at the beginning of your code by selecting <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Debug --&gt; Reset</term>.  Run your code.  Clear the clock by double-clicking on it, and then run it again.  The number of clock cycles will appear in the clock window.
</para>
</section>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="trouble">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Troubleshooting</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="trouble1">
If you are having any trouble, sometimes it is best to reset the CPU.  You can do this by selecting <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Debug --&gt; Restart CPU</term>.  You will have to reload the program.
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="trouble2">
Another option is to simply quit Code Composer Studio by selecting <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">File --&gt; Quit</term> and restart the application.
</para>
</section>






   
 
  </content>
  
</document>
