Searching \ for 'PIC being reset by spikes from motors - any ideas?' 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/ios.htm?key=motors
Search entire site for: 'PIC being reset by spikes from motors - any ideas?'.

Truncated match.
PICList Thread
'PIC being reset by spikes from motors - any ideas?'
1998\09\06@174529 by Douglas Reid

flavicon
face
I am going crazy trying to solve an interference problem and would much
appreciate any ideas!

I am using a 16C73 to control motorised entrance gates.  The PIC drives
relays to switch motors to open and close the gates.  I am experiencing
intermittent problems in that the PIC get frequently reset, apparently as a
result of the motor mains switching surges.

I have just added mains input filters, extra large PSU electrolytic
capacitors and a Dallas DS1233-15 microprocessor reset controller - yet the
problem still remains!

The system is constructed on several separate PCBs connected together within
the same enclosure.
The PSU board has a 12V 25VA toroidal transformer with a bridge rectifier
and a 4700uF/ 35V capacitor.  DC power for each of the other boards is
derived from here on a star wired basis.  The no-load output voltage
measures as 17.5v.  This voltage falls to 16.8V when the two gate wing motor
relays are driven (same whether opening or closing) and to 12.3v when
additionally an electric lock is energised.

The relay board has 7 relays (2 per each wing of the gate corresponding to
open and close = 4, 1 to control a 12V AC electric lock plus 2 others to
control lighting).  The relays are powered from the 17.5v DC (unloaded
value) of the PSU board) and driven by the PIC via a ULN2003B Darlington
transistor array.

The CPU card contains the PIC and some related low current circuitry and has
an on-board 5v reg.  The incoming 17.5V (the cable from the PSU is about 9
inches in length) is filtered by a 220uF (since increased to 4700uF! - which
improved things) at the input to a LM340 5v reg.  Across the output of this
regulator a 0.1uF ceramic is connected and a further 0.1uF ceramic is
connected across the 5v supply rails close to the PIC (which is only about 2
inches from the reg.).  Initially, the RST* pin was connected directly to
+5v.  Subsequently, the Dallas DS1233-15 reset controller has been added to
control the RST* line to the PIC.
The motors for the gate drives are made in Italian by a company called FAAC.
A gate drive motor has 4 connections corresponding to LIVE (OPEN), LIVE
(CLOSE), NEUTRAL AND EARTH.  A large 8uF mains rated capacitor is provided
by the motor manufacturer.  I have connected the capacitor across the LIVE
(OPEN) and LIVE (CLOSE) connections.  To open the gate, 240V (NB. I'm in
Britain!) is applied via my relays across the LIVE (OPEN) and NEUTRAL
terminals and to close it across the LIVE (CLOSE) and NEUTRAL terminals. The
two motor windings share the same NEUTRAL connection.  Each gate drive motor
consumes 1 Amp when driven (whether open or closed).  Since two gate wings
are involved, the total consumption is 2 Amp at 240V.

I suspect that large transient currents are involved when the drive motors
are switched on or off.  This is apparent from the flashes of light visible
at the relay contacts as they switch.  (I only have an analogue scope so
can't measure the transients.  The relays are rated at 16A which probably
explains why I have not yet experienced any relay failures.)  It appears
that these transients are coupling back through the mains and resulting in
the PIC being reset.  In fact, after I added the DS1233 the PIC was reset by
the Dallas chip on every switching of the motors!  I added a further 4700uF/
35V capacitor and a 0.1uF ceramic across the input to the LM340 on the PIC
CPU board.  This improved the situation but only in so far as the system now
resets perhaps once in every 5 to 10 motor switchings.

In a further attempt to improve the situation, I have fitted two mains input
filters.  The incoming mains connects to the PIC CPU board via one of these
filters and to the motor drive relay board via the other so that, in effect,
the PIC supply is isolated from the motors via two of these filters.  This
does not appear to have resulted in any improvement at all.  These filters
are the type used for input connection of mains supplies to equipment.  They
incorporate a mains connector and on/off switch.  They are approx 2 x 1 x 1
inch in aluminium enclosures and include 2 x 0.9mH chokes, a capacitor
between Live and Neutral at the input and capacitors between each of L and N
to earth at the output.

