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/TMS570LC4357: Halcogen SPI configuration TMS570 development kit

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN, LAUNCHXL2-TMS57012

Tool/software: Code Composer Studio

Hello,

I would like know what's a valid configuration in Halcogen for the tms570 MCU development kit for using the SPI. I want to use SPI5 with chip_select/no_chip_select because I want to know about both cases.

I already tried different configurations for the development kit as well as for the launch pad(for the launch pad I experimented with the mibspi, not spi) and neither had worked. I don't believe that is a software problem because I checked the registers for both master and slave and the transmitting registers were set correctly but I couldn't receive anything. The RXBUF/BUF register is never set to anything but 0. For the transfer I use SPIDAT0 which is uploaded with my transmitting data. I tried the simo0 and somi0 with only the clk for the spi5. Enable the driver, in the port I set those pins as SPI and the rest of them as GIO.

I hope that somebody can help or at least give me some details that it can't be found in the documentation.

Regards,

Ciprian.

  • Hi Andrei,

    Attached are two projects - SPI Master and SPI Slave. Master is LaunchPad Launchxl2-TMS57012 (TMS570ls1224PGE MCU) and Slave is HDK with TMS570ls3137WT on-board. Master waits until button is pressed and sends data to slave. Slave uses interrupt when data is received.

    5758.SPI_MASTER_SLAVE.zip

    Best regards,

    Miro

  • Hi,

    This is not what I asked  in the last 3 replies, this doesn't get me to understand what's wrong because I use the same code with the same functions by myself.

    Thank you, I will carry on by myself.

    Regards,

    Ciprian.

  • Hi Ciprian,
    Inside the project you can find HALCoGen project also. Opening it with HALCoGen you will see all setting needed. The setup is for SPI mode and is working at my place.
    I'll forward your post to my colleagues.

    Best regards,
    Miro
  • I know that, I already see what you do in halcogen and I don t get it why are you using enable pin for master but not for slave in spi1 port. Also mibspi1 in pin mux for master but not in slave's configuration.

    Thank you for your time. I probably don't see some minor thing which is my fault.

    Regards,
    Ciprian.
  • Hi Ciprian,
    One of our MIBSPI experts will take a look at this thread.
    Taking in account my setup:
    About Master: In PINMUX tab - MIBSPINCS_0 is the only one that needs to be selected for 4 pin mode. All other can be deselected. You can see at device datasheet, Terminal configuration and Function section, that in MIBSPI mode MIBSPI1CLK, MISPI1SIMO[0], MIBSPI1SOMI[0] are not multiplexed (They are not multiplexed with other function. So in PINMUX tab you are not seeing them). MIBSPINCS_0 is multiplexed with MIBSPI1SOMI[1]/ECAP6 and that is why exact function should be selected. As MIBSPI1NENA, MIBSPI1NCS[1..5], are not used (those pins are also set as GIO in MIBSPI1 Tab), we don't need to select them in PINMUX Tab. I have missed to deselect those pins in PINMUX.

    Best regards,
    Miro

  • Hello,

    I found what the problem was. There is a matter of synchronization between the master and slave. I check the flag interrupt register FLG and that's how I found about it.

    Now, do you have any recomandation of how to sync these 2? Can it be done through the ENA pin with the 5 pin configuration SPI ?

  • Hi Ciprian,

    Great news from you!
    Yes, you could use ENA pin. You could also use any GIO to confirm that SPI is ready.

    Best regards,
    Miro