1

My collegue here has two seperate boards linked by an SPI link. He just asked me: "So... you need to connect the grounds?" After I picked myself off the floor and answered very much in the affirmative, I wondered - ok, so how bad can this get? It's a much worse case than this question which had a common PSU.

In this case, the SPI bus slave had an open-drain MISO line (with a pull up to the PIC's Vcc). The other lines were SS, MOSI, CLK. No ground. The resulting communication state was odd to say the least. Mostly as MOSI alternatively connected and disconnected the grounds together, through the open-drain, at up to 500KHz! Not to mention different things happening when probes were connected. Or fingers for that matter.

I'd never seen the SPI transceiver on a PIC go gaga before, but this seemed to do it. The CLK is, well, odd now. It looks drunk. The PIC was on a demo board connected via USB to a PC.

If I asked myself though "What caused the damage" or "What was going on", I'd be stuck to give a proper answer. I guess the ground potentials can diverge wildly, even if the end device is sitting on a desk... Is it worse or better when a probe is connected? Who knows?

It begs the question, are other comms links better protected? RS-232 for instance. I've never seen a fried RS-232 transceiver and I've seen a few links where the ground got broken. Anyone shed more light?

carveone
  • 2,578
  • 1
  • 16
  • 23
  • Ah yes. That's how you can make data connections without, well, physical connections. But I'm asking what's the worst that can happen if you don't and how other systems protect themselves. Sorry if that wasn't clear. – carveone Jul 18 '13 at 16:20
  • @carveone Just being pedantic here, don't mind me: An optocoupler (or even optic fiber) is very much a physical connection. What it isn't, is an electrical connection. :-) – Anindo Ghosh Jul 18 '13 at 16:43
  • @AnindoGhosh Ah yes. That's what I meant to say. I guess us mecheng people don't regard light or air as too physical :) – carveone Jul 18 '13 at 16:48

3 Answers3

3

You should connect ground to be used as a reference point. Even in RS485/RS232, people should connect ground. The reason is that if both devices are not grounded, then common mode voltage (Vcm) can damage the port. For example, RS485 receivers runs on relatively small differential signal (+/-200mV). However, Vcm can exists...due to noise, bad local grounds, etc. If one device is correctly grounded but the other is not, then instead of seeing +/-200mV, they might see +/- 20.2V. This is assuming the devices are not close to each other.

NothinRandom
  • 339
  • 1
  • 6
  • Once you disconnect ground, I struggle to figure out the mechanism of how a data line with no other reference can cause damage. ie: there has to be a current completion somewhere right? That's where I was stuck. I guess out there in the real world, engineers have to protect against this. I've taken shocks from the grounding shield on a (tv) cable where its ground differed by a large amount from my ground. I guess somewhere the current is completed, even if it has to use the planet. – carveone Jul 18 '13 at 16:25
3

How bad can an unconnected ground be?

Pretty bad. Like, it can kill you:

schematic

simulate this circuit – Schematic created using CircuitLab

This probably isn't the case you had in mind, but it demonstrates the point: if ground isn't connected, then maybe there are other current paths you didn't consider, and these paths could lead to damage. Thankfully, RS-232 doesn't have the current or voltage to deliver a lethal shock, which is why it's not subject to the same safety regulations that mains powered devices are. A device like this, with no mains isolation, is probably illegal in most jurisdictions. But, replace "you" with "some other device which is easier to kill", and you have the same situation.

Phil Frost
  • 57,310
  • 18
  • 145
  • 267
  • No, but it is an important case example which I hadn't considered. I was thinking an unconnected gnd couldn't be that bad and I'm wrong. It is. Goes to show the effort Engineers need to make to make sure connected comms don't blow up all the time. Quite an eye opener for me! Thanks all. – carveone Jul 18 '13 at 22:00
0

Thanks all. Instead of putting a comment I'll put an answer as I want to type more text. I hope that isn't poor form.

I had assumed that RS-232 was bombproof. From what NothinRandom is saying it isn't, so I'll be more careful in future!

So the way I figure it is if you fail to connect ground between two boards you have these possiblities:

  • connect a data line to two isolated boards, you're ok. No current running.

  • connect these boards to a ground point, where the ground points can possibly differ (say via scopes, or even via a long ground line), you could get virtually any voltage on the data line. This can result in a damaged tranceiver.

Moral of the story seems to be: when you have external connected lines, use protection circuitry:

  • Optoisolate
  • Protection diodes
  • Common mode chokes

I also see some input circuits which have a small resistor in the data line followed by two back to back zener diodes.

A little googling shows protection circuits on USB are normal. I assume there's protection circuits on TV inputs, RS-232, etc.

carveone
  • 2,578
  • 1
  • 16
  • 23