This code has been tested on NEMA17 and A4988 motor drivers with OSP plugin. All the resolutions pins on both of the drivers were connected with single digital pin.