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 destination buffer configuration



 Hi,

 I m using TMS570 DMA package to interface with the SCI. I need to create the destination buffer in RAM which can hold the data from SCIRX buffer. Since i will be receiving data from external source I m unaware of the number of bytes I will be receiving. If i configure the destination buffer to hold say 50 bytes of data(and include a provision to read the buffer once in a while), will  the DMA write the 51st byte into the zeroth location of the destination buffer(like a circular buffer) or will there be a data loss since the destination buffer holds only 50 bytes?. If the provision is not available then what could be done to avoid the data loss?

Regards

pallavi

 

  • Pallavi,

    You can enable two DMA interrupts: HBC and BTC. The the block transfer size is 50. HBC interrupt is triggered after 25 data have been transferred. BTC interrupt will be triggered after 50 data have been transferred. Those interrupts will enable you to read data in time.

    Thanks and regards,

    Zhaohong

  • Hi Zhaohang,

    Thanks for the response,

    In our application we are not supossed to use any interrupts. And we need clarification on roll back of destination buffer.

    Eg: Dest_Buffer[50]

     1. During DMA transfer, if the buffer is completely filled  (all 50 elements) and for the NEXT DMA transfer is the array index going to be roll back to '0' or NOT even though if we have not read the desitnation buffer.

    Regards,

    Ajay.

     

     

  • Ajay,

    DMA only "rolls back" when the "autoinit" feature is enabled. Otherwaise, you will need to restart DMA after the 50 samples are moved. You can poll the DMA status flags if you cannot use interrupt.

    Thanks and regards,

    Zhaohong