Tmr1


Closed Thread
Results 1 to 8 of 8

Thread: Tmr1

  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237

    Default Tmr1

    Hi all

    Quick question

    Thinking of using TMR1 on a 16f688 device for a time out (PIC stays on after a button push for 20mins then goes sleep)

    Would this do that ?


    Or would you suggest another method that may be better.... Operators are forgetting to turn field loggers off!!

    Thank you
    Andy

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    Yes, you can do that.
    But you're not going to get 20 minutes out of it in one go, unless you clock it externally with a very low frequency of course. Instead you're going to set it up so it overflows 10, 25, 50, 100, whatever times per second and count the number of overflows, either using interrupts or by polling the interrupt flag - depending on how the rest of the program i structured.

    /Henrik.

  3. #3
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    Hmmmm...

    Back to drawing board then..

    TY for help.... least now I know I cant do it....

    or use a 555 on outside of pic lol

  4. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    You said in your other thread you're using GPS,
    You can easily know how long it was since someone pushed a button.
    Rather than use timer1 which might mess with software serial at a low
    crystal frequency, I would ignore GPS time which might not be present,
    and just count serial bursts which should arrive each second.

    Count 1200 serial bursts no matter what the content and go to sleep.
    Last edited by Art; - 7th May 2015 at 07:48.

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    ...Reset the count to zero any time a button is pushed (meaning someone is using it and they get a new 20 minutes).
    Looks like editing posts is turned off.

    I read again, and it wasn’t GPS, but you have “PAUSE 400” in a subroutine you’re calling, so you could increment a count
    to a bit more than double the 1200 in that routine.

  6. #6
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    Hi Art

    Will try your suggestions later.... Would you believe my PC has died now. So need fix that first !! Typing this on the Mac. PBP not mac friendly!

    Thank you for suggestions

  7. #7
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    I run a Windows partition on my Mac specifically for dev environments so that particular installation can’t see the internet
    because it doesn’t have the wifi module or network interface drivers installed.
    Everyone knows that as soon as a Windows PC sees the internet it breaks

  8. #8
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Tmr1

    CQ CQ CQ VK4FAST…..

    You may have a point…. LOL

    Watch this space

    Best 73 de Andy (G7IIF)

Similar Threads

  1. TMR1 issue
    By Lestat in forum General
    Replies: 6
    Last Post: - 29th August 2012, 15:41
  2. Tmr1
    By BobSpencerr in forum General
    Replies: 7
    Last Post: - 13th May 2008, 20:19
  3. TMR1 How it works?
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 12th January 2007, 14:24
  4. tmr1 on 16f690
    By dan gill in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th November 2006, 21:58
  5. TMR1 question
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th May 2006, 01:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts