Only change from the above circuit diagram is that I have not connected the grounds of the motor driver and controller together(common ground). The controller am using is an RPi 2B. I have connected only the STEP, DIR and stepping mode pins to the Rpi.
I have fried one Rpi previously using the same connections but I could not find the exact reason for this behaviour.
I need to know whether there is a chance of back current from the motor driver through the STEP and DIR pin.
Won't the motor driver be able to protect the controller from the same? Should I connect the ground pins together?