I2C, debugging problem
I2C, debugging problem
(OP)
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
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





RE: I2C, debugging problem
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 - http://www.flaminsystems.com
RE: I2C, debugging problem
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.
RE: I2C, debugging problem
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
RE: I2C, debugging problem
Dan - Owner

http://www.Hi-TecDesigns.com
RE: I2C, debugging problem
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: I2C, debugging problem
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