微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > 求救!高手来指点小弟一下!先作揖了

求救!高手来指点小弟一下!先作揖了

时间:10-02 整理:3721RD 点击:
小弟的程序
/****************************/
#include\"register.h\"
void initial(void)
{
asm(\"setc SXM\"

;
asm(\"clrc OVM\"

;
asm(\"clrc CNF\"

;
asm(\"setc INTM\");
*SCSR1=0x81FE;
*WDCR=0x0E8;
*IMR=0x0000;
*IFR=0x0FFFF;
*MCRA=*MCRA&0x0FF;
*PBDATDIR=*PBDATDIR|0x0FF00;
*MCRC=*MCRC&0X0FBFF;
*PBDATDIR=*PBDATDIR&0X0FF00;
*PFDATDIR=*PFDATDIR|0X0404;
*PEDATDIR=*PFDATDIR&0X0FFFB;
}
main()
{
int led;
int i;
int k;
intial();
while(1)
{
for(led=0x0080,i=0;i<8;led=led>>1,i++)
{
*PBDATDIR=*PBDATDIR&0x0ff00;
*PBDATDIR=*PBDATDIR|led;
*PFDATDIR=*PFDATDIR|0x0404;
*PFDATDIR=*PFDATDIR&0x0fffb;
for(k=0;k<0x0ffff;k++)
k=k;
}
}
}
/**********************************/
void interrupt nothing()
{
return;
}
编译结果
dspcl IO.C -g -v2xx -as -frC:\\tic2xx\\myprojects\\IO
[IO.C]
TMS320C2x/C2xx/C5x ANSI C Compiler Version 7.00
Copyright (c) 1987-1999 Texas Instruments Incorporated
\"IO.C\" ==> initial
\"IO.C\", line 9: [F022] illegal constant
\"IO.C\", line 9: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 10: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 11: [F108] \'Int\' undefined
\"IO.C\", line 12: [F022] illegal constant
\"IO.C\", line 12: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 13: [F022] illegal constant
\"IO.C\", line 13: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 13: [F137] operand of \'&\' must be an object or function
\"IO.C\", line 14: [F022] illegal constant
\"IO.C\", line 14: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 15: [F022] illegal constant
\"IO.C\", line 15: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 15: [F137] operand of \'&\' must be an object or function
\"IO.C\", line 16: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 16: [F137] operand of \'&\' must be an object or function
\"IO.C\", line 17: [F022] illegal constant
\"IO.C\", line 17: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 18: [F022] illegal constant
\"IO.C\", line 18: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 18: [F137] operand of \'&\' must be an object or function
\"IO.C\" ==> main
\"IO.C\", line 30: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 30: [F137] operand of \'&\' must be an object or function
\"IO.C\", line 31: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 32: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 33: [F001] syntax error at or near symbol \'=\'
\"IO.C\", line 33: [F137] operand of \'&\' must be an object or function
\"IO.C\" ==> nothing
Compile Complete,
27 Errors, 0 Warnings.
小弟初学实在不明白为何有错,尤其是哪个“=”的语法错吴
程序绝对是在英文输入法下完成
求高手指点一下小第感激涕零!

asm(\"setc SXM\"

;
asm(\"clrc OVM\"

;
asm(\"clrc CNF\"

;
asm(\"setc INTM\");
引号和汇编代码之间要有空格。

真的一个错误也没减少吗?
把你的VECTORS.ASM文件贴出来。

以下是vectors.asm
.title \"vectors.asm\"
.ref _c_int0,_nothing
.sect \".vectors\"
rest: b _c_int0
int1: b _nothing
int2: b _nothing
int3: b _nothing
int4: b _nothing
int5: b _nothing
int6: b _nothing

我新建了一个工程,把你的程序拷贝到里面。
只有一个错误,就是
intial();
此处应为initial();
还有
.title \"vectors.asm\"
.ref _c_int0,_nothing
.sect \".vectors\"
最好不要顶格写。
可能是你哪儿没设置好吧。

我刚学DSP对CCS不太熟悉,不知该如何设置,我装好CCS后除了配置防真器外没动过其他的任何参数,可否指点一下那些地方需要设置吗?或者推荐一下有关具体设置的资料(我手头的资料都没详细讲这个)
我用的是ccs c\'2000    4.1
还有.CMD文件有无要特别注意的地方

我用的是CCS 2000 2.2,其实我也没怎么设置。
你可以把你的CMD文件贴出来看看。

问题终于解决了,我以为汇编的.h文件和C的一样。。。。。。。。。。
浪费了我好多时间。。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top