Servo control / UART / SPI help needed


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by keithdoxey
    ...
    A 10mS pause is easy.... PAUSE 50

    Because your PIC is running 5 times as fast as the compiler thinks it is, all delays will be a fifth of what it expects so the 50mS pause will become 10mS.
    This is not valid for PAUSE command. It is for PULSOUT type of commands.

    Quote Originally Posted by Blackhawk
    I want a 10 microsecond pause not a 10 millisecond pause, that's the problem
    With at least 10Mhz OSC, 10uS pause can be achieved using PAUSEUS command. Since you are using 20Mhz, it WOULD BE ok in your case by PAUSEUS 10 but you are not using PBP. So it won't be possible until you get PBP.

    Therefore, you will need to use ASM routine to create a sensitive uS delay.



    -------------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by sayzer
    Therefore, you will need to use ASM routine to create a sensitive uS delay.
    Not so - try this (with 20Mhz xtal 4 instructions = 1 uS)

    Code:
    Main:
    
    Gosub Delay_10	' 10 uS delay
    Gosub Delay_1 	' 1 us delay
    
    GOTO Main
    
    ' *** Delay 10 us Subroutine (2 instructions to get here and 2 to get back)
    Delay_10:
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Gosub Delay_1
    Return
    
    ' *** Delay 1 us Subroutine (2 instructions to get here and 2 to get back)
    Delay_1:
    Return
    
    END
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    hehe

    Clever!


    --------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Blackhawk's Avatar
    Blackhawk Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the help, I was wondering if I could uselessly move bits around to get the delay but I didn't know exactly how long the processes would take.

Similar Threads

  1. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 09:40
  2. Replies: 10
    Last Post: - 26th May 2008, 08:00
  3. Help with Servo Control Please!
    By wireman22 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 19:15
  4. Servo control woes
    By Eriswerks in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 28th February 2006, 01:12
  5. Control RC servo via Parallax Servo Control
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th September 2005, 09:18

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