Hi-
My project is using a Teensy 4.1 and I need to control a stepper using a DM556T driver with the Accelstepper library. I think the DM556 needs 5V for the control pins but Teensy 4.1 only outputs 3.3v on digital pins.
I tested the setup below on an ARDUINO MEGA and the TEENSY 4.1 and it works perfectly on the MEGA but it does not on TEENSY..
..so I purchased these level shifter boards - I will get them Saturday.
This is the setup I used for testing. (works on Arduino Mega but not on Teensy 4.1)
STEPPER WIRING:
DIR+ and PUL+ connected to 5V
DIR- to pin 2
PUL- to pin 3
CODE:
// Include the AccelStepper library:
#include <AccelStepper.h>
// Define stepper motor connections and motor interface type. Motor interface type must be set to 1 when using a driver:
#define dirPin 2
#define stepPin 3
#define motorInterfaceType 1
// Create a new instance of the AccelStepper class:
AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);
void setup() {
// Set the maximum speed and acceleration:
stepper.setMaxSpeed(1000);
stepper.setAcceleration(500);
}
void loop() {
// Set the target position:
stepper.moveTo(8000);
// Run to target position with set speed and acceleration/deceleration:
stepper.runToPosition();
delay(1000);
// Move back to zero:
stepper.moveTo(0);
stepper.runToPosition();
delay(1000);
}
So while waiting for the level shifting boards, I'm planning how to wire it to the DM556T driver.
Would you mind looking at the diagram and see if that will work? I may have something wrong in there, I never used level shifting boards/chips before.
Thanks for looking!