The best way to control a servo with a PIC


Closed Thread
Results 1 to 40 of 42

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Just 'reading between the lines' of your post. I havnt checked yet but i wouldnt be supprised if you could set the value of the register to whatever you want after an interrupt so instead of counting 0-128 and checking in a loop you can start at 128 and count upto 255 which will allow the interrupt to work still
    BAM!
    So I think I can infer that you figured out that you can both read AND write the TMR0 register like any other R/W register out there. There's only a couple of 'catches' to writing the TMR0 register...and that item IS in the datasheet...
    Reload TMR0 with 128 (plus a small correction value depending on your code) and you're 51.2us can become 25.6us, or more, or less, depending on whatever you want to do...
    Works the same with the rest of the timers too...

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Master, locate and download the MID RANGE MCU FAMILY REFERENCE MANUAL here:
    http://ww1.microchip.com/downloads/e...Doc/33023a.pdf
    Read Section 11 for detailed info on TIMER0.

Similar Threads

  1. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 08:40
  2. Help with Servo Control Please!
    By wireman22 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 18:15
  3. Servo control / UART / SPI help needed
    By Blackhawk in forum mel PIC BASIC
    Replies: 10
    Last Post: - 10th November 2006, 03:40
  4. How would i write this in pic basic pro (Servo controller)
    By Jhdgkss in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th February 2006, 08:21
  5. Control RC servo via Parallax Servo Control
    By cibotsan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th September 2005, 08: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