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.

TMS570LS3137: MibSPI5 on the 144-pin PGE package has only 1x chip-select (CS0)

Part Number: TMS570LS3137

Tool/software:

Hi there,

We are using the 144-pin PGE package of the MCU TMS570LS3137.

According to the device datasheet SPNS162C, the MibSPI5 peripheral in this package provides only 1x chip-select (CS0) to the outside, while the MCU has internally up to 4 CS (_nCS[3:0] for the BGA package, for example).

I'm looking for helps and confirmation for the following method to connect 2x SPI devices:

  • Use the MibSPI1 CS0 to connect to one SPI device #1
  • Tape an inverter to the CS0 line and connect its output to SPI device #2
  • To exchange with device #1, pull down CS0 as normally do
  • To exchange with device #2, raise CS0 by selecting any other CS (3, 2, or 1)
  • Does the MCU allow this even when other CS signals are not routed to the outside?

Thank you very much!

  • Hi Chuck,

    According to the device datasheet SPNS162C, the MibSPI5 peripheral in this package provides only 1x chip-select (CS0) to the outside, while the MCU has internally up to 4 CS (_nCS[3:0] for the BGA package, for example).

    You are correct for 144-pin package there is only one chip select line available on MibSPI5.

    • Use the MibSPI1 CS0 to connect to one SPI device #1
    • Tape an inverter to the CS0 line and connect its output to SPI device #2
    • To exchange with device #1, pull down CS0 as normally do
    • To exchange with device #2, raise CS0 by selecting any other CS (3, 2, or 1)
    • Does the MCU allow this even when other CS signals are not routed to the outside?

    I don't think this is a good idea because we can't disable both the devices if needed. At any given instance of time one of the device SPI chip-select will be active right?

    This might create issues, there won't be any ideal condition where both the devices chip select can be OFF. At any instance of time at least one slave will expect clock and data.

    Instead of this method you can use another GPIO as chip-select for another slave. I mean connect CS line of MibSPI5 to slave-1 and GPIO to the other slave-2. You already knew how to communicate with slave-1 which is operating with CS line right, now if you want to communicate with slave-2 then you can simply disable the CS functionality of the slave-1 and enable the slave-2 CS using GPIO. If you write low on the GPIO it will enable the chip-select for slave-2 and then you can proceed with your communication.

    Again, if you want to communicate with slave-1 then you can disable slave-2 CS by simply writing logic high on GPIO and then you can enable CS functionality for mibspi. Actually many customers will use this method only when they lack the chip-selects.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    Thank you for your prompt reply. The method that you proposed above was the first method that came to my mind. However, we might have to start the communication directly via DMA transfers, from the MCU RAM to the MibSPI5 TXRAM, so it won't be practical to enable a GPIO before the transfers, unless there are tweaks that we can do to overcome that ...

    About the "CS0 inverter" method in my question, since the SPI5 will be dedicated to 2 slave devices, what could be dangerous if one being always listening to the SPI bus, and if there is no data on the line? Potential noise issues?

    Regards,

    Chuck.

  • Hi Chuck,

    My sincere apologies for the delayed response and i was off for some days so didn't get time to work on this issue again.

    Thank you for your prompt reply. The method that you proposed above was the first method that came to my mind. However, we might have to start the communication directly via DMA transfers, from the MCU RAM to the MibSPI5 TXRAM, so it won't be practical to enable a GPIO before the transfers, unless there are tweaks that we can do to overcome that ...

    You are correct for DMA based transfers GPIO is not practical.

    Still even you can easily configure for one slave device which is connected with CS, but the issue will happen for the other slave which is using GPIO.

    About the "CS0 inverter" method in my question, since the SPI5 will be dedicated to 2 slave devices, what could be dangerous if one being always listening to the SPI bus, and if there is no data on the line? Potential noise issues?

    I mean for some slave devices we might need to toggle the chip-select in between frames as well, for those devices we might face some issues, if you don't have this requirement then it's okay.

    And also, you maybe need to use different CSNR value for both the devices

    You need to consider changing of CSNR value also in the both the devices data input. If you use same CSNR value, then again you might always communicate with one device only.

    Also use the CSHOLD bit to hold the CS line in between the transfers, otherwise CS will activate other device in between the transfers.

    I think these are the things we might need to care about and apart from this i don't find any issues. My suggestion would be better to create one prototype based on your requirements and if everything working fine then you can go for production.

    --
    Thanks & regards,
    Jagadish.