Hear Hear, Jinx, Plus: Put a ground plane under your PIC. If you can't do it in copper, use electrical tape and aluminum foil. Better yet use steel. At a minimum make sure the ground plane is between the PIC and the magnetics. Put a ferrous ground plane all the way around your PIC, even better. Be very careful about your MCLR line. If even the tiniest transient gets into this part of the circuit, it can throw the PIC into "partial reset" which is essentially "the loony bin". I use a 10K resistor to 5V, then a ceramic capacitor right up next to the PIC, and short lines to a robust 5V bus. In a really noisy environment you may also need a small electrolytic on this line, as well as a small electrolytic next to your PIC, adjacent to the ceramic cap you already have. Use a sepearate ground system for the motor and for the PIC electronics. Make sure any heavy currents go through the motor ground system. Tie these grounds together at only one point back at the power supply. The same point is where you bring out a heavy braided wire to your nice ferrous case. Isolating your PIC from the heavy current load is also a good idea - if you can drive an opto component to trigger your motor instead of a transistor it will help maintain noise isolation. All of these things don't need to be done, but they should be tried one by one, as you have been doing, until your project behaves. I worked on a timer which would operate fine on the bench, but as soon as you assembled the two PC boards together, the micro was located physically on top of a relay. Fire the relay with an inductive load and the micro would freak out. It had an LCD display that would suddenly display chinese chicken tracks instead of letters and numbers. A thin copper sheet (actually copper tape) between the two components, with a ground strap, fixed the problem. -- Lawrence Lile Jinx Sent by: pic microcontroller discussion list 06/03/2004 09:47 PM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: Subject: Re: [EE]: 16F84 Reseting when controlling motor through TIP120 via PWM > Lastly, I changed out the TIP120 and the problem seems to be fixed. > No more resets > > Could I have blown something in the TIP during my first mistake that > caused the TIP to appear to function properly but continued to cause > the resets? Can say anything about that, but there is more you could do in the way of reset prevention, especially when using a probably noisy component like a motor (or relay/solenoid) Isolate the PIC's supply from the motor's supply with a diode and reservoir cap. You could also add a small (47R-ish, depends on what current you need for the PIC) series resistor. This will be the initial noise filter. The motor side of the supply should also go through a diode. In other words, split the 12V to go 2 ways through diodes, one to the PIC and one to the motor. The reservoir cap will buffer the PIC's Vcc against any nasties that get back through the diodes As well as the 10k to Vcc, Mclr should also have a cap (10n-ish) to 0V, and a series resistor, 220R, and a reverse diode across the 10k (k to Vcc), as per the manual A good solid ground is recommended too. You should scope it to check for any noise. In very noisy environments you may need to add Schottkys, at least, to prevent under-voltage on pins -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu