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 with CC1310 LaunchPad

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

Hi,

I am trying to run some I2C from CC1310 but with different slave then TMP006/TMP116.

I base my code on example: i2ctmp_CC1310_LAUNCHXL_tirtos_ccs.

I am not able to find where I2C pin definitions are because in CC1310_LAUNCHXL.c there are only some other pins.

Some functions in this project are completely external so that may be solution.

Where can I change I2C pins in such project?

Should I worry about anything specific when changing I2C slave device?

Regards

  • Every I2C device uses the same pins, that is the point. You can see the pins on the quickstart guide. Look at the green pins. Make sure to include the pull-ups!

  • The pins are defined in CC1310_LAUNCHXL.h

  • Thank You for reply.

    I am able to see pin init table in header file, but there are no I2C pins.

    const PIN_Config BoardGpioInitTable[] = {

    CC1310_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC1310_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC1310_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC1310_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC1310_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
    CC1310_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
    CC1310_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
    CC1310_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
    CC1310_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
    CC1310_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */

    PIN_TERMINATE
    };


    Should not there be some code with CC1310_LAUNCHXL_I2C0_SDA0  and SCL0?

    For example: CC1310_LAUNCHXL_I2C0_SDA0 | PIN_INPUT_EN | PIN_PULLDOWN.

     

  • Did you look in one of the examples that use I2C?

  • Search for I2C in the board files. In the .h file:

    /* I2C */
    #define CC1310_LAUNCHXL_I2C0_SCL0 IOID_4
    #define CC1310_LAUNCHXL_I2C0_SDA0 IOID_5

    In the .c file:

    const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1310_LAUNCHXL_I2CCOUNT] = {
    {
    .baseAddr = I2C0_BASE,
    .powerMngrId = PowerCC26XX_PERIPH_I2C0,
    .intNum = INT_I2C_IRQ,
    .intPriority = ~0,
    .swiPriority = 0,
    .sdaPin = CC1310_LAUNCHXL_I2C0_SDA0,
    .sclPin = CC1310_LAUNCHXL_I2C0_SCL0,
    }
    };