ti官网上运行28035的例程,运行cla.asm。C:\tidcs\c28\DSP2803x\v121\DSP2803x_examples\cla_adc_fir_flash
问题:我应用的28035的例程,第一步将10赋值给_VoltFilt是对的,这是_VoltFilt等于10,在向下运行时,我设置的A4是200.375,为何_VoltFilt的不更新呢,还一直是10?
请看:在Example_2803xClaAdcFir.c中定义:
#pragma DATA_SECTION(A, "CpuToCla1MsgRAM");
float32 A [FILTER_LEN] = {62.5L, -100.25L, 200.375L, -300.25L, 10.0625L};
在cla.asm中:
_X4 .set _X+8
_X3 .set _X+6
_X2 .set _X+4
_X1 .set _X+2
_X0 .set _X+0
_A4 .set _A+8
_A3 .set _A+6
_A2 .set _A+4
_A1 .set _A+2
_A0 .set _A+0
; CLA 5-tap FIR Filter
;
; Coefficients A[0, 1, 2, 3, 4]
; Data X[0, 1, 2, 3, 4] (Delay Line – X[0] is newest value)
;
; Equations
;
; Y = A4 * X4 First Calculation of sum of products.
; X4 = X3 X4 can now be updated, because it has been used.
; Y = Y + A3 * X3 Second product, 1st add.
; X3 = X2 X3 update
; Y = Y + A2 * X2 Third product, 2nd add.
; X2 = X1
; Y = Y + A1 * X1 Fourth product, 3rd add.
; X1 = X0
; Y = Y = A0 * X0
;
MDEBUGSTOP
MMOVF32 MR0,#10.6
MF32TOUI16 MR2, MR0 ; Get back to Uint16 value
MMOV16 @_VoltFilt, MR2
MMOV32 MR0,@_X4 ;1 Load MR0 with X4
MMOV32 MR1,@_A4 ;2 Load MR1 with A4
MF32TOUI16 MR2, MR1 ;T Get back to Uint16 value
MMOV16 @_VoltFilt, MR2 ;T
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 ;7 Wait till I8 to read result
MUI16TOF32 MR2, @_AdcResult.ADCRESULT1 ;8 Read ADCRESULT1 and convert to float
MMPYF32 MR2, MR1, MR0 ; MR2 (Y) = MR1 (A4) * MR0 (X4)
|| MMOV32 @_X0, MR2
MMOVD32 MR0,@_X3 ; Load MR0 with X3, Load X4 with X3
MMOV32 MR1,@_A3 ; Load MR1 with A3
MMPYF32 MR3, MR1, MR0 ; MR3 (Y) = MR1 (A3) * MR0 (X3)
|| MMOV32 MR1,@_A2 ; Load MR1 with A2
MMOVD32 MR0,@_X2 ; Load MR0 with X2, Load X3 with X2
MMACF32 MR3, MR2, MR2, MR1, MR0 ; MR3 = A3*X3 + A4*X4
|| MMOV32 MR1,@_A1 ; MR2 = MR1 (A2) * MR0 (X2)
MMOVD32 MR0,@_X1 ; Load MR0 with X1, Load X2 with X1
MMACF32 MR3, MR2, MR2, MR1, MR0 ; MR3 = A2*X2 + (A3*X3 + A4*X4)
|| MMOV32 MR1,@_A0 ; MR2 = MR1 (A1) * MR0 (X1)
MMOVD32 MR0,@_X0 ; Load MR0 with X0, Load X1 with X0
MMACF32 MR3, MR2, MR2, MR1, MR0 ; MR3 = A1*X1 + (A2*X2 +A3*X3 + A4*X4)
|| MMOV32 MR1,@_A0 ; MR2 = MR1 (A0) * MR0 (X0)
MADDF32 MR3, MR3, MR2 ; MR3 = A0*X0 + (A1*X1 + A2*X2 +A3*X3 + A4*X4)
MF32TOUI16 MR2, MR3 ; Get back to Uint16 value
MMOV16 @_VoltFilt,MR2 ; Output
MSTOP ; End task
MNOP
MNOP
MNOP
_Cla1T7End:
user3900194:
MDEBUGSTOPMMOVF32 MR0,#10.6MF32TOUI16 MR2, MR0 ; Get back to Uint16 valueMMOV16 @_VoltFilt, MR2;这一步之后_VoltFilt值可以为10
MMOV32 MR0,@_X4 ;1 Load MR0 with X4MMOV32 MR1,@_A4 ;2 Load MR1 with A4MF32TOUI16 MR2, MR1 ;T Get back to Uint16 valueMMOV16 @_VoltFilt, MR2 ;我是将程序运行到这一步,看_VoltFilt为何不更新为A4,反而还是10呢,这就是我的疑问,如何改变cla内的变量的值,请各路大侠们来帮助,谢谢!