By the way, the metal casing of the filters is connected to mains earth and
the system DC power supply is also connected to mains earth in one place.
The mains supply is derived from a house which is 100 yards away.  The mains
supply seems to be good in that only a small voltage drop (about 1 volt) is
noticed on the incoming mains to the system when the motors for both wings
are driven (perhaps the transient voltage drop as a motor switches is
greater?).  The physical connection to mains earth is also provided from the
house rather than locally at the gate via the third green wire of the power
cable.

Interestingly, this is the third similar system we have now installed.  The
first has been working perfectly since installation 6 months ago.  It also
involves a mains cable run of about 100 yds between the gate and the house.
Recently, two further systems have been installed - both of which are
suffering from the interference/ resetting problem!!  Thus, the problem
appears to be site or, at least, installation specific.  One of the problem
systems involves a mains run of only around 10 yards.

Any ideas??!!

It would seem desirable to suppress the motors at source.  I do not
understand motors.  I'm not sure of the function of the 8uF capacitor that
was provided with the motor.  It is provided for suppression purposes or is
it necessary for the motors to work (I have always had it connected).

I had imagined that that mains filter would filter the mains interference
resulting from the motors via the relay.  Is there any way that extra
filtering could be added to each of the motor coils?

I sometimes switch the motors directly between open and close - is it okay
to do this or should I introduce a delay?  (Resets happen even when I'm just
switching a motor on and not reversing direction.)

Would it be a good idea to add C-R snubber components across the relay
contacts that switch the 240V AC to the motors?  Would this both protect the
contacts and reduce interference?  How would I calculate the C and R values?

In theory, it is possible that electromagnetic radiation from the relay
contacts or wiring is upsetting the PIC.  However, I don't think this is the
case.  At one of the problem sites, I put the relay board into a separate
earthed metal case without obtaining any improvement.  It is clear that the
DS1233 is doing it's job of resetting the PIC - this implies that there must
be large clitches on the 5v supply which it monitors.  When I disconnect the
motors, the system behaves properly - this shows that it is not the DC
current being used to energise the relays that is causing the problem (the
relays are 12V so I am driving them hard but, I should imagine, well within
their capabilities).  The electric lock draws a lot of power (it is
connected across the raw output of the PSU transformer), resulting in the DC
supply falling to 12.3V.  Even then, the 340 reg still has plenty of
headroom.  In any event, I have noticed that the resets still occur even
when the lock is not being driven (ie. when only the gate motors are driven).

I'm using a 16C73.  Does the newer "A" revision have any improvements with
respect to interference immunity?  Since the DS1233 is now controlling the
RST* pin, it seems unlikely that this is an issue.

As explained above, the resets became less frequent when I increased the PSU
capacitors to 2 x 4700uF (one on each of the PSU and CPU boards).  One
strategy would be to increase the values yet further.  This is not very
convenient since I have run out of board space and the present value looks
excessive.

Would "bigger and better" mains input filters help?

Would providing a local mains earth point at the gate be likely to improve
matters?  This would involve getting an electrical contractor to provide an
earth rod connection into the ground so would be quite costly to try and
seems to me unlikely to resolve the problem.

Any ideas that anyone can offer on this would be MUCH appreciate!!!!!!

Thanks for your help

Doug Reid

Liverpool, England

1998\09\06@192337 by Jazz

flavicon
face
mate

all you need is to  dual pi filter across the motors

use  two  .033uf capacitors 250v
and one   .047 uf 400v

earth of motor  metal case ----------------| |-----------   positive
terminal
earth of motor  metal case -----------------| |------------    negative
terminal

positive motor ---------------| |------------------------- negative terminal

