I first of all need to establish the correct arrangement for shielding/ground/0volts.

one of the products has micro pins going out directly to push button ON/Off switch, indicator LEDS, which is bad practice, no transzorbs, resistors, bugger all.If you looked at the link to eda, I am surprised that the opinion is that all is OK from an earthing point of view.

earth chassis/anything that can be touched, that directs static to earth

connect electronics through 10nf/1KV capacitors to earth for emc.

so electronics should NOT be connected to earth

The ON/OFF switch is metallic, but the 2 pins just connect 0volts a micro pin to an un protected ATMEL micro pin.

Where does the energy go?If a path does not breakdown, it just gos into storing energy in the stray C by charging it up.If it does breakdown, where does the ESD current flow? If it is actually breaking down, it is likely through stray capacitive paths. Most notably, back through the power converter. ESD is a fast event and can take out stuff along the way. Any part of the design that can be touched by a person should be impedance limited and/or clamped(voltage limiting) through a low impedance path back to earth (not easy in your case)

Each ESD and EMC case can be very different and I caution against rules of thumb that you may have been lead to believe. You seem fairly confident in ESD being the cause. Can you get an ESD gun and start testing breakdown strength and paths? Knowing what particular parts of the design are susceptible, is 90% of the solution.

"so electronics should NOT be connected to earth"

Each case is different. There are many types of designs where it makes sense to isolate from Earth and many where it doesn't. I would not make a generalization like that at all.

did you have a schematic you can share? Nothing jumps out as really being "wrong" with how it is set up. You couldn't GO wrong with transorbs on the input and output, and 100ohm/100pf LPF on each signal input and output (such as the button or any I/O). If the metal spray isn't doing a good job (have you measure the impedance?) maybe you could be conducting static in through the metal button.

Is there a possibility of surges in the circuitry when input or output are connected or disconnected?

on one of the products, there is an ATMEL micro with several connectors, one of which takes the power button contact pins via a wiring loom, takes one directly to the micro pin, no protection, not even a series resistor, the other button pin back into the pcb, onto 0 volts via 2K resistor.

again on the same 18 pin connector NO protection on any pins, 2 LEDS RED/GREEN on the case via a wiring loom. on the pcb each has a series 100R resistor just limiting current to the usual few milliamps.

There are smart lithium batteries via a connector in the product, and so have an I2C bus which again goes straight to the ATMEL micro, no protection at all, only the usual 2K pullups

The ATMEL is programmed/debugged via a JTAG connector.

I blew the debugger up last week, it is of course a USB device, so when connected allows an earth connection via the desktop PC.I have no idea why the debugger blew up, and that worries me. I am currently building an isolated JTAG adaptor 'cos the ATMEL JTAGICE mkII costs £300At some point in the future, I will redesign and beef up the protection.

But I still have it in my brain to not connect 0volts to the chassis, connect the chassis ( its a poor metallic sprayed plastic case, and certainly no Faraday cage) via a 10nf/1KV Cap, and a 1M resistor to the earth on the power brick.

Still weird. Though protections would be nice, they really shouldn't be that necessary except under pretty harsh EMI conditions.

Is there a chance that your power bricks are not properly isolated from mains? Have you ever tried taking a running unit and used a multimeter to measure between 0V and GND on your computer?

It's definitely weird that you blew the programmer but this might be suggestive of a ground level shift between your device and the programmer.

Another stupid thought, is your power brick AC ground really connected to ground? I ask because if your power brick has X/Y caps in it to ground and the ground isn't connected properly this could allow an AC leakage up into the connector ground in your device.

I am really thankful for your thoughts.there is a connection from the power brick (XP Power) dc pin plug metal housing to the earth pin on the mains plug as measured by an ohmeter.

Of course, I expect there to be X/Y caps to earth.

as to "It's definitely weird that you blew the programmer but this might be suggestive of a ground level shift between your device and the programmer."

the situation was that the product wouldnt show signs of life, so I blindly replaced the 100 pin TQFP Atmel device, as that controls everything.

I connected the debugger/programmer, successfully JTAG blew the code into the device, so all was well then.I was single stepping/breakpointing trying to find out the problem, than at some point ( dont remember the circumstance ) I think I noticed the debugger getting hot/not working.The debugger on its own connected to USB for power now gets very hot, and there is an LM317 inside, which really gets hot.

Strange thing, the debugger/programmer can be powered by either USB or 9V DC normal 2.1mm DC plug.

So, the USB connection power gets hot, the external 9V power is fine !!!!, but the thing wont JTAG work anymore

Since I dont have the schematic of the ATMEL JTAGICE MkII, its hard to go much further.

I have a second working debugger, but am scared to plug it in, so am currently building an isolated JTAG adapter, so cant blow the debugger up again ( I pray )

I only joined the company 4 weeks ago, and havent used ATMEL before, but am experienced in PIC,ARM and other micro's so not a newbie.

I do think the problem is something to do with earthing/0v/usb

I have been in engineering for 45 years, so know a thing or two ( OC71,2N3055,uA709)

My understanding is 0V most of the time connected to chassis ground, except if an isolated device needed. To ground (earth) or not (floating) is a choice, to earth is for safety, floating is to avoid ground loops (aka noise) and for some measurement instruments.

Connecting mcu pins to outside without any protection is a big NO, not ESD i think but EMC (inductively coupled) is the enemy. A series resistor with value below 1K wont be enough to protect the clamping diode inside mcu pin, an external bi-dir clamping diode after the resistor will do the job, while in industrial environment an optocoupler (6N137) is the standard practice.

As for the blown debuger, i may check the circuit if it has some conflicts between JTAG pins and used I/O.

I did a design last year for an aircraft manufacturer, who in the spec insisted that the chassis MUST be isolated ( megohms @ 500V ) from any electrical circuit.

So I thought that was the best way.

I don't think there is anything wrong with isolated or floating circuits. It just has to be thought about carefully when you have, or introduce other current paths (like a USB port, power brick ground etc.)

I have read through this thread once more. And the more I think about it. It looks like some sort of a power supply problem to me. Perhaps it has transient problems releated to connection or disconnection of the power.

one thing I found before is that sometimes you have JTAG device provide ground path, but the device you are working with has a different idea of ground level - so maybe check for potential between those twoespecially if this problem only occurs near the time of jtag use / connection

second thing I would check is for spikey things coming from the power source, and then

where else in your system the cables run from this device - ie do they go near something that radiates something that can be coupled in - IE is the power switch wire acting like antenna

I really appreciate the time, effort and brainpower being applied to this problem.

the power brick is a 19V/6amp being powered by 240v ac.

it does have heaters and stepper motors,and fans, but they are not on since the unit is not working properly.

there are several smps regulators in the the unit, 2 off 19V->12V @6A, mainly for the heaters and motorsand small 12V fans, plus the usual 12->5V->3.3v for the electronics.

I will check, but I thik that the Atmel JTAGICE MkII does not supply 3V3 to the unit. It actually reports back the units 3v3 voltage, and indeed wont JTAG program if its out of the range 1.6-3.6V.

I do believe that the power switch wiring and the red/green LED's wiring from the PCB to them is a problem, and I will fix that in a re-spin.

As I have several times, my main area of uncertainty is the earthing of the chassis to 0Volts of the electronics.Its a plastic chassis with a poor spraying, and probably only 30% covered with BIG holes for airflow etc.

--------------------------------

just re-looked at the schematic, I would love to post a section, but dare not without permission.

the 19V comes in on a connector, then into a common mode choke. across the input of the choke are 100nf/50v,10nf/50 v caps.

the connector is a 10 pin , 2 pins connected to a gnd symbol ( which is the electronics 0volts), BUT the choke input/caps are connected to a 0v symbol.

so, i think that 0V symbol is connected to the chassis. i need to really check the overall wiring loom diagram to be sure on this.