-
可以抱着在琐碎的任务中发掘机会的目的去工作,心境会好些。
-
ADC之前LPH就必须是模拟的啊
-
数据比较靠谱,值得参考。
-
支持,期待楼主的进展
-
ADI的片子不能通过免费邮箱申请吧。
-
C语言的有符号整数向右移位运算不等同于除以2的某次幂。如(-1)/2和(-1)>>1,前者的结果一般是0,后者一般是-1,所以在C语言中,负数向右移动1位并不等同于除以2。
解决的方法是:当除数是2的N次幂时,x/(2^N),可以用移位操作(x + 2^N - 1) >> N来代替。其中x + 2^N - 1须小于0,^是乘方操作。
在C语言中,-100/8=-12,而-100>>3=-13,两者不相等,而用(-100+7)>>3代替则相等。
-
请看这个帖子。
https://bbs.eeworld.com.cn/viewt ... 4&page=1#pid1323817
-
恭喜!
-
−e是CCS的Link选项,其作用是定义程序执行的入口地址,主要用于CCS仿真。
当CCS把.out加载到目标memory后,代码从什么地址开始执行(即PC要初始化成什么值)是通过这个-e选项来指定。
如果未指定-e选项,CCS将默认使用
1) _c_int00 (如果存在)。如果使用C语言编码,入口必须是_c_int00,而_c_int00在rts[xxxx].lib定义,在链接时已经包含在目标文件中,所以无需手工去设定-e选项
或者
2) _main (如果存在)。如果使用纯汇编,程序的入口可以设成_main
或者
3) 0
如果你的程序入口地址不是以上三者中的任何一个,必须设定-e选项。
-
sprufe8b中提到了:
2.8.1 Register Addresses for Accessing the Control Registers
Table 3-27 lists the register addresses for accessing the control register file. One unit (.S2) can read from
and write to the control register file. Each control register is accessed by the MVC instruction. See the
MVC instruction description (see MVC) for information on how to use this instruction.
可以参考Table 3-27.
-
在spru733中有。
2.7 Control Register File
AMR Addressing mode register 2.7.3
CSR Control status register 2.7.4
ICR Interrupt clear register 2.7.5
IER Interrupt enable register 2.7.6
IFR Interrupt flag register 2.7.7
IRP Interrupt return pointer register 2.7.8
ISR Interrupt set register 2.7.9
ISTP Interrupt service table pointer register 2.7.10
NRP Nonmaskable interrupt return pointer register 2.7.11
PCE1 Program counter, E1 phase 2.7.12
-
代码有问题:
float FIR( float *Input, float *Output, int order, int length,const float *Iir_Coef)
{
int i;
float fSum;
fSum=0; // ----------------------->
for(i = 0; i < length ; i++)
{
Input = Input - 786;
}
for(i = order; i < length ; i++)
{
//
-
loop:
LDB .D1T1 *A4++[1], A_m
LDB .D2T2 *B4++[1], B_n
nop 4
ADD .L2 A_m, B_n, B_sum
STB .D2 B_sum, *B6++[1] ;
-
1. DSP和ARM的代码应该是相对独立的。
2. 可以这么理解。
3. ARM端的代码使用Linux PC下的tool chain来编译;DSP端的代码可以使用Windows下的CCS来编译,或者使用Linux PC下的CGTool编译。两者应该是等价的,但是使用CCS更方便。合众达的这篇手册对于如何配置环境,安装工具,比较有帮助。
-
可能需要用到TI的dsplink。ARM为主,与DSP之间的通信可以用dsplink的MSGQ模块。
这篇文章可以作为了解。
www.seeddsp.com/jszc/down2.php?id=195
-
除数为2的N次幂时,正数的除法与移位是相等的,但是负数的除法与移位并不等价。
假设除数为2^N,负数x的除法可以用以下方法来代替:
(x + 2^N - 1) >> N
可以验证下。
-
可以看下这个帖子。
https://bbs.eeworld.com.cn/viewt ... 1&page=2#pid1321868
-
* ===================== LOOP KERNEL ============================== *
; 由于在循环体内要修改B3(函数返回地址),在进入循环前B3应备份,例如MV B3, B0
MV .L1 A6, A_loopcount
loop:
LDB .D1T1 *A4++[1], A_x1
LDB .D2T2 *B4++[1], B_y1
SUB .L1 A_loopcount, 1, A_loopcount
CMPGT .L1 A_loopcount, 6, A_tmp
[A_tmp] B .S2 condition1
[A_tmp]ADDKPC loop, B3, 4
NOP 4 ; 此处不需要NOP,ADDKPC指令中的4表示NOP 4
CMPGT .L1 A_loopcount, 3, A_tmp
[A_tmp] B .S2 condition2
[A_tmp]ADDKPC loop, B3, 4
NOP 4
CMPGT .L1 A_loopcount, 0, A_tmp
[A_tmp]B .S2 condition3
[A_tmp]ADDKPC loop, B3, 4
NOP 4
*===================== LOOP EPILOG ============================== *
; 在出循环体时获取备份的B3,MV B0, B3
[!A_loopcount]B .S2 B3 ;return
|| MVK .S1 1,A4 ;return 1
NOP 4
* ================= LOOP PROLOG ============================ *
condition1:
ADD .S1X A_x1, B_y1, A_sum
STB .D2T1 A_sum, *B_s++[1]
[A_loopcount] B .S2 B3
nop 5
condition2:
SUB .S1X A_x1, B_y1, A_sum
STB .D2T1 A_sum, *B_s++[1]
[A_loopcount] B .S2 B3
nop 5
condition3:
MPY .M1x A_x1, B_y1, A_sum
nop 1
STB .D2T1 A_sum, *B_s++[1]
[A_loopcount] B .S2 B3
nop 5
.end
另外再检查下循环中止条件等是否正确。
从你的代码看condition1-condition3的代码体比较简单,为什么不内嵌到循环体内?不需要在循环体中修改B3,容易出错。
[ 本帖最后由 carrotchen 于 2012-6-15 13:43 编辑 ]
-
[!value] B .S2 function_1
NOP 5 ; 这个NOP 5有问题,在ADDKPC之前已经进入function_1,此时B3还未赋值(next_condition2),从子函数function_1中就无法退还到主函数,必须在B生效前给B3赋值(next_condition2)。
ADDKPC next_condition2, B3, 4
-
1. function_1, function_2, function_3函数结束时都应该有B .S2 B3跳回到父函数
2. 父函数每调用子函数(function_1, function_2, function_3)之前都需要以下几步:
(1) B 子函数(function_1, function_2, function_3)
(2) ADDKPC next_inst, B3, 4 ; 保存next_inst到B3,那么子函数结束时调用B .S2 B3就可以调回父函数
next_inst: