Searching \ for '[PIC:] 18f452, problems with interference' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=18F
Search entire site for: '18f452, problems with interference'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] 18f452, problems with interference'
2004\07\13@035522 by frax

flavicon
face
Hi!

I been trying to solve this for quite a few days now but just can't find a
solution.

Short story:
Etched 100 PCBs and deliverd them. Buyer calls back saying the system
crasches sporadicly.
The system measures tempratures and depending on several thing switches a
few relays (220v) on or off.

The problem seems to be the switching of 220v on and off. If I just switch
an ordinary table lamp on/off nearby my cicuit I can get it to lock up.
Sometimes after just 10 or 20 switches but on rare occasions I have to
switch it 15 000 times.
I tried running it on batteries and that made no difference, so it's not a
dip in the power supply.

I put an 18f452, a led, a reset circuit (standard) and a 3.68MHz crystal on
my labdeck.
Loaded it with a Blink a LED and can get it to freak out by switching a
lamp.

I get the feeling the something shocks my PIC from the outside, not through
the power line. I have activated the BOR and tried it to make sure it works.

The symptoms are several different, the PIC runs faster or slower, stops
executing, stops executing but timers still run, or it resets. The WDT does
not kick in when the PIC stops executing.

I must have missed something but can't figure out what.

tia
/Fredrik, going crazy any day now...

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@042518 by Jinx

face picon face
? I must have missed something but can't figure out what.
>
> tia
> /Fredrik, going crazy any day now...

Put the circuit inside a metal box. That might tell you whether
the noise is airborne or coming through the wires. Also, is
the case of the crystal earthed ? I've had a couple of circuits
where that really made a difference. And another with relays
inside the same box as the PIC, which at pull-in and release
messed up an LCD. I wrapped the LCD ribbon cable in tin
foil and all was peachy

Hope that helps

Joe, gone crazy, ain't so bad, come on in

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@045502 by Bob Axtell

face picon face
frax wrote:
> Hi!
>
> I been trying to solve this for quite a few days now but just can't find a
> solution.
>
> Short story:
> Etched 100 PCBs and deliverd them. Buyer calls back saying the system
> crasches sporadicly.
> The system measures tempratures and depending on several thing switches a
> few relays (220v) on or off.

Welcome to the real world. Up to this point, your job has been a
cakewalk. NOW you earn your pay.

> The problem seems to be the switching of 220v on and off. If I just switch
> an ordinary table lamp on/off nearby my cicuit I can get it to lock up.
> Sometimes after just 10 or 20 switches but on rare occasions I have to
> switch it 15 000 times.

You have the classic symptoms of radiation (RF pulses, noise pulses from
power, relay noise, etc) being imposed onto your equipment.

First, you must stop outside conductors from bringing the noise into the
PCB from outside. To do this, every wire going to the PCB has to be
FILTERED to remove the problem. If the wire is a signal wire, sometimes
just a series resistor (220 ohm) and a small cap (1000pF) will do the
job. If it is power or relay wiring, you will need to use RF chokes and
these will have to be able to carry the current.

