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.

TMS570LS1227: TMS570 SPI usage question

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Hi,

we are having a problem here with the SPI.   We are using it with 10 data bits to mimic a UART (output only).   The data register is written but no signal is coming out of the pin (MOSI[0]).   The driver function is hanging waiting for a transfer that never happens.   Due to pin restrictions the MISO, CLK, CS and ENA pins are used as GPIO elsewhere.  As far as I can see all SPI registers are initialised correctly (halcogen software).

My question: is it possible to use the SPI with one transmit pin only?   We had the same software working on another part but there the pins were assigned but simply not connected externally.   What makes me suspicious is the note in the user manual: Note: Regardless of the number of parallel pins used, the SPISOMI[0] pin will always have to be programmed as functional pins for any SPI transfers.

So in order to make a transfer, do we have to use MOSI, MISO and CLK (and possibly CS) externally?   Or can we send out data to just the MOSI pin?

Regards,

  • Hagen,

    SPI is a synchronous communication. The serial clock SPICLK is required. The SPICLK is generated by master. SPIENA is optional which is used to enable a slave SPI to delay the communication.

    If you only transmit data to one device, you can use two pins: SPICLK and SPISIMO. SPICLK is a MUST.

  • Hi,

    ok, you obviously did not read my post it so I have to repeat it: WE ARE USING THE SPI OUTPUT TO GENERATE A UART SIGNAL.  WE DO NOT USE ANOTHER SPI ON THE RECEIVING SIDE.  So we still have to enable the hardware clock output pin in order to get a signal on MOSI?

    Regards,

  • Hi Hagen,

    If you want to use SOMI as SPI functional, the SPI clk has to be configured as functional even it is not connected to another device. If polarity and phase are 0, the SIMO data is output on the rising edge of SPICLK, and input data is latched on the falling edge of SPICLK. If the SPICLK is not enabled, or you configure this pin as GIO, you will not be able to see data on SIMO pin.

    If you use SIMO pin as GIO, and use this GIO as UART signal, you don't need to configure SPICLK as functional. 

  • "If the SPICLK is not enabled, or you configure this pin as GIO, you will not be able to see data on SIMO pin."

    Why?   What is the reason for stopping the output signal when the clock is not routed to the outside?   Can you explain to me why ti decided to waste silicon space to reduce the functionality of an ic that is suffering already from using pretty much half of the pins on supply and otherwise useless adc input only pins even more???   What were the designers thinking???

    "If you use SIMO pin as GIO, and use this GIO as UART signal, you don't need to configure SPICLK as functional. "

    Are you seriously suggesting I am bit-banging a GIO to get a UART output as a workaround on a $20 IC???

    Why is it that we are running into problems left, right and centre with the hardware and software of ti all the time whereas we do not see that with other manufacturers products?   I will definitely have a serious talk with our customer(who insisted on ti originally).

    But thank you for your post, it confirmed what we feared already.   I have to double check but I think if MISO isn't routed to the outside the SPI stops too.   So we need 3 pins for one output signal when using ti :-(

  • Hello Hagen,

    I am sorry for my confused words.  You don't need to route SPICLK to the outside, you only need to configure SPICLK as SPI functional signal.

    May I know why you use SPI UART. TI has an example to use N2HET as UART.

  • Hi,

    ok, I have to double check on that one and check how the pin / gio select is internally connected.   But I am pretty sure when I did not have the signal routed to the outside pin (GIO selected) the SPI would not start transmitting.   Whereas when the pin was selected as funtional SPI pin the SPI worked.  Cannot test it at the moment but will repeat it asap.

    We have two coprocessors in the system via two isolation barriers that requires a UART each.   Also two external RS232 interfaces (one output only and one both ways).   And another TI IC that requires UART communication as well.    So that makes 5 in total.  Both HETs are used as UARTs already, having two UARTs running in one HET seems to be impossible due to processing time constraints (I think code uses 34 slots; with 32 it would work).   Adding the output only UART into one of the source files (that I believe you provided)  would be possible but I do not see us writing HET microcode as an option (Motorola did that microcode timer concept about 30 years ago and failed, so I'm surprised that TI is trying it again).  So the SPI as a simple output only UART seemed like a good idea at the time and we had it tested on an EVM (but with output pins MOSI, MISOI, CLK active).  We will have to change some pins and modify the PCB, not nice but it doesn't seem we have a choice.

    Regards,

  • Hello Hagen,

    Thank you for explanation.

    If you use only SPI_SIMO to transmit data (as UART_TX), the SPI_SIMO and SPI_CLK should be configured as functional. SPI_SOMI is not required to be functional. 

    If SPI_CLK pin is multiplexed with other signals, for example ePWM signal, you can use this pin as ePWM because you don't need to output the SPI_CLK on this pin.