Have you ended up trying to create a PIC controlled robot/device and surprisingly nothing seems to work when the motor is connected? Well, here is a checklist to avoid that very problem.
You might have a PIC controlling a motor through a motor driver IC like the very commonly used L293D. The problem is, every time the motor is turned on, it pulls in a large current upsetting the entire circuit. Because of this, 'Brown Out Reset' causes your PIC to, you guessed it, reset. So have this disabled.
An important thing is a capacitor across your motor. Any small value capacitor will help avoid noise and interference.
A large value capacitor across your +5 and Gnd is a very good habit. This will help stabilise the voltage across your entire circuit.
Another lifesaver of a tip is to never switch on your motor in the start of the code. Something like this may not work.
This pseudo code may not work because as you power up your circuit, the PIC tries to switch on the motor, and this causes the PIC to reset. Instead, do something like the one below. The delay in the start will let the voltage to stabilise first.
Following these simple tips will turn out to be a lifesaver when you're frustrated when nothing with a motor works right.