Module 02
Module 02
Module 02
32-Bit-DSP-Microcontroller
TMS320F2812
Texas Instruments Incorporated
European Customer Training Center
University of Applied Sciences Zwickau (FH)
2-1
Code Composer Studio® IDE
Menus or Icons Help CPU
Project Manager: Window
Source & object files
File dependencies
Compiler, Assembler
& Linker build options
Productive Editor:
Structure Expansion Status Watch window Graph
window Memory window
window
2-2
Code Composer Studio
Build SIM
Compile lnk.cmd Probe In
eZdsp™
Asm Link Debug
EVM
DSP/BIOS
Edit DSP/BIOS Probe Out
Config Third
Libraries Graphs
Tool Party
Profiling
XDS
• Code Composer Studio includes:
– Integrated Edit/Debug GUI
– Code Generation Tools DSP
– DSP/BIOS
Board
2-3
Code Composer Studio: IDE
2-4
The CCS Project
Project (.pjt) files contain:
2-5
Build Options GUI - Compiler
2-6
Build Options GUI - Linker
2-7
Default Build Configurations
• For new projects, CCS automatically
creates two build configurations:
– Debug (unoptimized)
– Release (optimized)
• Use the drop-down menu to quickly
select the build configuration
2-8
eZdsp™ F2812 Hardware
JTAG Interface (P1) EXPANSION SRAM
Data & Address (P2) 64K x 16
Parallel Port/
JTAG
Controller
Interface (P3)
25 pin male
D-sub connector
(Plugs into parallel
port on PC)
25 Conductor Cable
eZdsp F2812
25 pin male
D-sub connector
Power
Supply
8 x switch
8 x LED
1 CAN - Transceiver ( TJA 1054 )
1 Loudspeaker
2 x push- button
2 potentiometers 1 SCI - Transceiver (MAX
232)
eZdsp F2812 plus Zwickau Adapterboard
2 - 11
Learning by doing - Step by Step
2 - 12
1. The Startup - Window
Project-
tree
Working
Area
2 - 13
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 stores
all set-ups and options of the project. This is very useful for a version
management.
2 - 14
2. Create a F28x - project (cont.)
• 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 - 15
2. Create a F28x - project (cont.)
2 - 16
2. Create a F28x - project (cont.)
• Add your file to the project :
Project Add files to project
– Add: “lab1.c”
2 - 17
2. Create a F28x - project (cont.)
2 - 19
Placing Sections in Memory
Memory
0x00 0000
Sections
M0SARAM
(0x400)
.ebss
0x00 0400 M1SARAM
(0x400)
.stack
.text
2 - 20
Linking
Memory
Memorydescription
description
How to place s/w into h/w
How to place s/w into h/w
name.cmd
.map
2 - 21
Linker Command File
MEMORY
{
PAGE 0: /* Program Space */
FLASH: org = 0x3D8000, len = 0x20000
SECTIONS
{
.text: > FLASH PAGE 0
.ebss: > M0SARAM PAGE 1
.cinit: > FLASH PAGE 0
.stack: > M1SARAM PAGE 1
}
2 - 22
2. Create a F28x - project (cont.)
– 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.
Debug Go main
2 - 23
2. Create a F28x - project (cont.)
yellow arrow :
current PC
2 - 24
3. Debug your code !
• Perform a real time run :
Debug Run (F5)
Note 2: the yellow arrow is no longer visible – that’s another sign of a real time
run.
2 - 25
4. Watch your variables
• note : with the column ‘radix’ one can adjust the data format
between decimal, hexadecimal, binary etc.
2 - 26
4. Watch your variables
Watch-
Window
2 - 27
5. Perform a Single Step Debug
2 - 28
5. Perform a Single Step Debug
Source Single Step
Step Out
2 - 29
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 )
2 - 30
6. Adding a Breakpoint (cont. )
Toggle
Breakpoint
Remove all
Breakpoints
2 - 31
7. Set a Probe Point
• Causes an update of a particular window at a specific point in your
program.
• Run the program and verify that the watch window is updated
continuously.
2 - 32
7. Set a Probe Point (cont.)
2 - 33
8. Other View Commands
– double click on line ‘ACC’ and modify the value inside the Accumulator ACC
2 - 34
8. Other View Commands (cont.)
2 - 35
8. View C and Disassembly
Current
C - line
Current
Instruction
2 - 36
9. GEL - General Extension Language
• language similar to C
• lets you create functions to extend Code Composer's features
• to create GEL functions use the GEL grammar
• load GEL-files into Code Composer
2 - 37