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.

AWR1642: How to use I2C driver to communication MPU6050 Gyrosensor

Part Number: AWR1642

I used I2C_transfer(i2cHandle, &i2cTransaction) to write to MPU6050 (400kHz)

The I2C Address 0x69 and write are transmitted normally, and has received a ACK,

But the second byte 0x6B became 0x6A, and without ACK。It seems I2C_transfer 

function can't read/write Correctly. Or Some setting I missed?

Thank you

                                         Liang-Yu

txData[0] = 0x6B;

txData[1] = 0x80;

i2cTransaction.slaveAddress = 0x69;

i2cTransaction.writeBuf = txData;


i2cTransaction.writeCount = 2;

i2cTransaction.readBuf = rxData;


i2cTransaction.readCount = 0;

  • Hello,

    We would need more detail to help investigate the issue.

    1. Which version of the mmWave SDK are you using?

    2. Does your AWR1642BOOST EVM have a sticker on it that says "ES2.0"?

    3. Are you using the mmWave SDK I2C driver test code as a reference? It is located in the SDK at C:\ti\mmwave_sdk_<ver>\packages\ti\drivers\i2c\test.

    4. Are you setting the PINMUX registers for the I2C SCL and SDA pins as shown in the driver test code?

    Regards,
    John
  • Added one more question below...

    Hello,

    We would need more detail to help investigate the issue.

    1. Which version of the mmWave SDK are you using?

    2. Does your AWR1642BOOST EVM have a sticker on it that says "ES2.0"?

    3. Are you using the mmWave SDK I2C driver test code as a reference? It is located in the SDK at C:\ti\mmwave_sdk_<ver>\packages\ti\drivers\i2c\test.

    4. Are you setting the PINMUX registers for the I2C SCL and SDA pins as shown in the driver test code?

    5. Are there any other pull-up resistors on the SDA and SCL lines other than the ones on the AWR1642BOOST EVM (i.e. on the MPU-6050 board or elsewhere)?

    Regards,
    John

  • Hi John

          I used as below

    1. mmwave_sdk_01_02_00_05

    2. AWR1642BOOST EVM doesn't have sticker "ES2.0".

    3. C:\ti\mmwave_sdk_01_02_00_05\packages\ti\demo\xwr16xx\mmw\mss\mss_main.c,and copy

        some code from  \drivers\i2c\test\main.c

    4. PINMUX reg are set

    5. There are pull-up resistors on MPU-6050 board

    I observed the test result from Logic Analyzer,there is no ACK in read/write,and last bit is lost,I test two MPU-6050 board (different

    manufacture),they are the same.

    But I use the new generation Gyrosensor ICM-20608-G,yesterday. I2C_transfer the function is correctly, I do

    not know what happened?

    Regards, 

                                       Liang-Yu

  • Liang-Yu,

    It sounds like you are using the correct and latest mmWave SDK version (1.2) for AWR1642BOOST EVM ES1.0 (no ES2.0 sticker) and are correctly setting up the PINMUX registers.

    You may want to try building a simple application that just tests the I2C communication to make sure that the full mmw demo code is not interfering with the timing of the I2C driver. You can use the SDK I2C driver test code (C:\ti\mmwave_sdk_<ver>\packages\ti\drivers\i2c\test) as a reference to build a standalone test application. If you do use it, you would need to remove the line that enables loopback mode.

    Also, since the AWR1642BOOST EVM already has pull-up resistors on the I2C SCL and SDA lines, additional pull-up resistors on the other board may cause problems since it could make the pull-up too strong (especially if the other board uses resistors with smaller resistance values). You may want to try removing the pull-up resistors on the other board.

    Please mark the thread as answered if this resolves your issue or reply if more support is required.

    Regards,
    John
  • Hi John

            Thank you for your support. This resolves my issue.

    Thank you                        

                Liang-Yu