Top Banner
Getting Started with Code Composer Studio v3.3 for TMS320F2812
39
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Getting started with code composer studio v3.3 for tms320 f2812

Getting Started with Code Composer Studio v3.3 for

TMS320F2812

Page 2: Getting started with code composer studio v3.3 for tms320 f2812

OBJECTIVE

To understand the basic features and functions to create and debug a project in CCS v3.3

To get familar with CCS v3.3More in-depth explanations of Code

Composer Studio’s various features .Ex: Breakpoints,watch window, single stepping,

memory etc..,Finally, you will able to work with CCS v3.3

Page 3: Getting started with code composer studio v3.3 for tms320 f2812

Introduction

Code Composer Studio is the Integrated Design Environment for the Texas Instruments DSP/DSC/MC. DSP – TMS320C6745DSC – TMS320F2812MC – MSP430F5529

Code Composer Studio is the environment for project development for all tools needed to build an application for the Specific Target.

Page 4: Getting started with code composer studio v3.3 for tms320 f2812

Contents at a Glance

Setting up a Target Create a projectBulid a ProjectRunning a projectBreakpointsSource steppingWatch window

Page 5: Getting started with code composer studio v3.3 for tms320 f2812

Launching The CCS v3.3

Click this icon shown on your desktop.

To launch Code Composer Studio IDE for the first time, configure Code Composer Studio for a specific target.

Page 6: Getting started with code composer studio v3.3 for tms320 f2812

Setting Up The Target

Double-click the Setup CCStudio icon on desktop.

Page 7: Getting started with code composer studio v3.3 for tms320 f2812

Target Information

In Family, Select C28xx.In platform, Select XDS 100 USB Emulator.In Endianness, Select little. Then Select F2812 XDS100 USB Emulator

factory board.Select Add.Select Save and Quit.

Page 8: Getting started with code composer studio v3.3 for tms320 f2812
Page 9: Getting started with code composer studio v3.3 for tms320 f2812
Page 10: Getting started with code composer studio v3.3 for tms320 f2812

Creating a New Project

Launch Code Composer Studio. From the CCStudio Project menu, choose New.

Page 11: Getting started with code composer studio v3.3 for tms320 f2812

Project Name : Type the project name.Location field : Type or browse to the folder where you want to save project By default, Project Type is set as Executable (.out) and Target is set as the current configuration of CCS.

Page 12: Getting started with code composer studio v3.3 for tms320 f2812

From the CCStudio File menu, choose New – Source File.

Page 13: Getting started with code composer studio v3.3 for tms320 f2812

Type the program in untitled window then , File – Save. The Save As dialog box will appear. Choose our project path and type practice.c – Click save.

Page 14: Getting started with code composer studio v3.3 for tms320 f2812

Add files to the project by choosing Add Files to Project from the Project menu. You can also right-click the project in the Project View window on the left and then select Add Files to Project.

Page 15: Getting started with code composer studio v3.3 for tms320 f2812

Add practice.c, DSP281x_GlobalVariableDefs.c, and F2812_EzDSP_RAM_lnk.cmd (this is a linker command file that maps sections to memory) from the folder you created.

Page 16: Getting started with code composer studio v3.3 for tms320 f2812

Project - Build Options.

In compiler tab – preprocessor - Include Search Path(-i) : C:\tidcs\c28\DSP281x\v120\DSP281x_headers\include - preprocessor path

Page 17: Getting started with code composer studio v3.3 for tms320 f2812

In linker tab, 1. Select Basic –

a. stack size(-stack): 0x400

2. Select Libraries – a. Search path(-i):

C:\CCStudio_v3.3\C2000\cgtools\lib

b. Incl Libraries(-l): rts2800_ml.lib

3. Click Ok.

Page 18: Getting started with code composer studio v3.3 for tms320 f2812

Now that you have created a functional program, you can build it. Use the Project - Rebuild All

The Rebuild All Command is mainly used to rebuild the project when the project options or any files in the project have changed.

Page 19: Getting started with code composer studio v3.3 for tms320 f2812

An output window will show the build process and status. When the build is finished, the output window will display Build complete 0 errors, 0 warnings.

Page 20: Getting started with code composer studio v3.3 for tms320 f2812

Connecting the Target

Note: Before doing this step be sure that power cable and usb cable has plugged.

After the program has been built successfully, connect the target by going to Debug - Connect.

The Target is now connected with code composer studio, at once the disassembly window will open. Status Displayed in status bar at the bottom of the CCStudio window.

Page 21: Getting started with code composer studio v3.3 for tms320 f2812
Page 22: Getting started with code composer studio v3.3 for tms320 f2812

