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
...