My version of the algorithms are set up around a 4 MHz Xtal. They track 0.5 second intervals. On the half second (Col = 0 ), the colon is turned off, on the whole second (Col = 1), the time and colon are updated.

A 20MHz Xtal is five times as fast as a 4 MHz. Therefore, with everything the “same” in the code the tracked interval would be 0.1 Sec instead of 0.5 Sec. Although I have not tried this, I believe all you need to do is change the Col variable from a BIT to a BYTE and use it for updating the colon blink and time.

IF Col = 10 then update time (instead of IF Col = 1)
IF Col = 5 then turn off blink (instead of the “THEN” part of IF Col =1)

IF Col = 11 then Col =1 (add after Col=Col+1 to reset Col variable)

Note, however, that you will have 1/5 the time to do other stuff in between overflows. With a 4 MHz Xtal, this gives over 65 ms. With a 20 MHz Xtal, this gives 13 ms (you may need to watch those serial LCD times)

Since TMRO is maxed out with the prescaler of 256, the ideal solution would be to move to TMR1 or TMR2 (or to an 18F series where TMR0 = 2^16). With these other timers and a few code changes, you could get longer overflow times with your 20MHz Xtal. I encourage you to see Roman Black's original (www.romanblack.com) - he describes how to get any time period with any Xtal.

Good Luck,

Paul Borgmeier
Salt Lake City, Utah
USA