My code isn’t working!! I had this driver working off of a Nano which is 5v, but now I have a 3.3v Arduino M0 board which is the one I must use for the project. If I use the Accellstepper coding I am getting 1.2v out of the 8 pin. So I went and figured I would do a test with a simple easy to debug code shown below. The Accelstepper library has the same low voltage on pin 8 as this regular code does.
When I use this simple stepper code I am still getting 1.2v out of the pin. I needed the 3.3v which I expected to be level shifted up to 5v for the TB6600 driver from amazon. Problem is I am getting 1.2v and the same thru the level shifter. I took pictures of me measuring different parts to show the voltages I am getting with the simple stepper code. I am not sure how to show them in the post without having to be downloaded.
12v to main driver power and stepper wires tied to the correct spots.
White = PUL+ then pin #8
Black = DIR+ then pin #9
Red = ENA+ then pin #10
All negative wires tied to gnd.
Is it because the code uses delayMicroseconds it is actually working like a pwm and the voltage just is not enough to trigger the driver?
The code I have attached is what is loaded onto the board?
I hope I didn't miss anything you need.
This is the driver:
int PUL=8; //define Pulse pin
int DIR=9; //define Direction pin
int ENA=10; //define Enable Pin
void setup() {
pinMode (PUL, OUTPUT);
pinMode (DIR, OUTPUT);
pinMode (ENA, OUTPUT);
}
void loop() {
for (int i=0; i<6400; i++) //Forward 5000 steps
{
digitalWrite(DIR,LOW);
digitalWrite(ENA,LOW);
digitalWrite(PUL,HIGH);
delayMicroseconds(50);
digitalWrite(PUL,LOW);
delayMicroseconds(50);
}
for (int i=0; i<6400; i++) //Backward 5000 steps
{
digitalWrite(DIR,HIGH);
digitalWrite(ENA,LOW);
digitalWrite(PUL,HIGH);
delayMicroseconds(50);
digitalWrite(PUL,LOW);
delayMicroseconds(50);
}
}
