TIMER1 Interrupts and CCP


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2008
    Location
    Charlottesville, VA
    Posts
    31

    Post TIMER1 Interrupts and CCP

    I need help. I've tried using the timers before and I just don't seem to be doing something quite right. My goal is this. I have developed an intelligent mobile robot using the PIC16F877A. It uses Infrared Technology for obstacle avoidance and at some point, possibly even serial communications. Other implementations are: temperature sensing, voltage measurement, 2 x 16 (or 4 x 20) lcd display, cds photocells for light measurement. I would now like to implement an ultrasonic range finder on this system. The problem that I am having is that I don't know how to use TIMER1 to time how long it takes for the transmission signal to be received. I know the calculations, i.e., 340m/s @ 20C and t/2 for half of the measurement. I just need to know how to use TIMER1 and the CCP module to capture the interrupt and tell me how long it took. I am using the PicBasic language as I am not familiar with assembly. Besides, its converted to assembly and hex for programming. If you could please help me with this I would appreciate it. I've also considered the RCTIME command but I'm not certain that would give me the accuracy that I am looking for. Please help if you can. Thank you all in advance.

    P.S., I can post the code that I have for my robot if you are interested in that also. Maybe you could even tell me where to put the interrupts in it...lol. Thanks again!
    Last edited by mcbeasleyjr; - 27th January 2009 at 07:42.

    Morris Beasley
    Manufacturing Test Technician
    B.S. Industrial Technology (2007)

    For more information on our robotics, please visit:
    http://www.ish-electronics.webs.com

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Here's an example of using capture http://www.melabs.com/resources/samp.../pbp/ccpx2.bas
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. mS Timer
    By whmeade10 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th September 2020, 12:12
  2. Capture without CCP
    By boroko in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th March 2009, 23:09
  3. Instant Interrupts and Capture
    By Andy Wood in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st February 2008, 06:36
  4. How to set TMRO & TMR3 as Counter?.
    By NatureTech in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 18th May 2007, 08:52
  5. CCP Module How to ?
    By capitano in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th February 2005, 08:08

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts