Hi,
I am using one of the ADC channel for sampling the incoming signal and trying to filter it as described
I got the filter coeficients using parametrs fa=3Hz,fb=8Hz,lenght=21,Fs=500Hz in this http://arc.id.au/FilterDesign.html .
Then added the fiter coefficients to the FIR_filter_coeff.dat file (file with new coefficients is 0564.FIR_filter_coeff.dat and generated the FIR_filter.s43 using the FIR_filter_codegen tool and then migrated this FIR_filter.s43 IAR to CCS(and it looks this txt file but with the extension .s43
.cdecls C,LIST,"msp430x14x.h" ; Include device header file .global FIR_filter ;RSEG CODE .text .ref input_delay1 .ref input_delay2 .ref input_delay3 .ref input_delay4 .ref input_delay5 .ref input_delay6 .ref input_delay7 .ref input_delay8 .ref input_delay9 .ref input_delay10 .ref input_delay11 .ref input_delay12 .ref input_delay13 .ref input_delay14 .ref input_delay15 .ref input_delay16 .ref input_delay17 .ref input_delay18 .ref input_delay19 .ref input_delay20 .ref input_delay0,output FIR_filter: ;Stage 0 mov.w &input_delay0,R12 mov.w R12,R13 rra.w R13 rra.w R13 add.w R12,R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 rra.w R13 mov.w R13,R14 add.w R14,&output ;Stage 1 ;Stage 2 ;Stage 3 ;Stage 4 ;Stage 5 ;Stage 6 ;Stage 7 ;Stage 8 ;Stage 9 ;Stage 10 ;Stage 11 ;Stage 12 ;Stage 13 ;Stage 14 ;Stage 15 ;Stage 16 ;Stage 17 ;Stage 18 ;Stage 19 ;Stage 20 mov.w &input_delay19,&input_delay20 mov.w &input_delay18,&input_delay19 mov.w &input_delay17,&input_delay18 mov.w &input_delay16,&input_delay17 mov.w &input_delay15,&input_delay16 mov.w &input_delay14,&input_delay15 mov.w &input_delay13,&input_delay14 mov.w &input_delay12,&input_delay13 mov.w &input_delay11,&input_delay12 mov.w &input_delay10,&input_delay11 mov.w &input_delay9,&input_delay10 mov.w &input_delay8,&input_delay9 mov.w &input_delay7,&input_delay8 mov.w &input_delay6,&input_delay7 mov.w &input_delay5,&input_delay6 mov.w &input_delay4,&input_delay5 mov.w &input_delay3,&input_delay4 mov.w &input_delay2,&input_delay3 mov.w &input_delay1,&input_delay2 mov.w &input_delay0,&input_delay1 ret .end
Later added the FIR_filter.s43(CCS) ,FIR_sine_data.dat,FIR_filter_coeff.dat to the project where the main.c is sampling the signal at sampling rate of 500Hz.
__interrupt void ADC12ISR(void)
{
if (oldest == 499)
{
oldest= 0;
}
else
{
oldest=oldest+1;
}
result=ADC12MEM0;//Store ADC12MEM0 value to result(variable)
results[oldest]=FIR_filter(result);//calling the FIR_filter function
__bic_SR_register_on_exit(CPUOFF);
}
But it is giving error like this
Can someone explain why this error is coming as I am not sure if it is something wrong with the filter design steps.
Is it some problem with filter design steps or with the function call or something else.