Next, look at the relay circuits carefully. The collapsing coils of a
relay generate a noise spike of incredibly high energy. You MUST use a
Transorber or varistor- NOT a diode or Zener diode- to stop the relay
coil pulse, because diodes are NOT fast enough to crush that strong
signal. (I  know there are many app notes indicating that diodes are
recommended, but these are WRONG by being outdated- they are from a time
when some noise could be tolerated- and those days are gone.

If you've done the two paragraphs above religiously, your system is
probably now working at this point.

But here are some other pointers to nail electrical noise:

1. Make sure the PCB has a GOOD ground system. Ideally it means a ground
plane, because that simple act stops RF from passing through the PCB
from top to bottom. But if your product can't afford an inner plane,
create a GND copper pour on both top and bottom. You will be amazed how
well the system can reject noise with a good ground.

2. Try to design your product into a metal box or a metallized plastic
box. These metal coatings that look like copper on the inside of the
plastic case work almost as good as metal in stopping external noise
sources.

3. Finally, PROVE that your design is now fixed. I found that the best
way to do this is with a 110V surplus power relay; wire it up with a 10'
cord, without any coil suppressors, so that it acts like a buzzer, by
turning on and off hundreds of times a second. Wrap that 10' cord near
your product. If it works NOW, its fixed.

--Bob



{Quote hidden}

--

Replier: Most attachments rejected
      --------------
        Bob Axtell
PIC Hardware & Firmware Dev
  http://beam.to/baxtell
      1-520-219-2363

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@050124 by hael Rigby-Jones

picon face
>-----Original Message-----
>From: Bob Axtell [EraseMEengineerspam_OUTspamTakeThisOuTCOTSE.NET]
>Sent: 13 July 2004 09:55
>To: PICLISTspamspam_OUTMITVMA.MIT.EDU
>Subject: Re: [PIC:] 18f452, problems with interference

>Next, look at the relay circuits carefully. The collapsing
>coils of a relay generate a noise spike of incredibly high
>energy. You MUST use a Transorber or varistor- NOT a diode or
>Zener diode- to stop the relay coil pulse, because diodes are
>NOT fast enough to crush that strong signal. (I  know there
>are many app notes indicating that diodes are recommended, but
>these are WRONG by being outdated- they are from a time when
>some noise could be tolerated- and those days are gone.

Is this really true?  Whilst the generic 1N400x recitifiers are slow, the
cheap 1N4148/1N914 type diodes are very fast, low capacitance switching
diodes and are robust enough for clamping most relays.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@081627 by Spehro Pefhany
picon face
At 09:45 AM 7/13/2004 +0200, you wrote:
>Hi!
>
>I been trying to solve this for quite a few days now but just can't find a
>solution.

Okay, so switching a LOAD is what does it, right? Take the load off and
the relays switch fine, right?

So.. I think you've essentially got problems with the noise created by
the contacts of the relays. It can be getting into your circuit in a
number of places. Your layout is one thing to suspect. Make sure you've got
NO wires running from a PIC pin off the board. Preferably a ground plane
under everything to do with the PIC. SHORT wires to the crystal or
resonator. Different paths for the relay ground and the PIC ground
back to the power supply.. and many other things I can't begin to guess
at. Try to visualize the CURRENTs and the LOOPS. You want the currents
to follow benign paths to to MINIMIZE LOOP AREA (ideally with power planes,
next best is traces overtop of each other on a double-sided board, worst
case would be single-sided traces running around the outside of the board
in a big loop like a deliberately created antenna.

Good luck. There is *probably* a way to hack a fix for these 100 units
without replacing the boards, but it's best to be conservative to start
with, IMHO. I like to use ground planes, shielding, filtering, series
impedances, opto-isolation, shunt capacitance, ferrite beads, common-mode
chokes, copper pour, minimum inductance layout and other techniques up-
front to minimize the risk of disaster, which is what you have right now,
unfortunately.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
KILLspamspeffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@093758 by Bob Axtell

face picon face
Michael Rigby-Jones wrote:

{Quote hidden}

Alas, while they are significantly faster than the venerable
400X-series, the delay in switching time is significant enough
to allow a lot of energy to get through. You can google for supporting
specs; look at the IR (Power MOSFET) website, if I recall, it had the
best documents on protecting power MOSFETs.

--Bob

{Quote hidden}

--

Replier: Most attachments rejected
      --------------
        Bob Axtell
PIC Hardware & Firmware Dev
  http://beam.to/baxtell
      1-520-219-2363

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@100116 by Herbert Graf

flavicon
face
On Tue, 2004-07-13 at 03:45, frax wrote:
> Hi!
>
> I been trying to solve this for quite a few days now but just can't find a
> solution.
>
> Short story:
> Etched 100 PCBs and deliverd them. Buyer calls back saying the system
> crasches sporadicly.
> The system measures tempratures and depending on several thing switches a
> few relays (220v) on or off.
>
> The problem seems to be the switching of 220v on and off. If I just switch
> an ordinary table lamp on/off nearby my cicuit I can get it to lock up.
> Sometimes after just 10 or 20 switches but on rare occasions I have to
> switch it 15 000 times.
> I tried running it on batteries and that made no difference, so it's not a
> dip in the power supply.

       Stupid small thing, but you do have a reversed diode across the relay
coils right? What are you switching the coils with? TTYL

-----------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@101153 by David VanHorn

flavicon
face
> (I  know there
>>are many app notes indicating that diodes are recommended, but
>>these are WRONG by being outdated- they are from a time when
>>some noise could be tolerated- and those days are gone.
>
>Is this really true?  Whilst the generic 1N400x recitifiers are slow, the cheap 1N4148/1N914 type diodes are very fast, low capacitance switching diodes and are robust enough for clamping most relays.

I don't know what he's  on about. .

The only thing you need to do is provide a harmless path for the current induced by the collapsing magnetic field. When you stop the current through the inductor, the collapsing field attempts to induce this current, and the voltage at the switch rises as high as necessary to get the current to flow.  A diode across the coil (preferred) or a zener across the switch, will do that job.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

2004\07\13@134211 by Bob Axtell

face picon face
David VanHorn wrote:

>>>are many app notes indicating that diodes are recommended, but
>>>these are WRONG by being outdated- they are from a time when
>>>some noise could be tolerated- and those days are gone.
>>
>>Is this really true?  Whilst the generic 1N400x recitifiers are slow, the cheap 1N4148/1N914 type diodes are very fast, low capacitance switching diodes and are robust enough for clamping most relays.
>
> I don't know what he's  on about. .
> The only thing you need to do is provide a harmless path for the current induced by the
> collapsing magnetic field. When you stop the current through the
inductor, the collapsing field
> attempts to induce this current, and the voltage at the switch rises
as high as necessary to get
> the current to flow.  A diode across the coil (preferred) or a zener
across the switch,
will do that job.

No, the diode is too slow, and the zener is even slower than that.

The diode across the coil serves two purposes:

1. Prevent the inductive kick from damaging the driving device, whether
IC, MOSFET, or transistor.

2. Reduce the RF generated by the kick from being propagated into other
circuitry.

One problem with the diode method is that diodes have a finite switching
time, i.e. a delay before turning on. The spike before the  diode
conducts will radiate energy and the spike may still damage the driving
device. The second problem with simple diodes is that the PN junction
must dissipate the energy spike. This sudden heat may cause the junction
to fail, usually by spot overheating (short). This tendency makes diodes
unacceptable for good engineering design. Transorbers, Varistors and
other similar devices switch in a 1 ns or so, and they all have the
ability to handle large pulses of energy without failing.

The second problem has to do with the PCB layout, and where the
protective device is located. The protective device must be located as
close to the relay coil as possible, since the heavy current spike that
circulates in the PCB traces to the coil will be a RADIATION source to
other comnponents.



--

Replier: Most attachments rejected
      --------------
        Bob Axtell
PIC Hardware & Firmware Dev
  http://beam.to/baxtell
      1-520-219-2363

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...