Newbie Question - Timers


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    4

    Default Newbie Question - Timers

    I just purchase PBP and am looking over the manual along with the microchip datasheet for the 16F876. I am creating a project that will need a timer to calculate an elapsed time from 250 ms to 5 seconds. It looks like I could do this by polling the counter on the internal counter modules. But I don't see where this is supported in the manual, but did find references to TMR on this forum.

    I'd rather not use interupts if I can avoid it. I don't need micro-second resolution, milli-second will do.

    Can I poll the timer module using PBP? Where is this mentioned in the manual? How is this configured?

    Thanks for any help.

    - Joe

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


    Did you find this post helpful? Yes | No

    Smile

    JOE,

    The datasheet is your best friend in this case -

    If you are using TMR0, you can poll like this:

    Code:
    loop:
    if INTCON.2 = 0 then loop
    'deal with overflow here
    I have a clock example here that also shows polling of TMR0 for timing issues.
    http://www.picbasic.co.uk/forum/showthread.php?t=2129

    Also see Melanie's Olymic Timer here
    http://www.picbasic.co.uk/forum/showthread.php?t=632

    and Darrel's timer here
    http://www.picbasic.co.uk/forum/showthread.php?t=190

    for ideas.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Sep 2006
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Thanks Paul, I'll have a look at these resources. I'm sure they will cover what I need to do.

    I wonder why this isn't in the PBP manual?

    Thanks again,

    Joe.

Similar Threads

  1. Newbie 74hc595 question
    By manjero in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd January 2008, 22:22
  2. newbie with serial com question...
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th December 2006, 05:34
  3. Newbie Question - Info Please
    By ehoskins in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd October 2006, 14:50
  4. Greetings from Newbie and a question
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th July 2006, 15:52
  5. Newbie question
    By senojlr in forum General
    Replies: 7
    Last Post: - 11th April 2006, 21:23

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