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.

LP-AM243: Looping back SPI1 and SPI4 in Master Tx and Slave Rx mode

Part Number: LP-AM243

Hi
Is there any example for Looping back SPI1 and SPI4 in Master Tx and Slave Rx mode?  Or even an example of Slave Receive mode that I can use? I am not able to find correct settings for Slave Receive mode. Master Tx/Rx works and examples are available...

  • Hi Rajeev,

    Currently, there is no McSPI slave example, but the IC and API does support the McSPI slave mode. You can change the example.syscfg file as following:

    One more thing keep in mind, the McSPI slave mode only supported on channel 0.

    Best regards,

    Ming

  • Thanks. What does the following mean:
    Only channel 0 can be configured as a peripheral but through the MCSPI_CHCONF_0[22-21]
    SPIENSLV bit field any of the SPIEN[i] signals can be used to select the MCSPI module. I

  • Hi Rajeev,

    That is the limitation for the McSPI slave support as I mentioned in previous post: "McSPI slave mode only supported on channel 0" for each McSPI instance.

    Best regards,

    Ming

  • Understood. My question is about this following comment in the data sheet: What use is the ability to configure different enable signals via SPIEN[i] signal?

    Only channel 0 can be configured as a peripheral but through the MCSPI_CHCONF_0[22-21]
    SPIENSLV bit field any of the SPIEN[i] signals can be used to select the MCSPI module.

  • Hi Rajeev,

    It means that you can use any of the McSPI instances (McSPI 0 - 4) for slave mode, but only channel 0(CS0) is supported for slave mode.

    [22-21] SPIENSLV can be set to any of the four (0 - 3) , but it has to match with the SPIEN[i] actually used.

    Best regards,

    Ming

  • Hi Ming,
    One more question to clarify.

    When you say only channel 0 can be configured as Peripheral, does it mean only MCSPI0 port can be configured as peripheral and  MCSPI1, MCSPI2, MCSPI3 and MCSPI4 can NOT be? Or does it mean all, MCSPI0, MCSPI1, MCSPI2, MCSPI3 and MCSPI4 ports can be used as peripheral but only Channel 0 on these ports can receive data.

  • Hi Rajeev,

    The latter is correct. channel 0 means CS0 for McSPI 0 - 4.

    Best regards,

    Ming

  • Another question:
    In three pin mode, when Chip select is completely ignored, can ANY MCSPI Port (MCSPI0, MCSPI1, MCSPI2, MCSPI3 or MCSPI4) be used in Peripheral mode since chip select has no meaning anymore?

  • Hi Rajeev,

    According to the following paragraph in TRM, only channel 0 can be used for slave mode, because the channel i to channel 0 routing is done through the SPIEN[i]. When the 3 pin mode (PIN34=1) is used, SPIEN[i] is useless.

    12.1.4.4.5 MCSPI 3-Pin or 4-Pin Mode
    Depending on targeted application the MCSPI interface can be configured to use 3 or 4 pins through the [1]
    PIN34 bit. If this bit is set to 0, MCSPI is in 4-pin mode using the SPICLK, SPIDAT[0], SPIDAT[1] and SPIEN[i]
    signals. If PIN34 is set to 1 the controller is in 3-pin mode and SPIEN[i] is not used. In this mode all options
    related to chip select management are useless (EPOL, FORCE and TCS0 bits of /1/2/3). 3-pin and 4-pin
    operation applies to both master and slave modes.

    Best regards,

    Ming