help pulsout command?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Posts
    7

    Question help pulsout command?

    <code>
    portb = 0
    start:

    pulsout portb.0,120
    pause 1000
    pulsout portb.1,147
    pause 1000
    pulsout portb.0,150
    pause 1000
    pulsout portb.1,140
    pause 1000
    </code>

    when i try this it works, but when i add another pulsout command and pause, it do not do what i want. Is this affects the clock cycle? i used a 4MHz xt, and a pic16f84a. anyone knows this?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    What other pulsout and pause would that be?
    Show what doesn't work...

  3. #3
    Join Date
    Jan 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    when i try 8 consecutive pulsout and pause command, the servomotor react inaccurately, it turns crazy, i would like to know if it affects the clock cyle, because my oscillator is 4 MHz XT, so i know that the clock cycle is divided into four. Is it possible to do this?
    <code>
    pulsout portb.0,175
    pause 200
    pulsout portb.1,170
    pause 300
    pulsout portb.2,175
    pause 300
    pulsout portb.3,130
    pause 300
    pulsout portb.6,150
    pause 300
    pulsout portb.7,150
    pause 300
    pulsout portb.4,150
    pause 300
    pulsout portb.5,150
    pause 300

    </code>

    how can i put the servo back to the first position, but not getting the servo confused?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I know that's not the whole program...
    When are you going to help us help you?
    I wouldn't think that your code is some sort of state secret, is it?

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    And it looks to me like you're trying to drive more than one servo...8 of them?

    Is your power supply up to the task?

    Are you up to the task?

    You should probably know (if you've done any research on the subject of driving servo's) that servo's require a multiple updates per second to hold their position without going all over the place, usually about 50 timers per second, some more, most less per second will do.

    You code...8 servo pulses, say 2.5ms maximum, totals at 20ms.
    At most, you can go thru that loop 50 times per second.

    You've got all those extra pauses in there, which brings the total update rate per second down to less than one update per second...

    Have you thought about getting rid of those pauses?

  6. #6
    Join Date
    Jan 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Yes this is not the whole program. Im just starting to know how to make the servomotor move. i would like to ask help from you if you can help me? Im just a begginner. Please kindly help me.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ajak View Post
    Yes this is not the whole program. Im just starting to know how to make the servomotor move. i would like to ask help from you if you can help me? Im just a begginner. Please kindly help me.
    www.google.com

    Search on 'SERVO'

    www.picbasic.co.uk/forum

    Search on 'SERVO'

    www.any-search-engine-out-there.com

    Search on 'SERVO'

  8. #8
    Join Date
    Jan 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    yes i try to get rid of the pauses but when i test it, id like to make a bipedal robot, and yes i would like to control 8 servo, 4 servos for each leg, is 20 ms pause is ok for changing pulse position on every servo?

Similar Threads

  1. My code for TV remote and MIBAM for RGB control
    By idtat in forum Code Examples
    Replies: 4
    Last Post: - 12th January 2013, 20:52
  2. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  3. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 18:57
  4. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10
  5. Help Quick Need to make code smaller
    By Programmednew in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th January 2005, 03:46

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