Is a timer delay accomplished with an interupt?


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink The fair ( and simple ) solution ...

    Hi ShortBus,

    I Hope your bike is not a CB 250/350 ... no emergency brake signal needed ... cause no break at all !!! LOL ...

    But ... I'd bet for a CB 750 ...

    Being serious ... no interrupt needed :

    a fair solution could be to use a 32.768 Khz Xtal for clock ... and let TMR 1 ( 16 Bits ) run quietly ...

    that permits to use 12F683 and 16F628 as "simple" Pics.

    How to ???

    By polling the TMR 1 Overflow bit !!! (TMR1IF)

    Let's have TMR 1 running freely : an overflow will occur after the delay you want "not to re-arm the flashing sequence" ... let it run ...

    Let's use the brakes :

    Overflow bit is set : engage the flashing sequence, and when releasing brakes... quit the flashing sequence and reset TMR 1 and it's Overflow bit ...

    re use the brakes :

    - before "Timeout" : overflow bit is clear ... continuous lighting !

    - after "Timeout" : overflow Bit is set ... engage the flashing sequence !!!

    32.768 Khz Xtal ??? just will need you to correct the programmed times by x 122 if using the Std "DEFINE Osc 4"

    ( Programmed PAUSE 10 will give 1220 ms instead of 10 ms ... so, if needed, use Pauseus :
    Pauseus 1000 will give 122 ms instead of 1 ms ... )

    This is just not to twist your brain on how to create " 1 - 10 seconds" delays ...



    Alain ... Genuine Kawasaki H1 rider ... ha,ha,ha !!!
    Last edited by Acetronics2; - 12th August 2007 at 20:22.
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 08:57
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 16:23
  3. timer interupt help 16f73
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd July 2005, 09:41
  4. Memory Space of the PIC16F84...
    By Tear in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st July 2005, 20:55
  5. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 01:10

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