Stepper Motor troubles


Closed Thread
Results 1 to 2 of 2
  1. #1
    Fryin's Avatar
    Fryin Guest

    Question Stepper Motor troubles

    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

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Fryin View Post
    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
    What pins do you have your stepper motor connected to? (thru the '2003 of course).

    Also, have you been able to make your motor step using only push button switches...in other words, are you sure your motor will step as long as the software works properly (push one button, steps one coil, push another button, steps another coil, and so on)? I'd get that working first to make sure you don't burn anything up and worry about the software control later...

Similar Threads

  1. 18f4431; driving a stepper IN HARDWARE mode
    By DDDvvv in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st January 2010, 16:49
  2. Replies: 11
    Last Post: - 6th November 2008, 10:27
  3. Controlling stepper motor with PIC
    By The Master in forum Off Topic
    Replies: 3
    Last Post: - 1st July 2008, 10:21
  4. Driving Stepper Motor with PBL3717
    By crhomberg in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th November 2007, 20:59
  5. problem with stepper!!
    By ibra in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th August 2007, 16:41

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts