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.

CCS/TMS570LS0232: How to set SPI duplex communication in HalCoGen?

Part Number: TMS570LS0232
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello, TI Engineers

I want to use HalCoGen to set SPI duplex mode. But I do not sure that SPI could be set as duplex communication in halcogen. For duplex communication, I just need to uncheck Master in Global Config block? In interrupt block, should I do more?

Thanks and regards!

Xinyu

  • Hello Xinyu,

    SPI by protocol is full duplex in nature. SPI transmits and receives data simultaneously on two separate data pins SIMO and SOMI. It is possible to use SPI for half duplex mode, but you need to enable this mode manually (not included in HALCoGen)

    The Half Duplex Mode gives an additional flexibility to use the SIMO pin which is normally used TX pin in Master mode to work like an RX pin while the HDUPLEX_ENAx bit is set to ‘1’. In Half Duplex Master mode, SIMO pin itself acts as an RX pin. Switching between Full Duplex and Half Duplex can be achieved using the SPIFMTx registers being selected using the DFSEL[1:0] bits of SPIDATx or TXRAM locations.

    In case of Slave mode, the SIMO pin which is normally an RX pin, will act as a TX pin while the HDUPLEX_ENAx bit is set to ‘1’. In Half Duplex Slave mode, SIMO pin itself acts as a TX pin. Switching between Full Duplex and Half Duplex can be achieved using the SPIFMTx registers being selected using the DFSEL[1:0] bits of SPIDATx or TXRAM locations.
  • Hi, Wang

    Could you give me a case or example for setting full duplex SPI in HalCoGen? It is useful for me to operate and test on LAUCHXL-TMS57004.

    Thanks and regards!

    Xinyu
  • Hello, Wang

    In fact, for SPI source, I hope I could set SPI1 for simplex TX, SPI2 for simplex RX and SPI3 for duplex mode. And Could I set SPI simplex in HalCoGen? Could you offer me an example for SPI simplex in HalCoGen?

    thanks and Regards!

    Xinyu