TMR0 Confusion


Closed Thread
Results 1 to 16 of 16

Thread: TMR0 Confusion

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: TMR0 Confusion

    Thanks Darrel that's very clear, little by little i'm learning.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: TMR0 Confusion

    How long to execute the reload?

    I'm now using the timers for a few things but how do you work out the value to add on to the reload value for the time it takes to do the reload?

    Code:
     
     T1CON.0 = 0            'Stops Timer
     
     TMR1RunOn.Highbyte = TMR1H    'Load the Run-On (Over-Run) value (if any)
     TMR1RunOn.Lowbyte = TMR1L   'Load the Run-On (Over-Run) value (if any)
     TMR1RunOn = PreLoad + TMR1RunOn   'Calculate new Preload setting to include any timer overrun 
     TMR1H = TMR1RunOn.HighByte   'Load the timer with new value
     TMR1L = TMR1RunOn.LowByte      'Load the timer with new value
     PIR1.0 = 0     'Clear TMR1 int flag 
         T1CON.0 = 1            'Starts Timer
    The above for instance how much to add to keep the accuracy? How long does that all take? Any rough estimates? It's a pretty standard reload code but I could not find any examples. I'm running at 8mhz with 1/8 prescaler.

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