I wrote: >....... >>The problem is that my clock is losing one second every three hours. It >>is at least consistently doing this. It is well within specifications >>for the crystal. > > >Your error is ~1/3600, while xtal error is <= 50/1000000 = 1/20000, >so the problem is no doubt in your code. 4 mhz is not an even power >of 2, so your method of adjusting for timer overflows probably needs >to be fixed. Look there. > Ooops, 1sec/3hours = ~1/10000, so if you are using a +/-100 ppm xtal, then it could be your problem. If you look around, you can find 4Mhz xtals with 30 ppm - like Epson CA-301 [avail Digikey]. This would give you 1sec/9 hours, if s.w. is ok. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu