Digital Signal Processing Reference
In-Depth Information
int i;
short *point;
point = (short *) 0x80000000;
printf(“Begin\n”);
for (i=0;i<10;i++)
{
printf(“[%d]%d\n,”i, point[i]);
}
printf(“End\n”);
}
•
Save
,
Rebuild,
and
Load
the program into the DSP memory.
•
Run
the program.
A pointer is assigned to the beginning of our data in memory. This allows
us to bring data into our c program and print out the data.
Step 10: Checking a Variable during Program Execution
Breakpoints
and
watch windows
are used to watch variables while a pro-
gram runs. In order to look at the values of the variable pointer in
main.c
,
before and after the pointer assignment, as well as the value of variable
i
,
first we establish breakpoints as follows:
•
Select
File
>
Reload
to reload the program into DSP memory.
•
Double click on
main.c
in the
project window
.
•
Put a cursor on the line:
point = (short*) 0x80000000
.
•
Right click
and choose
Toggle Breakpoint
.
•
Click on
Stdout window
in order to see the output results.
•
Repeat the above procedure with the line:
printf(”[%d]%d\n,”i,
point[i])
;.
In order to add variables to
watch window
:
•
Use the mouse to highlight the variable point in the line beginning
with:
point = (short*)
.
•
Right click
and select
Add to Watch window
. A
watch window
should open with variable point.
•
Repeat above procedure for variable
i
in the line beginning with:
printf(“[%d]
.
•
Select
Debug
>
Run
.