pic16F877 getting reset

Thread Starter

mukfarid

Joined Jan 18, 2007
3
After long struggle thank God I was able to resolve the issue. The PCB design was changed such that pull up diode of pin 1 was connected close to the pin instead of having a routing such that it was passing on the PCB to a connecter ad connector was connected to a reset switch mounted on front panel. A capacitor of .1 mfd was also added and was connected to pin 1 to ground to filter noise.

I build a circuit to control pump. To run the pump certain conditions are to be met. This is all taken care by software. To operate pump a relay is switched on then after a determined time another relay is switched on. The first relay makes the pump in star and second relay changes it to delta. The pump is connected with contactors.
This PIC controller works fine as per required sequence when not connected to contactor relays. As soon as it is connected to operate relays it switches on the relay gives a pulse and gets reset. If interconnection cable is held in hand to form a shield it works ok. I changed the interconnection cable shielded type but it doesn’t work. The power used for microprocessor board and contactors relay is from two different transformers. This is to avoid any fluctuation on voltage. . Can any body suggest what causes system to get reset?
 

hgmjr

Joined Jan 28, 2005
9,027
Without a schematic and information on the physical layout of your circuit it is a bit tough to diagnose what may be at the bottom of your reset problem.

Most likely, noise generated during the energizing or de-energizing is the relay is the basic source of your problem. The disturbance may take the form of conducted noise or radiated noise. I would suspect conducted noise first. Make sure that your relay has a flyback diode across the coil. This will both protect your driver device as well as provide a path for the flyback voltage that occurs when the relay is de-energized.

hgmjr
 

thingmaker3

Joined May 16, 2005
5,083
When the shielded cable was tried, was the shield grounded at one and only one end? I've often run into problems with ground loops acting as couplers instead of shields when a shield is grounded at both ends.
 

fanie

Joined Jan 20, 2007
63
Can any body suggest what causes system to get reset?
It is caused by EMP - you should not get this if you switch normal 12V relays on or off, then your problem is PSU-related ie too small smoothing cap etc.

EMP problems are usually encountered when you switch mains contactors like MOTOR pumps. The solution is fairly simple, just add a 100nF cap over the coil of the contactor and make SURE the cap is rated for the voltage, ie for 230VAC use a 100nf 275VAC (not dc) cap !

Do post back if you resolved the problem.
 

cmartinez

Joined Jan 17, 2007
8,220
Fanie is right, I ran into exactly the same problem a few months ago. But the only way in which it was completely solved was when I changed the electromechanical relays for solid-state ones. Even with the capacitors installed, the microcontroller still reseted every once in a while. Placing a diode in series at the microcontroller's output also improves the situation, preventing any rogue voltages from re-entering the device.
 

fanie

Joined Jan 20, 2007
63
Hi Max

Even with the capacitors installed, the microcontroller still reseted every once in a while
It depends a lot where the capacitor is positioned. I have 2 of these on my aircon on different places of the supply else it resets my Iburst modem. Another thing you can do that helps if you have wiring going all over the place is pass them through ferrite beads. I'm not sure if they are ferrite or metal iron ones - can't remember !! (Altzheimers lite)
 

fanie

Joined Jan 20, 2007
63
Sorry for the double post... It seems the pics are a bit sensitive for EMP, someone also mentioned problems they had with a switchmode PSU that had the same effect if it gets placed too close to the pic, if one experience reset problems it seems you have to be carefull with the power supply too. I distinctly remember the 0.1uF cap on the 5V supply input and output may also have made a difference.
 

Thread Starter

mukfarid

Joined Jan 18, 2007
3
Without a schematic and information on the physical layout of your circuit it is a bit tough to diagnose what may be at the bottom of your reset problem.

Most likely, noise generated during the energizing or de-energizing is the relay is the basic source of your problem. The disturbance may take the form of conducted noise or radiated noise. I would suspect conducted noise first. Make sure that your relay has a flyback diode across the coil. This will both protect your driver device as well as provide a path for the flyback voltage that occurs when the relay is de-energized.

hgmjr
Please find attached schematic diagram. Further please note I used further relays to switched on contactor relays to avoide loading on contacts of relay in the circuit.
 

Attachments

chien

Joined Feb 1, 2007
1
Hello,
I got the same problem with resetting PIC16F877, I tend to make a sine wave from rectangle singal for determining discharge timing of CDI, the signal coming from PIC has pulse width 1ms. I used 9.4uf Capacitor and a coil from relay as conductor. But the Micom was reset very frequently.
Please give me some hints for that problem.
 
Top