Module 3: Program Development Tools: Digital Signal Controller TMS320F2833x
Module 3: Program Development Tools: Digital Signal Controller TMS320F2833x
3-1
Code Composer Studio
Menus or Icons Help CPU
Project Manager: Window
Source & object files
File dependencies
Compiler, Assembler
& Linker build options
Productive Editor:
Structure Expansion
eZdsp™
Asm Link Debug
Emulator
Editor Libraries Graphs,
(XDS100)
Profiling
MCU
Board
• Code Composer Studio includes:
– Integrated Edit/Debug Graphical User Interface
– Code Generation Tools
– Real – Time Operating System (DSP/BIOS)
3-3
Code Composer Studio: IDE
3-4
The Project - File
Project (.pjt) files contain:
3-5
Build Options GUI - Compiler
3-6
Build Options GUI - Linker
3-7
Default Build Configurations
3-8
Peripheral Explorer Board
3-9
F28335 Control Card
• Low cost single-board controllers
• perfect for initial development and small
volume system builds.
• Small form factor with standard 100-pin
DIMM interface
• F28x analog I/O, digital I/O, and JTAG
signals available at DIMM interface
• Isolated RS-232 interface
• Single 5V power supply required
• Versions:
• “Piccolo” F28027 (TMDXCNCD28027)
• “Piccolo” F28035 (TMDXCNCD28035)
• F28044 (TMDSCNCD28044)
• F2808 (TMDSCNCD2808)
• “Delfino” F28335 (TMDSCNCD28335)
• “Delfino” C28343 (TMDXCNCD28343)
3 - 10
Learning by doing - Step by Step
®
Code Composer Studio - The Basics
1. The Start - up – Window
2. Create a F2833x - project, based on C language
3. Debug your program
4. Watch your variables
5. Perform a Single Step Debug
6. Use Breakpoints
7. Real – Time – Debug
8. CPU Register Set
9. Memory Window
10. Graph Window
11. Mixed Mode Display
12. Assembly Single Step
13. GEL - General Extension Language
3 - 11
1. The Start up - Window
Project-
tree Workspace
3 - 12
2. Create a F2833x - project
Note : the project file (“Lab3.pjt”) is a simple ASCII-text file and stores
the set-up and options of the project. This is very useful for a
revision management.
3 - 13
2. Create a F2833x - project (cont.)
3 - 15
2. Create a F2833x - project (cont.)
C:\CCStudio_v3.3\C2000\cgtools\lib\rts2800_ml.lib
3 - 16
2. Create a F2833x - project (cont.)
C:\tidcs\c28\DSP2833x\v131\DSP2833x_common\cmd\28335_RAM_lnk.cmd
3 - 18
C – Compiler Sections
unsigned int k = 0;
void main(void)
{
unsigned int i; Local vars (.stack)
while(1)
{
for(i=0;i<100;i++) Code (.text)
{
k=i*i;
}
}
}
3 - 19
Compiler Section Names
Initialized Sections
Name Description Link Location
.text code FLASH*
.cinit initialization values for global and static FLASH*
variables
.econst constant variables (e.g. const int m=3;) FLASH*
.switch tables for addresses in “switch – case” lines FLASH*
.pinit tables for global constructors (C++) FLASH*
Uninitialized Sections
Name Description Link Location
.ebss global and static variables RAM
.stack stack memory area RAM (lower 64K)
.esysmem heap memory for dynamic memory allocation. RAM
Memory
Sections
0x00 0000 M0SARAM
(0x400)
.ebss
0x00 0400 M1SARAM
(0x400)
.stack
.text
3 - 21
Linking
Memory description
How to place Software
Sections into Memory
name.cmd
.map
3 - 22
Linker Command File
MEMORY
{
PAGE 0: /* Program Space */
FLASH: org = 0x300000, len = 0x40000
SECTIONS
{
.text: > FLASH PAGE 0
.ebss: > M0SARAM PAGE 1
.cinit: > FLASH PAGE 0
.stack: > M1SARAM PAGE 1
}
3 - 23
2. Create a F2833x - project (cont.)
3 - 24
2. Create a F2833x - project (cont.)
yellow arrow:
current position
of PC
3 - 25
3. Run and Halt
• Perform a real time run:
Debug Run (F5)
Note 2: the yellow arrow is no longer visible, because the F2833x runs at
full speed.
3 - 26
4. Watch your variables
• Open the Watch Window: View Watch Window
3 - 27
5. Perform a Single Step Debug
3 - 28
5. Perform a Single Step Debug
Step Out
3 - 29
6. Adding a Breakpoint
• Set a Breakpoint :
– Place the Cursor in Lab3.c at line: k = i * i;
– Click right mouse and select ‘Toggle Software Breakpoint’
– the line is marked with a red dot to indicate an active breakpoint.
– Another option to toggle a breakpoint is the “hand” – icon on the top
menu of CCS.
– Or, use a left mouse double click at the grey left hand side of window
“Lab3.c” to toggle the breakpoint.
Remove all
Breakpoints
yellow arrow:
Red dot:
current position
active
of PC
Breakpoint
3 - 31
7. Real – Time - Debug
Reset F2833x:
Debug Reset CPU
Watchdog – Timer:
• active after Reset.
• if not serviced, it will cause another Reset after 4.3
milliseconds.
• normally, watchdog is cleared by “Key”-instructions
• for the first lab, let us disable the watchdog:
GEL Watchdog Disable Watchdog
Watch – Window:
• right mouse click into watch window and select
“Continuous Refresh”.
• The variables k and i are updated in the
background, while the code is running
• The execution speed of the control code is not
delayed by monitoring variables.
• Note: The USB – emulator is too slow to update
the watch window as fast as the F2833x executes
the for-loop. That is why you will not see each
iteration of i and k.
3 - 35
10. Graph Window
View Graph Time/Frequency...
– View of sine-value look-up table
in BOOT - ROM (0x3FE000)
– 512 values (32 – bit signed, I2Q30)
3 - 36
11. Mixed Mode Visualization
– You will see two arrows, a yellow one at a C-line and a green one at the
current assembler instruction-line
– “Assembly Single Step” allows to monitor the internal machine code
flow.
3 - 37
12. Assembly Single Step
ASM –
single step Current
C - line
Current
ASM -
Instruction
Note: When you are done with mixed mode, switch the visualization
back to „Source Mode“ (right mouse click).
3 - 38
13. GEL - “General Extension Language”
• High level language similar to C
• Used to extend Code Composer Studio’s features
• to create GEL functions use the GEL grammar
• load GEL-files into Code Composer Studio
3 - 39