The resistors are to limit the current to the driver if voltages above 5volts are used. If 24 volt is used on the step/direction pins then a 2k resistor is required 12volts a 1k resistor is used. The bottom line is the current to the control side of the driver must be between 6-16mA