The capacitor shouldn't affect too much, btw their tolerance is often high... so don't worry too much.
This will help if we see your actual code.
'Beer is proof that God loves us and wants us to be happy. This also make ugly people looking better![]()
The capacitor shouldn't affect too much, btw their tolerance is often high... so don't worry too much.
This will help if we see your actual code.
'Beer is proof that God loves us and wants us to be happy. This also make ugly people looking better![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thank you for the help I will try and get the right caps for the crystal. I am new to electronics but can help with water problems if anyone needs them.
Snap
Beer is proof that God loves us and wants us to be happy.
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
__________________
I was throwing out ideas earlier. I've never tried to see how far I could 'pull' a crystal or even if I could do it.
But you're definetly right about reloading the timer. A guy should add a number to the timer rather than reload it with a fixed value in a case like this.
And I think it would really help in this case to see some more code...
I Used the code from Dogan Ibrahims book Pic Basic programming and projects.
Project 16 I copied the code onto my laptop and do not have the time to copy the entire thing out here. The main point of my question was if the caps could effect the clock and I understand (by the answers) they can if they are way out I really apprecate all the help and will publish the code if you want it but I just wanted to understand the relationship between a clock and the 22pf caps.
Thanks again
Snap
Beer is proof that God loves us and wants us to be happy.
Bookmarks