stepoko without grbl -- manual stepping

Hi,
I am trying to use a Stepoko (by Sparkfun - integrated Uno compatible ATmega328p; stepper Driver is DRV8811 IC) without the grbl software installed, to control a small bipolar motor. There is 12 VDC connected to the barrel jack to provide power to the device and I set the onboard current adjuster to about 0.6A (about what the stepper specs call for.)

Instead, I have tried uploading a simple sketch to the board, but there is no movement from the motor. Here are some more details about the arrangement:

The pinout for the integrated Arduino are as follows:

Stepoko - Sparkfun
Arduino map PIN
D0- RX 0
D1- TX 1
D2- STEP X 2
D3- STEP Y 3
D4- STEP Z 4
D5- DIR X 5
D6- DIR Y 6
D7- DIR Z 7
D8- STEP EN 8
D9- LIM X 9
D10- LIM Y 10
D11- SPIN PWM 11
D12- LIM Z 12
D13- SPIN DIR 13
A0- RESET/ABORT 14
A1- FEED HOLD 15
A2- CYCLE START 16
A3- COOLANT EN 17
A4- UNUSED 18
A5- PROBE 19
A6- UNUSED 20
A7- UNUSED 21

The bipolar motor is connected to the 4 screw terminals of the "Z-direction" channel.

I tried to setup a stepper motor object using pins 4 and 7 (z-step and z-direction) using an Arduino built-in example (copied below), but i cannot seem to get it working.

Stepper Motor Control - one step at a time

This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.

The motor will step one step at a time, very slowly. You can use this to
test that you've got the four wires of your stepper wired to the correct
pins. If wired correctly, all steps should be in the same direction.

Use this also to count the number of steps per revolution of your motor,
if you don't know it. Then plug that number into the oneRevolution
example to see if you got it right.

Created 30 Nov. 2009
by Tom Igoe

*/

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 4, 7);

int stepCount = 0; // number of steps the motor has taken

void setup() {
// initialize the serial port:
Serial.begin(9600);

}

void loop() {
// step one step:
myStepper.step(1);
Serial.print("steps:");
Serial.println(stepCount);
stepCount++;
delay(100);
}

I think the main problem is that I am not sure exactly what pins need to be setup to get this device to function. Any suggestions would be appreciated. Perhaps using a simpler stepper driver would have been an option, but it's nice to have the three drivers and board all in one package.

Any suggestions on how to troubleshoot this?

Thanks.

The standard Stepper library is not designed for stepper drivers that take step and direction signals.

Try the examples in this Simple Stepper Code

Or try the AccelStepper library

...R
Stepper Motor Basics

Thanks for the reply Robin2.
Actually, I had come across and tried your example (without the led). I read a lot of your background writing before posting, but still no luck.

Does it have something to do with the enable pin (8)?

I tried initializing it as "byte enabpin", then calling "digitalWrite(enabpin, HIGH)" and "digitalWrite(enabpin, LOW)" to see if that would work.

Any suggestions would be appreciated.

byte enabpin;

Is this what you wrote? Then you didn't initialize enabpin at all. No wonder digitalWrite() had no effect.

You have to be precise. The compiler will always do exactly what you tell it, even if it's obvious that you told it to do something stupid.

Did you set the enable pinMode to OUTPUT? And write LOW to the enable pin to enable the driver outputs.

Thanks for the replies everyone. I should have copied the full code, i see my case wasn't clear.

The problem was that the Stepoko has a normally open "e-stop" circuit. The "e-stop" LED was illuminated (which i only realized this morning) so i shorted the e-stop terminals on the board and the stepper came to life.