Other Parts Discussed in Thread: CONTROLSUITE
Hi everyone,
I face to a problem with the FIR16 function on my F28069.
My point is my function is working in one case and it goes to ILLEGAL_ISR in the second case.
Here is how is defined my function :
#define FFT_SIZE 2048
#define FIR_ORDER 16
typedef struct {
long *coeff_ptr; /* Pointer to Filter coefficient */
long *dbuffer_ptr; /* Delay buffer ptr */
int cbindex; /* Circular Buffer Index */
int order; /* Order of the Filter */
int input; /* Latest Input sample */
int output; /* Filter Output */
void (*init)(void *); /* Ptr to Init funtion */
void (*calc)(void *); /* Ptr to calc fn */
}FIR16;
FIR16 fir;
int Buff_acq[4*FFT_SIZE];
int Spectro[(FFT_SIZE/2)+1];
int coeff_fidl[17]={ 0.0090*32767, 0.0131*32767, 0.0245*32767, 0.0416*32767,
0.0618*32767, 0.0822*32767, 0.0994*32767, 0.1109*32767,
0.1150*32767, 0.1109*32767, 0.0994*32767, 0.0822*32767,
0.0618*32767, 0.0416*32767, 0.0245*32767, 0.0131*32767,
0.0090*32767 };
int coeff_lb[17]={ 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767,
0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767,
0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767,
0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767,
0.05850*32767};
void fir_od16(int *src, int *coeff, int size)
{
int i;
long dbuffer[FIR_ORDER+1];
fir.init=(void (*)(void *))FIR32_init;
fir.calc=(void (*)(void *))FIR32_calc;
fir.order=FIR_ORDER;
fir.dbuffer_ptr=dbuffer;
fir.coeff_ptr=(long *)coeff;
fir.init(&fir);
for (i=0;i<size;i++)
{
fir.input=src[i];
fir.calc(&fir);
src[i]=fir.output;
}
}
fir_od16(Buff_acq, coeff_fidl, 4*FFT_SIZE);
fir_od16(Spectro, coeff_lb, ((FFT_SIZE/2)+1));
fir_od16(Buff_acq, coeff_fidl, 4*FFT_SIZE) is working fine while fir_od16(Spectro, coeff_lb, ((FFT_SIZE/2)+1)) isn't and leads to ILLEGAL_ISR...
Finally, a question about FIR function, what is the dbuffer ? (I have read it's the Delay buffer but how am I supposed to define it ? Is it done in the FIR init function ?)
Regards,
Alex