Accelstepper outputing to low a voltage

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);
  }
}

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?

No. It is hard to tell just what you are measuring in that picture, but the meter reading shows 3.19, which, for a 3.3V board, is reasonable.

With nothing connected to the Arduino, what do you measure at pin 8?

What, exactly, is connected to pin 8?

What is connected to what other pins?

a couple pictures show me mearuing on the level shifter. The 3.3 is from the 3.3v on the board. The 1.2 is coming from pin 8 and meaured in one of the pictures at pin 8 while the sketch is running.

The other picture showing 1.2 on the meter is measured on the side of the level shifter which pin 8 is connected.

The meter won't respond to 50 microsecond pulses. It will average the voltage, getting 50% of the actual peak voltage. Try changing the delays to 1us and 99us. You should see 1% of the voltage. Then try 99 and 1.

Most drivers are built to work on both 3.3V and 5V systems. Look at the definition for the "digital input high voltage" or whatever. It will usually show 2.1V as a minimum. That means anything over 2.1V will be read as a valid HIGH. The Arduino should be able to do this with no level shifter.

My first thought was the meter not updating, but then the motor still was not working at the same time. Its very weak and can't make a full step.

When I get home I will do some testing with the code timing wise, and I will remove the level shifter. The only reason I put the shifter on was because the motor was not working when I had the same exact wiring running on the 5v Nano. I figured it was the 3.3v.

Thanks

That is a very fast step rate. I would start by slowing it down by a factor of 1000 before declaring that it's not working.

MorganS:
That is a very fast step rate. I would start by slowing it down by a factor of 1000 before declaring that it's not working.

+1

...R