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.

Sensor Controller I2C no ACK bit - MPU 9250 IMU

Other Parts Discussed in Thread: CC2650

Hello


I am attempting to communicate with an MPU 9250 IMU breakouk from Sparkfun using Sensor Controller Studio (SCS) version 1.3.1.42689 and a CC2650 Wireless Launchpad. I have de-soldered the 10k pullups on the IMU breakout board because the Launchpad already has 3k3 pullups on SCL and SDA lines, and running the bus at 400kHz with a 100us SCL stretch timeout frequency.  The device supports clock frequency up to 400kHz and supply voltages up to 3.6V.

When I attempt to issue a TX command to the device, the state.i2cstatus variable goes to 1, meaning no acknowledgement received.  Here is my code:

if(state.i2cStatus == 0x0000){
    i2cStart();
    i2cTx(I2C_OP_WRITE | DEVICE_ADDRESS);
    i2cTx(WHO_AM_I);

    
    if(state.i2cStatus == 0x0000){       
        i2cRepeatedStart();
        i2cTx(I2C_OP_READ | DEVICE_ADDRESS);
        i2cRxAck(state.whoami);
        i2cStop();       
    }  
}else{
    i2cStop();
}


I scoped the SCL (yellow) and SDA (blue) lines and this is the output for the first Tx condition (line 3).The address (0x68) is written for the first 7 bits, however the MPU 9250 does not pull the SDA line low for the bit 9 acknowledge.

Signals have 3.2V swing.


Heres what I've done to troubleshoot::

- ensured the MPU 9250 is receiving 3.3V and is grounded

- Verified the device address of 0x68 as per the position of SJ2 on the breakout board.


Can anyone give me insight as to why the ACK bit is not being driven by the receiver? Could it be the master not releasing the SDA line, and if so, how can I test for this?

  • I solved my own problem. Turns out my device address variable of 0x68 needed to be bit shifted to the left by 1 so that it was only 7 bits and aligned properly with what the receiver was expecting. Here is the new code:

    if(state.i2cStatus == 0x0000){
        i2cStart();
        i2cTx(I2C_OP_WRITE | (DEVICE_ADDRESS <<1 ));
        i2cTx(WHO_AM_I);
    
        
        if(state.i2cStatus == 0x0000){       
            i2cRepeatedStart();
            i2cTx(I2C_OP_READ | (DEVICE_ADDRESS <<1 ));
            i2cRxAck(state.whoami);
            i2cStop();       
        }  
    }else{
        i2cStop();
    }

  • Hi James,

    I'm glad you were able to solve your issue. Thanks for posting the solution for other users!