2 - 1 32-bit-dsp-microcontrollertms320f2812 texas instruments incorporated european customer...

12
2 - 2 - 1 32-Bit-DSP-Microcontroller 32-Bit-DSP-Microcontroller TMS320F2812 TMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH) Module 2 : Program Development Tools

Upload: maude-shields

Post on 14-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 11

32-Bit-DSP-Microcontroller32-Bit-DSP-MicrocontrollerTMS320F2812TMS320F2812

Texas Instruments Incorporated

European Customer Training Center

University of Applied Sciences Zwickau (FH)

Module 2 : Program Development Tools

Page 2: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 22

HelpHelp CPU CPU WindowWindow

Memory windowMemory windowGraph Graph windowwindow

Project Manager:Project Manager:Source & object filesSource & object filesFile dependenciesFile dependenciesCompiler, Assembler Compiler, Assembler & Linker build options& Linker build options

Status Status windowwindow

Full C/C++ & Assembly Full C/C++ & Assembly Debugging:Debugging:C & ASM SourceC & ASM SourceMixed modeMixed modeDisassembly (patch)Disassembly (patch)Set Break PointsSet Break PointsSet probe PointsSet probe Points

Watch windowWatch windowProductive Editor:Productive Editor:Structure ExpansionStructure Expansion

Menus or IconsMenus or Icons

Code Composer Studio® IDE

Page 3: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 33

Learning by doing - Step by Step

Code Composer Studio® - The Basics

1. The Start-up - Window2. Create a F28x - project, based on C language3. Debug your program4. Watch your variables5. Perform a Single Step Debug6. Use Breakpoints7. What is a Probe Point for ?8. Other View Commands

Page 4: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 44

2. Create a F28x - project

• Project ==> New give your project a name : “Lab1”, select a target and a suitable location of your hard disk:

Note : the project file (“Lab1.pjt) is a plain ASCII-text file and storesall set-ups and options of the project. This is very useful for a versionmanagement.

Page 5: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 55

• Write a C-Source Code :

File New Source File

unsigned int k;void main (void){unsigned int i;while(1)

{ for (i=0;i<100;i++)

k=i*i; }

}

2. Create a F28x - project (cont.)

File Save as : “lab1.c”

Page 6: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 66

2. Create a F28x - project (cont.)

• Add your file to the project : Project Add files to project– Add: “lab1.c”

• Compile your source code : Project Compile File – active window will be compiled– in the event of syntax errors : modify your source code as needed

• Add the C-runtime-library to your project : Project Build Options Linker Library Search Path :

c:\ti\c2000\cgtools\lib Project Build Options Linker Include Libraries :

rts2800_ml.lib

• Add the stack- size of 0x400 Project Build Options Linker Stack Size : 0x400

Page 7: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 77

Linking

LinkerLinker

namename.cmd.cmd

.map.map

.obj.obj .out.out

Memory descriptionMemory description How to place s/w into h/wHow to place s/w into h/w

Memory descriptionMemory description How to place s/w into h/wHow to place s/w into h/w

Page 8: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 88

2. Create a F28x - project (cont.)

• Load the binary code into the DSP :File Load Program Debug\Lab1.out

– Note: a new binary code can be downloaded automatically into the target. This is done by Option Customize Program Load Options Load Program after Build. This setup will be stored for permanently.

• Run the program until label “main”

Debug Go main

Page 9: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 99

5. Perform a Single Step Debug

• Perform a single step trough the program : Debug Step Into ( or F8 )

• Watch the current PC ( yellow arrow) and the numerical values of i and k in Watch Window while you single step through the code !

• There are more debug - commands available, see next slide

Page 10: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 1010

6. Adding a Breakpoint

• Set a Breakpoint :– Place the Cursor in Lab1.c on line : k = i * i;– Click right mouse and select ‘Toggle Breakpoint’– the line is marked with a red dot ( = active breakpoint )

Note : most Code Composer Studio Commands are also available through buttons or trough Command -Keys ( see manual, or help )

• Reset the Program Debug Reset CPU Debug Restart

• Perform a real time run Debug Run ( or F5)

• DSP stops when reaching an active breakpoint • repeat ‘Run’ and watch your variables• remove the breakpoint ( Toggle again) when you’re done.

Page 11: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 1111

Red dot :active

Breakpoint

Yellow arrow :Current PC

Toggle Breakpoint

Remove all Breakpoints

6. Adding a Breakpoint (cont. )

Page 12: 2 - 1 32-Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)

2 - 2 - 1212

7. Set a Probe Point

• Causes an update of a particular window at a specific point in your program.

• When a window is created it is updated at every breakpoint. However, you can change this so the window is updated only when the program reaches the connected Probe Point. When the window is updated, execution of the program is continued.

• To set a Probe - Point :– Click right mouse on the line ‘k = i*i;’ in the program first.c – select : ‘Toggle Probe Point ‘ ( indicated by a blue dot ) – select Debug Probe Points...– In the Probe Point Window click on the line ‘first.c line 13 -> no Connection’– in the ‘Connect to’ - selector select ‘Watch Window’– exit this dialog with the ‘Replace’ and ‘OK’ - Button

• Run the program and verify that the watch window is updated continuously.