TI公司的Delfino tms320F28377D是双核32位浮点微控制器单元(MCU),支持新的双核C28x架构,大大地提升了系统性能.每核提供200MHz的信号处理性能,集成了512KB或1MB闪存,172KB或204KB RAM
一个典型的F2837xD应用工程包含两个独立的CCS工程:一个用于CPU1,一个用于CPU2.折两个工程师完全独立的工程,没有真正的连接。
CPU1 子系统的创建
1、从CCS主界面窗口,选择 File -> New -> CCS Project.选择你的目标器件”Generic
C28xx Device”命名你的工程并且选择工程目录,点击完成,你的工程就创建好了
2、在你可以成功编译工程之前,你需要设置一些参数。点击你的project 选择properies。找到 Processor Options ,保证和下图一样
3、In the C2000 Compiler entry look for and select the Include Options. Click on the add directory icon to add a directory to the search path. Click the File System button to browse to the commonninclude folder of your C2000Ware installation (typically C:ntinc2000nC2000Ware_X_XX_XX_XXndevice_supportnf2837xdncommonninclude). Replace the ’X’s with your current C2000Ware version installation. Click ok to add this path, and repeat this same process to add the headersninclude directory.
4. Expand the Advanced Options and look for the Predefined Symbol entry. Add a Pre-define NAME called “CPU1”. This ensures that the header files build correct for this CPU. If using a Launchpad, also add a pre-define NAME called “_LAUNCHXL_F28379D”. This is required to setup the proper device clocking
7. In the project explorer, check that no linker command file got added during project setup. If so,remove the linker command file that got added.
- Next we need to link in a few files which are used by the header files. To do this right click on your project in the workspace and select Add Files… Navigate to the headersnsource directory, and select F2837xD_GlobalVariableDefs.c. After you select the file you’ll have the
option to copy the file into the project or link it. We recommend you link files like this to the project as you will probably not modify these files. Link in the following files as well:
commonnsourcenF2837xD_CodeStartBranch.asm
commonnsourcenF2837xD_usDelay.asm
commonnsourcenF2837xD_SysCtrl.c
commonnsourcenF2837xD_Gpio.c
commonnsourcenF2837xD_Ipc.c
At this point your project workspace should look like the following:
- Create a new file by right clicking on the project and selecting New -> File. Name this file
#include "F28x_Project.h"
void main(void)
{
uint32_t delay;
InitSysCtrl();
// Set pin direction
EALLOW;
GpioCtrlRegs.GPADIR.bit.GPIO10 = 1;
EDIS;
GPIO_SetupPinOptions(14, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(14, GPIO_MUX_CPU2, 0);
// turn off LED
GpioDataRegs.GPADAT.bit.GPIO10 = 1;
while(1)
{
// Turn on LED
GpioDataRegs.GPADAT.bit.GPIO10 = 0;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{ }
// Turn off LED
GpioDataRegs.GPADAT.bit.GPIO10 = 1;
// Delay for a bit.
for(delay = 0; delay < 2000000; delay++)
{ }
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- Save main.c and then attempt to build the project by right click on it and selecting Build Project. Assuming the project builds try debugging this project on a F2837xD device. When the code runs you should see GPIO 10 toggle.
2019-12-7 18:35 上传
Before we can successfully build a project we need to setup some build specific settings. Right
click on your project and select Properties. Look at the Processor Options and ensure they
match the below image:
In the C2000 Compiler entry look for and select the Include Options. Click on the add directory icon to add a directory to the search path. Click the File System button to browse to the commonninclude folder of your C2000Ware installation(typicallyC:ntinc2000nC2000Ware_X_XX_XX_XXndevice_supportnf2837xdncommonninclude). Replace the ’X’s with your current C2000Ware version installation. Click ok to add this path,and repeat this same process to add the headersninclude directory.
|