Professional Documents
Culture Documents
bng CCS V6
Code:
/*
==========================================================================
==============================
TITLE:
Main.c
DESCRIPTION:
Target of this Project is:
Lam quen voi moi truong CCS va nhan M3 cua Concerto F28M36x
1: config code compose for new project
+ Tao project moi
+ Them file cau hinh cho project (.ccxml)
+ Them file cau hinh va thu vien (cau hinh C-runtime, cau hinh bo nho vat ly, thu vien
ma nguon cho cac khoi ngoai vi )
+ Cau hinh trinh bien dich
2: Viet mot project
+ Cau hinh trang thai khoi tao cho nhan M3 cua concerto
+ Chay not ung dung dieu khien ngoai vi - nhay chan GPIO.
Cac chan nhay: Port P pin 0,2,4,6
Port Q Pin 0
RESULT:
ORIGINATOR: ESD Group
Toward the beautiful things :)
--------------------------------------------------------------------------------------------------------Ver | dd mmm yyyy | Who | Description of changes
-----|-------------|------| ----------------------------------------------------------------------------1.00| 29 06 2016 | H.T | The first version
==========================================================================
============================== */
#include "inc/hw_sysctl.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "driverlib/ipc.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/debug.h"
#include "driverlib/cpu.c"
#include "driverlib/gpio.h"
void main (void)
{
volatile unsigned long ulLoop;
// Disable Protection
HWREG(SYSCTL_MWRALLOW) = 0xA5A5A5A5;
// Sets up PLL, M3 running at 75MHz and C28 running at 150MHz
SysCtlClockConfigSet(SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xF) |
SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_2 |
SYSCTL_XCLKDIV_4);
// Send boot command to allow the C28 application to begin execution
//IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);
//------------------------------- My External Function -----------------#ifdef _FLASH
// Copy time critical code and Flash setup code to RAM
// This includes the following functions: InitFlash();
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
// symbols are created by the linker. Refer to the device .cmd file.
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
// Call Flash Initialization to setup flash waitstates