my stepper motor wont reverse

Hello ,

this is first time to use arduino uno
i have stepper motor Nema 23 model 23HD56003Y ( 6 wire )
and driver model DM422

this is a test sketch i used

int CLK = 2;
int DIR = 3;
int ENA = 4; 

word Counter ;

void setup() 
{  
    pinMode(CLK, OUTPUT);
    pinMode(DIR, OUTPUT);
    pinMode(ENA, OUTPUT);
    digitalWrite(CLK, LOW); 
    digitalWrite(DIR, LOW); 
    digitalWrite(ENA, HIGH); 
}

void loop()
{
  digitalWrite(DIR, HIGH);
  digitalWrite(ENA, HIGH); 
  
 for (Counter = 1 ; Counter < 2000 ; Counter++) 
 {
  digitalWrite(CLK, HIGH);
  digitalWrite(CLK, LOW); 
  delay(4);
 }

 digitalWrite(ENA, LOW);
 delay(500);
 digitalWrite(DIR, LOW);
 digitalWrite(ENA, HIGH); 
  
 for (Counter = 1 ; Counter < 2000 ; Counter++) 
 {
  digitalWrite(CLK, HIGH);
  digitalWrite(CLK, LOW); 
  delay(4);
 }
 
 digitalWrite(ENA, LOW);
 delay(500); 
}

now motor don’t reverse step
please help

Just for a test try changing :

 {
  digitalWrite(CLK, HIGH);
  digitalWrite(CLK, LOW); 
  delay(4);
 }

to

 {
  digitalWrite(CLK, HIGH);
  delay(4);
  digitalWrite(CLK, LOW); 
  delay(4);
 }

Otherwise it is probably something in the wiring.

delay(4);

What kind of mechanical thing will respond to much in 4milliseconds? I suspect not too many things.

This is from the manual for the driver:

Remark:
a) ENA must be ahead of DIR by at least 5us. Usually, ENA+ and ENA- are NC (not connected).
b) DIR must be ahead of PUL active edge by 5us to ensure correct direction;
c) Pulse width not less than t3;
d) Low level width not less than t4.

where t3 and t4 are 7.5 uS

Here is a link to the manual.

My concern was that he was pulsing too fast for the driver to pick up the pulse.

Have a look at these links
Stepper Motor Basics
Simple Stepper Code

Post links to the datasheets for your stepper motor and for the stepper driver.

...R

Use AccelStepper library and check all works with that... It has safe timings and is known to work.