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.
SPI5 is the Master. Please see the attached images of the SPI5 clock config
.
We have tried two methods
Two APIs are used from Halcogen spiTransmitData, spiTransmitAndReceiveData. Since it was slow we tried to use another wrapper by calling only spiTransmitAndReceiveData, Which also took 9.6us to give output.
Hi,
How did get 9.6us? Did you use scope or PMU?
When is the start point and end point of the 9.6us interval in your measurement?
You can measure how many CPU cycles the API takes using PMU:
/*Start Cycle Counter */
_pmuStartCounters_(pmuCYCLE_COUNTER);
/* SPI API */
spiTransmitData(...);
or
spiTransmitAndReceiveData(...)
/*Stop Cycle Counter */
_pmuStopCounters_(pmuCYCLE_COUNTER);
/* read the CNNT cycle */
cycles= _pmuGetCycleCount_();
Toggling a GIO pin is good enough to measure the time consumed by the SP API.
Hi Sachin,
I just check the CPU cycles taken by the SPI APIs:
1. spiTransmitAndReceiveData(spiREG1, &dataconfig1_t, 1, TX_Data_Master, RX_Data_Master);
This takes 313 CPU cycles to transmit and receive 1 word.
2. spiTransmitData(spiREG1, &dataconfig1_t, 1, TX_Data_Slave);
This takes the same amount of CPU cycles.
The following is the code for measurement:
The CPU frequency is 160Mhz, so the two APIs used in your else section take 626 CPU cycles: 626*1000/160=3.9us.
Hi Sachin,
Per today's conf call, this is the example of MibSPI+DMA. This example was implemented on TMS570LC4357 Launchpad.