Load the Project

After the Target has been connected successfully, load the program by going to File - Load Program. By default, CCS IDE will create a subdirectory called Debug within your project directory and store the .out file in it. Select practice.out and click Open to load the program.

File – Load Program – Debug – open – Practice.out – open.

Note: Remember to reload the program by choosing File - Reload Program if you rebuild the project after making changes.

Page 23: Getting started with code composer studio v3.3 for tms320 f2812
Page 24: Getting started with code composer studio v3.3 for tms320 f2812

Go Main

To begin execution of the Main function, Select, Debug – Go Main. The execution halts at the Main function and you

will notice the program counter (yellow arrow) in the left margin beside the function. This is called the selection margin.

Page 25: Getting started with code composer studio v3.3 for tms320 f2812
Page 26: Getting started with code composer studio v3.3 for tms320 f2812

BreakPoints

To set a breakpoint, place the cursor on the desired line and press F9 or by selecting the Toggle Breakpoint toolbar button.

When a breakpoint has been set, a red icon will appear in the selection margin. To remove the breakpoint, simply press F9 or the Toggle Breakpoint toolbar button again.

You can also open the Breakpoints Manager ( Debug – Breakpoints ) to view all the breakpoints, set new ones, or change the breakpoint action.

Page 27: Getting started with code composer studio v3.3 for tms320 f2812
Page 28: Getting started with code composer studio v3.3 for tms320 f2812

In practice.c, set a breakpoint at the line: k=i*i; As execution was halted at the main function(in go main step),

Select Debug – Run , you can press F5 , select the Run toolbar button to run the program.

Once execution reaches the breakpoint, it halts, as displayed in the status bar at the bottom of the CCStudio window.

After reached the breakpoint, it halts later you give run or Single stepping. Now we will see the source stepping to run further.

Page 29: Getting started with code composer studio v3.3 for tms320 f2812

Source Stepping

Source stepping is only possible when program execution has been halted. Since you halted at the breakpoint, you can now execute the program line by line using source stepping.

Page 30: Getting started with code composer studio v3.3 for tms320 f2812

Step into the while(1) Loop function by selecting the Source-Single Step button on the side toolbar. Step through a few times to observe the executions. The Step Over and Step Out functions are also available below the Single Step button.

Assembly stepping is also available. Whereas source stepping steps through the lines of code, assembly stepping steps through the assembly instructions.

Now we will see something about Watch Window, later we follow the execution of above example program, then we understand about breakpoints , source stepping and watch window together.

Page 31: Getting started with code composer studio v3.3 for tms320 f2812

Watch Window

In the debugging process, you should view the value of the variables to ensure that the function executes properly. Variables can be viewed in the watch window when the CPU has been halted.

The watch window can be opened by selecting View – Watch Window. The Watch Locals tab shows all the relevant variables in the current execution. Once the program reached breakpoint then , it halts.

Select , View – Watch Window., watch window box appear in ccs itself

Page 32: Getting started with code composer studio v3.3 for tms320 f2812
Page 33: Getting started with code composer studio v3.3 for tms320 f2812

As you continue to Step Into the while loop, the values of the variables change through each execution.

Example: As per our previous discussion, program execution reached breakpoint then it halts, we opened the watch window to viewing the varibles. Now the value of k is zero, then follow the below steps to understand breakpoint, source stepping and watch window.

Degug – run (or) click this icon Now see the watch window

Page 34: Getting started with code composer studio v3.3 for tms320 f2812
Page 35: Getting started with code composer studio v3.3 for tms320 f2812

Again Degug – run (or) click this icon Now see the watch window

Page 36: Getting started with code composer studio v3.3 for tms320 f2812

In addition, you can view the values of specific variables by hovering the mouse pointer over the variable or by placing the variables in the Watch1 tab.

Page 37: Getting started with code composer studio v3.3 for tms320 f2812

Output Window

The Output window is located at the bottom of the screen by default. It can also be accessed by View – Output Window. By default, the printf function displays the same Output window, showing information such as the contents of Stdout and the build log.

Page 38: Getting started with code composer studio v3.3 for tms320 f2812

Help

CCS provides many help tools through the Help menu. Select Help Contents to search by contents. Select Help Tutorial to access tutorials to guide you through the CCStudio development process.

Select Help Web Resources to obtain the most current help topics and other guidance. User manuals are PDF files that provide information on specific features or processes.

You can access updates and a number of optional plug-ins through Help Update Advisor.

Page 39: Getting started with code composer studio v3.3 for tms320 f2812

Presented byS.THIYAGARAJAN,Senior R & D Engg,Pantech Solutions,Chennai - 96

THANK YOU