Updating Timers


Closed Thread
Results 1 to 2 of 2

Thread: Updating Timers

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107

    Default Updating Timers

    I use a timer interrupt and re-write TMR0 at the top of the routine. I don't stop the timer before I do the writes, and I have never noticed any problems. However, in many code examples, I see where people stop the timer before they write to it. The datasheet isn't clear as to if this is necessary or not.

    Should I be stopping the timer before I write to it?
    Charles Linquist

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    For Timer0, no.

    The reason for stopping the timer is so that the LowByte can't carry into the HighByte in the middle of reloading. But this only has an effect on 16-bit timers that are not in RD16 mode.

    Timer0, when used as a 16-bit timer, is Always RD16. So the carry during reload doesn't matter.
    <br>
    DT

Similar Threads

  1. Timers and Interrupts
    By senior project1 in forum Off Topic
    Replies: 2
    Last Post: - 25th November 2008, 14:17
  2. Timers
    By mitchf14 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th November 2008, 20:08
  3. Reading Timers
    By kevj in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th August 2007, 08:19
  4. hardware timers
    By Adam in forum General
    Replies: 3
    Last Post: - 7th March 2007, 00:10
  5. Availability of PIC timers from PBP
    By coda64 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th February 2006, 07:18

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