I need to run a stepper motor(NEMA 17) for a specific number of steps with maximum speed possible controlled using myRIO. When I used Digital out to produce the square wave for the stepper, the maximum speed obtainable was 500 steps per second when I used 1 ms high and then 1ms low and so on in a loop. But When I use PWM to deliver the signal, higher frequency was obtained but there is no way to count the number of steps. Is there any way to get higher speed and be able to count the pulses? or get higher resolution for wait function?