Greetings!
I'm trying to get a stepper up and running using either a QT PY or an UNOR3, each with a DRV8833, with no luck so far. I'm guessing i'm missing something obvious, but I can't pick my brain any longer, so any help is greatly apprechiated.
Before the QT PY + DRV8833 arrived, I played about with the UNO R3 and an ULN2003 + 28BYJ-48, which worked great! Now after switching i can't figure out why the other driver + motor is so much different...
I tried following these two guides, but without luck.
https://learn.edwinrobotics.com/drv8833-dcstepper-motor-driver-hookup-guide/
My setup is rather basic and looks like this: (attached photo)
Input Pins on the µC, output Pins to the stepper (NEMA 17 - 48mm) plus a external power supply set to 9.5V and 1.25A. Ground of the DRV is wired to the GND on the µC, Vm I have tried without it and with it wired to the 3.3V Output on the µC.
In the code I simply cycle through the Output Pins, setting them High or Low in order to spin the motor, which works a treat with the setup UNO+ULN2003+28BYJ:
#define Ain1 5
#define Ain2 6
#define Bin1 9
#define Bin2 10
int speed = 0;
void setup() {
pinMode(Ain1, OUTPUT); //Ain1
pinMode(Ain2, OUTPUT); //Ain2
pinMode(Bin1, OUTPUT); //Bin1
pinMode(Bin2, OUTPUT); //Bin2
}
void loop() {
digitalWrite(Ain1,HIGH);
digitalWrite(Ain2,LOW);
digitalWrite(Bin1,LOW);
digitalWrite(Bin2,LOW);
delay(10);
digitalWrite(Ain1,HIGH);
digitalWrite(Ain2,HIGH);
digitalWrite(Bin1,LOW);
digitalWrite(Bin2,LOW);
delay(10);
digitalWrite(Ain1,LOW);
digitalWrite(Ain2,HIGH);
digitalWrite(Bin1,LOW);
digitalWrite(Bin2,LOW);
delay(10);
digitalWrite(Ain1,LOW);
digitalWrite(Ain2,HIGH);
digitalWrite(Bin1,HIGH);
digitalWrite(Bin2,LOW);
delay(10);
digitalWrite(Ain1,LOW);
digitalWrite(Ain2,LOW);
digitalWrite(Bin1,HIGH);
digitalWrite(Bin2,LOW);
delay(10);
digitalWrite(Ain1,LOW);
digitalWrite(Ain2,LOW);
digitalWrite(Bin1,HIGH);
digitalWrite(Bin2,HIGH);
delay(10);
digitalWrite(Ain1,LOW);
digitalWrite(Ain2,LOW);
digitalWrite(Bin1,LOW);
digitalWrite(Bin2,HIGH);
delay(10);
digitalWrite(Ain1,HIGH);
digitalWrite(Ain2,LOW);
digitalWrite(Bin1,LOW);
digitalWrite(Bin2,HIGH);
delay(10);
}
Now, why is the DRV8833 different? Is it because I somehow mess up the power supply?