DSP使用dma传输数据,只能响应一次中断,第二次情况是:读取数据个数未达到1帧(4096个)就停止读取数据,然后不能达到中断条件
具体程序如下:
#include <csl.h>
#include <csl_irq.h>
#include <csl_dma.h>
#include <csl_pll.h>
#include <csl_emif.h>
#include <csl_chip.h>
#include <stdio.h>
#include <_csl_pgpio.h>
#include <csl_gpio.h>
#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_stk
nmi .ivec no_isr
nop_16
int0 .ivec no_isr
nop_16
int1 .ivec no_isr
nop_16
int2 .ivec no_isr
nop_16
int3 .ivec no_isr
nop_16
int4 .ivec no_isr
nop_16
int5 .ivec no_isr
nop_16
int6 .ivec no_isr
nop_16
int7 .ivec no_isr
nop_16
int8 .ivec no_isr
nop_16
dmac1 .ivec _dma1_int
nop_16
int10 .ivec no_isr
nop_16
int11 .ivec no_isr
nop_16
int12 .ivec no_isr
nop_16
int13 .ivec no_isr
nop_16
int14 .ivec no_isr
nop_16
int15 .ivec no_isr
nop_16
int16 .ivec no_isr
nop_16
int17 .ivec no_isr
nop_16
int18 .ivec no_isr
nop_16
int19 .ivec no_isr
nop_16
int20 .ivec no_isr
nop_16
int21 .ivec no_isr
nop_16
int22 .ivec no_isr
nop_16
int23 .ivec no_isr
nop_16
int24 .ivec no_isr
nop_16
int25 .ivec no_isr
nop_16
int26 .ivec no_isr
nop_16
int27 .ivec no_isr
nop_16
int28 .ivec no_isr
nop_16
int29 .ivec no_isr
nop_16
*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
.text
.def no_isr
no_isr:
b #no_isr
|
|