this is a dual pie it supress the spikes generated by the motor brushes
that means any frequency from
dc to 1   ghz

cheers
jazz

{Original Message removed}

1998\09\06@193958 by Mike Gann

picon face
I once had a similar problem. The Arc of the relay contacts were causing
the PIC to reset, it was a 16c71. I used rc snubbers across the relays
and
this took care of the problem.

As for values, I don't recall what I used, something like 100k R and
.1uf C.

Mike Gann

Douglas Reid wrote:
>
> I am going crazy trying to solve an interference problem and would much
> appreciate any ideas!
snip
>
> I am using a 16C73 to control motorised entrance gates.  The PIC drives
> relays to switch motors to open and close the gates.  I am experiencing
> intermittent problems in that the PIC get frequently reset, apparently as a
> result of the motor mains switching surges.
>
snip
>
> Would it be a good idea to add C-R snubber components across the relay
> contacts that switch the 240V AC to the motors?  Would this both protect the
> contacts and reduce interference?  How would I calculate the C and R values?
>
>

1998\09\06@194621 by Dennis Plunkett

flavicon
face
Wow! I have just completed War and Peace!
Terrific, good to see that someone spells out the entire situation in one go!

>From what I can see, and many others will comment on this, the problem is
EMI being supplied by the relay contacts. The large EMI waveform that is
generated when the contacts open and close (Depends on the load for the
close bit, but the mains wiring may be in such a location as to cause
interference to the PIC). Ok so how do you solve this problem? I would
suggest that you look at semiconductor relays, or use TRIACs.

N.B other possible problems are the relay coils themselves. As you point out
increasing the dup cap on the PIC card seemed to hide / solve the problem.
If this is the case (And you say that it is) then the problem may be that
the relays and drivers are not isolated enough from the PIC power source
(Ground bounce and other little nasties may be occurring here). You can get
around this by separating the controller supply from the drive supply (A
simple diode in series to the regulator may suffice).


Dennis







At 10:42 PM 6/09/98 +0100, you wrote:
{Quote hidden}

1998\09\06@220116 by Reginald Neale

flavicon
face
>I am going crazy trying to solve an interference problem and would much
>appreciate any ideas!
>
>I am using a 16C73 to control motorised entrance gates.  The PIC drives
>relays to switch motors to open and close the gates.  I am experiencing
>intermittent problems in that the PIC get frequently reset, apparently as a
>result of the motor mains switching surges.
>
>I have just added mains input filters, extra large PSU electrolytic
>capacitors and a Dallas DS1233-15 microprocessor reset controller - yet the
>problem still remains!

 Much better to drive the heavy loads with SSR's. Probably cheaper than all
 the extra filtering components you've had to add.

 Also, make sure there are no floating pins on the PIC. Set everything that's
 not used to OUTPUT. Any inputs that have a resistive pull-up or down, make
 sure the value is low, e.g. 1K. Separate ferrite beads on any lines that
 come in from the outside will often scarf up glitches.

 Reg Neale

1998\09\06@223206 by Dale Gomes

flavicon
face
Fundamentally,
a good layout will solve most problems.

If you have the luxury of time and money, design a double sided pcb and use
one side for grond connections plane only and all other nets connect by
shortest route on the top. Fill any ramining areas on the top with ground
plain. DO NOT AUTOROUTE!

I have successfully used this method for automotive "under bonnet" pcbs for
OEM products as well as a PIC products of my own wich is sitting next to a
piezo electric ignitor for stove tops.

Dale

> {Original Message removed}

1998\09\07@005523 by Mike Keitz

picon face
On Sun, 6 Sep 1998 22:42:57 +0100 Douglas Reid
<spam_OUTDouglas.ReidTakeThisOuTspamBTINTERNET.COM> writes:

>It would seem desirable to suppress the motors at source.  I do not
>understand motors.  I'm not sure of the function of the 8uF capacitor
>that
>was provided with the motor.  It is provided for suppression purposes
>or is
>it necessary for the motors to work (I have always had it connected).
>

