Hi there! I am trying to implement the SilentStepStick (TMC2130) with a stepper motor and I can't get it to switch directions. It works and spins Clockwise when the DIR pin is pulled high, but when it's pulled low it won't reverse directions and go Counter Clockwise. I've tried just grounding it instead of using the output pin on my Arduino Uno and it seems to just hum in the same spot and it does not pull any current either (the shaft freely spins).
I've checked the motor wiring to make sure it's correct and I also have it working (loudly) on the L298N driver.
The wiring I have follows this:
and the code is below.
#include <AccelStepper.h>
#define PIN_EN 7
#define PIN_DIR 12
#define PIN_STEP 9
#define PIN_CS 10
int defaultAcc= 1000;
int defaultPos = 0;
int speedLim = 500;
AccelStepper stepper(AccelStepper::DRIVER, PIN_STEP, PIN_DIR);
void setup() {
pinMode(PIN_EN, OUTPUT);
pinMode(PIN_DIR, OUTPUT);
pinMode(PIN_STEP, OUTPUT);
pinMode(PIN_CS, OUTPUT);
stepper.setMaxSpeed(speedLim);
stepper.setAcceleration(defaultAcc);
stepper.setSpeed(defaultSpeed);
stepper.moveTo(defaultPos); // Default Positioning
digitalWrite(PIN_EN, LOW); // PIN_EN LOW is ENABLED, PIN_EN HIGH is DISABLED
Serial.begin(9600);
}
void loop() {
digitalWrite(PIN_DIR, HIGH); // setting to LOW won't work?
stepper.setSpeed(speedLim);
if (True){
stepper.run();
}
}
Any ideas would be greatly appreciated!