0
\$\begingroup\$

As I was programming a device's flash with a USB bus pirate, I was curious about how this was possible from an electrical perspective. The target device was powered from a separate power adapter than my computer.

In high school, I was always told that you shouldn't connect circuits together that have different power supplies. I was also told not to have two digital circuits trying to drive a bus line to different logic levels.

Even though I knew this, I didn't think twice when connecting:

  • two computers together with a serial cable
  • a computer with an Ethernet switch
  • a computer to a laser printer with a parallel cable
  • a laptop to a separate monitor with a USB-C cable

In the above cases, I suspected that there was some magic that solved this.

So, is there some simple and inexpensive magic for things like JTAG or device programming? How did the devices in the above list achieve this?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Unlike the others, Ethernet is transformer isolated, as it's designed to work across distances where there could be differences in mains ground. Each Ethernet interface contains a small signal transformer on the board or built into the RJ45 jack. Similarly the shell on the 10base2 coax BNC was visibly isolated from the backplane bezel chassis ground. \$\endgroup\$ Commented Aug 31, 2020 at 11:07

2 Answers 2

2
\$\begingroup\$

The devices either need a common ground reference, or there needs to be something to isolate the circuits like an optoisolator.

Most JTAG probes go for the common ground, just connecting it together, and assuming that both sides use isolated power supplies, and if they bring in an external ground reference, it will be the earth connection from the power supply.

Most development boards have an isolating power supply in a wall adapter and are not connected to the earth pin in the outlet, so they are floating.

If you connect a JTAG adapter connected to a desktop PC that uses the earth pin as ground reference, the entire system will be referenced to that.

The only configuration that is a bit difficult is if both devices use the earth connection as ground, like I have here with an FPGA card in a desktop PC that is controlled via JTAG from another desktop PC.

This is however still safe since the earth reference they have is the same, I'd have to take a really long extension cord and connect one of the PCs' supplies in another building. That is impractical, so that case is basically ignored.

\$\endgroup\$
1
\$\begingroup\$

There's no magic, as long as the current is limited (hint: use a resistor) then nothing will break.

The only line that you want to connect directly (no resistor) is the ground.

As long as all other lines are current limited, the ground can safely have a direct connection.

In case of USB, ethernet and JTAG there are "strict" specifications that need to be met, like which pins are inputs, which are outputs, what voltages are they allowed to support? Such specifications are made such that, as long as all devices follow it, nothing will break.

Note that supply lines like 5 V, 12 V etc. are not current limited and can deliver enough current to damage components. So supply lines should not be connected.

Note that the outputs of almost all microcontrollers etc. cannot even deliver enough current to break anything.

The "high school advice" is still a good advice just to keep things simple for students. It doesn't tell the complete story but that's OK, not everyone needs to know/can remember what is OK and why.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.