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.

LAUNCHXL-CC1310: I2C Between Two CC1310 Launchpads

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310, ENERGIA

Hello! Thank you in advance for your help

I've two CC1310 Launchpads and i would like to connect them via I2C.Therefore, one would act as Master and other as Slave.

I tried this idea in Energia but my code is not working. If you have time, look at the document that is attached to the end of this message. There I tried to explain better my idea.

Some questions and considerations:

a) I think that maybe my connection problem may be related to the central header block. Do you think this statement makes sense? If yes, which jumper i must pull off?

b)I tried this idea in CCS but I also failed. Is there any Master/Slave I2C example in ccs?

c) In fact, my ultimate goal would be to connect a CC1310 Launchpad to a Raspberry Pi (but I tought connecting two CC1310 boards would be easier to start ). The idea is to reproduce this example, but using the CC1310 as slave (instead of the Arduino);

d) There is a amazing code line in Raspbeery (i2cdetect -y 1) that allow us to see all the devices connected to the I2C Bus. Unfortunatelly, i can't find the CC1310 address (after i send my code to him)

This address is defined in the following line of my code:

Wire.begin(9); // Start the I2C Bus as Slave on address 9

Thank you again for all your help!

Best Regards,

Danilo,

I2C Between Two CC1310 Launchpads.pdf

  • Hello Danilo,

    There is not an example or driver for I2C slave on the CC1310 and therefore not inherently supported by any energia code. Please refer to I2C.h File Reference:

    http://dev.ti.com/tirex/explore/node?node=AOng5xFsavzvQ16.KytQHg__eCfARaV__LATEST 

    "The I2C driver is designed to operate as an I2C master and will not function as an I2C slave. Multi-master arbitration is not supported; therefore, this driver assumes it is the only I2C master on the bus. This I2C driver's API set provides the ability to transmit and receive data over an I2C bus between the I2C master and I2C slave(s). The application is responsible for manipulating and interpreting the data."

    There are examples of users on the forum that have tried to implement I2C slave:

    https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz/f/156/t/877957?CCS-LAUNCHXL-CC1310-i-can-t-implement-i2c-slave-mode-in-RTOS 

  • Hello ,

    Thank you for the direct and outstanding answer! This explain a lot about Energia :)

    However, i'm new to the CCS world and i would like know if you can give me a bit more of your insights. I've read the second link you sent me and my idea was to reproduce 's code enabling the power domain for peripheral

    I tought on going thought this steps  (i'm sure i'm doing a lot of wrong things):

    1. I tought about using a TI-RTOS example as a starting point to my project so I added the "12ctmp" example though the Resource Explorer:

    2. I opened the "i2ctmp.c" file and erased all the code;

    3. I pasted 's code

    4. I added this code (From 's answer in this Link)to enabe the power domain for peripheral (changing the PowerCC26XX_ ... to PowerCC13XX )

        PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
        Power_setDependency(PowerCC26XX_PERIPH_I2C0);
        // Set Power dependecies & constraints
        Power_setDependency(PowerCC26XX_PERIPH_GPIO);
        /* Set constraints for Standby, powerdown and idle mode */
        Power_setConstraint(PowerCC26XX_SB_DISALLOW);
        Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
        PRCMLoadSet();
        PRCMPeripheralRunEnable(PRCM_PERIPH_I2C0); // Enable I2C module
        PRCMPeripheralRunEnable(PRCM_PERIPH_GPIO);
        PRCMLoadSet();
     
     

    I got some errors like:
    I relly liked 's reply to  about enabling the power domain for peripheral:

    "Basically, before you can use any peripheral, it needs to be powered on, otherwise you will most likely crash trying to write to inactive hardware. The peripherals which has drivers provided take care of this, but as I2C Slave do not have a driver, you need power it on yourself."
     I'm sure i'm mixing different sort of codes and i would like to know what is the right way to do this
    Thank you very much for your patience and help,
    Best Regards
    Danilo