Hi Russ,
I spent 12 hours figuring this out so I hope this helps everyone else out there.
If you are using a mega you need to check all the included libraries for hard coded UNO SPI pin values and replace them with the MEGA SPI mapped pins. See the SPI documentation on the Arduino site for standard SPI mappings.
http://arduino.cc/en/Reference/SPI see the connections table.
The wiring diagrams shown on the Sparkfun Learning Autodriver (
https://learn.sparkfun.com/tutorials/getting-started-with-the-autodriver/example) are correct but there is one additional wire you need to run which connects the BUSYN to any digital pin you choose otherwise when you run the LibraryTest example it won't run as it does use the busy signal as it has this code:
while (boardA.busyCheck());
I'm using a MEGA so in my case I chose pin 48 for BUSYN.
So if you are going from UNO to MEGA the SPI mapping including user selectable ones would look something like this:
MOSI for UNO = pin 11, MEGA = pin 51
MISO for UNO = pin 12, MEGA = pin 50
SCK for UNO = pin 13, MEGA = pin 52
SS for UNO = pin 10, MEGA = pin 53
User selected BUSYN, for me MEGA = pin 48
User selected RESETN, for me MEGA = pin 49
So you should have 6 signal wires connected plus the additional VCC and GND lines as per the Sparkfun diagram. I grouped mine together so I could use a ribbon cable header for the MEGA.
The main library file you need to edit the hardcoded SPI pins is the AutoDriver.cpp - main library. For the examples I've listed the files below including the obvious ones just for completeness (so people please don't flame me):
dSPIN_exampledSPIN_example.ino - pin definitions
dSPIN_support.ino - pinMode change pin assignment from 10 to 53 for MEGA
LibraryTestLibraryTest.ino - pin definitions and also change
AutoDriver boardA(10, 6);
to read
AutoDriver boardA(53, 49, 48);
if you use the MEGA setup above.
Oh you probably also need to glue a small heatsink to the driver IC as it does get hot.
Hope this helps.