Are you counting 1000 overflows to equal 1 second?
[(256-131*8)*1000 = 1000000uS]
If so, you need to realize that TMRO has a 2 cycle delay after you write to it (see the datasheet). This would equate to [2*1000*60 = 120000uS (or .12S)] of your error (per minute). The other (part of the erro) from the fact that after you detect the overflow, TMRO is still counting ... you probably have some latency before getting to it to rewrite the 131. I bet this latency is the rest of your error (i.e., you are resetting a TMRO that has interrupted and carried on with counting when you re-write to it).
Options
1) adjust in software
2) free running TMRO - does not stop TMRO http://www.picbasic.co.uk/forum/showthread.php?t=2129
Lastly, you want XTAL caps of 15-33 pF (not 0.20pF or 0.22pF). It should not matter the value as long as you are in the ballpark – they should run your XTAL near the stated tolerance for the XTAL. I cannot image persuading the XTAL to vary by a percent or so day to day as suggested earlier in this thread – maybe I have been lucky the last 10 years, who knows.
Good Luck,
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks