Using Pause and TMR0


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I Found another Way.

    When I use for Example this:
    Display:
    Lcdout ..........................
    Pause 5000
    LCDout..........................
    Pause 4000
    Resume
    ------------------------------------------------------------------------
    Seconds = Seconds + 9 ' Add 9 Seconds to Seconds Variable
    Then I add in My Second Variable the Seconds that I have Lost with my pause statment.
    Is This a good Idea?

    Regards Pesti

  2. #2


    Did you find this post helpful? Yes | No

    Default

    I add a new Code line:

    Timer:
    TMR0IF = 0 '''''''''''''''''''''''''''''''''''''''''''''Clear Timer 0 Interrupt
    TMR0H = $0B
    TMR0L = $DB
    Second[2] = Second[2] + 1

    I add next Line
    If Second[2] > 60 Then Second[2] = Second[2] - 60 : Minute[2] = Minute[2] + 1

    If Second[2] = 60 Then Minute[2] = Minute[2] + 1 :Second[2] = 0
    If Minute[2] >= 60 Then Hour[2] = Hour[2] + 1 :Minute[2] = 0
    If Hour[2] >= 24 Then Hour[2] = 0

    Regards Pesti

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Pesti,

    If it works for your application, then go for it...;o}

    I can't see where it would hurt. Remember, however, that you have a time period that's not
    accounted for during each LCDOUT sequence. If this missing time isn't a problem, then just
    go with what you have.

    If timing is critical, you could always find out how long each LCDOUT takes, and factor this
    into your PAUSE time using PAUSEUS.

    See this thread for details http://www.picbasic.co.uk/forum/showthread.php?t=365
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 07:28
  2. Simple program - Strange problem!
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th December 2009, 23:52
  3. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 03:35
  4. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 12:48
  5. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 16: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