R12 should be on PCB side of cable. Because long wire have a capacitance to ground.
Spikes are clamped to -0,7V and +4V by pic internal diodes.
Negative voltage on input pin can latch new pic.