0
\$\begingroup\$

Working on a simple I2C setup: Raspberry Pi connected to a WM8731 audio chip. The Raspberry Pi configures the WM8731 (which is write only) over I2C.

Problem is WM8731 doesn't always respond with ACK. I have logic analyzer attached to the I2C lines, and about 5% of the time the transmissions end in NAK. No other devices are on the bus.

The curious thing is when I attach oscilloscope probes to the lines, it greatly increases the number of NAKs. The scope shows nice sharp transitions on SDA and SCL, but sometimes the WM8731 just doesn't pull low for ACK.

What could be going on such that merely attaching the scope probes would make the problem worse?

Signals during proper transmission:

enter image description here

Signals during NAK:

enter image description here

\$\endgroup\$
18
  • \$\begingroup\$ Looking at the WM8731 datasheet ( statics.cirrus.com/pubs/proDatasheet/WM8731_v4.9.pdf ), it does not appear to have an I2C interface. It says that it has an I2S interface. \$\endgroup\$ – crj11 Sep 15 '18 at 14:40
  • 1
    \$\begingroup\$ Your RPI seems to have difficulty pulling SCL, SDA low, whereas the WM8731L has no problem. Could be a ground-connection problem, or there could be ground-currents causing a ground offset between these two chips. \$\endgroup\$ – glen_geek Sep 15 '18 at 15:38
  • 1
    \$\begingroup\$ What is your BUS bit rate? Have you tried to slow it down? Anyway this being so sensitive to little and unnoticeable rising time tweaking makes me think data is sampled on the wrong clock edge, i.e. while changing and not in the middle of stable period. I'd rather have a thorough look to protocol timechart, both ends, on MPU and WM. \$\endgroup\$ – carloc Sep 15 '18 at 16:18
  • 1
    \$\begingroup\$ Removing the scope probe on SCL (while keeping the one attached to SDA) improves the situation. Adding extra capacitance to SDA (100pF) and the NAKs disappear completely. Slowing bus speed also helps... so seems like some timing incompatibility. \$\endgroup\$ – Owen Osborn Sep 16 '18 at 2:22
  • 3
    \$\begingroup\$ Use probes on x10 to minimize effects. \$\endgroup\$ – Spehro Pefhany Sep 16 '18 at 2:28
0
\$\begingroup\$

new

I would be curious to know if a 1MHz snubber at the Rx would reduce NAK error rate.

C=560pF in series with 220 Ohms across Rx to 0V. Some adjust may be necessary. e.g. 500 Ohm 270 pF


old info

I2S uses 74HCTxx or TTL logic thresholds. I2C uses std CMOS thresholds.

If the Vcc of each endpoint is floating, connecting a scope probe with an inductive long ground lead adds a common mode voltage (0V) than may differ from the "floating" ground and due to CM noise coupling at each end , some differential voltage can result.

It is hard to assess your CM noise without measurements between each ground with a current shunt.

The cable will have 100pF/m or so of capacitance and adding 10nH/cm of scope ground clip can induce a resonant impedance that may cause ringing.

So investigate noise ingress and experiment with earth grounding at either or both ends of the communication. Also, consider twin probes in A-B for signal integrity such that when both probes are on the same signal it produces a flat line. ( Vdif=0)

Depending on cable lengths and bit rate, a CM ferrite transformer can help raise the CM impedance to radiated noise.

The R pull-up depends on cable capacitance and bit period vs risetime and amount of noise ingress.

http://www.ti.com/lit/an/slva689/slva689.pdf


\$\endgroup\$
2
  • \$\begingroup\$ I tried a 470pF in series with 220 Ohms across SDA to GND, and another one on SCL. This eliminated the NAK completely! Separately I tried adding 220 Ohm series resistors to SDA and SCL near the slave. This also eliminated the NAKs. But still trying to understand why either of these remedies would be necessary for this simple setup (single master, single slave, separated by a few inches, without and noise or spikes that I have been able to observe). \$\endgroup\$ – Owen Osborn Sep 21 '18 at 16:11
  • \$\begingroup\$ Think of ringing impedance mismatch for cables>1m and EMI as a current source across lower R for lower noise. It’s all about SNR and signal integrity. twisted pair is bout 220~240 Ohm differential impedance on most. The probes can couple noise thru capacitance currents from ground differential , If desired you can test with an AC electric drill near cable for error rate margin improvement from experiments with snubber load. \$\endgroup\$ – Tony Stewart EE75 Sep 21 '18 at 18:44

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.