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.

C5515 SPI Chip Selects

Other Parts Discussed in Thread: TMS320C5515

Hello,

I have a question regarding SPI chip selects on the C5515.  In particular, how to set HI/LO the SPI_CS1 pin (see data pin assignments below). 

This pin is used to select the SPI slave device.

The screen shot below shows for P11=SPI_CS0 and N4=SPI_CS1.

From examples I cannot figure out how the SPI_CSn pins get toggled lo/hi to select the slave device. 

I am writing my own routines & do not plan on using the CSL code necessarily.

If I wanted to control GP[19] I would write

IOIDIR2 |= 0x0008;                // set GP[19] as output

IODATAOUT |= 0x0008;      // set GP[19] = HI

IODATAOUT &= 0xFFF7;  // set GP[19] = LO

Pretty easy.

From table 3-11 in the dataseet (page 29)

LCD_CS1_E1/SPI_CS1 -  N4 -  For SPI, this pin is SPI chip select SPI_CS1.

 If in the EBSR register I select PPMODE = Mode 5, the code above will be understood as controlling SPI_CS0 (Data Sheet Table 4-7).

 Q1.  But look at N4, LCD_CS1_E1SPI_CS1.  Here there is no GP[n] for me to control. 

            What do I do in order to set SPI_CS1 = HI/LO? 

            What code analogous to that shown in red would I use?


Thanks for your help!

  • I think you should look at 

    TMS320C5515/14/05/04/VC05/VC04 DSP
    Serial Peripheral Interface (SPI) User's Guisde (http://www.ti.com/lit/ug/sprufo3/sprufo3.pdf).

    In the document you'll find a complete description of typical communication operations (read and write) performed with a peripheral.

    But I reccomend (according to my own experience) using CSL for a start and especially CSL examples modified for your needs.

  • Hi Jamaal,

    You might want to double check the format of your post, it was confusing to not see the screenshot or red text you mentioned.

    It appears that you're trying to manipulate the pins manually via the gpio in the code above (i.e. bit banging). Alternatively, Have you had a chance to read the c5000 SPI User's Guide? It outlines how the SPI module can automatically control a lot of the functionality you might require. The guide could give you some good insight on how to use the SPI module registers (found on page 24 of the user's guide) to configure how the clock select pin is asserted during a frame transfer.

    The SPI User's Guide can be found here: http://www.ti.com/lit/ug/sprufo3/sprufo3.pdf.

    You will need to make sure to properly configure the SPICMD1 and SPICMD2 registers for the chip select pin you would like to assert on transfer.The chip select pin can be configured to be active high or active low during a transfer (the need for this configuration will be dependent on the component the c5515 is 'talking' to) via the SPIDCR1 and SPIDCR2 registers.

    Let me know if that helps!

    -Keegan

  • Hi Jamaal,

    You may have already seen this, but you can also find SPI example code in the C55x CSL.

    The CSL can be found here: http://www.ti.com/tool/sprc133 (you will want to get the LOWPOWER CSL for the C5515)

     

    Keegan