Motor Stepper Example


Closed Thread
Results 1 to 40 of 135

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    You might be able to turn MCLR off but we do not know the chip you are using.
    Post your configs, complete code, and schematic so the folks here will be able to help you.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    the schematic above is the one i used to...

    i am using pic16f84 and uln2803...

    here is the code:

    define osc 4
    ti var byte
    c var byte
    z var byte
    ti=40
    trisb=0
    open:
    for z=0 to 25
    portb=128
    pause ti
    portb=64
    pause ti
    portb=32
    pause ti
    portb=16
    pause ti
    next z
    goto delay

    open1:
    for z=0 to 25
    portb=128
    pause ti
    portb=64
    pause ti
    portb=32
    pause ti
    portb=16
    pause ti
    next z
    goto delay3

    close:
    for z=0 to 25
    portb=16
    pause ti
    portb=32
    pause ti
    portb=64
    pause ti
    portb=128
    pause ti
    next z
    goto delay1

    close1:
    for z=0 to 25
    portb=16
    pause ti
    portb=32
    pause ti
    portb=64
    pause ti
    portb=128
    pause ti
    next z
    goto delay4

    delay:
    portb=0
    pause 2000
    goto close

    delay1:
    portb=0
    pause 2000
    goto loop
    delay2:
    portb=0
    pause 2000
    goto open1

    delay3:
    portb=0
    pause 2000
    goto close1

    delay4:
    portb=0
    pause 2000
    goto loop1
    delay5:
    portb=0
    pause 2000
    goto open

    loop:
    for c=0 to 275
    portb=12
    pause ti
    portb=6
    pause ti
    portb=3
    pause ti
    portb=9
    pause ti
    next c
    pause 2000
    goto delay2

    loop1:
    for c=0 to 275
    portb=9
    pause ti
    portb=3
    pause ti
    portb=6
    pause ti
    portb=12
    pause ti
    next c
    goto delay5
    end
    Last edited by thenew; - 7th March 2011 at 15:15.

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    From the schematic you have posted, you have left the MCLR pin floating, and this is the reason of the problem you reported. Connect the MCLR pin to Vdd (+5V) using a 10K resistor. If you need to reset your chip then short the MCLR pin momentarely to ground for a second and than remove the short.

    Did you connect ULN2803 to ground ?


    Al.
    Last edited by aratti; - 7th March 2011 at 16:35.
    All progress began with an idea

  4. #4
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    yes i connect the uln2803 to ground...

    should i put switch to MCLR? or just connect to 10K and +5v?

    it is ok to connect the 4.7k resistor directly to the supply and MCLR without switch?
    Last edited by thenew; - 8th March 2011 at 01:20.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    Look at the example in the manual.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    my previous problem solved..

    do you have an ides how to program using sensor as input? That when it is high something would activate then when it is low still activate.

Members who have read this thread : 4

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