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.

RTOS/LAUNCHXL-CC2640R2: I2C (PIN DIO2 AND DIO3)

Part Number: LAUNCHXL-CC2640R2

Tool/software: TI-RTOS

Hello,

I am working on LaunchXL-CC2640R2F, i want to interface an accelerometer which is an I2C based sensor, i have referred I2C driver Example from CC2640R2 SDK, using the designated pins( DIO4 and  DIO5)  referred in the I2C driver example i am getting response from the sensor, but i wanted to use DIO2 and  DIO3 for same sensor,

I made the respective changes in CC2640R2_LAUNCHXL.h file, however i am not getting any response from the sensor,

The similar way i tried on CC2650-LaunchXL but i am facing the same issue,

So i checked the pin status by connecting LED on that pin, i can see that it is remaining high all the time,

Please let me know is there any required change to be made so that i can use these pin (DIO2 and  DIO3) for I2C and also let me if there any other pins i can use for I2C interface except (DIO4 and  DIO5) 

  • Check your board file to make sure other GPIO or peripheral don’t use those two pins.
  • Hello YK Chen,

    Thank You for replying, i checked with the board file but cannot see that this pin is is assigned to any other pin but still it remains high.

    One more thing i would like to mention that i have tried running other code also but this pin remains high all the time so please let me known, Is this PIN is locked?, if so can we unlock it or have to use any other pin, or am i missing out on something.

    I have used your example code of I2C and to use the DIO2 and DIO3 i just made changes in CC2640R2_LAUNCHXL.h and CC2640R2_LAUNCHXL.c as required.

    Thanks and Reagrds

    Utkarsh

  • If I remember correctly, DIO2 and DIO3 are defined as UART RX and TX like the followings:

    #define BOARD_IOID_UART_RX IOID_2
    #define BOARD_IOID_UART_TX IOID_3

    I suggest you to check board.h again.
  • Hello YK Chen,

    I have checked in board.h file but no such declarations as mentioned in last post,

    I also commented the whole part of UART where ever it was declared and then assigned these two pins to I2C as follows,
    #define CC2640R2_LAUNCHXL_I2C0_SCL0 IOID_3
    #define CC2640R2_LAUNCHXL_I2C0_SDA0 IOID_2

    But still i am facing same issues the main thing I am observing is Without any declaration of instruction the DIO2 pin remains High all the time i also tried to Pull down it to LOW while Initializing yet It is HIGH
  • Hi,

    As I remember, CC2640R2DK_7ID is defined in pre-definition.

    in CC2640R2DK_7ID.h

    /* UART Board */
    #define CC2640R2DK_7ID_UART_RX IOID_2 /* P1.7 */
    #define CC2640R2DK_7ID_UART_TX IOID_3 /* P1.9 */

    in CC2640R2_LAUNCHXL.c

    const PIN_Config BoardGpioInitTable[] = {

    CC2640R2_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
    CC2640R2_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
    CC2640R2_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
    CC2640R2_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
    CC2640R2_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */
    CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
    CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
    CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */

    PIN_TERMINATE
    };

    BR,
    Ji Won
  • I use CC2640R2 SDK vwerstion 1.50 and check CC2640R2_LAUNCHXL.h under my C:\ti\simplelink_cc2640r2_sdk_1_50_00_58\source\ti\blestack\boards\CC2640R2_LAUNCHXL. I can see the following defines:

    /* UART Board */
    #define CC2640R2_LAUNCHXL_UART_RX IOID_2 /* RXD */
    #define CC2640R2_LAUNCHXL_UART_TX IOID_3 /* TXD */
    #define CC2640R2_LAUNCHXL_UART_CTS IOID_19 /* CTS */
    #define CC2640R2_LAUNCHXL_UART_RTS IOID_18 /* RTS */