1967 views|0 replies

3836

Posts

19

Resources
The OP
 

TMS320F28377S Study Notes 3 Building a fully portable CCS9.3 project [Copy link]

1. Copy the project file
to create a new blank project in CCS


Official file copy
Library file organization
Add F2837xS_Headers_nonBIOS.cmd
and other modifications
Test code
This is the second time I have written a similar article. I have ignored some details. For more information, please refer to: TMS320F280049C Study Notes 2 Building a fully portable CCS9.3 project
Reference materials are located in C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\device_support\f2837xs\docs《F2837xS_FRM_EX_UG.pdf》

1. Copy the project file and
create a new blank project in CCS

Official file copy
Copy the entire source folder under C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\device_support\f2837xs\common to the project folder.
Copy F2837xS_GlobalVariableDefs.c under C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\device_support\f2837xs\headers\source to the source folder just now.
Copy the include folder of C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\device_support\f2837xs\common to the project folder.
Copy all the files in C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\device_support\f2837xs\headers\include to the folder just now. Copy the
following 4 files in C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\device_support\f2837xs\common\cmd to the project folder Insert image description here
Copy library functions. These files are all in C:\ti\C2000Ware_DigitalPower_SDK_3_00_00_00\c2000ware\driverlib\f2837xs\driverlib. They need to be operated separately as follows:
Copy all .h files to the include folder
Create a C_lib folder in the project folder and copy all .c files in driverlib into it.
Copy the ccs and inc folders directly to the project folder.

After predefining _DUAL_HEADERS, you can use library function programming and register programming at the same time.

Test code


Program to make the red LED of LaunchPad flash

#include "F28x_Project.h"
#include "device.h"
#include "math.h"

void main(void)
{
// Initialize clock and peripherals Initialize device clock and peripherals
Device_init(); // Library function programming initialization
// InitSysCtrl(); // Register programming initialization, equivalent to the previous line

/*//Library function version configuration
// Initialize GPIO and set it as push-pull output Initialize GPIO and configure the GPIO pin as a push-pull output
Device_initGPIO();
GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD); // Push-pull output or floating input
GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT);
*/
InitGpio(); //Register instruction configuration
GPIO_SetupPinMux(DEVICE_GPIO_PIN_LED1, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(DEVICE_GPIO_PIN_LED1, GPIO_OUTPUT, GPIO_PUSHPULL);


// Initialize PIE and clear PIE registers
. Disables CPU interrupts.
Interrupt_initModule();

//
Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
Interrupt_initVectorTable();

// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
EINT;
ERTM;

float a=cos((float)3.1415926/4); // FPU32
float b=__sin((float)(3.14/4)); // TMU

for(;;)
{
// Turn on LED
// The hardware circuit design is that the LED turns on when the GPIO outputs a low level
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0);

// 延迟0.5s Delay for a bit.
DEVICE_DELAY_US(500000);

// Turn off LED
GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1);

// Delay for a bit.
DEVICE_DELAY_US(500000);
}
}

This post is from Microcontroller MCU
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list