From: Steve H on

I've designed & built a device using a 16F877A PIC, and have had a few
issues with the device resetting or locking up due to static
sensitivity. I think I've got to the point where it's working acceptably
well, but I'd be very interested in anybody else's opinions on the
issues I've faced.

The device itself is essentially the 16F877A driving a couple of stepper
motors via darlington transistors, a couple of LEDs and some control
buttons. There is another input to the PIC via an optocoupler, the input
itself isolated via the opto and a DC-DC converter. The electronics are
contained in an earthed steel enclosure and the 0v rail is connected
directly to earth, the connection being at the PSU end.

The first problem I faced was that the PIC would frequently lock up when
either the case or any part of the 0v rail was touched. I realised this
was due to a mild static charge building up when I got up off a chair
and being discharged through whichever point was touched. The PIC would
crash and would draw then excessive current from the 5V supply.
Investigations found the solution to this particular type of crash was
to pull the MCLR up to Vdd via a 4k7 resistor and not have it connected
directly to the 5v (as the Microchip datasheet suggests is acceptable).

The PIC would now not lock up as before but would still perform a reset
if earth was touched when slightly charged up. It would also, as it
happens, do the same when part of the isolated circuit was touched.

The solution I found to make the circuit acceptably resilient to the
cause of the problem was to remove a 100nf ceramic decoupling capacitor
I'd connected between MCLR and ground as part of my investigations into
the cause of the first lock-up. The use of a decoupling capacitor on the
MCLR is not uncommon it would seem, but not always used.

While not perfect, the device is now at least reliable enough for use.
It does however raise the question in my mind as to what the ideal
circuit arrangement is for the reset circuit, to make the device as
resilient as possible? I note you can charge yourself up with static and
give the metal case of your PC a pretty severe zap without any ill
effects.

--
Steve H
From: Vladimir Vassilevsky on

Apparently the ESD current is flowing through your board. That could
result in all sorts of peculiar effects. Fix the board layout and/or
rethink the connection of grounds and cables.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com


Steve H wrote:

>
> I've designed & built a device using a 16F877A PIC, and have had a few
> issues with the device resetting or locking up due to static
> sensitivity. I think I've got to the point where it's working acceptably
> well, but I'd be very interested in anybody else's opinions on the
> issues I've faced.
>
> The device itself is essentially the 16F877A driving a couple of stepper
> motors via darlington transistors, a couple of LEDs and some control
> buttons. There is another input to the PIC via an optocoupler, the input
> itself isolated via the opto and a DC-DC converter. The electronics are
> contained in an earthed steel enclosure and the 0v rail is connected
> directly to earth, the connection being at the PSU end.
>
> The first problem I faced was that the PIC would frequently lock up when
> either the case or any part of the 0v rail was touched. I realised this
> was due to a mild static charge building up when I got up off a chair
> and being discharged through whichever point was touched. The PIC would
> crash and would draw then excessive current from the 5V supply.
> Investigations found the solution to this particular type of crash was
> to pull the MCLR up to Vdd via a 4k7 resistor and not have it connected
> directly to the 5v (as the Microchip datasheet suggests is acceptable).
>
> The PIC would now not lock up as before but would still perform a reset
> if earth was touched when slightly charged up. It would also, as it
> happens, do the same when part of the isolated circuit was touched.
>
> The solution I found to make the circuit acceptably resilient to the
> cause of the problem was to remove a 100nf ceramic decoupling capacitor
> I'd connected between MCLR and ground as part of my investigations into
> the cause of the first lock-up. The use of a decoupling capacitor on the
> MCLR is not uncommon it would seem, but not always used.
>
> While not perfect, the device is now at least reliable enough for use.
> It does however raise the question in my mind as to what the ideal
> circuit arrangement is for the reset circuit, to make the device as
> resilient as possible? I note you can charge yourself up with static and
> give the metal case of your PC a pretty severe zap without any ill effects.
>
From: Jan Panteltje on
I have had similar effects with driving steppers, with a different
processor.
In my case ESM made it via the wires to the steppers.
Use transzorbs on each outgoing and ingoing connection,.
Those transzorbs will have to be grounded at the right points,
probably the metal casing.
Layout of wires is also very important as Vladimir points out.

From: Frank Buss on
Jan Panteltje wrote:

> I have had similar effects with driving steppers, with a different
> processor.
> In my case ESM made it via the wires to the steppers.
> Use transzorbs on each outgoing and ingoing connection,.
> Those transzorbs will have to be grounded at the right points,
> probably the metal casing.
> Layout of wires is also very important as Vladimir points out.

For digital signals, and if you don't need it lightning fast, you can use a
resistor and a BAV99:

http://www.mikrocontroller.net/attachment/74930/Schutz.png

--
Frank Buss, fb(a)frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
From: Jeroen Belleman on
On 05/30/2010 06:10 PM, Steve H wrote:
>
> I've designed & built a device using a 16F877A PIC, and have had a few
> issues with the device resetting or locking up due to static
> [...] The electronics are
> contained in an earthed steel enclosure and the 0v rail is connected
> directly to earth, the connection being at the PSU end.

If I understand correctly, your electronics and the box it sits in
each have their own individual wire to a common ground at some
remote PSU?

That's bad!

The box should *be* the electronics ground. In the setup you
have, discharging static through either the box or the electronics
ground will make the potential of one jump w.r.t. the other,
causing all sorts of mayhem.

Any wire going through the wall of the box should be filtered
and protected against excessive voltages, ideally right at the
point where it penetrates.

Jeroen Belleman