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.

TMS320F28386D: Seeking for advice on DMA/SPI usage with specific protocol

Part Number: TMS320F28386D
Other Parts Discussed in Thread: C2000WARE

Hello,

I have a specific component I am interfacing to with a SPI bus which has a specific protocol.

The protocol is composed of a first data byte corresponding to an OP-Code followed by 1 or more data bytes. The chip select must not be deactivated in between each bytes, which is achievable corresponding the corresponding data of the access are in the FIFO.

I need to perform multiple accesses of that type during our real time cycle without the CPU action, considering that the chip select must be deactivated in between each access.

As-is I am not sure how to achieve that with the available DMA triggers, would you have any idea to suggest me ?

Best regards,

Clément

  • Clement,

    If you intend to transmit / receive at specific time interval you can consider using CPU timer trigger / EPWM trigger to trigger SPI transmit / receive operation.

    Have you already looked into spi_ex4_loopback_dma example available in C2000Ware example? This shows how to configure SPI / DMA.

    Regards,

    Manoj

  • Hi,

    We have already achieved DMA/SPI transfer in the past.

    My concern here was on the way to achieve our specific protocol constrained thing without using the SPITXDMA event as it would work.

    But yeah maybe a solution would be to manage it using an internal timer, as I think it's possible to stop the DMA after X transfers even if the timer still raises new interrupts ?

    Best regards,

    Clément

  • But yeah maybe a solution would be to manage it using an internal timer, as I think it's possible to stop the DMA after X transfers even if the timer still raises new interrupts ?

    If you wish you to stop DMA transfer after 'X' transfer, make sure to configure DMA to disable DMA channel after 'X' transfer by clearing MODE.CONTINUOUS = 0.