On August 13, 2004 01:41 am, Anand Dhuru wrote: > Thanks Jose, Jinx, > > > 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). > > I do; the sensor cable can be in tens of feet; typically 80. This is probably your problem then. You have an input antenna. Try shielded cable. Preferably twisted-pair. Not sure what you want to put on inputs, depends on speed. If really slow sense, probably try resistor between cable and input, with cap across input to kill spikes, guess maybe 1k to 10k, choose T=RC to suite your circuit. You're making a low-pass filter on inputs. You'll have to do similar on outputs going on long runs. choose an R large enough to kill spikes, yet small enough to do the work. C to suite for your T=RC If GND on inputs/outputs does not have to be "ground" at far end, add resistors on ground side as well so you don't have current loops or other nonsense sent via GND line. You have a poor circuit design if you need to ground the far side (imagine far end getting yanked up-n-down several volts due to spikes). Inductors might be are more effective. > > Add inductors to your PIC power lines to kill voltage spikes. > > At the input of the 7805? or the output? What value? If power comes thru a stepdown transformer, it is an inductor. If switching power supply, you might want to put the inductor in front of cap leading to 7805. you may need to add cap in front of inductor to compensate (basically making a low-pass filter). > > Add inductors to your PIC inputs/outputs to kill voltage spikes. > > What value? XL = 2 x PI x 60 x L (does 1...10mH look okay?) > > 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. > > Could you elaborate the above again, please? I somehow thought evoking the > brownout would make matters worse. If you have a variable voltage supply, try slowly cranking up the voltage by hand. Some chips won't start correctly. Try again with brownout enabled. > > 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. Forgot to add, you'll need to do it thru a cap - imagine lock-up if pin frozen in 1 state. Sending reset thru a cap won't matter if PIC freezes in bad state. > Thats a great suggestion. If nothing else works, I'll do this. This option > I'll keep for the worst case, as I'll have to redesign the PCB. The > technique does sound great! If one-of-a-kind, you can build it on a breadboard, use thin wirewrap-type wire to connect to reset, VCC, GND and PIC-pin. Use something stiff to stand it above main board - if nobody is going to be looking at or touching it, you may even use 1/4watt resistors as standoffs since board isn't that heavy - electricity doesn't care how ugly a board looks. If it's going to be viewed, do something that looks nice-n-professional. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu