2
\$\begingroup\$

I have been doing some simple stuff with PIC's, using a $12 cable from Sparkfun to program them. Wanting to do more advanced stuff, I bought an ICD 3 and with it came a warning about proper grounds with respect to AC powered applications.

I'm not entirely certain what you need to look out for when using an AC powered 12v supply on your target, be it a simple wall wart or a regulated linear power supply.

Can someone explain this more clearly than the Microchip documentation? The same warning also came with a USB logic analyzer and I would like to better understand this before I blow something up.

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

In North America, typical AC distribution has the neutral tied to earth, and most HV and LV circutry on the primary side will reference a primary return separate from the earth. See below:

enter image description here

The return labelled "PRI" would be the reference point for most primary-side stuff. The point labelled "PE" represents the earth connection. (Fuse omitted - my bad)

So far, so good.

Another common practice is to tie the returns of low-voltage secondary (i.e. mains-isolated) circuits to earth. Most everything out there follows this practice, for a multitude of reasons (safety, EMC, etc.).

What happens if you connect an earthed-secondary instrument to a primary return? You've earthed the primary return. What does that mean?

enter image description here

Is this really so bad?

enter image description here

Actually, it is quite bad. Notice that direct connection from N to L through D2? This 'path of least resistance' will invariably include whatever wires / PCB traces / connectors that happen to be in the secondary return of your test gadget (usually very small and not rated for line current) as well as the primary return traces of the DUT (size depends on where you connect your test gadget - if it's a low power circuit, usually small and not rated for line current).

This is why earthing the primary return usually blows the snot out of everything. The connections involved often burn and fuse before the input fuse does, leaving you with lots of burning silicon.

That's also why isolated test gadgets are essential for primary-side work. I believe it's always sane to assume that the primary of any mains-connected circuit is never isolated. That way, I always instinctively use isolated test gadgets like differential probes, and use USB isolators without exception.

Further to your question: if your 12V power supply has a properly-designed transformer in it, you're no longer mains-connected. The transformer breaks the connection between neutral and earth, and you may earth the secondary return of this transformer without the same catastrophic risk. You may not, however, stick your earth in the primary side of the power supply, since it's still mains-connected.

\$\endgroup\$
3
\$\begingroup\$

The ICD is connecting the PIC and its application circuit's 0V reference to the PC, which normally has a path through to the mains earth. Therefore you cannot power up your application circuit in a way which raises the 0V above or below earth potential without causing problems. If your application circuit is powered from a floating output eg from a wall wart or bench PSU, you would not have a problem. The problem normally comes when someone is developing a circuit which is directly mains powered, so that the PIC 0V is connected or referenced from live or neutral i.e. without an isolating transformer. In that case, you are well advised to use a USB isolator between the ICD and the PC, and an isolation transformer and ELCB for your circuit.

\$\endgroup\$
2
\$\begingroup\$

Those warnings apply more to the older ICD 2 unit, which needed a separate power supply if it was required to power the target system. There is a good description of the problem in the IN-CIRCUIT DEBUGGER DESIGN ADVISORY document (51764b.pdf).

If you do damage the ICD 3 you will get a free replacement from Microchip very quickly. :)

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I did read that document and doesn't this apply just as well to the ICD3 if you use an external power supply while debugging? \$\endgroup\$
    – Jim A
    Sep 14 '11 at 0:06

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.