This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

信号发生器

Other Parts Discussed in Thread: CONTROLSUITE

你好,我使用的斜波发生器程序是controlSUITE软件里的例程修改(基本改变不大)的。

问题有三:1.RMPGEN rgen = RMPGEN_DEFAULTS;  //这条语句不能编译通过,错误提示如下:

Description Resource Path Location Type
unresolved symbol _RMPGEN_calc, first referenced in ./main.obj rmpgen C/C++ Problem

2.#pragma DATA_SECTION(ipcb, "SGENipcb"); // 加这条语句时,编译出现警告,警告如下:

Description Resource Path Location Type
#10247-D creating output section "SGENipcb" without a SECTIONS specification rmpgen C/C++ Problem

3.程序使用FLASH下载,运行程序时,程序一直进入非法操作中断:

interrupt void ILLEGAL_ISR(void) // Illegal operation TRAP
{
// Insert ISR Code here

// Next two lines for debug only to halt the processor here
// Remove after inserting ISR Code
asm(" ESTOP0");
for(;;);

}

附程序:

/********************************* Heard Files Call *******************************************/
#include "DSP2833x_Device.h"
#include "DSP2833x_Examples.h"
#include <sgen.h>
/******************************* Heard Files Call end *****************************************/

#define SIGNAL_LENGTH 512

RMPGEN rgen ;   //= RMPGEN_DEFAULTS;
#pragma DATA_SECTION(ipcb, "SGENipcb");
int ipcb[SIGNAL_LENGTH]={0};
int x1;

/************************************** Main Function ******************************************/
void main(void)
{
unsigned long i;
DINT;
InitSysCtrl();
MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); // 内存复制
InitFlash(); // 初始化Flash
InitPieCtrl();
IER = 0X00000000;
IFR = 0X00000000;
InitPieVectTable();
EINT;
ERTM;
rgen.offset = 0;
rgen.gain = 0x7fff;
rgen.freq = 5369;
rgen.step_max = 1000;
rgen.angle = 8192;

for(i=0; i<SIGNAL_LENGTH; i++)
{
ipcb[i] = 0;
}

for(;;)
{
for(i=0; i<SIGNAL_LENGTH; i++)
{
rgen.calc(&rgen);
x1= rgen.out;
ipcb[i] = x1;
}
}
}
/************************************ Main Function end ****************************************/

仿真时查看ipcb[i] 数组一直是0.

工程师们,请求解答一下。