They sound like "split-phase" induction motors.  The capacitor is
essential to make the motor work.  It causes the current in one winding
(connected to mains through the capacitor) to lead that in the other one
(connected directly).  Having the currents out of phase causes the rotor
to turn in a particular direction.  That's why you can reverse the motor
by changing the wiring.  The capacitor is tuned to the motor windings and
the line frequency.  A value close to that specified by the manufacturer
must be used.

If you have double-throw relays, consider configuring one to select the
direction of rotation and using a single pole relay to make and break the
circuit.  Now you only have to suppress the arcing of one relay per
motor.  Also it would not be possible for a software failure to connect
both windings to the line directly, which may burn out the motor.

As far as suppressing the arcing, a RC "snubber" network at the relay
contacts should work.  Typically, values are on the order of 100 ohm
resistor and 0.1 uF capacitor (connected in series).  The capacitor must
be rated for line voltage and the resistor may need to dissipate more
than a little power.  A MOV connected across the motor or relay can also
help clamp those spikes.  The spikes you are trying to suppress are very
short, so 4700 uF capacitors are of dubious value.  It would work better
to place capacitors in the 0.1 uF range very close to the susceptible
components.



_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\09\07@005532 by Dennis Plunkett

flavicon
face
At 12:19 PM 7/09/98 +1000, you wrote:
>Fundamentally,
>a good layout will solve most problems.
>
>If you have the luxury of time and money, design a double sided pcb and use
>one side for grond connections plane only and all other nets connect by
>shortest route on the top. Fill any ramining areas on the top with ground
>plain. DO NOT AUTOROUTE!
>
>I have successfully used this method for automotive "under bonnet" pcbs for
>OEM products as well as a PIC products of my own wich is sitting next to a
>piezo electric ignitor for stove tops.
>
>Dale
>

Yes, correct Dale but it is not the whole story,
One MUST remember that this is only part of the solution. Good software
design is essential to ensure that the device continues to operate in either
favorable or un favourable conditions for the longest possible time. This
process includes many items that start from the basics:-

1/      Always reloading the Port direction registers
2/      The use of constants rather than calculating
3/      Reloading port values
4/      Re enabling I/O and control registers
5/      Removing assumptions (eg. This bit should be set, so don't set it again)
6/      The use of watchdogs

These can be expanded more and then leads off to crash recovery and crash
detection. Often crashes are subtle, and may involve a simple memory
corruption. If one is lucky, then the system will reset and things will be OK?

<Flame suit on>
One of the best pieces of advice that a lecture gave me was "The only
assumption that you can make is that your software may be used in a
situation where peoples lives will depend on it" OK, so it is a bit over the
top, but I hope that the basic idea is seen.
<Off>

By default many people will use the basics, perhaps without even knowing
they do.


As for under bonnet stuff. This does depend on location! I have used good
old vero board for development in the engine bay of modern cars with no
problems. Put the board near the spark plug end of a HT lead and things are
different. I have also seen very well layed out boards fail when placed near
the fuel pump line (PWM drive from the ECU), alas, it required input
conditioning!


Dennis

1998\09\07@021705 by paulb

flavicon
face
Mike Gann wrote:

> As for values, I don't recall what I used, something like 100k R and
> .1uf C.

 No!  Actually, 100 *ohms* "R" and .1µF "C".  Note that the resistor is
a 1W type and the capacitor rated at 250VAC, not 600VDC.  A critically
rated fuse in the main supply should be provided to protect against
failure of the capacitors or relays etc.

 The capacitor between forward and reverse windings of the motor is to
provide the quadrature (phase shift) to cause the motor to *turn*.  If
it is shorted *or* open, the motor will stall (and draw excess current).

Douglas Reid:
> The system is constructed on several separate PCBs connected together
> within the same enclosure.

 As to the interference, after "snubbing" with the above components,
the *most* important requirement is *lead dress*; that is, making sure
all returns both in the motor circuit and the PIC circuit and
particularly the relay coils, travel with their actives and the control
wiring is separated from the mains wiring.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> DC power for each of the other boards is derived from here on a star
> wired basis.

 Fine as long as all the signal connections from each board travel
*back* along the spokes of the star.  You must avoid anything resembling
a loop where two corresponding current- or signal- bearing wires have
ecome separated.  This applies equally to the wiring of the power
transformer (for the PIC system) secondary and the design of the PCB
itself bearing the relays.

 Some relays are made to provide isolation by mounting only the coil
end on the PCB while the contacts are brought out to "spade" lugs at the
other.  SSRs would be a nice idea in the same fashion, especially if
they contain zero-switching logic.

> The incoming 17.5V (the cable from the PSU is about 9 inches in
> length)

 That's a big worry!  It's called an "antenna".

> is filtered by a 220uF (since increased to 4700uF! - which improved
> things) at the input to a LM340 5v reg.

 Even more improvement - put a 100 ohm resistor in series with the +ve
to this board!

> Subsequently, the Dallas DS1233-15 reset controller has been added to
> control the RST* line to the PIC.

 I have to be a trifle amused at the concept of installing a reset
controller when the problem is spontaneous/ spurious resets!  OK, so I
know it enables you to gracefully recover after brownouts...

> In fact, after I added the DS1233 the PIC was reset by the Dallas chip
> on every switching of the motors!

 Predictable!

> In a further attempt to improve the situation, I have fitted two mains
> input filters. ...  This does not appear to have resulted in any
> improvement at all.

 Two reasons:  1) These filters filter RF, not impulses.  2) The mains
