0

I have this code:

#include <stdint.h>

# define STEP 14

void setup()
{
    pinMode(STEP, OUTPUT);
}

long steps = 0;
void loop()
{
    if (steps < 200)
    {
        digitalWrite(STEP, digitalRead(STEP) ^ 1);
        delay(10);
        steps++;
    }  
}

Simple implementation and I have a nema17 motor with 1.8 degrees per step, which should give 200 steps per revolution, but I only have half a revolution on 200 steps, I tried connecting all MODEx pins to VCC and this should give me 6400 steps per revolution but 6400 steps also gives mi half an revolution. Could there be an issue with the wiring of the motor? Why don't I receive a full revolution? By full revolution I mean that the motor shaft should complete the whole circle but it completes only half.

0
2

See page 33 of the DRV8825 datasheet https://www.ti.com/lit/ds/symlink/drv8825.pdf.

DRV8255 moves the stepper on a rising edge in the signal.

That requires the signal to go low, then high.

That is two cycles of your program.

Add two lines to your code so that it is output low, delay 10, output high, delay 10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.