Other Parts Discussed in Thread: SYSCONFIG, CC3220SF, DRV8850
Hi,
In my design, I am using 2 PWMs and I2C master.
I2C and PWM both work as expected individually. Trouble occurs when I enable 2nd PWM.
After I call PWM_open() for 2nd PWM, I2C_open() return with success but I2C_transfer() always return with a failure.
I probed I2C pins there is no activity on the pins after i call PWM_open() and then I2C_transfer().
I have a feeling that somehow PWM is interfering with I2C registers of its PIN configuration.
Below is my setup:
PIN16--SCL
PIN17--SDA
PIN2--IN1H Enabling PWM on this PIN is causing the issue.
PIN64--IN2H
When i try to debug in the register view. I am not able to read the registers.
I am using the older version of simple link SDK and not using sysconfig.
Below is the configuration of the pins from CC3220SF_LAUNCHXL.c and CC3220SF_LAUNCHXL.h files.
/*
* =============================== I2C ===============================
*/
#include <ti/drivers/I2C.h>
#include <ti/drivers/i2c/I2CCC32XX.h>
I2CCC32XX_Object i2cCC3220SObjects[CC3220SF_LAUNCHXL_I2CCOUNT];
const I2CCC32XX_HWAttrsV1 i2cCC3220SHWAttrs[CC3220SF_LAUNCHXL_I2CCOUNT] = {
{
.baseAddr = I2CA0_BASE,
.intNum = INT_I2CA0,
.intPriority = (~0),
.clkPin = I2CCC32XX_PIN_16_I2C_SCL,
.dataPin = I2CCC32XX_PIN_17_I2C_SDA
}
};
const I2C_Config I2C_config[CC3220SF_LAUNCHXL_I2CCOUNT] = {
{
.fxnTablePtr = &I2CCC32XX_fxnTable,
.object = &i2cCC3220SObjects[CC3220SF_LAUNCHXL_I2C0],
.hwAttrs = &i2cCC3220SHWAttrs[CC3220SF_LAUNCHXL_I2C0]
}
};
const uint_least8_t I2C_count = CC3220SF_LAUNCHXL_I2CCOUNT;
/*
* =============================== PWM ===============================
*/
#include <ti/drivers/PWM.h>
#include <ti/drivers/pwm/PWMTimerCC32XX.h>
#define CONFIG_PWM_COUNT 2
/*
* ======== pwmTimerCC32XXObjects ========
*/
PWMTimerCC32XX_Object pwmTimerCC32XXObjects[CONFIG_PWM_COUNT];
/*
* ======== pwmTimerCC32XXHWAttrs ========
*/
const PWMTimerCC32XX_HWAttrsV2 pwmTimerCC32XXHWAttrs[CONFIG_PWM_COUNT] = {
/* IN1H */
{
.pwmPin = PWMTimerCC32XX_PIN_02, /* 02 */
},
/* IN2H */
{
.pwmPin = PWMTimerCC32XX_PIN_64, /* 64 */
},
};
/*
* ======== PWM_config ========
*/
const PWM_Config PWM_config[CONFIG_PWM_COUNT] = {
/* IN1H */
{
.fxnTablePtr = &PWMTimerCC32XX_fxnTable,
.object = &pwmTimerCC32XXObjects[IN1H],
.hwAttrs = &pwmTimerCC32XXHWAttrs[IN1H]
},
/* IN2H */
{
.fxnTablePtr = &PWMTimerCC32XX_fxnTable,
.object = &pwmTimerCC32XXObjects[IN2H],
.hwAttrs = &pwmTimerCC32XXHWAttrs[IN2H]
},
};
const uint_least8_t IN1H_CONST = IN1H;
const uint_least8_t IN2H_CONST = IN2H;
const uint_least8_t PWM_count = CONFIG_PWM_COUNT;
/*!
* @def CC3220SF_LAUNCHXL_I2CName
* @brief Enum of I2C names on the CC3220SF_LAUNCHXL dev board
*/
typedef enum CC3220SF_LAUNCHXL_I2CName {
CC3220SF_LAUNCHXL_I2C0 = 0,
CC3220SF_LAUNCHXL_I2CCOUNT
} CC3220SF_LAUNCHXL_I2CName;
/*!
* @def CC3220SF_LAUNCHXL_PWMName
* @brief Enum of PWM names on the CC3220SF_LAUNCHXL dev board
*/
typedef enum CC3220SF_LAUNCHXL_PWMName {
IN1H = 0,
IN2H,
CC3220SF_LAUNCHXL_PWMCOUNT
} CC3220SF_LAUNCHXL_PWMName;