Step motor control


Results 1 to 23 of 23

Threaded View

  1. #8
    Join Date
    May 2010
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Re: Step motor control

    HI,
    do you now what is hapend,
    when I write this code:

    Delay VAR BYTE
    i VAR WORD

    TRISB = 0 ' All outputs.

    Delay = 10 ' ~100steps / second

    For i = 1 to 512
    PORTB = %00000001
    Pause Delay
    PORTB = %00000010
    Pause Delay
    PORTB = %00000100
    Pause Delay
    PORTB = %00001000
    Pause Delay

    NEXT

    Pause 1500

    For i = 1 to 512
    PORTB = %00001000
    Pause Delay
    PORTB = %00000100
    Pause Delay
    PORTB = %00000010
    Pause Delay
    PORTB = %00000001
    Pause Delay
    NEXT
    My motor turn round 360 degrees, and back - 360 degrees ,1 time!!!

    and when I write this code:

    Delay VAR BYTE
    i VAR WORD

    TRISB = 0 ' All outputs.

    Delay = 10 ' ~100steps / second

    For i = 1 to 4096
    PORTB = %00000001
    Pause Delay
    PORTB = %00000010
    Pause Delay
    PORTB = %00000100
    Pause Delay
    PORTB = %00001000
    Pause Delay

    NEXT

    Pause 1500

    For i = 1 to 4096
    PORTB = %00001000
    Pause Delay
    PORTB = %00000100
    Pause Delay
    PORTB = %00000010
    Pause Delay
    PORTB = %00000001
    Pause Delay
    NEXT
    my motor turn round 360 degrees,and back - 360 degrees, 4 time is correct?
    Last edited by dragan77; - 5th September 2011 at 19:32.

Members who have read this thread : 0

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