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.

i2c clock lost one pulse when communicate with the mpu9250

I'm porting the MotionDriver from the STM32F4 discovery board to the TM4C123 launchpad these days. I use the i2cm_drv.c from the sensor lib to handle the i2c communication with the MPU9250 in the interruption manner. I met a strange problem in the i2c communication, sometimes when the launchpad writes to or read from the MPU9250, the i2c clock lost one pulse, then the i2c bus enter the error state. The pull-up resistor for the i2c is 10k ohm at the mpu9250. The LA snaps and my whole project are attached, could anyone give me some suggestions?

Thanks with regards

   

motion_driver_tm4c_2015052801.rar

motion_driver_tm4c_2015052801.zip

  • Many (most) here in US use, ".zip" files. Might you provide your project in that .zip format - greatly eases our read/review. Thanks...
  • Hi cb1,

    Thanks for your reply, the .zip file is updated. I really appreciate if you could give me some suggestions. Thanks in advance.
  • Hi my friend,
    Thank you - we travel - often present/demo (sell) on weekends - promise to read/review/comment - may not be for awhile.
    Might you advise why you've (moved) from your past device?    (that's one we often use - btw)

    As quick/dirty (not much more than "swag") suggest that you carefully test & "key" on "ACK/NAK" as - usually - but not always - they're "usual suspects" for your report...

  • Hello Gaojen,

    What is the threshold of capture set for the Logic Analyzer. Also if there are free wires between the board and TM4C. then as a recommendation I would suggest using stronger pullup resistance.

    Regards
    Amit
  • Noting that yours is a, "Motion Control" project - and that, "Only (sometimes) does your LPad's I2C clock "loose" one pulse" does paying close attention to the routing of that I2C bus wiring not make sense?

    If possible - can you power your motor/actuator from a separate source?

    Insure that the I2C wire/cable is as far as possible from the motion components.

    As a check upon my "theory" cannot you repeat your program run "without" the motor/actuator running?     This reveals - rather quickly - if motor noise is your issue.

    Succeeding with I2C is challenge enough - adding noise to the mix cannot help.    KISS dictates that you simplify - and then simplify some more...

  • Hi Amit, 

    The threshold is 1.5 volts. 

    I use the Dupont wires to connect the mpu9250 modules with the launchpad, and only the mpu9250 module is connected to the launchpad. Currently my pull-up resistors are 10k ohm, should i change them to a larger value, like 20k ohm.  Thanks. 

  • HI cb1,

    Thanks for your reply.
    I'm moving the project from the STM32F4 to the launchpad is that the motion driver demo, which is provided by the InvenSense, is developed at the STM32F4 discovery board, but we want to use the launchpad as our fusion chip.

    Currently only the mpu9250 module is connected to the launchpad via 10cm Dupont wires, no motors, no other sensors, the power source for the mpu9250 is the 3.3 volts pin at the launchpad.
  • Thank you - so motor/actuator are disqualified as issue's source.
    Did this project work properly when you employed that other, MCU? Do you know the current requirements of your sensor board? Might it be that the LPad's 3V3 regulator is unable to power both itself and your sensor board? (perhaps the voltage "dips" during operation - causing the missing clock.)
    I believe that Amit was suggesting that you (lower) the value of those pull-up resistors for the I2C bus - which should render the signal edges stronger & sharper.
  • Hello Gaojun

    As cb1 suggested using a lower resistance would make the edges sharper. Also can you enable the Glitch Filter for the TM4C123. Note that the Glitch Filter API in the i2c.c is for TM4C129. So you would need to refer to the data sheet of TM4C123 to get the correct bits for the glitch filter settings.

    Regards
    Amit