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.

How to select which Chip Select is used on SPI1 port

Guru 15580 points
Other Parts Discussed in Thread: OMAP-L138

I am having trouble understanding how to configure SPI1_SCS[1] to be the active chip select line on writes to my SPI1 port. I understand how to configure the PINMUX5_3_0=0x1 to select the SPI_SCS[1] function for the pin. I also understand how to configure spi->SPIPC0.SCS0FUN[n]=0x02 to make SPI1_SCS1 a SPI functional pin. But what I do not understand is how to actually *select* SPI_SCS1 when I write to the SPI1 port. At first I thought SPIDAT1->CSNR[1] would select CS1, but this config register only tells the SPI port whether CS is to be a 1 or zero during the SPI transfer.

How to I select SPI1_SCSn1 for my SPI1 port transfers?

Thx,

Mikeh

 

  •  

    ....and from the User Guide (spru4fm)....

    In master mode, the SPIx_SCS[n] pin functions as an output, and toggles when a specific slave device is

    selected.

    ...so how do I select a "specific slave device"?

    However, this is most useful on devices that support multiple SPIx_SCS[n] pins.

    ...which the OMAP-L138 *does*...

    The SPI only supports a single SPIx_SCS[n] and so the usefulness of this pin in master mode is limited. In practice,

    general-purpose I/O pins are needed to support multiple slave device chip selects.

    Huh? What does this mean? Why would the OMAP-L138 provide several SPIx_SCS[n] pins if it does not support them?

    However, one reason to use the SPIx_SCS[n] pin as a functional pin for the SPI master is to take

    advantage of the timing parameters that can be set using the SPI delay register (SPIDELAY). The

    SPIDELAY allows delays to be added automatically so that the slave timing requirements between clock

    and chip select may be more easily met. Another reason would be to make use of the error detection built

    into the SPI.

    These are all of the reasons why I *do* want to use SPIx_SCS[n]. I just don't quite understand how to.....

    Clarifications appreciated.

    Thx

    MikeH