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 improve SPI performance, especailly speed and stability

Hi TI engineers,

I encountered speed and stability bottleneck when i select SPI1 channel 0 as SPI interface with another SPI to CAN chip.

My question is as below:

1.  How fast  can the SPI1 channel 0 can support, Mega HZ or more? How can i configure it in my application. It seemed when i  set the macro of MCSPI_CHCONF_CLKD(x) with x below 5, SPI communication became instable and wrong.

2. Currently,  i am not so sure whether it is stability or SPI speed issue which cause Error code during CAN communicaition. For example, standard CAN data frame would be considered as remote frame when a group of frames were sent together.

3. About the SPI APIs provided by TI. What measures should i take to deal with applications which have various SPI commands with different size. For example, byte read operation and byte write operation require two bytes timing, then i Set the macro of MCSPI_CHCONF_WL(16), But for those 3 bytes timing command, should i set this macro to MCSPI_CHCONF_WL(24). And besides, for multiple bytes read and write operation, i could not implement them directly by API from TI's. I am wondering what should i do if multiple bytes write and read operations has to be done.  At present, i write like below

 timing 1: send command.

 timing 2: send address.

timing 3: send one byte.

then repeat above procedures to perform another byte read or write operation. 

 But i think it is less effective comapred with timing below

timing 1: send command

timing 2: send address

timing 3 :send first bype

timing4: send  a second byte

...

  • Hi,

    Can anybody help me!, it is time critical project. Thanks.

  • Hi,

    i would like to update the process of SPI debugging.

    There is SPI force cs character in datasheet about multiple byte send and receive method and  i also check source code of spi APIs since i had no reference example about SPI usuage. By the way, in wince A8 user guide, the touch screen driver uses spi2 cs0 to configure it and it is just single byte spi related.

    There are a pair of API called SPILockController and SPIUnlockController which provide access to set single bit in control register. So i used them in multiple byte method by setting or clearing the Force bit.  The problem is that it would take tens of milisecond to send  just several bytes.

    So could please help give me some advice about multiple byte SPI operation. Thanks!