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.

MibSPI Communication between two TMS570

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

Hi everyone,

I want to connect two TMS570LS3137 over SPI to send data from the Master MCU to the Slave. To do so, I want to use the Multibufered-SPI.

I am already able to transmit data out of the Master via different Transfer Groups. I made an example with HalCoGen, where i call the following funcions to transfer data with group1 and group 2:

mibspiSetData(mibspiREG1, 0, data);
mibspiSetData(mibspiREG1, 1, data2);

mibspiTransfer(mibspiREG1, 0);
mibspiTransfer(mibspiREG1, 1);

But I don't quite get the Multibuffered-SPI receive mechanism yet.

As far as I get it by now, the slave MCU hast to know how many bytes will be received and has to configure the transfer groups accordingly.

At the moment my slave MCU only receives data throug transfer group 1. If i do not enable group 1 in the slave by writing the TGENA bit in TGCTRL

(mibspiREG3->TGCTRL[0] |= 0x80000000;) I do not receive anything at the slave, altough the other transfer groups are enabled.

My questions are:

Is the configuration of the transfer groups relevant for receiving data?

I have to transmit flexible numbers of bytes. Would it be better to use normal SPI mode to send data from the master to the slave?

Thanks in advance

Dominik

  • Dominik,

    I would recommend to use normal SPI mode if you want to transfer flexible amount of data.

    Thanks and regards,

    zhaohong

  • Can you explain why you recommend using normal SPI mode?

    I believe the problem is that it is not possible that the slave recognizes a completed transmission by hardware, when the receive buffer has not been filled completely  (e.g. the amount of data received by the slave was less than the size of transfer group 0 of the slave MCU) or more data has been received.

    Am I right with that?

    The amount of data which has to be transferred, will be very huge. So I would prefer the multi buffer mode.

    Thanks in advance,

    Dominik

  • Dominik,

    In the multibuffer  mode, the module only generates an interrupt when a transfer group is complete. You can poll the buffer but it is not the preferred method. I would suggest you to spend more time on the data structure for communication. If the transmission side can notify the receiver side about the number of data it will send, you may still use the multibuffer mode. You can use the SPI_EN pin so that SPI master does not start transmission before the slave is ready. If you data size is larger that the buffer size, I would suggest you using DMA instead.

    Thanks and regards,

    Zhaohong