Altera_Forum
Honored Contributor
16 years agoproblem of DMA(Momery to memory)
#include"system.h"# include<stdio.h># include"altera_avalon_dma_regs.h"# include"altera_avalon_pio_regs.h"# include"alt_types.h"
alt_u8 tab[8]={'a','b','c','d','e','f','g','h'},des[8]; alt_u32 flag; int main() { IOWR_ALTERA_AVALON_DMA_STATUS(DMA_BASE,0X00); IOWR_ALTERA_AVALON_DMA_RADDRESS(DMA_BASE,tab); IOWR_ALTERA_AVALON_DMA_WADDRESS(DMA_BASE,des); IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_BASE,8); IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_BASE,0X289); while(1) { if(0X01&IORD_ALTERA_AVALON_DMA_STATUS(DMA_BASE)) { IOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE,des[1]); } } return 0; } the DMA seems to work,the LEN AND DONE of status register are set to 1, but the des[8] did not receive anything from tab[8].