SVP controlling A4988

Based on the first answer on this thread, I am trying to control two stepper motors using Timer0 PWM of my SVP1284.

I would like to use the A4988 motor driver to connect to the 1284 and actually power the motor, but the stepper motor code I am running does not yield the desired result.

The code I am testing is exactly the same as the stepper code provided with the pololu-avr library, except instead of a call to set_motors(), I am calling my own functions that should send PWM outputs on pins B3 and B4 for Timer0 outputs, ie

#define PWM0C   IO_B3  // PWM output pin for Timer zero, motor C
#define PWM0D   IO_B4
#define DIRC    IO_A7 // Assign A7/A6 to be M3/M4 direction control lines
#define DIRD    IO_A6

As of now, only the STEP and DIR pins (and logic power) pins are connected to the SVP. The result is that the motor vibrates at intervals defined by the main program, but does not actually move. So, it seems as if the Timer0 PWM is working, but there is still something wrong. I have played with the delay_us settings to be anywhere between 2 and 10 milliseconds between steps, but the results are the same.

Thanks in advance


There is no need for you to send a PWM signal to the STEP pin of an A4988. If you are using the stepper-motor1 example as your starting point, you should just change the “one_step” function to send a single pulse to the STEP pin. You can send pulses using the set_digital_output function of the library. If you need more help troubleshooting, please provide details about your setup.


Thank you for your prompt reply.
From your response can I assume that the SVP is really capable of driving a large number of stepper motors, provided it’s not sourcing power for the motors? Ideally I would like a setup with 4 DC motors (with encoders) and 4 steppers. Thanks again

Yes, the SVP is capable of controlling a large number of A4988s because it has a large number of I/O lines.