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/TMS570LS3137: problem with spi1 in slave mode

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hey guys

I want to use SPI1 in slave mode. I have illustrated the settings in these images:

I want to use CS1, because CS0 has conflict with SOMI1. 

in main function I have initialized the SPI1 and enabled the its interrupt. but I don't know why it doesn't work. I also couldn't find a appropriate example code. could you please tell me, what I must do?

thanks.

  • Hello,

    1. You enabled the MibSPI1 Level interrupt which is the LOW level interrupt (low priority)
    2. In SPI configuration, you enabled the High Level interrupt for RX

    Please make those two selections consistent.
  • thanks Mr Wang
    Excuse me, what should I write in spiNotification and spiEndNotification functions? I couldn't find any example project. the example_spi_Master_Slave.c example code is using interrupt but It has just used two simple function. (now I'm using spi2 as the master and spi4 as the slave).
  • and when I run the example_spi_Master_Slave.c, the RX_Data_Master and RX_Data_Slave are completely zero. I don't know what I should do. I'm using spi2 as master and spi4 as slave.
  • Hi Hamid,

    You don't enable the SPI4 in "Friver Enable" of HALCoGen. You only enabled SPI1 (your screenshot in your 1st post).

    PIN Connections must be as Below

        ---------------         ---------------

        SPI2 ( Master )          SPI4 ( SLave)

        ---------------         ---------------

        SIM0             --->    SIMO

        S0MI             <---    SOMI

        CLK              --->    CLK

        CSx             --->    CSx

    Enabled SPI2 and SPI4:

  • 1. Check SPI2 and SPI4 in "Pinmux", and select either "SPI2ENA" or "SPI2CS_1" (pin D3)
    2. Under SPI2: check "master mode" and "Internal clock", and enable RXINT
    3. Under SP4: Uncheck "Master Mode", Uncheck "Internal Clock", and uncheck "DIR" for CS0
    4. Under VIM: enable SPI2 and SPI4 High and Low channels