supply is already a low impedance to minor (and yours *are* minor)
surges.

> The mains supply seems to be good in that only a small voltage drop
> (about 1 volt) is noticed on the incoming mains to the system when the
> motors for both wings are driven

 Goes with the above.

> (perhaps the transient voltage drop as a motor switches is greater?).

 Trivially.


> I had imagined that that mains filter would filter the mains
> interference resulting from the motors via the relay.

 Wrong sort of filter.

>  Is there any way that extra filtering could be added to each of the
> motor coils?

 Yes, but ... the motor coils aren't really the source of the
interference!

> I sometimes switch the motors directly between open and close - is it
> okay to do this

 No.

> or should I introduce a delay?

 Yes.
--
 Cheers,
       Paul B.

1998\09\07@022026 by Dale Gomes

flavicon
face
Yes, I agree with all that.
but if you start off with a solid designed hardware platform, you will not
be chasing your tail, trying to implement
unessecessary digital filtering.

Dale

> {Original Message removed}

1998\09\07@054531 by g.daniel.invent.design

flavicon
face
Hi Doug,

Check that you have connected the common pin of the ULN2003B to your
*relay* positive feed, this will enable the free wheeling diode circuits
when relays are de energised.
Also you can connect a MOV across the relay power supply, and partly
isolate relay supply from logic by indroducing a small resistor (ie 10
ohms) from initial supply to the 7805 reg'. Generally the relay coil
transients are of far greater effect than the contact transients.
(unless track layout is totally wrong.) The other big improvement you
can make is to put a larger capacitor (ie 47 uF) on the logic supply.
Capacitors are available in "low ESR" varieties, this relates to
internal resistance. Look in the Farnell catalog and you will see
resistance values at stated frequencies, low ESR capacitors will absorb
spikes more rapidly before the voltage rises or falls excessivly.

Additionally you can make the pic switch the relay at say 10 Hz and then
scope out the source of the problem.

regards,

Graham Daniel,
Electronic Product Enhancements


