timer question (probably for Mel)


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216

    Default timer question (probably for Mel)

    Hello all, 'specially Melanie.
    I got your olympic stopwatch working and did a cuppla mods to it as far as triggering start and stop, with not too many problems.
    Also saw your post of 8 August '04 in relation to cutting out the bits that weren't wanted. Tried to incorporate them into my prog but no luck so far.
    Perhaps they are a bit of overkill???
    What I am trying to do is like this.

    100 Hz, free running timebase
    count up to a predetermined (variable) time. 15 secs MAX (=1500 ticks)?
    at timeout, set a flag to do some other stuff.

    I have done this using simple PAUSEs but I think accuracy may become an issue.

    The program is a bit of a dogs breakfast, but will post it if you like.

    What is the simplest way to do the above. BTW, during counting period, absolutely nothing happens except increment counter, so no problem with interrupt time. Am driving an LCD during setup, but will not be required in final.

    I got no more hair to pull out, gee it's tuff on us old blokes...

    Thanks again.

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


    Did you find this post helpful? Yes | No

    Default

    Gimme a break... I have trouble remembering how I staggered into work this morning let alone a post from 13 months ago! To save me searching, do you have an easy link?

    What are you trying to achieve? Count 15 Seconds then do 'something' and repeat? When you're doing 'something' are you still counting the next 15 second period in the background - or is that suspended? Gee... you can actually get it to last that long? Most guys I know are still in mS...

    Kojak resorted to sucking lollipops...

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink Some useful .xls file

    Hi, Muddy

    see here : http://www.vermontficks.org/pic_calculations.xls

    solution comes with ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    http://www.picbasic.co.uk/forum/showthread.php?t=603 reply #7,9

    OK Mel, what I am trying to do is:

    do a bunch of stuff (all code OK and works)

    press START button
    start counter up to 100 - 1500 ticks (1 - 15 secs set by switches during first bunch of stuff)
    time out
    leave and do another bunch of stuff (all code OK and works)

    do not count until start pressed again, and new number of ticks read.
    'MY THOUGHTS:
    either start the interrupt routine at press START, and stop it at TIMEOUT
    or Have interrupt routine free running and zero counter and count to TIME and then go off and do the other stuff.

    During the time delay, nothing happens except wait for TIMEOUT

    Sorry to ask all these dumb Qs Mel, but seems to me you are the brains in this outfit?
    Last edited by muddy0409; - 12th September 2005 at 14:55.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    > Sorry to ask all these dumb Qs Mel, but seems to me you are the brains in this outfit?

    Actually there's some pretty clever folks here... and some have been at it for a lot longer than me... as for 'this outfit', I'm not associated with Crownhill (other than being press-ganged into being an Admin on this forum) nor am I associated with MeLabs (though I rather like their PICBasic compiler product).

    Gimme a little time to snatch a free moment and revisit the Olympic Timer code...

  6. #6
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Hi again everyone.
    After sleeping on it overnight, and damned uncomfortable it was too, I have decided that a simple PAUSE 15000 would be good enough to give me my 15 sec. maximum time. As long as the accuracy of PAUSE is reasonable it will be good enough. After all, I ain't launching rocketships, just turning pistol targets.
    Time to read the manual and check out how good PAUSE is.

    Better late than never.
    Regards,
    Peter

Similar Threads

  1. Simple Timer question
    By jimseng in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th September 2009, 23:12
  2. Watchdog Timer Question
    By kevj in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2008, 01:56
  3. Timer Question 16f877
    By Bonxy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th November 2005, 08:40
  4. Timer / CCP Question
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd November 2005, 08:22
  5. Timer Question
    By aywho in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd October 2005, 21:54

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