-
DSP
学习心得笔记
----------------
白建成
.r
引言:学习
DSP
的时间有两个多月了,收获很多新知识,我们要每天都有进步才行,以
下
内容没有特别的顺序,
跟具自己的学习情况写的,
如果有不对的地方希望指出来,
如果有不
懂得也可
以问我,大家相互交流很重要,我的一个邮箱:
baijc@
欢
迎联系!
建立新工程过程中:
问题
1
:
1 fatal error
detected in the compilation of
解决方法:
因为
project
?
build options
?
p>
compiler
?
preprocess
or
中,
要包含的头文件的地址
没有加
进去,你可以找到头文件的地址,然后加进去。
问题
2
:
undefined
first
referenced
symbol
in file
---------
----------------
_c_int00
D:DSP
studytest3DebugDSP280x_
FS$$$$MPY
D:DSP
studytest3DebugDSP280x_
FS$$$$TOL
D:DSP
studytest3DebugDSP280x_
>>
error: symbol
referencing errors - './Debug/' not built
或者下面的问题:
undefined
first referenced
symbol
in file
---------
----------------
_c_int00
D:DSP
studyGPIO_StudyDebugDSP280x_
>>
error: symbol referencing errors -
'./Debug/GPIO_' not built
解决办法都是下面:
这个问题是因为没有加在库文件,请在
project
?
build options
?
p>
linker
?
libraries
中加入
。
问题
3
:
>> warning: creating .stack
section with default size of 400 (hex) words.
Use
-stack option to change the default
size.
>>
error: can't allocate .stack, size
00000400 (page 1) in RAMM1 (avail:
00000380)
>>
error: errors in input -
./Debug/GPIO_ not built
解决办法:
这个问题是关于堆栈存储
大小的问题,
他是说,
创建堆栈段使用与设置
< br>400
个字,
并建议在
“
堆栈操作
”
中改变这个与设置。这时,需要进
行如下修改就可通过:
project
?
build options
?
Linker
?
basic
,在
Stac
k Size(-stack):
填入
800
< br>或者其他小
于
1024
的数值。
调试程序:
在编译完成之后,要来下
载程序并进行功能调试。
File
?
L
oad Program
,在工
程文件夹下面的
Debug
文件夹下,
选中
*
*.out
文件,
点击打开,
便开始下
载程序
了。将
**.out
文件下载到
目标板上
2812
的
RAM
中。
注意,这里是调试,所以将程序下载到
p>
RAM
。等到最后您要固化程序的时候,
就
得下载到
FLASH
了,因为断电之后,
RAM
里面所有的数据都会消失。
(
Run
和
A
nimate
的区别,
Run
是如果遇
到断点的话它就停下来了。而
Animate
就算遇到断点时先
停止
DSP
内核,
刷新窗口,
然后接着继续启动运行,
常用来连
续刷新变量窗
口和生成
graph
图形等)——知识储备。
< br>
添加断点:
加上断点的方法
很简单,只要在该行代码前双击就行。双击之后,这行代码
前面会出现一个红色圆块。<
/p>
另外一种添加断点的方法,
就是在刚才的编译工具栏
上,
点一下那个小手图形的按钮,
前提是你要把光标
移动到想要设置断点的哪一
行上。
使用
watch
window
:
Watch win
dow
的作用是来观察程序运行过程中的各个变量的值。
调用<
/p>
watch
window
的方法是点击
菜单栏的
,
这时
watch window
就会
显示在
CCS
下方的信息区域;
选中所要观察的变量,然后右键,在右键菜单中选择
add
to watch window
。
调试代码观察:
我们在调试程序的时
候经常想让程序从
Main
函数开使运行,点
< br>Debug
?
Go
main
。
既能看到源文件中代码的执行情况,又能看到汇编指令的执行情况
View
?
Mixed
Source/Asm
;
关于
F2
812
中用
C
语言来实现中断的说明<
/p>
1.
首先在
.
cmd
中定位系统中断表:
MEMORY
{
PAGE 0 :
......................................
PAGE 1 :
......................................
PIE_VECT
: origin = 0x000D00, length = 0x000100
......................................
}
SECTIONS
{
...................................
PieVectTable
: >
PIE_VECT,
PAGE
= 1
.....................................
}
2.
在
C
中制定该中断的结构体:
#pragma
DATA_SECTION(PieVectTable,
struct
PIE_VECT_TABLE PieVectTable;
(在
DSP28_GlobalVariableDefs.C
中初始化)
3.
用
一组常数
(按照中断向量的顺序)
初始化该名字为
PIE
_VECT_TABLE
的表:
typedef interrupt void(*PINT)(void);
这里有些一问,一下应该为函数名??
// Define Vector Table:
struct PIE_VECT_TABLE {
// Reset is never fetched from this
table.
// It
will always be fetched from 0x3FFFC0 in either
// boot ROM or XINTF Zone 7 depending
on the state of
// the XMP/MC input
signal.
On the F2810 it is
always
// fetched from boot ROM.
PINT
PIE1_RESERVED;
PINT
PIE2_RESERVED;
PINT
PIE3_RESERVED;
PINT
PIE4_RESERVED;
PINT
PIE5_RESERVED;
PINT
PIE6_RESERVED;
PINT
PIE7_RESERVED;
PINT
PIE8_RESERVED;
PINT
PIE9_RESERVED;
PINT
PIE10_RESERVED;
PINT
PIE11_RESERVED;
PINT
PIE12_RESERVED;
PINT
PIE13_RESERVED;
// Non-Peripheral Interrupts:
PINT
XINT13;
// XINT13
PINT
TINT2;
// CPU-Timer2
PINT
DATALOG;
// Datalogging interrupt
PINT
RTOSINT;
// RTOS interrupt
PINT
EMUINT;
// Emulation interrupt
PINT
XNMI;
//
Non-maskable interrupt
PINT
ILLEGAL;
// Illegal
operation TRAP
PINT
USER0;
// User Defined trap 0
PINT
USER1;
// User Defined
trap 1
PINT
USER2;
// User Defined trap 2
PINT
USER3;
// User Defined
trap 3
PINT
USER4;
// User Defined trap 4
PINT
USER5;
// User Defined
trap 5
PINT
USER6;
// User Defined trap 6
PINT
USER7;
// User Defined
trap 7
PINT
USER8;
// User Defined trap 8
PINT
USER9;
// User Defined
trap 9
PINT
USER10;
//
User Defined trap 10
PINT
USER11;
//
User Defined trap 11
// Group 1 PIE Peripheral
Vectors:
PINT
PDPINTA;
// EV-A
PINT
PDPINTB;
// EV-B
PINT
rsvd1_3;
PINT
XINT1;
PINT
XINT2;
PINT
ADCINT;
//
ADC
PINT
TINT0;
// Timer 0
PINT
WAKEINT;
// WD
.............
.............
// Group 12 PIE Peripheral Vectors:
PINT
rsvd12_1;
PINT
rsvd12_2;
PINT
rsvd12_3;
PINT
rsvd12_4;
PINT
rsvd12_5;
PINT
rsvd12_6;
PINT
rsvd12_7;
PINT
rsvd12_8;
};
然后在使我们在
.cmd
文件中定义的表有以上属性:
extern
struct PIE_VECT_TABLE PieVectTable;(
在
p>
.h
文件中)
4
.
初始化该表(在
.c
文件中)使之能
够为主程序所使用:
const struct
PIE_VECT_TABLE PieVectTableInit = {
PIE_RESERVED,
// Reserved space
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
PIE_RESERVED,
//
Non-Peripheral Interrupts
INT13_ISR,
// XINT13 or
CPU-Timer 1
INT14_ISR,
// CPU-Timer2
DATALOG_ISR,
// Datalogging
interrupt
RTOSINT_ISR,
// RTOS interrupt
EMUINT_ISR,
// Emulation
interrupt
NMI_ISR,
// Non-maskable interrupt
ILLEGAL_ISR,
// Illegal operation TRAP
USER0_ISR,
// User Defined trap 0
USER1_ISR,
//
User Defined trap 1
USER2_ISR,
// User Defined
trap 2
USER3_ISR,
// User Defined
trap 3
USER4_ISR,
// User Defined
trap 4
USER5_ISR,
// User Defined
trap 5
USER6_ISR,
// User Defined
trap 6
USER7_ISR,
// User Defined
trap 7
USER8_ISR,
// User Defined
trap 8
USER9_ISR,
// User Defined
trap 9
USER10_ISR,
// User Defined trap 10
USER11_ISR,
//
User Defined trap 11
//
Group 1 PIE Vectors
PDPINTA_ISR,
// EV-A
PDPINTB_ISR,
// EV-B
rsvd_ISR,
XINT1_ISR,
XINT2_ISR,
ADCINT_ISR,
// ADC
TINT0_ISR,
// Timer 0
WAKEINT_ISR,
// WD
.............
.............
// Group 12 E
Vectors
rsvd_ISR,
rsvd_ISR,
rsvd_ISR,
rsvd_ISR,
rsvd_ISR,
rsvd_ISR,
rsvd_ISR,
rsvd_ISR,
};
//-----------
--------------------------------------------------
--------------
// InitPieVectTable:
//-------------------------
--------------------------------------------------
// This function initializes the PIE
vector table to a known state.
// This
function must be executed after boot time.
//
void
InitPieVectTable(void)
{
int16 i;
Uint32 *Source =
(void *) &PieVectTableInit;
Uint32
*Dest = (void *) &PieVectTable;
EALLOW;
for(i=0;
i < 128; i++)
*Dest++ = *Source++;
EDIS;
// Enable the PIE Vector Table
= 1;
}
5.
中断服务程序:
让以上的数值指向你所要的服务程序,例如:
2 = &ISRTimer2;
那么,
ISRTimer2
也就成了中断服务程序,
×××切记:一定要在主程序的开始先声明该程序:
interrupt void ISRTimer2(void);
.............
.............
然后按照您的需要编制该程序:
interrupt void ISRTimer2(void)
{
uptCount++;
}
-
-
-
-
-
-
-
-
-
上一篇:美军全球信息栅格体系现状及发展趋势
下一篇:药物涂层球囊临床应用中国专家共识要点