Hi,
Hope this hasn't already been answered somewhere else but I'm having some trouble with talking to an I2C device is on a second I2C channel coming off the CC26xx. Here's the trouble. Sometimes, I can talk to the device and sometimes I can't. I'm not having any trouble talking to devices on the first I2C channel (on which there are multiple devices). On the second I2C channel, there's only one device, but when I ask for it's signature, sometimes it's there and sometimes it's not.
At this point, one of my main uncertainties is how I've set up the I2C channels in my Board.c file. Here's how I've set up the Board.c file:
/* I2C */
#define Board_I2C0_SDA1 IOID_19
#define Board_I2C0_SCL1 IOID_18
#define Board_I2C0_SDA0 IOID_1
#define Board_I2C0_SCL0 IOID_0
typedef enum CC2650_I2CName {
CC2650_I2C0 = 0,CC2650_I2C1 = 1,
CC2650_I2CCOUNT
} CC2650_I2CName;
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
#pragma DATA_SECTION(i2cCC26xxHWAttrs, ".const:i2cCC26xxHWAttrs")
#endif
/* Include drivers */
#include <ti/drivers/i2c/I2CCC26XX.h>
/* I2C objects */
I2CCC26XX_Object i2cCC26xxObjects[CC2650_I2CCOUNT];
/* I2C configuration structure, describing which pins are to be used */
const I2CCC26XX_HWAttrs i2cCC26xxHWAttrs[CC2650_I2CCOUNT] = {
{
.baseAddr = I2C0_BASE,
.intNum = INT_I2C,
.powerMngrId = PERIPH_I2C0,
.sdaPin = Board_I2C0_SDA0,
.sclPin = Board_I2C0_SCL0,
},
{
.baseAddr = I2C0_BASE,
.intNum = INT_I2C,
.powerMngrId = PERIPH_I2C0,
.sdaPin = Board_I2C0_SDA1,
.sclPin = Board_I2C0_SCL1,
}
};
const I2C_Config I2C_config[] = {
{&I2CCC26XX_fxnTable, &i2cCC26xxObjects[0], &i2cCC26xxHWAttrs[0]},
{&I2CCC26XX_fxnTable, &i2cCC26xxObjects[1], &i2cCC26xxHWAttrs[1]},
{NULL, NULL, NULL}
};
In red, green, and blue, I've highlighted my uncertainties. In blue is the fact that both are sharing the interrupt #. Is this okay and, if not, what should it be? In red is the fact that they're both sharing the same power manager id. Is this okay, and, if not, what can I do about it? Same for the green?
Any help you might be able to give would be greatly appreciated...
Thanks!
Hunter