
Originally Posted by
crhomberg
Really Darrel, You always seem to spot the errors quick.
It's a Curse, really.
I can spot things in other peoples programs like it's got a blinking red light on it.
But in my own programs, it can take weeks to find a simple bug.
er - ok well I think it works that way for everyone. I just never ask for help. 
If you have any other nasties you can see in that code please tell me.
Well, if it's turning smoothly then I think the "Nasties" are gone. But I might be able to make some new ones for you.
Sorry, my other curse is the need to reduce redundant code (RRC).
So here's my idea.
Code:
Qstep VAR BYTE
Coils VAR BYTE
StepForward:
Qstep = Qstep + 1
IF Qstep >= 16 THEN Qstep = 0
GOTO DoStep
StepReverse:
IF Qstep = 0 then Qstep = 16
Qstep = Qstep - 1
DoStep:
LOOKUP Qstep,[%001101,%001111,%001100,%001010,%101000,%111000,%100000,%010000 _
,%000100,%000110,%000101,%000011,%100001,%110001,%101001,%011001], Coils
PORTB = (PORTB & %11000000) | Coils
PAUSEUS TIME
RETURN
Completely un-tested.
Bookmarks