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.

CC1350: CC1530 5x5 GPIO configuration conflict with I2C configuration

Part Number: CC1350

Hi Dear friends,

My customer has a strange issue with CC1350 5x5 package I2C IO configuration conflict with GPIO configuration issue. 

The main steps they do:

Configure I2C IO:

GPIO_init();
I2C_init();

I2C_Params      i2cParams;
I2C_Params_init(&i2cParams);
i2cParams.bitRate = I2C_100kHz;
i2c = I2C_open(CC1350_LAUNCHXL_I2C0, &i2cParams);
if (i2c == NULL) {
   while (1);
}

Then PIN_open() will never return success. 

为了规避问题1,在main函数入口地方Board_initGeneral();里面调用PIN_init(BoardGpioInitTable); 在BoardGpioInitTable中填入需要控制的GPIO口,如下:

Then to avoid this, in Board_initGeneral() of main() funcgion, called PIN_init(BoardGpioInitTable), and in BoardGpioInitTable, add the GPIOs that need to be used:

The GPIOs are configured as below:

Then DIO 4 and DIO 8 work ok, but DIO 6 and DIO 7 could not be controlled by code.

Do we miss anything for the IO configuration on 5x5 package?

Thanks!

  • Hello Yan,

    I do not see any PIN_Open in the code snippet you provided, also if we are using the PIN drivers, you should not be using GPIO_init.

    Another thing is, never do XXX_Open (PIN_Open, ADC_Open, I2C_Open, etc) inside main(), wait until you are inside a task to do this, this is because once you open a peripheral using TI Drivers the API creates TI RTOS dependencies.

    Inside the task, they should do something like this:

    PIN_Config PinTable[] =
    {
        CC1350_LAUNCHXL_PIN_CTRL_5TO3_EN    | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_PUSHPULL | PIN_DRVSTR_MAX, 
        CC1350_LAUNCHXL_PIN_CTRL_PA_PD    | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_PUSHPULL | PIN_DRVSTR_MAX, 
        CC1350_LAUNCHXL_PIN_CTRL_PA_G8    | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_PUSHPULL | PIN_DRVSTR_MAX, 
        CC1350_LAUNCHXL_PIN_CTRL_PA_G16    | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_PUSHPULL | PIN_DRVSTR_MAX, 
        CC1350_LAUNCHXL_PIN_CTRL_TX_EN    | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_PUSHPULL | PIN_DRVSTR_MAX, 
        CC1350_LAUNCHXL_PIN_CTRL_RX_EN    | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_PUSHPULL | PIN_DRVSTR_MAX, 
        PIN_TERMINATE                                                                      /* Terminate list */
    };
    
    /*
     *  ======== mainThread ========
     */
    void *mainThread(void *arg0)
    {
        PIN_State   pinState;
        PIN_Handle  hPin;
    
        /* Allocate pins */
        hPin = PIN_open(&pinState, PinTable);
    
        while(1) {
        /* Here you can now do any PIN calls and they should work.*/
        }
    }

    I hope  this helps,

    AB