CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC reset

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hundil
Guest







PIC reset
PostPosted: Wed Feb 28, 2007 12:57 am     Reply with quote

Hiii everybody

I have a circuit with PIC 18F24J10.

PIC drives a BC817 transistor and 817 drives (turns on and off) a relay with 2x5A contacts. The relay contacts turn on and off a load of app. 1 A

Sometimes, the PIC resets itself unintentedly when the relay is on or off.

Watchdog and BOR is NOT used.

Is it due to noise or something else ?

Aurgent help will be appreciated.

hundil
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 28, 2007 1:20 am     Reply with quote

Go to this web page and scroll down about half-way.
http://www.kpsec.freeuk.com/components/diode.htm
Look at the section called: "Protection diodes for relays"

Do you have a protection diode installed in your circuit,
with the polarity as shown in the schematic ?
asmallri



Joined: 12 Aug 2004
Posts: 1636
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Feb 28, 2007 1:21 am     Reply with quote

There are a few possible causes for this to happen.

    1. Failure install a snubber diode or transorb across the relay coils
    2. Insufficient filtering of the power supply. Do you have bypass capacitors installed before and after the voltage regulators? Do you have decoupling capacitors (0.1uF) across the PIC and other digital components?
    3. Does the regulator deliver enough peak current to drive the circuit and the relay coil (also related to power supply filtering problem)
    4. Is the MCLR floating (not a good idea)
    5. Are the relay contacts voltage free (independant of the PICs power supply rails). If not (say the ground is common) then you could have an earth related problem.

_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
hundil
Guest







PIC resets
PostPosted: Wed Feb 28, 2007 2:46 am     Reply with quote

The relay has a fast reverse diode in parallel.

hundil
hundil
Guest







reset on PIC
PostPosted: Wed Feb 28, 2007 3:43 am     Reply with quote

dear assmallri

thank you for your fast reply...

1- I use a fast snubber diode across the relay coil. in addition for a 12V / 0.5 A bulb load across relay contacts , nothing changes.
2- Power supply is a fully charged 12V - 2.0 Ah battery which remains very stable in terminal voltage all the time. I have 0.1 uF caps both at the input

and output of voltage regulator , also across the PIC.
3- The relay coil is not supplied from voltage regulator , it is supplied from the 2.0Ah battery via BC817 transistor . But the ground is the common.
4- It is difficult to do that.
5- Yes it is completely free.

hundil
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

View user's profile Send private message Send e-mail

PostPosted: Wed Feb 28, 2007 6:34 am     Reply with quote

I had a similar problem and found that I had voltage spike jumping from the relay contacts and relay coil. we had tried several remedies,

Low pass filter, resistor and cap across the relay coil/reverse diode.
relay to drive another relay that drives the load.

I didn't fix the problem, only reduced from constant reset to intermittent reset.

I found using opto isolation to switch relay's, mosphet/triac works for me, no load/reset fail.

Andrew
_________________
What has been learnt if you make the same mistake? Wink
asmallri



Joined: 12 Aug 2004
Posts: 1636
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: reset on PIC
PostPosted: Wed Feb 28, 2007 6:44 am     Reply with quote

hundil wrote:

2- Power supply is a fully charged 12V - 2.0 Ah battery which remains very stable in terminal voltage all the time. I have 0.1 uF caps both at the input
and output of voltage regulator , also across the PIC.


Try putting a 10uF Tantalum capacitor on the ouotput of the voltage regulator. If you do not have a tantalum capacitor handy try a 100uF electrolytic capacitor.

storic wrote:

I had a similar problem and found that I had voltage spike jumping from the relay contacts and relay coil. we had tried several remedies,


I bet you didn't try a transorb :-)
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

View user's profile Send private message Send e-mail

Re: reset on PIC
PostPosted: Wed Feb 28, 2007 3:18 pm     Reply with quote

asmallri wrote:


storic wrote:

I had a similar problem and found that I had voltage spike jumping from the relay contacts and relay coil. we had tried several remedies,


I bet you didn't try a transorb :-)


No, it will be one I will try in the future Embarassed
_________________
What has been learnt if you make the same mistake? Wink
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group