Controlling multiple stepper with SPI


Hi there,

I am trying to control the stepper motors from Arduino. So far, I have been able to do control 1 stepper at the time with this guide from Roboteurs. But i don’t know how to control stepper motors more than one. I think we can declare more motor on Arduino code, but in SlushEngine how can i know the pin for Motor 1, 2, 3, 4, 5? Do I have to specify it in Arduino code?

Thanks in advance,


Hi Tulga,

The Arduino code should look something like this,

#include <SPI.h>
#include <L6470.h>

// Motors
L6470 Motor1(10)
L6470 Motor2(9)
L6470 Motor3(6)
L6470 Motor4(5)

void setup() {
	// Initialise 4 stepper motors
	// Acceleration for each motors
	// Etc.

I’m not familiar with Arduino, but you have to specify four slaves (SS), see Serial Peripheral Interface (SPI).

Once four slaves (SS) have been setup, you will then need to connect this to the SlushEngine pins, as highlighted in red (STP0_CS, STP1_CS, STP2_CS, STP3_CS)

This should be able to help you out, in defining multiple CS pins.


Hi. Can you please explain what the numbers 10, 9, 6 and 5 are?


Hi Firas,

They were examples of the output pins of the Arduino, that connects to the _CS pins of the SlushEngine. The pin numbering on the Ardiono may not be be correct!

The example shown here, show’s one stepper motor connected, using pin 10.


Hi friend. I have SlushEngine D and I need to control all the seven motors. Can you describe the connection?



First, you need the schematics of the SlushEngine Model D, which can be found here SlushEngine Model D.

Second, follow these instruction Using the SlushEngine with an Arduino, and try and get one stepper motor working. You need to understand what RST, CS, SDI, SDO, CLK, FLAG, BUSY and GND pins do.

Third, once you have figured out the pins on the SlushEngine, you should then be able to setup and control more than one stepper motor.

Note: I’ve never used Arduino before, but I’m guessing the GPIO Setup will be similar to RPi


I already know what these pins do but that is not enough. The schematic diagram of SlushEngine Model D does not say anything about how to connect it to arduino. The example of controlling one stepper motor with arduino and the SlushEngine does not give any clue about how to upgrade into controlling multiple motors. Maybe I am missing something here but I am still on step zero.


Hi Firas,

Have you managed to get one stepper motor working using your Arduino and the SlushEngine?