Hi this is my first time posting. I am a student learning Microcode in school and I am having trouble making this program. My problem is I need to control a stepper motor using the pic16F84A and driving the stepper with ULN2003A. Now I have to make the program so I am able to chose using 3 pushbuttons for singlestep, doublestep or microstepping. I'm trying to use a lookup table for this and I just can't figure out what to do with the variable Motor once it has the lookup's value. I can show you what I have so far, which aint much and maybe you can give me some idea's on how to progress.
Motor Var byte
x var byte
TRISA = %00011100 'Pushbuttons on port 2,3 and 4
TRISB = %00000000
SingleStep:
Stepoffset = 0
StepLimit = 3
Return
DoubleStep:
Stepoffset = 4
Steplimit = 3
Return
MicroStep:
Stepoffset = 8
Steplimit = 7
return
Start:
gosub checksequence
For x = 0 to 17
PortB=Motor
Checksequence: 'Lookup table includes single, double and microstep all
'together
LookUp x,[1,2,4,8,3,6,12,9,1,3,2,6,4,12,8,9],Motor
return
End
Bookmarks