TI中文支持网
TI专业的中文技术问题搜集分享网站

28035 例程 cla

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

Hank Zhao:

你在调试cla程序时,单步一下,看MMOVZ16 MR0,@_CputoClaAAA   MMOV16 @_CputoClaBBB,MR0哪一条语句没有执行?

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

Hank Zhao:

_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,不能理解为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间,虽然确实是这样的现象。原因是_A4 和CputoClaBBB在CLA中只能作为源操作数。

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

user3900194:

回复 Hank Zhao:

我无法看到MR0的值,也不知道怎么看,你能否给指导下。但肯定是执行了这一步:MMOVZ16 MR0,@_CputoClaAAA,因为我可以将MR0中的值再接着能够赋值给_VoltFilt,但是不能赋值给MMOV16 @_CputoClaBBB,MR0。

表面的现象是因为_CputoClaBBB和_CputoClaAAA是都在CpuToCla1MsgRAM空间内:

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

而_VoltFilt在Cla1ToCpuMsgRAM空间内:

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

user3900194:

回复 Hank Zhao:

首先谢谢您来给我解答这个问题,困扰我很久了,一直找不到答案。

那是不是意味着我以上的程序运行结果确实是正常的。

A4 和CputoClaBBB在CLA中只能作为源操作数,而_A4 和CputoClaBBB作为源操作数不能够在CLA内相互更新,cla之外的cpu空间可以,我这样理解可以吧,我仿真结果看,实际情况也是这样的。就是找不到支持的理论,所以在这想得到权威的确定。

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

Hank Zhao:

回复 user3900194:

可以将MR0 add watch expression来观察MR0的值。

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

user3900194:

回复 Hank Zhao:

我是用的ccs3.3,找不到“ add watch expression”在何处,能否再给指点?

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

user3900194:

回复 Hank Zhao:

那就听你的了。毕竟您是ti工程师,非常感激,这个问题我在线询问好长时间了,谢谢您的帮助。

A4 和CputoClaBBB存放在cpu-to-cla ram空间,在cpu直接赋值就行了,而转到CLA中再相互赋值显得有点多此一举,我为何在cla在调试中相互赋值,也是偶尔调试才发现的这个问题。所以一直比较困惑,找不到答案。和您之间的交流,让我确信,以后不这么干了,直接在cpu内赋值就行了。谢谢

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

Hank Zhao:

回复 user3900194:

我这边没有安装CCS3.3,对CCS3.3不太熟悉,你右击一下变量或寄存器,找一下watch之类的选项。

我应用的是dsp f28035.我现在定义了变量CputoClaAAA、CputoClaBBB和VoltFilt

#pragma DATA_SECTION(CputoClaAAA,"CpuToCla1MsgRAM");
#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

Uint16 CputoClaAAA,CputoClaBBB;

#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

Uint16 VoltFilt;

在main中初始化

CputoClaBBB=1258;
CputoClaAAA=2536;

MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR0
MNOP ;3 Wait till I8 to read result
MNOP ;4 Wait till I8 to read result
MNOP ;5 Wait till I8 to read result
MNOP ;6 Wait till I8 to read result
MNOP

问题:运行后CputoClaBBB=1258为何还是不能更新为CputoClaAAA的值2536呢,如何让_CputoClaBBB跟随_CputoClaAAA变化呢?

补充:类似的情况

问题:_VoltFilt的值能够跟随A4改变,而CputoClaBBB不能,就是因为_A4 和CputoClaBBB是同一区间,_A4 和_VoltFilt不在同一区间的缘故吗

在这定义

#pragma DATA_SECTION(A,          "CpuToCla1MsgRAM");

#pragma DATA_SECTION(CputoClaBBB,"CpuToCla1MsgRAM");

而#pragma DATA_SECTION(VoltFilt,   "Cla1ToCpuMsgRAM");

#if LOWPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};
#elif HIGHPASS
float32 A [FILTER_LEN] = {625, 100, 200, 300, 2000};//T{0.0625L, 0.25L, 0.375L, 0.25L, 0.0625L}
#endif

MMOV32 MR0,@_A4 
MF32TOUI16 MR1,MR0
; MMOVZ16 MR0,@_CputoClaAAA
MMOV16 @_CputoClaBBB,MR1
MMOV16 @_VoltFilt, MR1

请求帮助!

user3900194:

回复 Hank Zhao:

我刚才在css中看到MR0的值了,验证了_CputoClaAAA能够赋值给MR0,而MR0不能赋值给_CputoClaBBB,那原因就按您的解释来了。“也就是说cpu-to-cla ram空间的变量只能被CPU修改,不能被CLA修改,反之,cla-to-cpu ram空间的变量只能被CLA修改,不能被CPU修改。”

谢谢!

赞(0)
未经允许不得转载:TI中文支持网 » 28035 例程 cla
分享到: 更多 (0)