
2.5.2 新建CCS工程
1.下载controlSUITE并安装
官网下载地址:http://processors.wiki.ti.com/index.php/Download_CCS,根据DSP的型号选择合适的版本下载完成后,安装即可。
2.打开CCS建立工程
操作步骤:在CCS_edit界面,在菜单栏选择Project→New CCS Project→按照图2-8填写→Finish,建立一个新的工程。

图2-8 CCS中新建工程
3.复制底层文件到工程
1)将controlSUITE \ device _ support \ f2833 x \ v142中的“DSP2833x _ common”和“DSP2833x_headers”两个文件夹复制到新建的工程。
2)将controlSUITE\ libs\ math中的“FPUfastRTS”和“IQmath”两个文件夹复制到新建工程,如图2-9所示。
4.文件的删除/禁用
1)删除28335_RAM_lnk.cmd。
2)DSP2833x_common的配置。
① 展开DSP2833x_common,如图2-10所示。
② 展开cmd。
a)只保留DSP2833x_common\ cmd下的28335_RAM_lnk.cmd和F28335.cmd文件。注意:28335_RAM_lnk.cmd是烧录到RAM,F28335.cmd烧录到Flash。
b)屏蔽F28335.cmd:右键单击F28335.cmd,选择Resouce Configurations→Exclude from Build→Select All→OK。
③ 展开gel\ ccsv4,只保留f28335.gel文件。

图2-9 复制controlSUITE中的底层文件到工程
④ 展开source,屏蔽DSP2833x_SWPrioritizedDefaultIsr.c和DSP2833x_SWPrioritizedPieVect.c。
3)DSP2833x_headers的配置,如图2-11所示。

图2-10 文件的删除/禁用

图2-11 DSP2833x_headers的配置
① 展开DSP2833x_headers。
② 展开cmd,屏蔽DSP2833x_Headers_BIOS.cmd。
4)FPUfastRTS的配置,如图2-12所示。
① 展开FPUfastRTS\V100。
② 只保留“include”“lib”和“source”三个文件夹。
5)IQmath的配置,如图2-13所示。

图2-12 FPUfastRTS的配置

图2-13 IQmath的配置
① 展开IQMath,只保留v160文件夹。
② 展开v160,只保留“include”“lib”和“source”三个文件夹。
6)在test工程下,新建一个文件夹,命名为APPS,用来存放我们自己写的程序,如图2-14所示。
鼠标放置test处然后单击右键,在弹出的对话框中依次单击New→Floder,在Floder name处填写APPS。
至此,各个文件夹配置完成了。

图2-14 在工程中如何添加文件夹
5.索引配置:右键单击test,选择properties
1)Build→C2000 Compiler→Include Options→Add dir to #include search path,如图2-15所示。

图2-15 索引配置步骤1
添加:


2)Build→C2000 Linker→File Search Path。
① Add dir to library search path添加:

② Include library file or command file as input添加:

勾选如图2-16所示界面中的两个复选框。

图2-16 索引配置步骤2
6.完善工程
main.c添加下面代码:


7.将代码烧写到Flash中
屏蔽28335_RAM_lnk.cmd,而不是F28335.cmd,在main函数中添加下面代码:
