📄 example_dps2812m_extram.c
字号:
/* =================================================================================
File name: Example_DPS2812M_EXTRAM.c
Originator: SEED R&D Group
Description:
Example Program That Executes From XINTF (assumes MPNMC = 1)
As supplied, this project is configured for "boot from XINTF Zone 7"
operation.
XMP/MCn pin = 1
Map the region for XINTF Zone 7 as RAM in Code Composer
(Refer to the F2812.gel file supplied with CCS Studio)
This example configures CPU Timer0 and increments
a counter each time the timer asserts an interrupt.
Watch Variables:
CpuTimer0.InterruptCount
BackGroundCounter
=====================================================================================
History:
-------------------------------------------------------------------------------------
10-20-2005 Release Rev 1.0 Jijunhui
------------------------------------------------------------------------------*/
// Step 0: Include required header files:
// DSP281x_Device.h: device specific definitions #include statements for
// all of the peripheral .h definition files.
#include "DSP281x_Device.h" // DSP281x Headerfile Include File
#include "DSP281x_Examples.h" // DSP281x Examples Include File
#include "Examples_DPS2812M_EXTRAM.h"
void main(void)
{
Uint32 LoopVar;
//-----------------------------------------------------------------------
// Step 1 to Step 5 should be followed in all designs:
//
// Step 1: Disable and clear all CPU interrupts:
DINT;
IER = 0x0000;
IFR = 0x0000;
// Step 2. Initialize System Control registers, PLL, WatchDog, Clocks to default state:
// This function is found in the DSP281x_SysCtrl.c file.
InitSysCtrl();
// Step 3. Select GPIO for the device or for the specific application:
// This function is found in the DSP281x_Gpio.c file.
// InitGpio(); // Not required for this example
// Step 4. Initialize PIE to known state (control registers and vector table):
// The PIE vector table is initialized with pointers to shell Interrupt
// Service Routines (ISR). The shell routines are found in DSP281x_DefaultIsr.c.
// Insert user specific ISR code in the appropriate shell ISR routine in
// the DSP281x_DefaultIsr.c file.
//
// Initialize Pie Control Registers To Default State:
// This function is found in the DSP281x_PieCtrl.c file.
InitXintf();
ERTM; // Enable Global realtime debug DBGM
for(LoopVar = 0; LoopVar < SRAM_LENGTH; LoopVar++)
{
sram_data[LoopVar] = LoopVar;
}
for(LoopVar = 0; LoopVar < SRAM_LENGTH; LoopVar++)
{
if(sram_data[LoopVar] != LoopVar)
{
good_flag = 0;
break;
}
good_flag = 1;
}
if(good_flag == 1)
{
for(;;);
}
else
{
for(;;);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -