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.
ESD problems with PIC 16F88
Started by ●November 20, 2007
Reply by ●November 20, 20072007-11-20
On Tue, 20 Nov 2007 11:39:40 -0800 (PST), I said, "Pick a card, any card" and lloydcam@gmail.com instead replied:>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?http://www.l-com.com/item.aspx?id=8721 -- Ray
Reply by ●November 20, 20072007-11-20
Ray Haddad wrote:> On Tue, 20 Nov 2007 11:39:40 -0800 (PST), I said, "Pick a card, any > card" and lloydcam@gmail.com instead replied: > >> 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? > > http://www.l-com.com/item.aspx?id=8721Now that's thinking outside the box. ;-)
Reply by ●November 20, 20072007-11-20
On Tue, 20 Nov 2007 15:57:43 -0600, I said, "Pick a card, any card" and "Anthony Fremont" <nobody@noplace.net> instead replied:>Ray Haddad wrote: >> On Tue, 20 Nov 2007 11:39:40 -0800 (PST), I said, "Pick a card, any >> card" and lloydcam@gmail.com instead replied: >> >>> 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? >> >> http://www.l-com.com/item.aspx?id=8721 > >Now that's thinking outside the box. ;-)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 by ●November 20, 20072007-11-20
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 lloydcam@gmail.com wrote:> 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 by ●November 20, 20072007-11-20
Ray Haddad wrote:> On Tue, 20 Nov 2007 15:57:43 -0600, I said, "Pick a card, any card" > and "Anthony Fremont" <nobody@noplace.net> instead replied: > >> Ray Haddad wrote: >>> On Tue, 20 Nov 2007 11:39:40 -0800 (PST), I said, "Pick a card, any >>> card" and lloydcam@gmail.com instead replied: >>> >>>> 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? >>> >>> http://www.l-com.com/item.aspx?id=8721 >> >> Now that's thinking outside the box. ;-) > > 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 theI believe that's entirely possible. The CMOS inputs are of such high impedance that touching a pin will easily trigger it.> circuit. Thus, I suggest covering the connector so when it's not in > use, it's safe. Either that or a serial loopback connector.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 by ●November 21, 20072007-11-21
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 by ●November 21, 20072007-11-21
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 lloydcam@gmail.com wrote:> 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 by ●November 21, 20072007-11-21
dbr@kbrx.com wrote:> > 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.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: -- <http://www.catb.org/~esr/faqs/smart-questions.html> <http://www.caliburn.nl/topposting.html> <http://www.netmeister.org/news/learn2quote.html> <http://cfaj.freeshell.org/google/> (taming google) <http://members.fortunecity.com/nnqweb/> (newusers) -- Posted via a free Usenet account from http://www.teranews.com
Reply by ●November 22, 20072007-11-22
On Nov 21, 12:39 am, lloyd...@gmail.com wrote:> 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. >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