>project is to make . . . yet another clock, but this "time" using a 4.000 MHZ xtal, which is not >the most natural choice, but offers some >(1) XTAL is 4.000MHZ >(2) Instruction cycle is therefore 4.000/4 = 1.000 MHZ Here's another thought (it's not my original idea, but I can't remember where I heard it first)... At 1MHz, 256cycles and a prescaler of 64, there will be approximately 61.03515625 overflows per second. Let's call that 61 and clock a second every 61 overflows. So, every minute, we are out by 2.109375 overflows. At the time we clock over 1 minute, subtract 2 overflows or count up to 63 overflows, your choice So, every hour, we are out by 6.5625 overflows. At the time we clock over 1 hour, subtract 6 overflows as with the minutes. So, every day, we are out by 13.5 overflows. At the time we clock over a day, subtract 13 overflows as with the minutes and hours. So, every week, we are out by 3.5 overflows. At the time we clock over a week, subtract 3 So, every year, we are out by exactly 26 overflows which means the clock is perfectly accurate of the crystal is perfectly on 4MHz! This technique can be worked backwards if you have a measured time interval and know how far the clock is off, you can substitute the 'real' clock value and tune the offsets. ---------------------------------------------------------------- Drew & Karen Ames Home E-Mail: drew@rebel.net.au or karen@rebel.net.au Business E-Mail: dames@syserv.com.au -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics