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.

CC2538EMK: SSI of CC2538

Part Number: CC2538EMK
Other Parts Discussed in Thread: CC2538, Z-STACK, CC3100

Greetings All,

I am working on connecting CC2538EM to another TI module through SPI. I found that there are 2 SSI modules in the CC2538EM. So I searched for the difference between SSI and SPI and found that SSI is somehow more general but I have some questions if someone could help.

Q1) Is there many modifications (functions to be written) that I should do in order to connect an SSI module to SPI module?

Q2) How does the CC2538 connects to SmartRF06, is it through SPI?

Q3) If the answer to Q2 is yes, then which pins are used for this connection from P1 and P2 on the CC2538EM?

Q4) If the answer to Q2 is yes, which SSI module is used for this connection (SSI0 or SSI1)? and is it reserved for only the connection to the SmartRF06 or could I use it further -after flashing my program- to interface to the another slave module of mine?

Q5) If the other module wants 2 more wires (nHIB - HOST_IRQ) more than the standard 4 wires of SPI (MOSI-MISO-CLK-CS) for the connection, should I use 2 GPIOs or there is a better way?

Q6) I read in "Z-stack ZNP Interface Specification" in Z-stack 1.2 that it used 2 additional wires to the default 4 SPI wires, MRDY and SRDY which I think are the same as NHIB and HOST_IRQ, So am I right about this or not?

Thanks in advance

Regards
James

  • Hi,

    1. As you said, the SSI module is a more general implementation of a 4-wire communication interface and can act different depending on the software used. If you wish to use SPI, you can use the SPI driver provided with the CC2538 foundation firmware, or the SPI driver found in Z-Stack. Also, more information about the SSI module can be found in section 1.3.8.4 here:
    www.ti.com/.../swru319c.pdf

    Here are links to the CC2538 foundation firmware and to Z-Stack:
    www.ti.com/.../cc2538-sw
    http://www.ti.com/tool/z-stack

    2. There is actually communication done over both SPI and UART depending on what is being done.

    3. Table 13/14 on page 20/21 will show the relevant connections:
    www.ti.com/.../swru321b.pdf

    4. SSI0 is used for LCD, Micro SD, and accelerometer communication on the SmartRF06 and I believe the pins are exposed on IO header pins, so you should be able to use them to do whatever you want.

    5. These two pins may be related to the functionality of the SPI device but they are not directly related to the 4-wire communication interface, so they will need to be put on GPIO pins.

    6. I am not sure about this, what SPI device are you using?
  • Thanks for your answers Jason,


    Q7) Regarding Q1, Could you tell me where I can find the "SPI driver found in Z-Stack" that you mentioned? since I only found 2 SPI drivers in the ZNP architecture directory?

    Q8) Regarding Q3, I checked the document you mentioned and found only EVM SPI Clock, EVM SPI MOSI, EVM SPI MISO, and EVM reset signal (active
    low) only and didn't find the SPI CS, Am I missing something?

    Q9) Regarding Q6, I am not using the ZNP-ZAP architecture at all, I am using CC3100. But I found a section in the "Z-stack ZNP Interface Specification" that mentions SPI connections so I was curious if it would help me to avoid implementing some functions although they exist there.

    Thanks in advance

    Regards
    James
  • 7. Upon further investigation, it appears Z-Stack does not have an explicit SPI driver for general use. However, I would recommend referring to the SPI implementation inside znp_spi.c, you should be able to copy and slightly modify this functionality to use any SPI device generically. Alternatively, you could try using the spi_master example in the foundation firmware along with the ssi.c/h driver.

    8. Chip select is simply any (unique) GPIO pin. If you notice in 5.4/5.5/5.6 in that document, all these devices use the same SPI pins but use different GPIO pins for the chip select.

    9. Refer to (7.)
  • Thanks Jason, but I went through the znp_spi.c that you mentioned (I am using Z-stack 1.2), and found the following comment,

    "This file contains the interface to the H/W-specific ZNP SPI driver. Please
    NOTE that this driver is not yet complete and is in progress"

    Q10) Does this mean that it is really incomplete or this comment is just an old one?

    Q11) I found out a big portion of code there and I know nothing about ZNP architecture, so could you clarify for me which functions I should look for and modify for my own SPI?

    Q12) Would it be harder to modify and use the one from spi_master since it is not using Z-stack in its implementation like the znp_spi file?

    Regards
    James
  • ZNP SPI is not be suported in Z3.0 stack,i found that illustrate in Z-Stack ZNP Interface Specification.pdf Revision:

    1.1 11/11/2016 Update ZNP usage and definitions to Z3.0 stack. Removed support for SPI
  • 10/11. As mentioned, the ZNP SPI driver was removed from Z-Stack 3.0 due to the lack of customer demand for this interface and because we had not continued to actively develop it. In Z-Stack 1.2.2a, I wouldn't say it is an "incomplete" driver, but in general we have told customers to be careful with using this interface without proper testing. As I said before though, the idea here was just to see how the SPI APIs are used, not necessarily to copy/paste this driver implementation.

    Have you used SPI before on any other platform? I would recommend reading up on basic usage of SPI on any generic platform first, it will help you understand how SPI is implemented on our platform.

    12. Now that I am looking at both examples side by side, I think it may be easier to use spi_master.c as a starting point. This file is commented pretty thoroughly so you should be able to test it out yourself and follow each step to understand it better.
  • I searched in the Z-stack 3.0.0 and found that znp_spi.h exists there and I found at the beginning of the file the same sentence "Please
    NOTE that this driver is not yet complete and is in progress", Am I missing something?

    Also, I found that the folder of projects/zstack/znp/ has the same exact files in both Z-stack3.0.0 and Z-stack1.2.2a!

    I also didn't use SPI before but I read a lot about how it works for CC2538, do you think that this is sufficient?

    Regards
    James
  • Sorry, I meant documentation support for the ZNP SPI driver was removed from Z-Stack 3.0, the driver files were left in the stack though in case anyone wants to attempt to use them.

    I think general knowledge about how SPI works on the CC2538 should be enough to get you started, with the driverlib SPI example spi_master.c as a reference. Try it out and if you have more specific questions about SPI usage on this platform you can follow up here or with a new e2e (more specific) e2e thread.