Tool/software:
HI TI:
In my project, I have used SSI, but the person who wrote the code has left, and I couldn't find any examples of these codes in the official SDK, such as: (HWREG(hwAttrs->baseAddr + SSI_O_SR) & SSI_SR_TNF). Therefore, I'm not clear about how to use SSI and how to combine SSI with DMA. Now I need to optimize the time consumption of the chip on SSI. Could you please provide more detailed materials, documents, or examples?
thanks.
Hi Yi,
Our SPI/SSI driver in the SDK already makes use of the DMA, for transfers above 10 bytes.
Here is the code example: spicontroller
If you want to update your own driver, please have a look at our implementation in our SDK as well: SPICC26X2DMA.h
Regards,
Arthur
HI Arthur:
Why does the library function SPI_transfer in the SPI driver library used for data transmission take such a long time?
I have two pieces of code that achieve the same functionality.
1.The first one is to call the library function SPI_transfer as follows:
The waveform displayed by the oscilloscope is like this:
The yellow one represents the interrupt signal. When it is pulled low, the SPI read/write operation begins. The other color represents the clock signal on the SPI.
There are many scattered 6-byte signals on the SPI clock. The time interval between each 6-byte sequence is approximately 27 microseconds.
2.The second code is like this.
The waveform displayed by the oscilloscope is like this:
Below is the configuration of my SPI.
In summary, when performing the same task, using the library function SPI_transfer takes much longer than directly reading and writing to the registers, and there are many strange signals on the SPI clock. What's the reason for this? Is there any method that takes less time than directly reading and writing to the registers?
Furthermore, I attempted to change the value of Min DMA Transfer Size to 1. The overall time consumption remained quite long, but the time interval between each byte became shorter. This indicates that the configuration of DMA must have taken effect.
thanks
Hi yi,
this is very strange, as you should be able to transmit the whole 512 block at once. Using the SPI.h driver will allow you to fully implement power management in your application (handled by Power.h) so it is important that you use it.
What is the value of this headerLength + readLength block?
And where is SPI_open defined in your code? I see that it is commented out here:
Regards,d
Arthur
Hi
Each time it is called, the sum of headerLength and readLength should not exceed 30 at most. The spi_open function has already been called when using the spi, and the rate is 12,000,000.
thanks