Hi all just curious and a lot of questions hope dont annoy with me...hihi

Hello all first of all i want know how much is the frequencies for any common microstepping driver that has only pulse and directions pins? secondly how can i measure my PWM code arduino frequencies example for this simple HIGH LOW code below

///////////////////////////////
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
///////////////////////

thats all tq.... :slight_smile:

The frequency is governed by the speed you pulse your drive.
That code is not PWM
Each digital write takes about 2.5 uS.

isnt the digitalWrite code stands for PWM.....so how does PWM code looks like?

Can you find the time to Google "PWM" ?

okay im sorry im too noob...tq anyway

Google "PWM"
SEARCH RETURNS

FIRST link:

Was that so hard ?

thanks dude....okay let me just straight forward i have this 2.0ampere step motor same just like this thread Help with Stepper motors? - Motors, Mechanics, Power and CNC - Arduino Forum .....some said i need to use PWM to drive this kind of motor but as you can see from my dumb question before im just too noob ....

zamir89:
so how does PWM code looks like?

analogWrite( pin, value )

zamir89:
thanks dude....okay let me just straight forward i have this 2.0ampere step motor same just like this thread Help with Stepper motors? - Motors, Mechanics, Power and CNC - Arduino Forum .....some said i need to use PWM to drive this kind of motor but as you can see from my dumb question before im just too noob ....

I think there is confusion between using pulses to cause the motor to move step by step and the use of PWM within the stepper motor driver board to limit the current in the motor coils when you drive it with a high voltage.

All your Arduino program needs to do is generate a pulse for every step the motor is to make. The motor driver board invisibly handles all the PWM stuff. Usually there is a small potentiometer on the board that you adjust to set the maximum current to match your motor.

You will need to make sure that you choose a stepper driver board that can handle 2 amps. While the hobby boards such as the Pololu A4988 claim to manage 2 amps they would be struggling to achieve that even with forced cooling and 1 amp is more realistic.

...R