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.

CC1352P7: i2c clk stop

Part Number: CC1352P7
Other Parts Discussed in Thread: BOOSTXL-BASSENSORS

Hi,

We test on "simplelink_cc13xx_cc26xx_sdk_6_40_00_13\examples\rtos\LP_CC1352P7_1\drivers\i2ctmp\tirtos7\ticlang".  We added while(1) on “for (i = TMP_COUNT - 1; i >= 0; i--)”,i.e. { for (i = TMP_COUNT - 1; i >= 0; i--){} }. It work well at begin, ended with "I2C bus is already in use!". We found clock of iic keep high level.

Regards

Dong

  • Hello Dong, 

    thanks for reaching out.

    Can you tell me more of what you are trying to do with the while loop?
    I have tried your configuration like this:
     

    /*
         * Determine which I2C sensors are present by querying known I2C
         * target addresses.
         */
        while(1)
        {
            for (i = TMP_COUNT - 1; i >= 0; i--)
            {
                i2cTransaction.targetAddress = sensors[i].address;
                txBuffer[0]                  = sensors[i].resultReg;
    
                if (I2C_transfer(i2c, &i2cTransaction))
                {
                    targetAddress = sensors[i].address;
                    Display_printf(display,
                                   0,
                                   0,
                                   "Detected TMP%s sensor with target"
                                   " address 0x%x",
                                   sensors[i].id,
                                   sensors[i].address);
                }
                else
                {
                    i2cErrorHandler(&i2cTransaction, display);
                }
            }
        }

    For me this results in the program to constantly polling for I2C devices and initializing the connection.

    The "I2C bus already in use!" response did not show up in the serial monitor.

    Also, is there a reason you are using the 6.40 version of the SDK? The most recent release is 7.10.

    Regards
    Manuel

  • Hi Manuel,

    Our program is same as yours. But we modiy iic address as attached file. When “#define TMP_COUNT 1”, result is like yours,but "#define TMP_COUNT 2", runing amoment there are "I2C bus is already in use!".

    //#define TMP11X_BASSENSORS_ADDR 0x48
    //#define TMP116_LAUNCHPAD_ADDR  0x49
    #define TMP11X_BASSENSORS_ADDR 0x16 // ddgg
    #define TMP116_LAUNCHPAD_ADDR  0x18 // ddgg
    
    /* Number of supported sensor iterations */
    #define TMP_COUNT 2
    //#define TMP_COUNT 1 // ddgg

  • Hello Dong,

    the code that I was running was also configured for TMP_COUNT 2.

    Can you try disconnecting one of the sensors and see if it works then?
    Also try upgrading the SDK to the newest version (7.10) from SIMPLELINK-LOWPOWER-F2-SDK Software development kit (SDK) | TI.com.

    Regards
    Manuel

  • Hello Manuel,

    We disconnected one of the sensors and see  it works, but only one is online. We connected the lost sensor, then all two is online.

    We upgrading the SDK to the newest version (7.10) from SIMPLELINK-LOWPOWER-F2-SDK Software development kit (SDK) | TI.com. We burned the program to chip. First It work well, a moment late "I2C bus is already in use!" showed. We run again, it directly show "I2C bus is already in use!"。

    We use simplelink_cc13xx_cc26xx_sdk_6_40_00_13。It work well at begining, and then "I2C bus is already in use!". We run again, It work well at begining, and then "I2C bus is already in use!". 

    Rgards

    Dong

    Detected TMP116 sensor with slave address 0x18
    Detected TMP11X sensor with slave address 0x16
    Detected TMP116 sensor with slave address 0x18
    Detected TMP11X sensor with slave address 0x16
    Detected TMP116 sensor with slave address 0x18
    Detected TMP11X sensor with slave address 0x16
    Detected TMP116 sensor with slave address 0x18
    Detected TMP11X sensor with slave address 0x16
    I2C data byte not acknowledged!
    I2C bus is already in use!
    I2C bus is already in use!
    I2C bus is already in use!
    I2C bus is already in use!
    I2C bus is already in use!
    I2C bus is already in use!
    I2C bus is already in use!
    I2C bus is already in use!

  • Hello Dong,

    the "I2C bus is already in use!" error is only thrown if another I2C controller tries to be the master in the system.
    Can you please further specify which devices you have connected to this I2C bus? Can you tell me the exact part numbers of the TMP sensors and any other sensor or controller connected?

    Also can you try stepping through the code and checking the MSTAT register (Offset = 804h) to see, when the DATACK_N turns true? This is the trigger for the "I2C data byte not acknowledged" error, which seems to be the start of the issue.

    Regards
    Manuel

  • Hi Manuel,

    One chip is LIS2DW12. Another is GH3018 from "https://www.goodix.com/en/about_goodix/profile/overview".

    Regards

    Dong

  • Hello Dong, 

    the "i2ctmp" example that you are using is designed to work with the BOOSTXL-BASSENSORS boosterpack that incorporates a temperature sensor.
    Therefore the application code is written to poll for the temp sensor data and output it to serial.

    If you try to connect any other sensor over I2C, you are expected to adapt the code in order to correctly read out data from these sensors.
    As the serial output shows, the discovering of present sensors works fine. But to poll for data from the sensors, you will need to adapt the code according to the datasheet of the sensor you want to use.

    Regards
    Manuel