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.

CC2650: Connection to TCA9544A failed

Part Number: CC2650
Other Parts Discussed in Thread: TCA9544A,

Dear community

I use CC2650. I would like to connect to TCA9544A and select channel 0. I use the TI RTOS I2C driver library to implement I2C communication (I2CCC26XX.c/h) between CC2650 and TCA9544A.

A BME280 sensor with slave address 0xEC is connected on TCA9544A

Here is my implementation:

  /* a0, a1, and a2 are tied to GND. The address of the device will be: 111 0000 or 0x70 */
  #define TCA9544A_SLAVE_ADDR		0x70;     

  I2C_Transaction masterTransaction;

  uint8_t slaveAddr = TCA9544A_SLAVE_ADDR;

  /* write slave address + R/W. We want to write. R = 1, W = 0. We write slaveAddr + 0 = 1110000 0  = 0xE0 */
  uint8_t wdata = 0xE0;
  
  uint8_t rxBuffer[1];
  uint8_t txBuffer[1] = {wdata};
  
  
  masterTransaction.writeCount   = 1;
  masterTransaction.writeBuf     = txBuffer;
  masterTransaction.readCount    = 0;
  masterTransaction.readBuf      = NULL;
  masterTransaction.slaveAddress = slaveAddr;
 
 /* 1. Write wdata = 0xE0 to TCA9544A */
  bool op_succ = I2C_transfer(i2cHandle, &masterTransaction); // lib function from I2CCC26XX.c
  
  /* 2. Select channel 0. 
   *    |INT3|INT2|INT1|INT0|B2|B1|B0|
   *    | X  |  X |  X |  X |1 |0 |0 |
   *    We will write 0x04 to control register
   */
  wdata  = 0x04;
  txBuffer[0] = wdata;
  
  /* 3. Write wdata = 0x04 to TCA9544A to select channel 0 */
  op_succ = I2C_transfer(i2cHandle, &masterTransaction);
  
  // Read data from BME280
  slaveAddr = BME280_SLAVE_ADDR; 
  
  //read register part id
  txBuffer[0] =  BME280_REG_PART_ID; 

  masterTransaction.writeCount   = 1;
  masterTransaction.writeBuf     = txBuffer;
  masterTransaction.readCount    = 1;
  masterTransaction.readBuf      = rxBuffer;
  masterTransaction.slaveAddress = slaveAddr;

Unfortunately, the communication to the TCA9544A does not work and I cannot select in this way channel 0. Can please someone help me?

Regards

Volatile

  • Hi Volatile,

    Are you able to interface directly with the BME280?  There is example software provided in the SIMPLELINK-SDK-SENSOR-ACTUATOR-PLUGIN.  I don't have any experience with the TCA9544A device but the following is from its datasheet:

    The connections of the I 2C data path are controlled by the same I 2C master device that is switched to communicate with multiple I2C slaves. After the successful acknowledgment of the slave address (hardware selectable by A0-A2 pins), a single 8-bit control register is written to or read from to determine the selected channels and state of the interrupts.

    You will need to make sure that this is followed accordingly. What hardware are you using and have you monitored the I2C communication lines with a logic analyzer?

    Regards,
    Ryan

  • Hi dear Ryan

    Thank you very much for your help.

    I checked again the communication to the TCA9544A device. The communication works fine. I can read from the device and write to it. I write and read the value 0x04 to the control register of the multiplexer. So I could choose channel 0. The code above works fine.

    Expression	Value	Location	Type	
    i2cHandle	I2C_config (0x83D4)	0x20002D50	I2C_Handle	
    masterTransaction	<struct>	0x20002D20	I2C_Transaction	
    writeBuf	0x0 "ð<"	0x20002D20	uint8_t *	
    writeCount	0	0x20002D24	size_t	
    readBuf	0x20001E39 "."	0x20002D28	uint8_t *	
    	'.' (0x04)	0x20001E39	uint8_t	
    readCount	1	0x20002D2C	size_t	
    slaveAddress	'p' (0x70)	0x20002D30	uint8_t	
    arg	0x00000000	0x20002D34	void *	
    nextPtr	0x00000000	0x20002D38	void *	

    The communication to BME280 could not be established in both cases, with TCA9544A device and without TCA9544A.Tomorrow I will check the hardware again. It is definitely a hardware issue.

    Thank for your support.

    Regards

    Volatile