Based on your link, it should be exactly 400 steps/revolution. Have you actually tried measuring the exact number of steps for one rotation? Maybe that would give you some insight. For instance, if it was 800 steps, or 600 steps (exactly), then you would have something to go on.
I seem to remember reading somewhere about if your stepper goes two steps forward and one step back, even through you are driving it one direction, you have a wiring problem. I think that was for 8-wire motors though. But perhaps it is something bizarre like that?
Also, what is your setup/hold time on driving the stepper? The stepper driver chip has a specification for how long signals are supposed to be high or low before they change. This applies between pins too - for instance, there is a delay you have to follow between when you change the direction pin and when you change the step pin. It is on page 6 of the datasheet at [
www.allegromicro.com]
What this means is you need to have *some* delay (at least theoretically) between (for instance) changing the direction of the stepper and issuing the step command. Also, the step pin has to be high for at least one microsecond. If you have no delays at all, then you might set it from low->high then high->low too quickly. My board runs at 16MHz clock, which means 62.5 ns/cycle. I don't know how many cycles it takes to set a pin in AVR assembly, but if it is less than 16 cycles, then you *might* be violating the setup/hold times in the A3982 datasheet.
I think I wait a full millisecond when I change direction before doing anything else, and have a hold time of 20 microseconds or so (just an arbitrary-ish number) for the actual step pulse (followed by lots more waiting to make sure it doesn't skip).