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.

TMS320F28335 - SPI on McBSP read word length

Other Parts Discussed in Thread: TMS320F28335

 We are planning on using the SPI on the McBSP channel B. McBSP user’s guide states that the maximum word length for the SPI on the McBSP is 32 bits and that after each word transmitted the FSX pin will go inactive.

We are attaching a SPI device to the McBSP that requires and 8 bits command followed by a 24 bits address before retrieving the data. So my 32 bits are already consumed before I even get the first bit of the data I’m trying to read. And the FSX signal will go inactive, telling the device that I’m done reading… Does the framing phase feature on the McBSP still apply when used as an SPI, in which case the FSX pin would only go inactive after every words in a phase have been transmitted? Please see user’s guide extract below….

 

  • Just so I understand, I believe you are referring to Frame Phase feature that allows flexibility in terms of the number of words and the number of bits per word that can be specified differently for each of the two phases of a frame, allowing greater flexibility in structuring data transfers? And if this applies to SPI mode?

    Frame Phase (section 2.4 of McBSP user's guide):
    http://www.ti.com/litv/pdf/sprufb7a

    I looked at Table 6-1 of the above guide. It mandates a frame-length of 1 serial word only. i.e. XFRLEN1 & RFRLEN1 must be 0. I don’t think the concept of “frame” applies to the SPI mode.

  • Thanks Harman for looking into this.

    So we can only have a one word frame, and the frame length can be no longer than 32 bits.

    I have a 1Mbits SPI MRAM chip and to read from it you have to send an 8 bit read command followed by a 24 bits address, and then continue issuing clock until you've read your data. The problem here is that with the command byte and the address field I already total 32 bits which is the maximum word length and the FSX pin will go inactive, which will make my MRAM chip terminate transaction....

    Looks like we can't use the FSX pin with our MRAM chip then? Do you confirm that?

  • I would confirm that in this case FSX may not work. In SPI mode it operates like a chip select signal and will go high after each packet transfer.
    Instead I would recommend using a GPIO controlled by software.

  • Harman,

    I would agree. SS and/or CS  is not very standard in mplementation or meaning throughout the SPI world. Best to use a GPIO. Also, have to ask the question, "Why not use the SPI peripheral for this application?"

  • Would it make sense to keep the device on the McBSP in order to benefit from the DMA with SPI transfers then?

  • The reason here was to take advantage of the DMA trasnfers available while using the SPI on the McBSP... Now I'm wondering if that would still work?

  • What is the reason for the DMA mode? If it's talking to a memory then the 16 level FIFO should be more than enough. Also I would think that the DMA mode McBSP would also work, but what is the transmit size? You can really ignore the SS/CS line and frame the transfer with GPIO, it shouldn't make any difference to the data stream. One last thing, the 32 bit address is merely data from the SPI interface standpoint. It shouldn't enforce any special requirements on the interface.

  • We are planning on using the SPI_slave on the one of the McBSP channel(TMS320F28335). word length 16 bit and as per the McBSP user’s guide states that the maximum word length for the SPI on the McBSP is a frame-length of 1 serial word only. i.e. XFRLEN1 & RFRLEN1 must be 0 [I looked at Table 6-1 of the MCBSP user guide(SPRUFB7b)].

    First i have tested single world per frame it is working fine and i tried to implement  the continuous data (16 world per frame) receiving and transmitting in MCBSP_SPI_SLAVE mode, as per the Mcbsp user guide it is not possible because McBSP_SPI frame-length of 1 serial word only but i am surprised after testing i am able to receive continuous data 16 world/frame. still i am not convinced the result because as per the user guide is not possible but i am able to do that , now i am confused MCBSP_SPI_Slave mode able to receive 1 world/Frame or multiple world/Frame. Please  can you clarify above the statement.

    Regards,

    M.Kannan