This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DMA Transfer



Hi,

I am attempting to do the following:

Transfer the 4 bytes from the SPI SPIBUF to RAM using DMA.

I have configured the SPI to receive the data I send by setting LOOPBACK  =1

I have enabled DMA in the SPI and assigned the DMA request line 0 to the SPI Rx event.

I have the DMA configured to transfer the 4 bytes from the SPIBUF to RAM.

I would like to have the DMA controller to incrment the destination RAM addess by 4 bytes each time a DMA is carried out.

Thus, I will get the 4 byte values that arrive in the SPIBUF written sequentially to memory.

However I am having problems setting the DMA to increment the destination address.

I am setting the the write addressing mode (ADDMW) to post-increment (1) but each time a DMA transfer occures the destination address does not increment.

Any ideas what I am doing wrong?

Steve

  • I read your another post:

    Please try:

    DMACtrlPkt.Frame_Cnt       = 10;                 // FRM_CNT 1 Frame transfer
    DMACtrlPkt.Elmnt_Cnt       = 1;     // ELM_CNT Element per Frame

    And in the main program, initialize and check these 10 transfers.

    I am afaid in your case, the current destination address is in the package 'working session' and might be reset by a new block transfer.

    Regards,

    Haixiao

  • Normal 0 false false false EN-GB X-NONE X-NONE MicrosoftInternetExplorer4

    Hi Haixiao,

    thanks for your reply.

    I have made the changes as per your suggestion and also set up an interrupt to signal block transfer complete and it is now running as I had planned.

    That is, SPI received data DMA'd to RAM each time new SPI data is received and the BTC flag getting raised after x number of DMAs to RAM.

    As you suspected my error was in the configuration of the element, frame and block sizes.

    Thank you very much for your assistance with this problem, consider it the matter now closed.

    Regards,

    Steve