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/TMS320C6748: the spi1's clk setting

Part Number: TMS320C6748


Tool/software: Code Composer Studio

Now i am using the spi1 to do some communication work, and i set the spi as master, 3 pin mode. but when i set the dataformat to 3 it can't change the clk's prescale by the function "SPIClkConfigure(unsigned int baseAdd, unsigned int moduleClk,unsigned int spiClk, unsigned int dataFormat)", if i set the dataformat to 0 ,it can be changed by this function." why this happen?  And by the manual it is said that under the slave mode it should just can use dataformat0, but i have set it to master mode, why i still can't change the clk?

And i want to know the dataformat of spi 0-3 equal with which chart?figure 28-8~28-11?

  • Hi,

    I've notified the design team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Hi,

    What software are you running?  What PRESCALE value are you trying to use?

    Also, you can program any of the dataformats (0-3) to match Figure 28-8 ~ 28-11 by configuring SPIFMTn.POLARITY and SPIFMTn.PHASE.

    Regards,

    Melissa

  • I am using the ccs. THE precale value belongs to the SPIFMT_4 registers about this register which confuse me is that no matter which register i set  it still show SPIFMT_4, so i can't sure about  if i have set successful. Another question is that  about the four figure which exactly format they belong? because the manual is not very clear, i think. So when i want to use some format i can know it's timing chart clearly.

  • Are you using a particular software package (i.e. SYS/BIOS, RTOS, StarterWare, etc.)?  Or are you setting registers by writing directly into the CCS Memory Window?

    Can you also share your code for how you are configuring the prescale value?

    You (as the user) program the SPIFMTn registers .  Any SPIFMTn register can be configured or programmed to match any of the Figures (28-8 ~ 28-11).  For example, if you configure SPIFMTn.POLARITY = 0 and SPIFMTn.PHASE = 0, then SPIFMTn will match Figure 28-8.  Alternatively, if you configure SPIFMTn.POLARITY = 1 and SPIFMTn.PHASE = 0, then SPIFMTn will match Figure 28-10.

    Regards,

    Melissa

  • Yeah, I think you are right, and they will math. but which format (0-3?) they can call? for example if SPIFMTn.POLARITY = 0 and SPIFMTn.PHASE = 0 , can i call it as format 0? because the manul didn't says clearly.  And if these formats is the regular format for spi communction? at another cpu, i mean different bound does it is exactly the same format? because we want to build the com with the cpu, which belong to different bound. 

  • Yes, these correspond to the regular formats for SPI communication.  See below.

    Figure 28-8:    SPIFMTn.POLARITY = 0, SPIFMTn.PHASE = 0  (SPI Mode 0)
    Figure 28-9:    SPIFMTn.POLARITY = 0, SPIFMTn.PHASE = 1  (SPI Mode 1)
    Figure 28-10:  SPIFMTn.POLARITY = 1, SPIFMTn.PHASE = 0  (SPI Mode 2)
    Figure 28-11:  SPIFMTn.POLARITY = 1, SPIFMTn.PHASE = 1  (SPI Mode 3)

    Regards,

    Melissa

  • thank you very much