Douglas Reid wrote:
>
> I am going crazy trying to solve an interference problem and would much
> appreciate any ideas!
>
> I am using a 16C73 to control motorised entrance gates.  The PIC drives
> relays to switch motors to open and close the gates.  I am experiencing
> intermittent problems in that the PIC get frequently reset, apparently as a
> result of the motor mains switching surges.
>
cut
> I added a further 4700uF/
> 35V capacitor and a 0.1uF ceramic across the input to the LM340 on the PIC
> CPU board.  This improved the situation but only in so far as the system now
> resets perhaps once in every 5 to 10 motor switchings.
>
> Doug Reid
>
> Liverpool, England

1998\09\07@114444 by David VanHorn

flavicon
face
>Check that you have connected the common pin of the ULN2003B to your
>*relay* positive feed, this will enable the free wheeling diode circuits
>when relays are de energised.


One product I know of drives thermal printheads with this chip (resistive
load) so they connect the printhead common to +9V and connect the diode pin
to +5V.  This results in the 5V regulator being shut off most of the time,
and the +5V line being at 5.24V.  Funny thing, they have a lot of
unexplained crashes.

1998\09\07@195123 by Douglas Reid

flavicon
face
At 09:49 07/09/98 +1000, you wrote:
>Wow! I have just completed War and Peace!
>Terrific, good to see that someone spells out the entire situation in one go!
>

Hi Dennis!

By strange coincidence, I actually happen to be in the middle of reading War
& Peace.  It seems that Tolstoy's verbose style must have got to me!  Apologies!

>From what I can see, and many others will comment on this, the problem is
>EMI being supplied by the relay contacts. The large EMI waveform that is
>generated when the contacts open and close (Depends on the load for the
>close bit, but the mains wiring may be in such a location as to cause
>interference to the PIC). Ok so how do you solve this problem? I would
>suggest that you look at semiconductor relays, or use TRIACs.

In fact, the Mk I version of this design used MOC3021 opto-triac drivers
driving
BTA06 600BW triacs.  A snubber network using two resistors (360R and 470R)
plus a 50nF/ 400V cap was used between the driver and the triac.  This was
used in the first of our 3 installations and whilst it worked well for a
time, was subject to catastrophic failure. On two occasions triacs failed
(in fact, as I recall, all 4 triacs on the card
were found to have failed).  It had been considered that the triacs were
adequately specified - clearly, transient effects were not properly
considered!  Given that we needed the system working quickly, we changed to
the relay design, considering that it might be more reliable than the
semiconductor alternative.

Clearly the motors have some nasty characteristics!  I would certainly
consider going back to the triac idea.  Does anybody have any ideas on which
triacs would be up to the job and an appropriate snubber network?

>
>N.B other possible problems are the relay coils themselves. As you point out
>increasing the dup cap on the PIC card seemed to hide / solve the problem.
>If this is the case (And you say that it is) then the problem may be that
>the relays and drivers are not isolated enough from the PIC power source
>(Ground bounce and other little nasties may be occurring here). You can get
>around this by separating the controller supply from the drive supply (A
>simple diode in series to the regulator may suffice).
>
I don't think this is our problem since the system doesn't reset when the
motor loads are disconnected.  The relays are observed to correctly sequence
without upsetting the PIC.

>
>Dennis

Thanks for your help!

Doug

1998\09\07@195130 by Douglas Reid

flavicon
face
Dennis,

I agree fully with your strategy for writing fail-safe/ reliable software.

It is difficult to think of and cover all eventualities in software.  With
my gate system, there was one instance when it was reported that the drive
motors were running continuously rather than stopping after the 18 secs of
an open/ closing transition.  tmr0 interrupts are used to time events and
sequencing between various states of a state machine.  It appears that a
brownout (one of the many that my system has suffered from!) must have
either corrupted the option register (by reassigning the tmr0 clock source)
or perhaps disabled the tmr0 interrupt.  I have a clrwdt in the "main"
routine.  In fact, the "main" programme does nothing

       main    clrwdt
               goto  main.

All the work is done in the various interrupt service routines.

The WDT didn't help in this situation!  Should I put clrwdt somewhere else
instead?

