0
\$\begingroup\$

Microcontroller Schematicenter image description hereI2C Signal Communication SDA(PINK)  SCL(Yellow)

hello to all,

I'm working on I2C Based Communication Device bq27742-g1(Texas Instrument) Battery fuel gauge which is Slave Device address is 0xAA. I have put in the 10K pull up resistor.

In this I'm using Kinetis series Cortex M4 micro controller as Master device. The microcontroller works with another I2C device.

I have tested the bq27741-g1 Battery fuel gauge with an MSP430 Launchpad board using I2C scanner and it works fine.

I have attached screen shot of CRO Signals (SDA(PINK) SCL(Yellow)) of I2C Device in the 9th clock pulse of SCL when SDA have undetermined state. Why does this occur at this level? Is this issue from the pull up resistor?

\$\endgroup\$
  • \$\begingroup\$ did u use any level shifters in the I2C (like MOSFET level shifter etc) \$\endgroup\$ – user19579 Jan 3 '17 at 8:13
  • \$\begingroup\$ That does look like the ti.com part tried but could not drive the data line low to ack the address sent by the master. Are you sure the bq27742-g1 ground is at the same voltage as the processor's ground? \$\endgroup\$ – st2000 Jan 3 '17 at 8:40
  • 1
    \$\begingroup\$ 200 ohms is a lot of resistance to place between the Bq27741-g1 I2C driver and the I2C bus. That part of the ti.com Bq27741-g1 specification schematic says "Additional ESD protection. Not part of application circuit." so it is not know if it is necessary. Yet with a 10K ohm pull up it should not cause the problem you show on the scope. Please verify you are pulling up with a 10K ohm resistor. As it appears to be a 100 ohm resistor. \$\endgroup\$ – st2000 Jan 3 '17 at 9:50
  • 1
    \$\begingroup\$ Am I reading that scope shot correctly? Are the I2C lines really swinging between 0 and 35V-37V? At 20V per division, it sure looks that way. If that's really the case, then I think you probably fried the GQ27741-G1. Absolute max on the I2C pins are 5.5V on the GQ27741. \$\endgroup\$ – CHendrix Jan 3 '17 at 11:44
  • 1
    \$\begingroup\$ @Kalarav N. Parmar, are you implementing the I2C in software? Or did you use the Kenetic's I2C hardware? If in software you must tri-state (set to input) the pin controlling the I2C DATA pin when not driving it low. If you are using the Kenetic's I2C hardware, what is the processor's part number, pin count, pin you are using for I2C DATA and the value you are setting the Kenetic's mux register which controls that pin. \$\endgroup\$ – st2000 Jan 4 '17 at 15:08
2
\$\begingroup\$

I'm not familiar with the Kinetic MCU, but on a different MCU I have had the same waveform when I misconfigured the SDA line as a regular output instead of configuring it as an open-drain output.

You can see that the slave is responding with an ACK and trying to drive SDA low but something (probably the Kinetic as I2C master) is driving SDA high thus you see the voltage at 1/2 the rail during bit 9.

Set SDA as open drain.

\$\endgroup\$
  • \$\begingroup\$ On the Kinetic processors the pin multiplex feature should configure (usually configures) pin properties. Although your comment is making me question this. There may be a problem with this specific Kinetic processor or this specific feature. But from my experience, all that is needed is to "connect the feature to the physical pin". \$\endgroup\$ – st2000 Jan 4 '17 at 14:59
  • \$\begingroup\$ You know, it just occurred to me that @Kalarav N. Parmar may be implementing the I2C in software. And not driving the bus correctly. \$\endgroup\$ – st2000 Jan 4 '17 at 15:03
  • \$\begingroup\$ @st2000 yes i am implementing i2c on software . \$\endgroup\$ – Kalarav Parmar Jan 5 '17 at 11:53
  • \$\begingroup\$ @KalaravN.Parmar, then what you need to do is set the pin to output and low for a low. But, for a high you need to set it as an input. Do not drive an I2C but line high. Let the pull up resistor do that. Let me know if you want me to put this into an answer with more details. Also, why are you not using the built in I2C. I am almost sure that if you do, all of this will be taken care of for you in the hardware. Ha, this also explains why the scope traces don't consistently line up! There is a little jitter in the edges because it is being run by software. \$\endgroup\$ – st2000 Jan 5 '17 at 12:10
  • \$\begingroup\$ @st2000 i'm using it Kinetic micro controller internal I2C but it have also feature that we can enable those pin as OPEN DRAIN ENABLE after that i have nake SCL and SDA to ODE. so, its working fine I2C Write And I2c Read. \$\endgroup\$ – Kalarav Parmar Jan 5 '17 at 12:13
0
\$\begingroup\$

This is problem happens when I2C slave and master both are trying to drive the line at the same time in opposite directions.

Your battery fuel gauge is I2C slave and MSP is I2C master. Are you using some libraries for I2C communication or have you implemented the I2C protocol on your own?

In the 9th clock cycle, MSP should release the SDA line (make it tristated input), to allow Fuel Gauge to drive it low. This low should be interpreted as an Acknowledgment. Please cross check your I2C code.

\$\endgroup\$
  • \$\begingroup\$ On a normal I2C bus, all drivers are open collector. None of the drivers should be capable of pulling the bus high. \$\endgroup\$ – st2000 Jan 4 '17 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.