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.

CCS/CC3200-LAUNCHXL: General SPI Questions (TMS320F28335/CC3200)

Part Number: CC3200-LAUNCHXL
Other Parts Discussed in Thread: TMS320F28335, , CC3200

Tool/software: Code Composer Studio

Hello everyone,

I attempted to try to configure a SPI connection between the TMS320F28335 and CC3200-LAUNCHXL boards, but I had no luck. I'm trying to teach myself on how to establish a SPI connection, and would like to use this thread for general questions.

So, from what I have read, the first thing I need to do is to look at the clock speeds for both boards. I would like to configure the TMS320F28335 as the master and the CC3200-LAUNCHXL as the slave. According to page 27 of the CC3200-LAUNCHXL Technical Reference Manual (Literature Number: SWRU367C), the SPI can run up to 20MHz. Now, according to page 29 of the TMS320F28335 SPI Interface Reference Guide (Literature Number: SPRUEU3A), I could set the master's baud rate to roughly 9.375MHz using this register setup:

SPIBRR = 0b00000011   (LSPCLK = 37.5MHz according to page 43 of the TMS320F28335 datasheet (Literature Number: SPRS439N) as long as the SYSCLKOUT = 150MHz)

The master's baud rate of 9.375MHz is well with the slave's 20MHz operation.

Am I understanding this correctly? Or am I off track? Thanks for your reply and guidance.

  • Dalen,

    Yes you are understanding correctly. Generally, the Master node will be transmitting the clock. The SPICLK frequency must be less than or equal to the maximum operational frequency of the slave. In your stated configuration, the SPIs will be able to communicate. You will also need to look at the clock polarity and phases as well. I am not well versed on the CC3200, but the general operation of slave mode should be similar to the F28335. When in slave mode, the SPI is always operating at it's maximum frequency, as it needs to sample and detect the data and clock lines, this is why the clock dividers do nothing in slave mode. 

  • Hi Mark, thank you for your time.

    Let's say I want to setup my character length bits to 16, and I want to send data from the TMS320F28335 to the CC3200-LAUNCHXL on a rising clock edge while receiving data from the CC3200-LAUNCHXL on a falling edge. Then I would configure these registers on the TMS320F28335 as followed:

    SPICCR = 0b00001111 (then write it as 0b10001111 when ready for data transmission)

    SPICTL = 0b000001?0

    Now, I'm confused about bit 1, but it appears that if it is set to 0, then there is no outgoing data to the slave. Likewise, if set to 1, then data is allowed to be sent to the slave?

    Now, should the CC3200-LAUNCHXL be configured so to receive data on the rising edge and send data on the falling edge since it is "out of phase" with the TMS320F28335 (POL=0 and PHA=1)? Or, should the CC3200-LAUNCHXL be configured the exact same way as the TMS320F28335, with sending data on a rising edge and receiving data on a falling edge (POL=0 and PHA=0)? I got the POL and PHA values from the CC3200-LAUNCHXL Technical Reference Manual (Literature Number: SWRU367C) on page 223.

    Thank you to whoever replies!
  • Dalen,

    SPICTL.TALK (bit 1) bit enables data to be output. So if configured as Slave, no data will be put on SPISOMI, if master, no data will be put on SPISIMO.

    You would want the Polarity and Phase configuration to match. Data will be sent on one edge and sampled on the next edge in phase with each other, otherwise you might change the data while it is trying to be sampled by the other node. This is a simple test to try out yourself and see the results. Configure the SPIs to be "out of phase" with each other and then back in phase and watch what happens. you can see which works.
  • Dalen,

    Did my response answer your question?
  • Yes it did. Thank you Mark.

    Like I said, I'm using this thread for any general SPI questions so no one please close this thread yet.