I have an Atmega328P MCU that is driving a stepper motor driver using its digital I/O. However, I'd like to use the same pins to drive the motor externally as well possibly using a different MCU or hardware. When the external driver is driving the motor using these same pins, the Atmega328P MCU maybe powered down and its state would be unknown. I know that its not safe to drive the Atmega328P MCU's pins with logic levels when its powered down and it will in fact destroy the chip.
To overcome this, I thought of adding low power Schottky diodes between the Atmega328P MCU's pins and the motor driver inputs (as shown in the image). Would this be ok or can any one recommend a better solution? I know I could use an optocoupler but I do not space on the board for placing so many of them.
UPDATE: This is what I'm finally thinking of doing (see image). The buffer chosen here can sustain upto +6.5V on its output terminals when powered down. I also realized that even when an external logic control is used, the board still has to be powered on for the motor drivers to work. This means that the onboard Atmega would also be powered on. However there is the possibility of the user inadvertently forgetting to power on the board before plugging in an external control source. In this case the onboard Atmega would experience 5V on its I/O pins when its powered down which obviously is not good. These buffers take care of that.