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.

CC1352P7: How to use SSI and DMA

Part Number: CC1352P7

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

  • I would greatly appreciate your response when you have a moment。

  • 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

  • Hi Yi, 

    I was thinking, are you trying to use the SPI_transfer call inside the interrupts contexts? 

    Also, note that the CC1352P7 does not support 12 MHz SPI clock rate:



    Here, please find attached a Code Composer Studio project which transmits 30 bytes every seconds, at 4 MHz.

     spi_example_cc1352p7.zip

    Regards,

    Arthur

  • Hi Arthur:

    1.We don't call within an interrupt; instead, an interrupt triggers a semaphore, and then a call is made within a thread.

    2.However, when checking the functions of CC1352P7, it is stated that it can support 12 MHz. And the CLK measurement also shows that it is in line with 12 MHz. The time consumption for one byte is approximately 666 ns. Because one bit takes 1/12 us, and 8 bits is 2/3, which is 666 ns.

    Regards,

    Yi

  • Hi yi,

    Thanks for the data.

    That comments most likely includes the CC1354, which does supports up to 12 MHz.
    In the CC1352P7's datasheet (https://www.ti.com/lit/ds/symlink/cc1352p7.pdf), we specify a maximum supported clock speed of 4 MHz.

    Have you evaluated the Code Composer Studio project that I have sent you?

    Regards,

    Arthur