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.

CC1352R: CC1352R SPI

Part Number: CC1352R
Other Parts Discussed in Thread: CC3120MOD, SYSCONFIG

Hi,

I use CC1352R.

One if the SPI channel is shared between CC3120MOD and other chip with SPI interface.

For porting purposes the SPI module is used in user.h file in CC3120MOD driver.

The question are:

1. Is it possible to use the some HW SPI module for both devices (in SPICC26X2DMA_HWAttrs  only one CS pin can be defined).

2. If, no I will implement SW SPI for the second device, using the pins of the HW SPI module. For this purpose is it necessary to "de" SPI_init(), before communicate with second device using SW implementation?

Best regards,

Ilian

  • Hi Ilian,

    What version of the SimpleLink CC13x2/26x2 SDK are you using?

    I am not familiar with the CC3120MOD board, but usually our LaunchPads and Booster Packs are designed so that if you mount the BP on the LP the SPI lines are on top of each other.

  • Hi Marie,

    the question is not about the evaluation boards, I know how to connect.

    The question is basic.

    If one of the SPI channel of the CC1352R is used (in this case to communicate with CC3120MOD), is it possible this channel to be used for communication with other SPI device - how to implement one SPI channel to work with two (or more) CS pins.

    If it is not possible, is there problem, if for second device communicate with SW SPI is implemented (the some pins used for HW SPI module )?

    Best regards,

    Ilian

  • Hi Ilian,

    What is typically done in these scenarios (as the HW only allows for a single HW controller CS) is to use SW based CS instead. This is a much easier approach compared to implementing a "Software SPI" and switch over to this for the second device. Have you considered this?

  • Hi,

    yes, that is the exact question.

    Now the HW SPI module use the CS pin declared in SPICC26X2DMA_HWAttrs structure.

    This is done and the SPI module work correct.

    If, I use the some HW module and SW control of the CS pins, this men that for example in SPICC26X2DMA_HWAttrs structure .csnPin  = NULL?

    Implementing SW SPI is not a problem.

    SPI_init() does not modify peripheral registers. This mean that after using the HW SPI module (from example with CC3120MOD) , after finishing the communication and SPI_close(), the SW SPI implementation can be used for second SPI slave device?

    Best regards,

    Ilian

  • Ilian, 

    I do not understand what you mean by "the SW SPI Implementation", are you just referring to CS control from SW? If so, why would you like to close the SPI?

    As for not using the HW chip select, you can simply set the SPI module to "Three wire" mode in SysConfig. This will set the csnPin  = NULL;

  • Hi,

     "the SW SPI Implementation" I mean implement SPI communication without using the HW modules.

    SW set/clear pins for SCL, SDI and SDO to implement SPI protocol.

    Best regards,

    Ilian

  • Hi ilian,

    Sure, but why? I do not understand the need for this software SPI. It sounds to me that you have two SPI devices on the same bus with two separate CS pins. If you do not use the "HW CS" feature of the SPI Hardware then you can simply assert the CS pin you want before issuing a SPI transaction.

  • Hi M-W,

    yes you are right.

    This was only a question to be sure, that the software implementation will work correctly in combination with HW module.

    Best regards,

    Ilian