AnsweredAssumed Answered

hi 21489 fir accelerator 's registers

Question asked by yongyaqin21489 on Mar 22, 2015
Latest reply on Mar 31, 2015 by yongyaqin21489


hi ,all

 

    

 

I modify the FIR on ADSP 21489 EZ KIT , I set the registers of FIR accelerator, but there are some noise in the voice, I can not get the pure voice,

I check the registers, I can not find where is wrong, please kindly help me check the program, thanks.

 

 

/* This code has the TCBS, initialization routines, and the DMA completion ISR for the FIR accelerator */

#include<def21489.h>
#include<Cdef21489.h>
#include "ADDS_21489_EzKit.h"
#include "signal.h"

void Init_FIR();

void ACC_ISR();


/* Declaring the external buffers needed for FIR Accelerator */
extern float input_left[];
extern float input_right[];
extern float coeffs[];

extern float output_left[];
extern float output_right[];

//extern float coeffs_low_pass[];
//extern float coeffs_high_pass[];

extern volatile int acc_over;

/*Adding the TCB for FIR channels*/
// TCB Initialization
int FIR_TCB_RIGHT[13]={
    0,        // CP   = Chain pointer register
    TAPS,       // CC/CL  = Coefficient buffer length register 64
    1,        // CM    = Coefficient modifier register
    coeffs,                // CI     = Cofficient index refister
    output_right,     // OB     = Ouput data base register
    AUDIO_BLOCK_SIZE,    // OL/OC   = Output buffer length register 64
    1,        // OM   = Output modifier register
    output_right,     // OI    = Output data index register
    input_right,     // IB   = Input data base register
    TAPS + AUDIO_BLOCK_SIZE - 1, // IL/IC    = Input buffer length register
    1,        // IM   = Input buffer modifier register
    input_right,     // II   = Input data index register
    (0<<29)|(TAPS -1 )|((AUDIO_BLOCK_SIZE-1)<<14)   // IIRCTL2  = Channel control register,
   // (TAPS -1 )|((511-1)<<14)
   };

 

int FIR_TCB_LEFT[13]={
    FIR_TCB_RIGHT+12,     // CP   = Chain pointer register
    TAPS,        // CC/CL  = Coefficient buffer length register
    1,         // CM    = Coefficient modifier register
    coeffs,              // CI     = Cofficient index refister
    output_left,      // OB     = Ouput data base register
    AUDIO_BLOCK_SIZE,     // OL/OC   = Output buffer length register
    1,         // OM   = Output modifier register
    output_left,      // OI    = Output data index register
    input_left,       // IB   = Input data base register
    TAPS+AUDIO_BLOCK_SIZE-1,   // IL/IC    = Input buffer length register
    1,         // IM   = Input buffer modifier register
    input_left,       // II   = Input data index register
    (0<<29)|(TAPS-1)|((AUDIO_BLOCK_SIZE-1)<<14)   // IIRCTL2  = Channel control register,
   // (TAPS -1 )|((511-1)<<14)
   };

 


/* Adding the Initialization Code for FIR Accelerator Now */


void Init_FIR()
{

int temp;

FIR_TCB_RIGHT[0]=FIR_TCB_LEFT+12;


//Mapping the FIR DMA interrupt
temp=*pPICR0;
temp&=~(P0I0|P0I1|P0I2|P0I3|P0I4);
temp|=P0I0|P0I1|P0I3|P0I4;
*pPICR0=temp;
interrupt(SIG_P0,ACC_ISR);

//Selecting the FIR Accelerator
temp=*pPMCTL1;
temp&=~(BIT_17|BIT_18);
temp|=FIRACCSEL;
*pPMCTL1=temp;

asm("nop;nop;nop;nop;");

//Initializing the chain pointer register
*pCPFIR=FIR_TCB_LEFT+12-0x80000;

//Now Enabling the fir Accelerator
*pFIRCTL1=FIR_EN|FIR_DMAEN|FIR_CH2|FIR_CCINTR;


while(!(*pFIRDMASTAT & FIR_DMAACDONE));
{
  asm("nop;");
}
}

void ACC_ISR()
{

acc_over=1;

}

Outcomes