Olympic Timer


Results 1 to 40 of 48

Thread: Olympic Timer

Threaded View

  1. #27
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Exclamation TMR1 Pause generator

    Mel,

    Your Olympic timer program is a piece of work. Wow. The example has given me a pretty good start with timer operation.

    I was wanting to use the PIC's TMR1 resource to do two things.

    1. Act as "a timer" as in the Olympic Timer Demo to set a FLAG after 5 mins
    2. Simulate a program PAUSE (say 3 seconds)

    I gather from your program description that instructions can NOT take longer thatn 10ms, otherwise my 5 min timer will in (1) will not be accurate. (Hence cant use a simple PAUSE command)

    I have attached code that I think should work (but doesn't) and was wondering if you could help me out.

    This is the main difference:

    DELAY VAR BYTE
    TIME_END VAR BYTE
    TIME_START VAR BYTE

    Begin:

    DELAY = 3 ' CREATE A THREE SECOND DELAY
    TIME_START = SECONDS ' SAVE CURRENT TIME
    GOSUB KILLTIME ' GO WAIT FOR THE DELAY
    TOGGLE PORTB.0 ' DELAY FINISHED NOW TOGGLE LED

    goto begin ' DO IT ALL OVER AGAIN

    DISABLE


    KILLTIME: ' KEEP DOING THIS ROUTINe UNTIL delay time reached
    TIME_END = SECONDS-TIME_START ' MINUS START TIME EQUALS THE CHOSEN DELAY
    IF TIME_END > DELAY THEN RETURN
    GOTO KILLTIME
    Attached Files Attached Files

Similar Threads

  1. About olympic timer..
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th June 2006, 10:16
  2. Melanie's Olympic Timer
    By nedtron in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th January 2006, 15:41
  3. Olympic Timer MPH readout
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2005, 18:56
  4. Help with scroll text in Melanie Olympic Timer
    By jorge in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th November 2004, 15:52
  5. Melanie Olympic Timer -> Banner....scroll text...
    By jorge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th November 2004, 23:11

Members who have read this thread : 2

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