Hi to all,
I would like to use the same Arduino UNO board to control two stepper motors.
I see that Pololu provides the “AMIS-30543 Stepper Motor Driver Carrier” board and I was thinking to purchase two of them for my application.
I tried to search on google but I found nothing about the possibility to use two boards with the same Arduino.
Is it possible to do that? Is there any documentation on how to do that?
I’ve read that It uses the it uses the SPI Arduino library to communicate with the SPI interface placed on the board, but I cannot understand if there is any way to connecto two different boards.
The SPI interface uses the chip select input (i.e. the nCS pin on the AMIS-30543 Stepper Motor Driver Carrier) to specify which device is being communicated to. So, you can connect the Arduino SCK, MOSI, and MISO pins to the SLK, DI, and DO pins on each driver. Then, select 2 separate pins on your Arduino to connect to each driver’s CS pin. (You will also need separate step and direction pins for each driver.)
To use our library, you would instantiate 2 objects (one for each driver), then when you call the
init() function for each one, you would pass it the pin number that you connected to the nCS pin. For example, re-writing the setup for the
BasicStepping.ino example from our library to work with 2 drivers would look something like this:
const uint8_t amis1DirPin = 2;
const uint8_t amis1StepPin = 3;
const uint8_t driver1CS = 4;
const uint8_t amis2DirPin = 5;
const uint8_t amis2StepPin = 6;
const uint8_t driver2CS= 7;
//Initialize each driver
// Drive the NXT/STEP and DIR pins low initially on each driver.
// Give the drivers some time to power up.
// Reset the drivers to their default settings.
// Set the current limits. You should change the number here to
// an appropriate value for your particular system.
// Set the number of microsteps that correspond to one full step for each driver.
// Enable the motor outputs.
Thank you a lot, @BrandonM !
I’m going to purchase the boards and then I’ll test them as you suggested!