This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6748的EDMA3传输完成中断问题

Other Parts Discussed in Thread: OPA334

目前 EDMA3 传输完成中断已经使能,IER寄存器已经是0x00000004,中断初始化已经打开,在相同条件下定时器中断可以进行,EDMA3中断已经映射到INT4,添加到事件,当程序运行时EDMA3的IPR寄存器已经置位0x00000004,但是就是不能进入中断服务函数,求大神帮忙了,具体的配置如下:

int main(void)
 {
// 外设使能配置
PSCInit();
// Set_Core_456MHz();           //调试ADC、DAC时将CPU始终屏蔽,因为仿真器仿真始终会出现错误
//  Set_DDR_156MHz();
GPIOBankPinMuxSet();    // GPIO 管脚复用配置
GPIOBankPinInit();     // GPIO 管脚初始化
DEVICE_DDR_Init();
InterruptInit();
EventCombineInterruptInit();
McBSP0Init();      //CLKX0:4.8 MHZ      FSX0:96KHZ
McBSP1Init();      //CLKX1:6.0 MHZ      FSX1:80KHZ
MCBSP0_ReceiveData(tccNum, chNum, AUDIO_DATA0);

GPIOPinWrite(SOC_GPIO_0_REGS, LED1_ADC_Sample, GPIO_PIN_HIGH);
GPIOPinWrite(SOC_GPIO_0_REGS, DAC_LDAC, GPIO_PIN_HIGH);
GPIOPinWrite(SOC_GPIO_0_REGS, OPA334_ENABLE, GPIO_PIN_HIGH);
while(1);
}

void InterruptInit(void)
{
 // 初始化 DSP 中断控制器
 IntDSPINTCInit();

 // 使能 DSP 全局中断
 IntGlobalEnable();
}

void EventCombineInterruptInit(void)
{
// EDMA3DisableEvtIntr(SOC_EDMA30CC_0_REGS,chNum);       //OK
     EDMA3EnableEvtIntr(SOC_EDMA30CC_0_REGS,chNum);    //OK
    // 传输完成中断
  IntEventCombineInit(C674X_MASK_INT4, C674X_MASK_INT15, ECM2_UNUSED, ECM3_UNUSED); //OK
  // 注册中断服务函数
     IntEventCombineRegister(SYS_INT_EDMA3_0_CC0_INT1,EDMA3_CHANNEL0_ISR);
  IntEventCombineAdd(SYS_INT_EDMA3_0_CC0_INT1);
  // 使能 定时器 / 计数器 中断
  TimerIntEnable(SOC_TMR_1_REGS, TMR_INT_TMR34_NON_CAPT_MODE);
  IntEventCombineRegister(SYS_INT_T64P1_TINT34, TimerIsr);
  IntEventCombineAdd(SYS_INT_T64P1_TINT34);
}
void EDMA3_CHANNEL0_ISR()
{

 EDMA3ClrIntr(SOC_EDMA30CC_0_REGS, chNum);
// IntEventClear(SYS_INT_EDMA3_0_CC0_INT1);
 GPIOPinWrite(SOC_GPIO_0_REGS, LED1_ADC_Sample, GPIO_PIN_LOW);
// MCBSP0_ReceiveData(tccNum, chNum, AUDIO_DATA1);
}

void MCBSP0_ReceiveData(unsigned int tccNum, unsigned int chNum, unsigned long *dest_buffer)
{
    EDMA3CCPaRAMEntry paramSet;
    unsigned int acnt = 4;     // 一维                                    DRR 4:32位数据                2:16位数据
    unsigned int bcnt = AMOUNT_DATA_FRAME;  // 二维  AMOUNT_DATA_FRAME=24552                    采样 点的个数
    unsigned int ccnt = 1;  // 三维
    // 申请 EDMA3 通道
    EDMA3RequestChannel(SOC_EDMA30CC_0_REGS, chType, chNum, tccNum, evtQ);
 // 配置参数 RAM
//    paramSet.srcAddr = (unsigned int)src_buffer;            //          SOC_MCBSP_0_CTRL_REGS+0;
    paramSet.srcAddr = SOC_MCBSP_0_CTRL_REGS+0;
 paramSet.destAddr = (unsigned int)dest_buffer;
 paramSet.aCnt = (unsigned short)acnt;
 paramSet.bCnt = (unsigned short)bcnt;
 paramSet.cCnt = (unsigned short)ccnt;
 // 设置 SRC / DES 索引
 paramSet.srcBIdx = (short)0u;                    // DRR不动
 paramSet.destBIdx = (short)4u;                   //4:  4个字节=1个long
 // A Sync 传输模式(一维传输模式)
 paramSet.srcCIdx = (short)0u;
 paramSet.destCIdx = (short)0u;    //待定AMOUNT_DATA_FRAME
 paramSet.linkAddr = (unsigned short)0xFFFFu;          //链接到当前Param集
 paramSet.bCntReload = (unsigned short)0u;
 paramSet.opt = 0u;
 // Src 及 Dest 使用自增(INCR)模式
 paramSet.opt &= 0xFFFFFFFCu;
 // 配置 TCC
 paramSet.opt |= ((tccNum << EDMA3CC_OPT_TCC_SHIFT)|EDMA3CC_OPT_ITCINTEN|EDMA3CC_OPT_TCINTEN);
 // 写参数 RAM
 EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, chNum, &paramSet);
 // 使能传输
 EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, chNum, trigMode);
}