ESD problems with PIC 16F88

I have built a number of battery operated circuits using PIC16F88s.

They are housed in a plastic case with a socket to plug in a serial connection for controlling LED outputs by RS232 comms.

Sometimes when you touch the socket with your finger, the PIC responds in a manner suggesting that it has received some random data on the Rx pin of the USART. The problem occurs much more frequently in cold dry weather which I know is worse for static generally.

Presumably this suggests that electrostatic discharge is being interpreted by the PIC as a signal.

Any ideas on how to prevent this? (Ideally with modifications that I can do to existing circuits as I have made quite a few already.)

Here is what I have already tried, in an attempt to fix it:

- Now there is a 1K resistor in series between the USART Rx pin and the socket pin corresponding to serial data.

- I have also tried a 100K pull-up from the Rx pin on the PIC to Batt

+ve.

- I have attached 100k pull-down resistors to the other unused pins of the PIC that were previously not connected. (They are all set as outputs anyway)

- The PIC's Vdd has a 100nF capacitor connected directly between it and Vss (within 20mm of pins)

- There is also a 10uF capacitor between Vdd and Vss (but located a little further away on the board - about 150mm from PIC)

The PICs I am using are SOIC package. I made a very similar batch of circuits a couple of years ago using DIP package (also PIC16F88) running the same program and didn't have any such problems.

Thanks in advance for any advice, Bo.

Reply to
lloydcam
Loading thread data ...

On Tue, 20 Nov 2007 11:39:40 -0800 (PST), I said, "Pick a card, any card" and snipped-for-privacy@gmail.com instead replied:

formatting link

-- Ray

Reply to
Ray Haddad

Now that's thinking outside the box. ;-)

Reply to
Anthony Fremont

On Tue, 20 Nov 2007 15:57:43 -0600, I said, "Pick a card, any card" and "Anthony Fremont" instead replied:

Indeed.

I believe he hasn't got an ESD problem; that would tend to be damaging to the point of destruction of the circuit. What he most likely has occurring is that his fingers, or his body, is picking up stray radiation from power lines, the internal oscillator, his PC or perhaps a nearby radio. Any of those could induce a signal into the circuit. Thus, I suggest covering the connector so when it's not in use, it's safe. Either that or a serial loopback connector.

-- Ray

Reply to
Ray Haddad

Assuming the socket is connected to ground; shunting the rs232 input pin to ground with 100pf, to start, might have an effect. If not, add more & see what happens. Maybe the same approach but close to the connecter rather than the ic.

Hul

snipped-for-privacy@gmail.com wrote:

Reply to
dbr

I believe that's entirely possible. The CMOS inputs are of such high impedance that touching a pin will easily trigger it.

Sounds good to me, I think the OP should also consider modifying the software such that it can reject noise generated signals. The unused output pins that have pull-up resistors should be changed to either let the outputs float or make them inputs, asis they are just wasting power. I've noticed that the lower the power requirements of the PIC line, the more fussy they are about the power supply, but I don't think that has anything to do with the problem now. I wonder if the OP is using a MAX232 type level convertor or has brought the PIC pins straight out to the external connector.

Reply to
Anthony Fremont

Many thanks for the replies,

re. Ray Haddad's suggestion of covering the sockets: Good idea BUT the problem has happened a few times when I was going to plug a wire into the socket... So it has to be uncovered at that moment anyway. In fact, I should have mentioned this in the original post - sometimes the strange behavior occurs just as a plug first touches the socket - i.e. before the pins inside the plug and socket have properly mated. So in this case, it is not my fingers but a wire connected to another PCB which make it happen. But several other times, it happens just when touching with fingers even if no other circuits or wires are nearby. It has happened at times when there is no other electronic apparatus nearby at all. So my guess is that the source of the discharge (if that's what it is) is body static or as you say possibly something else within the circuit... the circuit is fairly simple - a bunch of LEDs connected to mosfets, an Xtal connected to the PIC and a little battery charging chip. The socket is not actually DB9, but a mini-USB B. However USB protocol is not used, RS232 is used as mentioned previously. (That socket was chosen just for its size and convenience getting leads etc).

to Anthony Fremont: The unused Output pins are pulled down to GND (not up) and they are set as output zero so I don't think I'm wasting any power there. The only pull-up is on the Rx pin which is an input. I'm not sure how to modify the software to reject noise-generated signals as I'm using the PIC's built-in USART. I'm not using a MAX232 within the circuit. When the device is plugged in, the device that communicates with it has a FTDI232 chip that converts to TTL levels. But when the device is not plugged in, there is nothing in the circuit to intentionally affect the RS232 RX input.

to Hul: I will try a 100pF cap between Rx and GND either close to the socket or close to the PIC and let you know the result.

Thanks again to all of you.

Reply to
lloydcam

One other thought - rs232 data lines are normally negative, in a formal case, 10-12 v below ground or greater that 3 v negative. If the ic expects that, ie not designed for an inverter "pre-amp", then you may well be looking at behaviour caused by logic, not transients. If so, pull down, not up.

Hul

snipped-for-privacy@gmail.com wrote:

Reply to
dbr

There is something wrong here. The hardware RS232 spec. is for logic levels below zero for one sense, and above zero for the other. IIRC the minimum level is 3V in either direction. Many PCs effectively use TTL levels, though, and most receivers have the ability to resolve this.

Please do not top-post. Your answer belongs after (or intermixed with) the quoted material to which you reply, after snipping all irrelevant material. See the following links:

--
  
  
 Click to see the full signature
Reply to
CBFalconer

Normally ICs worried about ESD come up with some buffer technique internally or you can also implement externally (just like a fuse) such that the buffer will get affected or will cut the path to the core part. I am not sure if PIC has such a technique internally . Maybe , you can try one of those methods in your external circuit to avoid problem to your circuit.

One more trick can be to prevent the user from placing the finger over the circuit using some covers/shields.

If you think, that you have to uncover for connecting something frequently, then, I think, you can device an external circuitry for auto-ON/OFF based on the ESD impact level.

Karthik Balaguru

Karthik Balaguru

Reply to
karthikbalaguru

I do not know, whether this applies to the 16F88 or to your application. But in general this problems can appear, if you do not tie the MCLR Pin to High. Some PICs will run well for years without it. But other exemplars will cause a strange instability, in particular then, when fingers come close to the enclosure or the pins.

Reply to
Paul Rosen

This is a general rule for all CMOS logic - tie any unused inputs either high or low, preferably through a 1k (or more) resistor.

--
 Chuck F (cbfalconer at maineline dot net)
   
 Click to see the full signature
Reply to
CBFalconer

Try putting good number of decoupling capacitors across all the supplies. Try to place the supply near to the circuit. Try using a anti-static wristband.

Did you succeed in your attempt ?

Karthik Balaguru

Reply to
karthikbalaguru

Unless you need to access the pin for ATE, or other reasons, you can omit the resistor. Decades ago, TTL logic used to need a pullup because they could not guarantee the Zener knee of the reverse E-B junction, in worst case corners, was above Vcc. So the series was literally there to limit current.

-jg

Reply to
Jim Granville

However power lines can have noise spikes on them, and the results (if no series R) can be excess current into that input pin. The Rs are safer. One can be used to a herd of tied input lines.

--
 Chuck F (cbfalconer at maineline dot net)
   
 Click to see the full signature
Reply to
CBFalconer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.