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.

TMS320F28388D: Synchronize SPI Module for Simulataneous Transmit

Part Number: TMS320F28388D


Hi all!

As I mentioned we wanted to start all 4 SPI modules at tthe same time to send data. Or at least 2 of them if all not possible. Therefore I check the CLB unit to make a combinational logic circut to start SPI transmit at same time. But I am not sure if it is possible. I checked the SPI related CLB outputs but didn't get the meanings of IN and OUT in the list.

To sum up can I synchronize all SPI's data tranmission? 

cheers,

  • Yes Im not sure what you are trying to accomplish is related to the Signals in your screenshot. Those are signals you can OVERRIDE using the CLB. For example if instead of the output signals of the SPI module, you wanted to generate the wave with CLB and replace those signals then you could use those.

    For your case, starting all transactions at the exact same time, I have been thinking about it and I can come up with only 1 method that may work.

    How about this?

    Set up two different DMAs to write to the two different SPI TX modules. Have them both triggered by the same SIGNAL source, maybe an INT, ePWM or something else that you can generate.

    When the TRIGGER arrives, both DMAs should write to their corresponding SPI modules at the same time and that should trigger the transfers.

  • Hi Nima!

    Thabnks for your explantation and your answer. I just didn't get the exact meanings of the (IN) and (OUT) next to signal names. FOr example what is the difference between the SPISTE(OUT) and SPISTE(IN)?

    For my issue, actually I will use SPI's with DMA to send continuously data without CPU interaction. I will start them once together and they will send data synchronously. But which signal can start them at simultaneously?

    cheers,

  • SPISTE OUT means you are replacing the SPITE signal send out if your SPI module in master mode, and you are planning on creating this output signal through CLB.

    IN means you are creating the SPISTE signal fed into your slave SPI module by using the CLB output.

  • The Trigger for your DMA can be the same signal for both DMAs. You can look at all available DMA triggers in the TRM.

  • I got what you mean but in my application trigger for each dma channel will be TX event of its dedicated SPI module. Like below.

    SPIA_TX  -> DMA1

    SPIB_TX  -> DMA2

    SPIC_TX  -> DMA3

    SPID_TX  -> DMA4

    And they will work continuously at background without CPU interaction. Do you mean can I use one SPI to trigger all 4 DMA channels?

        DMA_configAddresses(DMA_CH5_BASE, (uint16_t *)(SPIA_BASE + SPI_O_TXBUF),
                            &dummy_data);
        DMA_configBurst(DMA_CH5_BASE, BURST, 0, 0);
        DMA_configTransfer(DMA_CH5_BASE, TRANSFER, 0, 0);
        DMA_configMode(DMA_CH5_BASE, DMA_TRIGGER_SPIATX, DMA_CFG_ONESHOT_DISABLE |
                       DMA_CFG_CONTINUOUS_ENABLE | DMA_CFG_SIZE_16BIT);

  • You can use the same DMA trigger for all DMAs. Trigger them all with the same signal.

  • Thanks a lot. I will try it.