Servo Code problem


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    20

    Question Servo Code problem

    Hi, I recently wrote a program to control 12 servos. The program ran perfectly on my PIC16F84-A but when I tried to run it off my 16F88 it did not control all of the servos properly. The F88 caused some servos to move back and forth rapidly and others worked fine. I thought the problem could be in the fuse data but I looked through it and everything seemed to be in order (although I am not 100% sure). Does anyone have any ideas of what could be happening?
    Thanks

    P.S. My code looks something like this:

    for i = 1 to 50

    Low portb.0
    Pulsout portb.0, 150

    low bortb.2
    pulsout portb.2, 150 ...

    next i

  2. #2
    Join Date
    Mar 2003
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Servo problem

    I assume you are using a 4 MHz crystal where the PULSOUT unit time would be 10 uS per count giving 1500 uS for a centred servo.

    Your code will loop extremely fast - way too fast for a servo thst is looking for a refresh rate around 50 per second.

    Try putting
    PAUSE 18
    in youf FOR/NEXT I loop and it should centre the servo.

    HTH
    Brian

Similar Threads

  1. Replies: 14
    Last Post: - 31st March 2009, 12:04
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 14:17
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. problem with my code
    By civicgundam in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd February 2008, 01:52

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