ADI 技术
直播中

张秀荣

8年用户 236经验值
私信 关注
[问答]

请问在CCES环境下如何使用21489的IIR加速器

在VDSP++的环境下程序已经实现,但是到了CCES下,把中断初始化函数修改了,还是无法正确配置中断,直接返回IIR的中断初始化失败,请问CCES下怎么使用IIR加速器?
代码如下:

/* This code has the TCBS, initialization routines, and the DMA completion ISR for the IIR accelerator */  #include #include "ADDS_21489_EzKit.h"#include "IIR_Accelerator.h"void Init_IIR(void);void ACC_ISR();float input_left[NUM_SAMPLES];float input_right[NUM_SAMPLES];float output_left[NUM_SAMPLES];float output_right[NUM_SAMPLES];float coeffs_low_pass[7*NUM_SECTIONS+1] = {                                                                                                                                                      #include "lowpass_200Hz.dat"                                                                                                       } ;float coeffs_high_pass[];volatile int acc_over;ad1939_float_data fBlockA;// TCB Initializationint IIR_TCB_RIGHT[13]={                                        0,                                                  // CP                     = Chain pointer register                                        21,                                                  // CC/CL           = Coefficient buffer length register                                        1,                                                  // CM                      = Coefficient modifier register                                        (int)coeffs_low_pass,          // CI              = Cofficient index refister                                        (int)fBlockA.Tx_R1,                    // OB              = Ouput data base register                                        NUM_SAMPLES,                                        // OL/OC            = Output buffer length register                                        1,                                                  // OM                     = Output modifier register                                        (int)fBlockA.Tx_R1,                    // OI                      = Output data index register                                        (int)fBlockA.Rx_R1,                    // IB                     = Input data base register                                        NUM_SAMPLES,                                        // IL/IC             = Input buffer length register                                        1,                                                  // IM                     = Input buffer modifier register                                        (int)fBlockA.Rx_R1,                    // II                     = Input data index register                                        2|(383<<14)                              // IIRCTL2           = Channel control register, no of biquads = 3, WINDOW SIZE=512                              };  int IIR_TCB_LEFT[13]={                                        (int)IIR_TCB_RIGHT+12,          // CP                     = Chain pointer register                                        21,                                                  // CC/CL           = Coefficient buffer length register                                        1,                                                  // CM                      = Coefficient modifier register                                        (int)coeffs_low_pass,          // CI              = Cofficient index refister                                        (int)fBlockA.Tx_L1,                    // OB              = Ouput data base register                                        NUM_SAMPLES,                                        // OL/OC            = Output buffer length register                                        1,                                                  // OM                     = Output modifier register                                        (int)fBlockA.Tx_L1,                    // OI                      = Output data index register                                        (int)fBlockA.Rx_L1,                              // IB                     = Input data base register                                        NUM_SAMPLES,                                        // IL/IC             = Input buffer length register                                        1,                                                  // IM                     = Input buffer modifier register                                        (int)fBlockA.Rx_L1,                              // II                     = Input data index register                                        2|(383<<14)                              // IIRCTL2           = Channel control register, no of biquads = 3, WINDOW SIZE=512                              };/* Adding the Initialization Code for IIR Accelerator Now */  void Init_IIR(void){          int temp;          IIR_TCB_RIGHT[0]=(int)IIR_TCB_LEFT+12;          //Mapping the IIR DMA interrupt          temp=*pPICR0;          temp&=~(P0I0|P0I1|P0I2|P0I3|P0I4);          temp|=P0I0|P0I1|P0I3|P0I4;          *pPICR0=temp;           adi_int_InstallHandler(ADI_CID_P0I,(ADI_INT_HANDLER_PTR)ACC_ISR, _NULL ,true);          //Selecting the IIR Accelerator          temp=*pPMCTL1;          temp&=~(BIT_17|BIT_18);          temp|=IIRACCSEL;          *pPMCTL1=temp;           asm("nop;nop;nop;nop;");          //Initializing the chain pointer register          *pCPIIR=(int)IIR_TCB_LEFT+12-0x80000;          //Now Enabling the IIR Accelerator          *pIIRCTL1=IIR_EN|IIR_DMAEN|IIR_CH2|IIR_RND0; }void Process_block(float* input_left,float* input_right, float* output_left, float* output_right, bool first_flag){          int i;           //Start the accelerator for first time          if(first_flag)          {                    Init_IIR();          }          /*Move the accelerator from IDLE state to the Data Load state by resetting and clearing           the IIR_DMAEN bit*/          else          {                    *pIIRCTL1&=~IIR_DMAEN;                    *pIIRCTL1|=IIR_DMAEN;          }           /* Wait till IIR accelerator finishes the processing */          while(acc_over==0);          acc_over=0;           /*Multiply the output with filter gain */          for (i =0; i < NUM_SAMPLES; ++i)          {                    output_left=output_left*coeffs_low_pass[21];                    output_right=output_right*coeffs_low_pass[21];           } } void ACC_ISR(){          acc_over=1;}

回帖(12)

张虎豹

2018-12-6 09:38:34
您好,您的问题已经提交给ADI相关专家,将邀请专家尽快回答您的问题。谢谢!
举报

袁喆

2018-12-6 09:48:19
你好!
 
在你的代码里面,你通过
adi_int_InstallHandler(ADI_CID_P0I,(ADI_INT_HANDLER_PTR)ACC_ISR, _NULL ,true);  
把Programmable Interrupt 0 和中断处理函数关联起来了,但是你还需要通过PICRx这个寄存器把Accelerator DMA 的中端映射到Programmable Interrupt 0
举报

张秀荣

2018-12-6 09:59:49
引用: 海蜇pi 发表于 2018-12-6 13:30
你好!
 
在你的代码里面,你通过

谢谢你的答复,代码里面第64行到68行不是在对PICR0进行设置了吗?
//Mapping the IIR DMA interrupt  temp=*pPICR0;  temp&=~(P0I0|P0I1|P0I2|P0I3|P0I4); temp|=P0I0|P0I1|P0I3|P0I4; *pPICR0=temp;
这里应该是吧IIR DMA Interrupt映射到Programmable Interrupt 0上吧?
举报

袁喆

2018-12-6 10:05:50
引用: lulijian 发表于 2018-12-6 13:42
谢谢你的答复,代码里面第64行到68行不是在对PICR0进行设置了吗?
//Mapping the IIR DMA interrupt  temp=*pPICR0;  temp&=~(P0I0|P0I1|P0I2|P0I3|P0I4); temp|=P0I0|P0I1|P0I3|P0I4; *pPICR0=temp;
这里应该是吧IIR DMA Interrupt映射到Programmable Interrupt 0上吧?

你好!
 
你需要debug一下,看看PICR0 的最低5位是不是0x1B,如果是的,哪可能是系统其他的问题让IIR没有正常工作,所以没有中断产生
举报

更多回帖

发帖
×
20
完善资料,
赚取积分