Forum Discussion

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

stream transfer between uart and onchiop memory

Hello:

I use the DMA controler to connect the data rom and Uart and use it to connect the instructing ram and data ram.But the uart can't receive the data.My code is below:

IOWR_ALTERA_AVALON_DMA_STATUS(DMA_BASE,0);

IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_BASE,0);

IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_BASE,0xff);

IOWR_ALTERA_AVALON_DMA_RADDRESS(DMA_BASE,(int)buffer);

IOWR_ALTERA_AVALON_DMA_WADDRESS(DMA_BASE,UART_BASE);

IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_BASE,ALTERA_AVALON_DMA_CONTROL_GO_MSK|ALTERA_AVALON_DMA_CONTROL_LEEN_MSK|ALTERA_AVALON_DMA_CONTROL_WCON_MSK|ALTERA_AVALON_DMA_CONTROL_BYTE_MSK);

Have problem?

while((IORD_ALTERA_AVALON_DMA_STATUS(DMA_BASE)& ALTERA_AVALON_DMA_STATUS_BUSY_MSK)!=0);

2 Replies

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

    Yes, me too.

    i can read uart through DMA, but can't write!

    why? SOPC configuration or else?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To Simon.Embed;

    The receive you use what code ,like me?

    and in the pc you use what tool?