微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > DSP5509a使用dma只能响应一次中断

DSP5509a使用dma只能响应一次中断

时间:10-02 整理:3721RD 点击:


DSP使用dma传输数据,只能响应一次中断,第二次情况是:读取数据个数未达到1帧(4096个)就停止读取数据,然后不能达到中断条件具体程序如下:#include #include #include #include #include #include #include #include <_csl_pgpio.h>#include #include "port5509Adma.h"#define N 4096#pragma DATA_SECTION(databuffer,"dmaMem")unsigned int databuffer[4096],sj[4096];#pragma DATA_SECTION(src,"shuju")unsigned int src[4096];interrupt void dma1_int();extern void VECSTART(void);PLL_Config myConfig = {}EMIF_Config emiffig = {}void init_dma1(unsigned int * src_data,unsigned int * dst_data){unsigned long int temp;//此处为DMA传输设置,一帧4096个数据,从EMIF接口到daram,中断条件是完成一帧并且同步事件发生,同步事件为int1*DMA_CCR1=0x4370;*DMA_GCR=0x0008;*DMA_GSCR=0x0001;*DMA_GTCR=0x0000;*DMA_CICR1=0x0008;*DMA_CSDP1=0x0209;*DMA_CEN1=0x1000;*DMA_CFN1=0x0001;*DMA_CSEI1=0x0000;*DMA_CSFI1=0x0000;*DMA_CDEI1=0x0000;*DMA_CDFI1=0x0000;*DMA_CSSA_L1=(unsigned int)(src_data)<<1;temp=((unsigned long int)(src_data))>>15;*DMA_CSSA_U1=(unsigned int)(temp);*DMA_CDSA_L1=(unsigned int)(dst_data)<<1;temp=((unsigned int)(dst_data))>>15;*DMA_CDSA_U1=(unsigned int)(temp);*DMA_CCR1=0x43f0;}main(){/*初始化CSL库*/CSL_init();/*EMIF为全EMIF接口*/CHIP_RSET(XBSR,0x0a01);/*设置系统的运行速度为144MHz*/PLL_config(&myConfig);EMIF_config(&emiffig);IRQ_globalDisable();IRQ_setVecs((Uint32)(&VECSTART));IRQ_clear(IRQ_EVT_DMAC1);IRQ_enable(IRQ_EVT_DMAC1);IRQ_plug(IRQ_EVT_DMAC1,&dma1_int);IRQ_globalEnable();_PGPIO_pinEnable(GPIO_PIN6);_PGPIO_pinDirection(GPIO_PIN6,1);_PGPIO_pinWrite(GPIO_PIN6,1);delay();_PGPIO_pinWrite(GPIO_PIN6,0);delay();_PGPIO_pinWrite(GPIO_PIN6,1);delay();init_dma1(src,databuffer);while(1);}interrupt void dma1_int(){}向量表:.sect ".vectors"*------------------------------------------------------------------------------* Global symbols defined here and exported out of this file*------------------------------------------------------------------------------.global _VECSTART*------------------------------------------------------------------------------* Global symbols referenced in this file but defined somewhere else.* Remember that your interrupt service routines need to be referenced here.*------------------------------------------------------------------------------.ref _c_int00.ref _dma1_int.def nmi, int0, int1, int2, int3, int4, int5, int6.def int7, int8,int10, int11, int12, int13.def int14, int15, int16, int17, int18, int19, int20.def int21, int22, int23, int24, int25, int26, int27.def int28, int29_VECSTART:.ivec _c_int00,c54x_stknmi .ivec no_isrnop_16int0 .ivec no_isrnop_16int1 .ivec no_isrnop_16int2 .ivec no_isrnop_16int3 .ivec no_isrnop_16int4 .ivec no_isrnop_16int5 .ivec no_isrnop_16int6 .ivec no_isrnop_16int7 .ivec no_isrnop_16int8 .ivec no_isrnop_16dmac1 .ivec _dma1_intnop_16int10 .ivec no_isrnop_16int11 .ivec no_isrnop_16int12 .ivec no_isrnop_16int13 .ivec no_isrnop_16int14 .ivec no_isrnop_16int15 .ivec no_isrnop_16int16 .ivec no_isrnop_16int17 .ivec no_isrnop_16int18 .ivec no_isrnop_16int19 .ivec no_isrnop_16int20 .ivec no_isrnop_16int21 .ivec no_isrnop_16int22 .ivec no_isrnop_16int23 .ivec no_isrnop_16int24 .ivec no_isrnop_16int25 .ivec no_isrnop_16int26 .ivec no_isrnop_16int27 .ivec no_isrnop_16int28 .ivec no_isrnop_16int29 .ivec no_isrnop_16*------------------------------------------------------------------------------* This is a dummy interrupt service routine used to initialize the IST.*------------------------------------------------------------------------------.text.def no_isrno_isr:b #no_isr

楼主应该把DSP的型号标上去。看包含的头文件,是5509 ?

对啊。。不好意思忘掉了。。

有人说是中断函数用IRQ挂的原因,是IRQ只能挂硬中断么?
如果把irq那几条注释掉,会直接一次中断都不能进入。
相当于向量表中挂的中断函数没起作用?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top