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.

SPI configuration for TMS570LC4357 don't work

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Dear All,

I worked with the configuration of the spi for TMS570LC4357 but when I run the program I can't see nothing in the signals.

I use HalcoGen 04.05.02 for the configuration:

spiDAT1_t dataconfig1_t;

dataconfig1_t.CS_HOLD = FALSE;
dataconfig1_t.WDEL = TRUE;
dataconfig1_t.DFSEL = SPI_FMT_0;
dataconfig1_t.CSNR = 0xFE;

spiInit();


spiSendAndGetData(spiREG2, &dataconfig1_t, 16, TX_Data_Slave, RX_Data_Slave);

  • And I add the code that I use in the main program:
    ...

    spiDAT1_t dataconfig1_t;
    dataconfig1_t.CS_HOLD = FALSE;
    dataconfig1_t.WDEL = TRUE;
    dataconfig1_t.DFSEL = SPI_FMT_0;
    dataconfig1_t.CSNR = 0xFE;

    spiInit();
    spiSendAndGetData(spiREG2, &dataconfig1_t, 16, TX_Data_Slave, RX_Data_Slave);

    ...
    But I can't see any signal in the oscilloscope. I configurate after the pins to validate that the pins are ok, and if I configured the pins lik gpios the terminals work fine.

    Regards
    Juan Carlos
  • Hi Juan Carlos,

    What exactly does this mean? "I configurate after the pins to validate that the pins are ok, and if I configured the pins lik gpios the terminals work fine."

    Does it mean that you have checked the PINMUX tab? And that if you configure the SPI2 pins as GIO then you can control them as GIO through the SPI2 GIO registers and see the values change on the pin?

    Try just using the 3 pin SPI mode to start with. That way you don't get stuck if the ENA pin is low.

    There is also a MibSPI example that comes with HalCoGen for this part and you could try working that example first to get familiar w. how SPI works. There isn't really a reason to not use the MibSPI mode if this is the kit you're working with. The main reason to use SPI mode on this particular kit is if you had the need to go backward to a lower part in the family that only has a standard SPI on SPI2.
  • Dear all,

    I'm decided not created other post because I have a question about the configuration of SPI pheripheral.

    I'm working with the sabe microcontroler Hercules TMS570LS4357 and I designed the board to use this MCU. In the code use the MibSPI3 but I have a problem and question.

    The problem is: I use this spi to communicated with MAX31865 of Maxim Integrated. When I turn On my board, both CIs works fine, but after of minutes the MISO signal is bad and is similar of CLK or CS. I detected that when this event ocurred the MISO signal is in short circuit with  the other signals.

    I desolder the integrated and change for other integrates of other batch but is the same problem. In this moment in my board isn't this integrated (MAX31865).

    But I have a question, I see the signals of the spi with slaves and I can see that the miso signal has near 600mv level, in my configuration in HalCoGen I put a push pull resistor in the miso terminal, but I think that the normal status of this signal should be 3.3V with this resistor, this is ok or not?

    I share with you two picture:

    The fist is without pull up and pull down in the miso terminal

    And the second is with pull up resistor in miso terminal

    Regards

    Juan Carlos

  • No, if the pin is truly not connected to anything else, is configured as the master input pin and is configured with an internal pull-up, then the pin should be high (near VCCIO). You may have damaged the pin driver. In CCS you can write directly to the registers and configure the pin as a digital output instead of SOMI, and try writing it as a one and then as a zero.
  • Thank you Bob,

    I do the suggestion, but I can't see change in the signal, I use de following code:

    /* USER CODE BEGIN (1) */
    #include "HL_gio.h"
    #include "HL_mibspi.h"
    /* USER CODE END */

    /* USER CODE BEGIN (3) */

    uint32_t wait_counter = 0;

    gioInit();
    mibspiInit();

    int main()
    {
    int time=0;

    while(1)
    {
    gioToggleBit(mibspiPORT1, 11);
    //RTD_Reading(0x11, 0x82);
    for (time = 0; time< 10000000; time++);
    }
    }
    I have a question, I can read the data in the MISO lIne when I turn on my system, but do you have a idea of why is the reason to change the performance and after this lines will be in short circuit?
  •  Dear Bob,

    I have a picture of the signal in the pin, I can change the value of the miso like GIO