Problem using anolog input and digital I/O for stepper motor

I am currently trying to run a stepper motor and controller. I am using the St-M5045 controllet available to receive 300 kHz pulse and runs on 24V. I am able to run the stepper motor alone at a pretty good ram by accessing the delayMicroseconds(350). I want to control the direction, enable, and stEpperson pulse on the Due but when I am looking for the signal from my switch in the analogRead(A0) it slows my pulse for the stepper slows down or a crawl. Any suggestions on how to make things speed up without moink the switches away from the Due?

Where is your program?

How do we know what is happening without knowing what you are doing?

The first thing newbies need to learn is how to put their code in its own window as seen in other posts. This can be done by placing     [code] and [/code]  around the code. This makes it easier for others to read.


The Thread stepper motor basics may be useful and it links to some simple code.

As @weedpharma has said, post your code AND a diagram showing how you actually have everything connected i.e. NOT a diagram of how it should be connected.