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.

Is there a way to tell how many bytes were transferred by the MSP432 DMA?

Hi,

I am trying to implement an I2C driver that uses DMA to transfer data, but since the driver has no knowledge of how many bytes are going to be sent by the master, I am setting the DMA buffer to a "Big" number, bigger than any message we are expecting. That means that most of the time, the DMA interrupt will not trigger and just the EUSCI_Bx will upon the master sending the STOP. That is the way, I have it currently setup, but when looking at the DMA API's and the Technical Reference, I could not find any register that would tell me how many bytes have been transferred. So, other than implementing a protocol , is there another way to find out how many bytes were transferred?

thanks

Pedro Valladares

  • Pedro,
    I have not tried to do this, but the size value in the control register within the dma control table should be counting down to 0. www.ti.com/.../slau356d.pdf.

    Chris
  • ... I could not find any register that would tell me how many bytes have been transferred.

    Maybe because this is not the use-case DMA is intended for. Polling the current state would defeat the very purpose of DMA - the cycles saved by DMA are spent while polling.

    Perhaps an event-based (i.e. interrupt) approach would be more appropriate in your case.

**Attention** This is a public forum