One way to protect the driver from such peaks is to place a large 100µF
electrolytic capacitor (or at least 47µF) across the motor's supply connections.
Pin assignment of the "A4988"
Selection of microstep pins
The "A4988" driver enables microstepping through smaller step positions.
This is achieved by supplying the coils with а variable current. For example,
if you operate the "NEMA17" stepper motor, it has a step angle of 1.8° or
makes 200 steps per full revolution. In quarter-step mode, this motor makes
800 microsteps per full revolution.
The A4988 driver has three input pins for microstep resolutions: