On August 12, 2004 10:22 pm, Anand Dhuru wrote: > Hi, > > I have a 16F628 based circuit that is used to monitor the water level, and > then operate a 240 volts, 3phase pump depending on the level conditions. > > I've disabled MCLR, yet connected it to +5 to eliminate erratic resets. Likely a power supply or voltage spike problem. Possibly a long-run on your ports (if you got several feet of trace wire going directly to your ports, you may be inductively reseting the PIC). Add inductors to your PIC power lines to kill voltage spikes. Add inductors to your PIC inputs/outputs to kill voltage spikes. If this is a 1-of-a-kind circuit where you don't plan on building more, simply cut traces, use an X-acto knife to scratch the paint off the related traces, then solder the inductors onto the traces over the gap.... assumming you have no other locations to place inductors. I've dealt with some low voltage circuits where adding the PIC watchdog circuit plus PIC brownout circuit helps. Watchdog because a voltage glitch may make the program counter jump unexpectedly. Brownout because sometimes the voltage rises too slowly, so although reset works correctly, the chip isn't exactly fully functional since it isn't at a "good enough" operating voltage. Short of those suggestions, you may have to add an external rest circuit such as a 555 timer type circuit if you are still in trouble. You keep reseting the external 555 using one of the PIC port-pins so that it doesn't reset your PIC chip. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu