Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I2C, debugging problem

Status
Not open for further replies.

CarbonWerkes

New member
Mar 15, 2006
62
0
0
US
Hi,

I have a problem with an I2C bus. For whatever reason, it will not start as it lays on the PCB. However, touching the SDA line with a scope probe kick-starts it, and from that point, it runs as expected even with the probe removed. If the scope probe is physically connected to SDA on system power-up, the I2C bus will start/operate as expected. So, sort of a catch-22, in that by attempting to monitor SDA, Im preventing the problem. Fyi- touching SCL with the probe has no effect in this context.

Im not an I2C expert, so Im trying to understand why the scope being connected to SDA is all that is required to start the system. Presumably, lower capacitance is better, and the scope has about a 10Meg input resistance, so it should not do much in the way of signal skew etc. But obviously, it must.

The setup is a single Master, single slave, 3K pullups on SDA/SCL to 5V, signaling verified as well within low/high requirements, running 100Khz. Trace length is < 3”.

Any ideas? Im lost.

Best-
Rob
 
Replies continue below

Recommended for you

I hate I2C.. I have to do one soon myself. I much prefer SDI.

Anyway. Touching with a scope probe causes a sudden transition which is causing a state change needed for your software/hardware to 'proceed'. You need to look at your code and specifically the boundary, or initial conditions, to see what happens on boot and what a state reversal means to it. Perhaps you haven't set the the master's pin direction correctly and once an input transition occurs your code then starts handling the pin direction correctly.

One other possibility is your hardware is in some fault state that is latching up the hardware? The sudden transition is getting it past the bad initial conditions.

Keith Cress
kcress -
 
Hi Keith

That was my initial thought also- and I found that by touching SDA to ground briefly, that would get things rolling. But, even if the DSO is connected to SDA (i.e. wire soldered to SDA-side of pullup- to the DSO probe), the system will function correctly- where, in theory, the DSO is not producing any transition event.

In fact, on powerup, the SDA/SCL lines should pullup to 5V before the MCU/slave are even internally happy, so any initial bounce or whatever that may come from loading via the probe should be gone way before any bus start event is called.

Very confusing.
 
Your scope is a 10 Megohm (or lower) load, so that may be just enough of a connection to ground to get you started.

It sounds like you may have a floating channel because the output on your single master is not active. As it said, check your initialization conditions.

My $0.02

John D
 
Connect a 100k resistor to ground and see if the comms become reliable upon start-up... remove the scope from the equation.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Don't just focus on the resistive impedance of the scope probe. The typical scope probe has a chunk of capacitance as well.

TTFN

FAQ731-376
 
OK, problem seems resolved with more capacitance on SDA. Strange, because the spec says 10pF, and I had tried that very early on- up to 27pF, attempting to emulate the probe's characteristics, with no luck. However, it will start with 100pF on SDA. The silicon engineers are looking into it now... I'd better look into my scope probe's actual capacitance! lol.

I tried 20K-100K pulldown on SDA, but that did not help, so it does not seem to be a float problem.

Thanks all for the help- much appreciated.

Regards,
Rob
 
Status
Not open for further replies.
Back
Top