I would resume that circuitry not shown ( some form of logic ) gets a surge of voltage applied to it and that it enters some unexpected state. My recommendation is to measure the voltage at pin 2 of D2. If you are getting drive voltage at pin 2 after the "stop" is pushed, then your logic is getting hammered by a voltage spike. Are Q4 and Q? ( the Q below Q4 ) acting as an active motor brake ? The circuitry shown does not seem to offer any snubbing of the voltage spike you would get from the motor. The relay is going to allow the motor to be disconnected for several milliseconds, certainly long enough to allow voltage spiking to occur. I am assuming the relay is a "break before make" variety, otherwise I don't see how the relay contacts would survive. This design seems a bit strange to me. I await the comments of other PLs. The fact that R25 is missing renders C20 as useless. cc -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist