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.

TMS570LS1224: Setting SPI RX pin in dual mode. Digital Input and SOMI

Part Number: TMS570LS1224

Dear All, 

For one of my application, I want to use SPI3 RX pin for 2 purpose

1. To receive the RX data

2. To monitor the pin state 

can somebody help how this can be achieved ?

Kind Regards

Vikram Jain

  • Hello,
    Bit SOMIDIN[x] in SPIPC2 register contains the current value on the SPISOMI[x] pin. Another way is to connect SPISOMI[x] tin to GIO and monitor GIO state.

    Best regards,
    Miro
  • Dear Miroslav, 

    Thank you for your reply. But what i want to achieve is both. I want to use SPI RX to receive the data as well as see the input state of the pin ? both will happen one after other and not at the same time. 

    Thanks

  • Hello,
    The clock in SPI mode is provided by Master . If there is no clock, then data on RX pin will not be moved in to shift register. In this case you could monitor bit SOMIDIN[x] in SPIPC2. This will give you the current state on the SPISOMI[x] pin at any moment. But if there is a clock on CLK pin then any data on SOMI pin will be received. Another approach could be using handshaking mechanism, provided by the SPIENA pin, enables a slave SPI to delay the generation of the clock signal supplied by the master if it is not prepared for the next exchange of data.
    You could change mode of that pin to GIO while you are not expecting data.

    Best regards,
    Miro
  • Thank you so much for your reply.

    so using SOMIDIN[x] in SPIPC2 register, I can monitor the status of the RX pin whilst the data is not been received ? All I want to do I s monitor the SPI RX pin state when there is no data transmission ?

    To give you an insight of application is I have a Analog chip that puts out the status of conversion on the SPI RX line is the conversion is completed then the RX line is pulled high and this is what i want to poll whether conversion is over or not.
  • Hello,
    Yes, you can monitor state of the RX pin with testing SOMIDIN[x] bit.

    Best regards,
    Miro
  • Dear All,

    Thank you so much that has helped a lot.


    Kind Regards
    Vikram Jain