2
\$\begingroup\$

I have a microcontroller (LPC1768FBD100) and am using I2C to configure a 3 port eithernet switch (KSZ8863RLLI). I’ve made about 100 boards so far and they have all worked well, except one. For some reason switch configuration (performed over the I2C interface) is failing. While probing the control signals with an oscilloscope, it all of a sudden sprung to life. On closer inspection it appears that adding the capacitance of the probe (15pF) to the clock line is enough to get it all working.

If I understand the I2C bus correctly, officially you don’t need a minimum value of line capacitance for it to work, but is there some kind of rule of thumb minimum capacitance value for reliable operation?

=======Specs/Notes=======

I2C clock speed = 370kHz.

I2C pull up resistors = 4k7.

Pull up’s are located near the microcontroller.

I2C Clock Length = 91mm.

I2C Data Length = 78mm.

There are no nearby sources of noise that may be interfering with the clock and both traces are running adjacent to a continuous ground plane.

=======Testing=======

Tried reducing clock speed to 100kHz, didn’t work.

Tried 1k, 4k7, 10k, 47k pull up resistances. None worked

Tried adding 8pF of grounding capacitance to the 4k7 clock pullup, didn’t work.

Tried adding 16pF of grounding capacitance to the 4k7 clock pullup, system works and boots reliably.

When I check the clock and data signal lines, there are no signs of ringing. Though, I guess there could potentially be some ringing which the 15pF of probe capacitance is concealing.

=========UPDATED INFO=========

We are using the hardware implementation of I2C built into the LPC1768FBD100

I don't think it is a mechanical issue. I have reflowed all the joins and when I probe the line, I am doing so on a test point, not a solder connection.

Regarding noise and cross talk, my gut is telling me that isn't the issue as the traces are not that long (~80mm), are running adjacent to a continuous ground plane and i'm using pull ups of 4k7. I could be wrong though.

Waveforms. Notations added to each screenshot. Waveforms. Notations added to each screenshot.

I2C Traces. Routing is not mine. I inherited this from another engineer. I2C Traces. Routing is not mine. I inherited this from another engineer.

\$\endgroup\$
  • \$\begingroup\$ As far as I can check, there is none. But if only 1 out of 100 is bad, then it probably shouldn't be that. (a 1% manufacturing failure rate is not un-unacceptable sometimes) Can you provide any graphs of the line with and without the capacitance? For both a good and the bad one? Can you measure the capacitance of the good boards? \$\endgroup\$ – Passerby Aug 25 '15 at 4:57
  • \$\begingroup\$ Maybe there is a partial short that holds the line low without the added capacitance? \$\endgroup\$ – Passerby Aug 25 '15 at 4:57
  • 2
    \$\begingroup\$ Did you look on the signals close to the receiver? It sounds most like a signal integrity issue. Probably there is some crosstalk or overshoot. How far is the receiver from the driver? Can you show the layout? \$\endgroup\$ – Gregory Kornblum Aug 25 '15 at 6:23
  • \$\begingroup\$ You are using hardware I2C or software? \$\endgroup\$ – Spehro Pefhany Aug 25 '15 at 12:05
  • 1
    \$\begingroup\$ @philby, that oscilloscope waveform is not proper i2c data. There is SDA changing at the same time there is a falling edge of SCL. Because the state of SCL is not stable at the SDA edges, the receiver can't know from each SDA edge if it's a START/STOP or a data bit. For a reference, I've added a waveform timing picture from your microcontroller's datasheet. Are you sure you are configuring the I2C hardware correctly? \$\endgroup\$ – PkP Aug 27 '15 at 9:53
6
\$\begingroup\$

I can think of three possible mechanisms that may result in the system starting to work if you touch the SCL line with an oscilloscope probe. All three indicate a fault in the unit.

First, it may be a mechanical issue such as a bad solder. When you poke it with the probe, it may repair the connection and signal starts to flow.

Second, it may be a noise issue; crosstalk, coupled noise from any source, and the application of the probe's capacitance dampens that noise. But that would mean that your I2C bus's pull-up resistors are far too small. They should be something like a few kilo-ohms.

Third, your SCL and SDA signals might be switching at the same time, which is a no-no in I2C bus. You shouldn't change both signal states in the same operation; there should be a time delay between any edge in SDA signal to any edge in SCL signal. If the both switch at the same time, the application of the probe capacitance to SCL may delay the SCL edge enough that the I2C device's input data stabilizes before it sees the edge in the clock signal. And this failure mechanism would indicate an error in your microcontroller code.


Edit: For a reference, here is a picture of a proper i2c waveform from the datasheet of the microcontroller which the asker is using.

i2c bus timing

Image source: LPC1769 datasheet page 59

\$\endgroup\$
  • \$\begingroup\$ In the absence of a comment from the OP I'd go with SCL and SDA switching together! \$\endgroup\$ – Andy aka Aug 25 '15 at 9:58
  • \$\begingroup\$ Thanks for your reply. As you can see from the screen shots I added there is a data transition on the clock falling edge, but I believe the data is clocked in on the rising edge? \$\endgroup\$ – philby Aug 26 '15 at 0:32
  • \$\begingroup\$ I don't think it is a mechanical issue. I have reflowed all the joins and when I probe the line, I am doing so on a test point, not a solder connection. Regarding noise and cross talk, my gut is telling me that isn't the issue as the traces are not that long (~80mm), are running adjacent to a continuous ground plane and i'm using pull ups of 4k7. I could be wrong though. \$\endgroup\$ – philby Aug 26 '15 at 0:43
  • \$\begingroup\$ I still have not solved the problem, but I'm marking PkP's reply as the answer since it does a good job covering all the main modes of failure. \$\endgroup\$ – philby Aug 26 '15 at 23:00

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.