Perhaps I should frequently redefine the option registers and interrupt enables?

Doug



At 14:05 07/09/98 +1000, you wrote:
{Quote hidden}

again)
{Quote hidden}

1998\09\07@195133 by Douglas Reid

flavicon
face
Many thanks to all for the helpful suggestions.

I shall be away on a business trip for around 7 days so will be "off the air".

I shall try out the various suggestions on my return and let you know how I
get on.

Thanks again for all your help.

Doug

1998\09\07@220729 by shadedemon
picon face
Douglas Reid wrote:
 Try TECCOR triacs instead.  Had more than 10 times the
failure rate with BTA's on 8x8 (64 triacs per card) lamp
driver modules.  The T4000 series is a much better triac for
the same ratings in our experiences..
Alan




{Quote hidden}

1998\09\08@181018 by Harrison Cooper

flavicon
face
               Speaking of software solutions, it is also possible that
the voltage to the PIC and related control circuits get a bump of drop
in the voltage/current levels.  If you are switching more than one relay
at a time, try staggering the turnon of the devices.  This will minimize
the spikes in the supply voltage at least.  Just one more idea....

                               ----------

1998\09\08@183926 by paulb

flavicon
face
Douglas Reid wrote:

> I have a clrwdt in the "main" routine.  In fact, the "main" programme
> does nothing

>         main    clrwdt
>                 goto  main.

 Well, the argument goes, if it does nothing, it *almost certainly*
shouldn't clrwdt either!

> The WDT didn't help in this situation!  Should I put clrwdt somewhere
> else instead?

 Absolutely!  It certainly offers *no* protection against timer failure
in this position. Put it at the *end* of the timer service routine, so
that it is only executed when all necessary timeouts have been examined.
If the timer fails, then WDT timeout will occur and reset everything.

 The timer routine in turn may need to set and check flags which check
that other necessary things have happened betwen timeouts.

> Perhaps I should frequently redefine the option registers and
> interrupt enables?

 Careful as the option controls the prescaler.  To re-define prescaler
and interrupt enables you have to clrwdt and disable interrupts
respectively, otherwise you may generate bogus interrupts in the
process.
--
 Cheers,
       Paul B.

1998\09\19@150857 by Douglas Reid

flavicon
face
Thanks for your help, Graham.

I have always thought that large electrolytics should best be only used at
the input to voltage regs rather than at the output.  I seem to remember
having read somewhere that using a large capacitor at the output would
degrade the performance of the regulator - ie. adversely effect transient
response and such-like.

Databooks tend to show just 0.1uF ceramics at the output which some
regulators appear to need to stabilise - ie. to prevent oscillations.

Databooks also indicate that if large output capacitors are used, diodes may
be needed between the regulator input and output to prevent failure of the
regulator in the event of certain conditions.

Actually, when I was on site, in desparation, I soldered a 22uF electrolytic
across the PIC supply pins.  It resulted in no improvement so I removed it.

Doug


At 21:42 07/09/98 +1200, you wrote:
{Quote hidden}

1998\09\19@214112 by Reginald Neale

flavicon
face
How is MCLR connected? Do you have any unused pins? They should be set to
outputs. All pins you are using as inputs should be tied up or down with
the lowest practical resistance, e.g. 1K would be good.

MOVs across the motors can limit voltage spikes. If there are HF glitches
getting in on the input wiring, ferrite beads around the conductors might
help.

Sean's description of the relay shocker doesn't mention that this device is
a very effective noise generator too. Use one next to your circuit or even
attached to it. When you get lots of resets it's easier to tell if there's
an improvement when you make a change.

Reg Neale

1998\09\20@075836 by Norayr S. Elmayan

flavicon
I haven't really followed this, but quick suggestion:

Use 2 channel scope (possibly storage scope) to monitor your 5 volts &
reset line.  If you don't have a major dip, then you have to filter out the
unwanted noise.

I will follow up with you soon

Norayr

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