Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

DMA transaction between SDRAM and a UART

I would like to begin a DMA transaction between SDRAM and a UART on my Nios Development kit.

This is the code:

while(1)

{

IOWR_8DIRECT(DMA_BASE,1,SDRAM_BASE); // read address

IOWR_8DIRECT(DMA_BASE,2,UART_0_BASE); // write address

IOWR_8DIRECT(DMA_BASE,3,768); //length

IOWR_8DIRECT(DMA_BASE,6,0x281); // config

IOWR_8DIRECT(DMA_BASE,6,0x289); //GO!

i=IORD_8DIRECT(DMA_BASE,0); //read status

usleep(1000000);

}

i equals 0 if I put a breakpoint on the usleep line (after the delay, it always equals 0) ; at least the BUSY or DONE bit should be high.

I obtain nothing on the output pin (seen with an oscilloscope; I obtain data if I "fputc" them).

Any ideas?

Regards,

Marco Lazzaroni

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Marco,

    Try using IOWR_32DIRECT instead of IOWR_8DIRECT - the DMA registers are aligned to 4-byte boundaries.