A voltage drop could cause a reset. Are the motors using the same power supply as the MCU?
How are the configs set for the 18F?