PIC16F1503 resets during relay switching of 1HP motor
Relays sometimes cannot be driven directly by the micro, as the power they require is too big compared to what the micro can output. If this is the case, you will need a dedicated circuit or IC to drive it.
It would be helpful if you could give more information about the relay you're using and the way you're driving it.