TMR1 & Button - long delay (1 min) before starting


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default Re: TMR1 & Button - long delay (1 min) before starting

    Define "best".
    Accuracy, long time stability, resolution, power consumption, ease of use, what?

    You can either run the PIC off of an external 4MHz (or whatever you need) x-tal and derive the TMR timebase from the main oscillator. You won't get as slow as 1Hz but you can get, lets say, 100Hz and keep counting interrupts. Or you can use the TMR1 oscillator with a separate (32768Hz ) x-tal. Since it's a 16bit timer it will overflow every 2 seconds if you let it freerun.

    /Henrik.

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Default Re: TMR1 & Button - long delay (1 min) before starting

    When timing is in the game, for me "best" is "accurate".

    Does a higher crystal frequency mean more accuracy?

    Is it best to choose 4'194'304MHz (32'768kHz*128) crystal and lots of interrupts (if used) or a 32'768kHz one (less interrupts - plenty of time to do "things")?
    Roger

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,627


    Did you find this post helpful? Yes | No

    Default Re: TMR1 & Button - long delay (1 min) before starting

    Doesn't really matter as far accuracy goes. Look at the frequency tolerance of the crystals you're considering, the one with the lowest value will be the most accurate one. But keep in mind that the TMR1 oscillator is designed specifically for low frequency crystals, typically a 32.768kHz. The datasheet for the 16F690 says DC to 200kHz.

    /Henrik.

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Default Re: TMR1 & Button - long delay (1 min) before starting

    Thanks a lot, Henrik.
    Roger

Similar Threads

  1. ICD & PBP && how to get it to work
    By archendekta in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 24th March 2010, 02:56
  2. Replies: 2
    Last Post: - 7th October 2009, 01:06
  3. Tmr1
    By BobSpencerr in forum General
    Replies: 7
    Last Post: - 13th May 2008, 21:19
  4. Button press and press & hold how to ?
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd August 2007, 04:37
  5. 12f629 push button & LED
    By yankee in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th February 2006, 02:45

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