I think I see what you were getting at.

Instead of saying digitalWrite(51, HIGH) for a moment to trigger the reset, you instead did INPUT_PULLUP briefly instead to trigger the reset. The rest was just to put it back in the standard input state.

Now that I've got the voltage divider and diode circuit implemented, then I can trigger the reset with a short burst of digitalWrite(51, HIGH) and it should work. It does in my tests (the pullup didn't work any more with the voltage divider circuit).
_________________________
Tony Fabris