Hi,
I bought a L297/L198 stepper-motor-controllerboard (SMCB) wich originally wasn´t designed for the arduino. I thought that this shouldn`t be a problem, but now its getting complicated.
As the control-connection the board has 10 Pins: A 5V logic voltage, a GND and 8 for the control.
All the control-pins have all already Pull-up resistors and are switched by connecting to GND. I tried a bit, but I am not completely satisfied.
Please help.
1.) I could not simply connect a SMCB-Pin to a Arduino-Pin in INPUT-Mode. This won`t work. Should it?
2.) By manually connecting the SMCB-Pin to the Arduino-GND it would switch as wanted.
3.) I connected the SMCB-Pin to the GND via a relais. Switching the relais via an Arduino-OUTPUT-Pin works.
4.) I now could build kind of a "translation-board" with 8 relais and connections for Arduino and the SMCB, but isn´t there an easier way to do it?
No,
I have set them to output and I can measure a change in current when switching from HIGH (0.002V) to LOW (4.8V). To GND it is 4.8V as well, but with GND it would switch, and with LOW-Pin it would not... Am I getting crazy?
I do not really have a code yet.
If I connect the SMCB-Pin1 to the Arduino-GND the motor would do a step.
If I connect the same Pin to either Arduino Pin 4, 5 or 6 the motor would not do a step although I measure the same current.
int intPinEnable = 4;
int intPinDrehrichtung = 5;
int intPinTakt = 6;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
pinMode(intPinEnable, OUTPUT);
pinMode(intPinDrehrichtung, OUTPUT);
pinMode(intPinTakt, OUTPUT);
}
void loop() {
Serial.print("\nloop\n");
digitalWrite(intPinEnable, HIGH);
digitalWrite(intPinDrehrichtung, LOW);
Serial.write("LOW");
digitalWrite(intPinTakt, LOW);
delay(40000);
Serial.write("HIGH");
digitalWrite(intPinTakt, HIGH);
delay(4000);
Serial.print("\nENDE");
delay(500);
Serial.print("\n");
while(1);
}
I just realized, that the motor would not move, if I connect SMCB-Pin1 to the Arduino-GND through the multimeter (while measuring current).
And I do not measure any electric current (or < 1µA).
Is this a hint for anyone? Anyone any idea?
correction: I misused the word "current". Please check the units to get what I meant - sorry.
Might it be, that either my Arduino or the motor-board has some kind of malfunction or is there any other explanation for this behavior? Does anyone have any idea what I might check or what I might do wrong?