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.

AWR6843AOPEVM: read Temperature via i2c

Part Number: AWR6843AOPEVM
Other Parts Discussed in Thread: MMWAVEICBOOST

Hi,I want to read the TMP112A's temperature of  xwr6843aopEVM via i2c.

Device:  xWR6843AOPEVM Mounted on MMWAVEICBOOST

The read Task and read function is  as follows:

Task:

TMP_ReadTemp() function:

float TMP_ReadTemp(I2C_Handle i2cHandle, uint8_t i2cSlaveAddress, uint8_t i2cSlaveRegAddress)
{
    uint8_t         txData[2];
    bool            retVal = false;
    uint8_t         rxData[2];
    I2C_Transaction i2cTransaction;
    int16_t         digitalTemp = 2;
    int32_t         errCode;

    /* Scan for the slave address */
    txData[0] = i2cSlaveRegAddress;
    i2cTransaction.slaveAddress = i2cSlaveAddress;
    i2cTransaction.writeBuf = txData;
    i2cTransaction.writeCount = 1;
    i2cTransaction.readBuf = rxData;
    i2cTransaction.readCount = 0;

    System_printf ("888888888 \n");
    /* Writing to slave address */
    retVal = I2C_transfer(i2cHandle, &i2cTransaction);
    System_printf("OKKK!");
    if (retVal == false)
    {
        System_printf ("I2C_transfer Failed \n");
    }
    else
    {
        /* Read from slave */
        System_printf ("99999999999 \n");
        i2cTransaction.slaveAddress = i2cSlaveAddress + 1;
        i2cTransaction.writeBuf = txData;
        i2cTransaction.writeCount = 0;
        i2cTransaction.readBuf = rxData;
        i2cTransaction.readCount = 2;

        retVal = I2C_transfer(i2cHandle, &i2cTransaction);

        System_printf ("22222222222 \n");
        if (retVal == false)
        {
            errCode = -1;
        }
        else
        {
            digitalTemp = (rxData[0]<<4) | (rxData[1]>>4);
            if(digitalTemp > 0x7FF)
            {
                digitalTemp |= 0xF000;
            }
        }
    }
    return digitalTemp * 0.0625;
}

The result when I debug is as follow:

 

It seems that there is something wrong in I2C_transfer(), I2C_transfer() Failed. My questions are:

    1. are these two TMP sensors (in the red box) on my device? Can my device ( xWR6843AOPEVM Mounted on MMWAVEICBOOST) read the temperature via I2C ?  

     2. You can see not only one devices linked the I2C BUS (U18,U19,U11,U21...), how could I know the Logical peripheral number of each one when I use the api I2C_open(index , &i2cParams)? For example, I wanna to read temprature from U18, I should use I2C_open(0&i2cParams)? I2C_open(1&i2cParams)? I2C_open(2&i2cParams)? or something else?

     3. Could you please check my  read task and read function  above ? I don't know why the api I2C_transfer() failed, maybe the Initialization is wrong ? -- I don't know.      And I have checked the Slave address and slave reg address. I think the addresses are  correct.

     Sincerely,

     lei Gong