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.

CC2650 using I2C and SPI

Other Parts Discussed in Thread: CC2650

Hi,

In my project I use the Sensor Controller of the CC2650 to store data in a buffer from I2C @ 400kHz every 10 ms. The M3 is woken up every 1 second to collect the data from the buffer and then go to sleep again.

At the beginning of the SC task, I send the registers configuration of the device through I2C.

I wanted to know if I could use the same IOs to do the I2C communication and receive data through SPI @ 4MHz every 6 seconds.

Is there a way to sequence the two communications ?

Regards,

Guillaume

  • Hi Guillaume,

    If you know exactly when the SPI communication will happen, or can use some sort of flow control scheme, I guess you can halt the SC task, configure the pins for SPI, do the SPI comm, and then restart the SC task. I am looping in our SC expert to confirm.

    Cheers,
    Fredrik
  • Hi Guillaume,

    Could you elaborate a bit more on the reason for sharing pins between the two interfaces? Disregarding the effect the pull-ups on I2C will have on power consumption it is technically possible but we don't have a SW framework supporting this.

    If you want to use Sensor Controller Studio for both SPI and I2C this is technically possible but Sensor Controller Studio will not let you in the current implementation.
    If you are using I2C with the SC and SPI from the M3 it should be possible but you will need to go through the drivers and you might need to extract a bit of the driver contents to execute manually.

    - Stop all SC tasks (scifStopTasksNbl)
    - Wait until it is done (scifWaitOnNbl)
    - Reset the task structs (scifResetTaskStructs). Will empty all buffers
    - Un-initialize SC IO setup (see scifTaskResourceUninit)
    - Run SPI_open in TI RTOS to open the SPI
    - Do the communication needed
    - Close the SPI
    - Re-initialize SC IO setup (see scifTaskResourceInit)
    - Start SC controller task again.

    Regards,
    Svend
  • Hi Svend,Thanks for these informations.
    I wanted to use the same pins to reduce the power consumption, but I prefer not to stop the SC task so I will use to other pins to do the SPI communication.
    In my case the I2C is used by the SC and the SPI is used only by the M3.Regards,
    Guillaume
  • Hi Svend,

    my problem is that i cannot open the PINS while on a connection.
    On the init() i open them and do some initialization stuff and closed them normally.
    But afterwards when the connection is established, the Pinhandle returns NULL.
    Is this because i didnt do this:

    - Stop all SC tasks (scifStopTasksNbl)
    - Wait until it is done (scifWaitOnNbl)
    - Reset the task structs (scifResetTaskStructs). Will empty all buffers
    - Un-initialize SC IO setup (see scifTaskResourceUninit)
    - Run SPI_open in TI RTOS to open the SPI
    - Do the communication needed
    - Close the SPI
    - Re-initialize SC IO setup (see scifTaskResourceInit)
    - Start SC controller task again.

    If so is there any example code for this?


    This is my post:
    e2e.ti.com/.../1960584

    Thanks,

    Michael