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.

CCS/CC1352R: Realize multiple I2C masters

Part Number: CC1352R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: Code Composer Studio

Hy,

as described here, we also want to realize 2 I2C busses in one system. It is no problem that we can only use them subsequently. In previous systems we realized the scheme with two I2C descriptions, on each I2C open software would check if previous call was addressing the same I2C, if not it would close and open again with different settings, i.e. pins for SDA and SCL.

In current project we use the latest CC1352 SDK and syscfg for system configuration. What is the recommended way of realizing multiple I2C in this scenario? At

\ti\simplelink_cc13x2_26x2_sdk_4_20_00_35\source\ti\ble5stack\hal\src\target\cc2650st\bsp_i2c.c

I find

void bspI2cAcquire(uint8_t newInterface, uint8_t address)
{
  Semaphore_pend(Semaphore_handle(&mutex),BIOS_WAIT_FOREVER);

  slaveAddr = address;

  // TBD: will this concept work with power management and TI RTOS style drivers?
  //      should driver be torn down and reopened??
  if (newInterface != interface)
  {

What does that comment mean? Shall I use this code or rather implement it myself?

Best regards

Harald

  • Hi Harald,

    I would say that the easiest approach here is to do what you did before, use two descriptors. SysConfig today will not allow you today to setup 2 instances of the same hardware which means the easiest approach here is to simply define the structures expected by the driver yourself. The information needed has not really changed, just the way it is generated.

    As for the comment (and the code connected to it), it could (or can) in theory work but it is a risky move as it could introduce a glitch on the line that is picked up by the I2C hardware. If you are unlucky it could interpret it as a START/STOP condition and the hardware end up in an unwanted state.