But if I have design with 16 bits SDRAM memory and 16 bits some device and
I send by DMA data from memory to the device. In this case I should add to DMA
something device with 32 bits data bus else?
So, in my case I've added this 32bits device, program does work, but when I'm trying to
send data from my 16 bits memory to my 16 bits device by dma, the dma doesn't work.
My source code:
*****************
volatile unsigned short* dma_draw;
int ScrWidth=800,ScrHeight=600;
int ready=0;
unsigned short* p1 =(unsigned short*) SDRAM_V1_BASE; //16 bits slave
unsigned short* p2 =(unsigned short*) SDRAM_V2_BASE; //16 bits slave
//Video DMA //16 bits slave
void * pdma = (void*) VGA_DMA_BASE;
void isr_dma(void* context, alt_u32 id);
int main(void)
{
unsigned int i,j;
unsigned short* scr2;
alt_irq_register(VGA_DMA_IRQ, pdma, isr_dma);
scr2= p1;
scr2+=ScrWidth*ScrHeight;
for(i=ScrHeight+1;--i;)
for(j=ScrWidth+1;--j;)
*--scr2=i*j;
scr2= p2;
scr2+=ScrWidth*ScrHeight;
for(i=ScrHeight+1;--i;)
for(j=ScrWidth+1;--j;)
*--scr2=i*j;
dma_draw = p1;
IOWR_ALTERA_AVALON_DMA_CONTROL(VGA_DMA_BASE,0);
IOWR_ALTERA_AVALON_DMA_STATUS(VGA_DMA_BASE, 0);
IOWR_ALTERA_AVALON_DMA_RADDRESS(VGA_DMA_BASE, (int)dma_draw);
IOWR_ALTERA_AVALON_DMA_LENGTH(VGA_DMA_BASE, 800*600*2);
IOWR_ALTERA_AVALON_DMA_WADDRESS(VGA_DMA_BASE, VGA_BASE);
IOWR_ALTERA_AVALON_DMA_CONTROL(VGA_DMA_BASE,ALTERA_AVALON_DMA_CONTROL_GO_MSK |
ALTERA_AVALON_DMA_CONTROL_I_EN_MSK|
ALTERA_AVALON_DMA_CONTROL_HW_MSK|
ALTERA_AVALON_DMA_CONTROL_WEEN_MSK|
ALTERA_AVALON_DMA_CONTROL_WCON_MSK|
ALTERA_AVALON_DMA_CONTROL_LEEN_MSK);
********
Program continue works, data aren't transmiting
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif
Why?
Thx.